1
0
forked from baron/baron-sso

5ee9a46663 반영 code-check 오류 수정

This commit is contained in:
2026-05-08 16:11:50 +09:00
parent 8307f65f6a
commit 636da587e3
3 changed files with 54 additions and 38 deletions

View File

@@ -796,15 +796,15 @@ function UserDetailPage() {
payload.metadata = { payload.metadata = {
...metadata, ...metadata,
additionalAppointments: appointments, additionalAppointments: appointments,
primaryTenantId: primaryAppointment?.tenantId, primaryTenantId: primary?.tenantId,
primaryTenantName: primaryAppointment?.tenantName, primaryTenantName: primary?.tenantName,
primaryTenantSlug: primaryAppointment?.tenantSlug, primaryTenantSlug: primary?.tenantSlug,
primaryTenantIsOwner: primaryAppointment?.isOwner ?? false, primaryTenantIsOwner: primary?.isOwner ?? false,
}; };
payload.tenantSlug = primaryAppointment?.tenantSlug; payload.tenantSlug = primary?.tenantSlug;
payload.primaryTenantId = primaryAppointment?.tenantId; payload.primaryTenantId = primary?.tenantId;
payload.primaryTenantName = primaryAppointment?.tenantName; payload.primaryTenantName = primary?.tenantName;
payload.primaryTenantIsOwner = primaryAppointment?.isOwner ?? false; payload.primaryTenantIsOwner = primary?.isOwner ?? false;
} }
mutation.mutate(payload); mutation.mutate(payload);

View File

@@ -40,6 +40,7 @@ import {
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from "../../components/ui/select"; } from "../../components/ui/select";
import { Switch } from "../../components/ui/switch";
import { import {
Table, Table,
TableBody, TableBody,
@@ -702,39 +703,25 @@ function UserListPage() {
</TableCell> </TableCell>
<TableCell> <TableCell>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Select <Switch
value={user.status} checked={user.status === "active"}
onValueChange={(value: "active" | "inactive") => onCheckedChange={(checked) =>
statusMutation.mutate({ statusMutation.mutate({
userId: user.id, userId: user.id,
status: value, status: checked ? "active" : "inactive",
}) })
} }
disabled={ disabled={
statusMutation.isPending || statusMutation.isPending ||
user.id === profile?.id user.id === profile?.id
} }
>
<SelectTrigger
className="h-8 w-[112px]"
aria-label={t( aria-label={t(
"ui.admin.users.list.toggle_status", "ui.admin.users.list.toggle_status",
"{{name}} 활성 상태", "{{name}} 활성 상태",
{ name: user.name }, { name: user.name },
)} )}
data-testid={`user-status-select-${user.id}`} data-testid={`user-status-toggle-${user.id}`}
> />
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="active">
{t("ui.common.status.active", "활성")}
</SelectItem>
<SelectItem value="inactive">
{t("ui.common.status.inactive", "비활성")}
</SelectItem>
</SelectContent>
</Select>
<span className="text-sm text-muted-foreground"> <span className="text-sm text-muted-foreground">
{t(`ui.common.status.${user.status}`, user.status)} {t(`ui.common.status.${user.status}`, user.status)}
</span> </span>

View File

@@ -2,10 +2,36 @@
set -euo pipefail set -euo pipefail
job_name="${1:-adminfront-tests}" job_name="${1:-adminfront-tests}"
repo_root="$(pwd)"
tmp_dir=""
cleanup() {
if [ -n "${tmp_dir:-}" ] && [ -d "$tmp_dir" ]; then
rm -rf "$tmp_dir"
fi
}
trap cleanup EXIT INT TERM
mkdir -p reports mkdir -p reports
rm -rf adminfront/node_modules rm -rf adminfront/node_modules
tmp_dir="$(mktemp -d /tmp/baron-sso-adminfront-tests.XXXXXX)"
playwright_browsers_path="$tmp_dir/ms-playwright"
if command -v rsync >/dev/null 2>&1; then
rsync -rlptD --delete \
--exclude 'node_modules' \
--exclude 'playwright-report' \
--exclude 'test-results' \
"$repo_root/adminfront/" "$tmp_dir/adminfront/"
else
cp -R "$repo_root/adminfront" "$tmp_dir/adminfront"
rm -rf "$tmp_dir/adminfront/node_modules" \
"$tmp_dir/adminfront/playwright-report" \
"$tmp_dir/adminfront/test-results"
fi
is_port_available() { is_port_available() {
local port="$1" local port="$1"
node -e ' node -e '
@@ -43,7 +69,7 @@ fi
set +e set +e
( (
cd adminfront cd "$tmp_dir/adminfront"
npm ci --ignore-scripts npm ci --ignore-scripts
) 2>&1 | tee reports/adminfront-install.log ) 2>&1 | tee reports/adminfront-install.log
install_exit_code=${PIPESTATUS[0]} install_exit_code=${PIPESTATUS[0]}
@@ -71,8 +97,8 @@ fi
set +e set +e
( (
cd adminfront cd "$tmp_dir/adminfront"
"${playwright_install_cmd[@]}" PLAYWRIGHT_BROWSERS_PATH="$playwright_browsers_path" "${playwright_install_cmd[@]}"
) 2>&1 | tee reports/adminfront-provision.log ) 2>&1 | tee reports/adminfront-provision.log
provision_exit_code=${PIPESTATUS[0]} provision_exit_code=${PIPESTATUS[0]}
set -e set -e
@@ -106,13 +132,16 @@ if ! is_port_available "$port"; then
fi fi
echo "==> adminfront using PORT=$port" echo "==> adminfront using PORT=$port"
( (
cd adminfront cd "$tmp_dir/adminfront"
PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \ PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" PLAYWRIGHT_BROWSERS_PATH="$playwright_browsers_path" \
node ./node_modules/playwright/cli.js test node ./node_modules/playwright/cli.js test
) 2>&1 | tee reports/adminfront-test.log ) 2>&1 | tee reports/adminfront-test.log
test_exit_code=${PIPESTATUS[0]} test_exit_code=${PIPESTATUS[0]}
set -e set -e
[ -d "$tmp_dir/adminfront/playwright-report" ] && rm -rf reports/adminfront-playwright-report && cp -R "$tmp_dir/adminfront/playwright-report" reports/adminfront-playwright-report || true
[ -d "$tmp_dir/adminfront/test-results" ] && rm -rf reports/adminfront-test-results && cp -R "$tmp_dir/adminfront/test-results" reports/adminfront-test-results || true
if [ "$test_exit_code" -ne 0 ]; then if [ "$test_exit_code" -ne 0 ]; then
{ {
echo "# Adminfront Test Failure Report" echo "# Adminfront Test Failure Report"