forked from baron/baron-sso
5ee9a46663 반영 code-check 오류 수정
This commit is contained in:
@@ -796,15 +796,15 @@ function UserDetailPage() {
|
||||
payload.metadata = {
|
||||
...metadata,
|
||||
additionalAppointments: appointments,
|
||||
primaryTenantId: primaryAppointment?.tenantId,
|
||||
primaryTenantName: primaryAppointment?.tenantName,
|
||||
primaryTenantSlug: primaryAppointment?.tenantSlug,
|
||||
primaryTenantIsOwner: primaryAppointment?.isOwner ?? false,
|
||||
primaryTenantId: primary?.tenantId,
|
||||
primaryTenantName: primary?.tenantName,
|
||||
primaryTenantSlug: primary?.tenantSlug,
|
||||
primaryTenantIsOwner: primary?.isOwner ?? false,
|
||||
};
|
||||
payload.tenantSlug = primaryAppointment?.tenantSlug;
|
||||
payload.primaryTenantId = primaryAppointment?.tenantId;
|
||||
payload.primaryTenantName = primaryAppointment?.tenantName;
|
||||
payload.primaryTenantIsOwner = primaryAppointment?.isOwner ?? false;
|
||||
payload.tenantSlug = primary?.tenantSlug;
|
||||
payload.primaryTenantId = primary?.tenantId;
|
||||
payload.primaryTenantName = primary?.tenantName;
|
||||
payload.primaryTenantIsOwner = primary?.isOwner ?? false;
|
||||
}
|
||||
|
||||
mutation.mutate(payload);
|
||||
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "../../components/ui/select";
|
||||
import { Switch } from "../../components/ui/switch";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -702,39 +703,25 @@ function UserListPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-2">
|
||||
<Select
|
||||
value={user.status}
|
||||
onValueChange={(value: "active" | "inactive") =>
|
||||
<Switch
|
||||
checked={user.status === "active"}
|
||||
onCheckedChange={(checked) =>
|
||||
statusMutation.mutate({
|
||||
userId: user.id,
|
||||
status: value,
|
||||
status: checked ? "active" : "inactive",
|
||||
})
|
||||
}
|
||||
disabled={
|
||||
statusMutation.isPending ||
|
||||
user.id === profile?.id
|
||||
}
|
||||
>
|
||||
<SelectTrigger
|
||||
className="h-8 w-[112px]"
|
||||
aria-label={t(
|
||||
"ui.admin.users.list.toggle_status",
|
||||
"{{name}} 활성 상태",
|
||||
{ name: user.name },
|
||||
)}
|
||||
data-testid={`user-status-select-${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>
|
||||
aria-label={t(
|
||||
"ui.admin.users.list.toggle_status",
|
||||
"{{name}} 활성 상태",
|
||||
{ name: user.name },
|
||||
)}
|
||||
data-testid={`user-status-toggle-${user.id}`}
|
||||
/>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{t(`ui.common.status.${user.status}`, user.status)}
|
||||
</span>
|
||||
|
||||
@@ -2,10 +2,36 @@
|
||||
set -euo pipefail
|
||||
|
||||
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
|
||||
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() {
|
||||
local port="$1"
|
||||
node -e '
|
||||
@@ -43,7 +69,7 @@ fi
|
||||
|
||||
set +e
|
||||
(
|
||||
cd adminfront
|
||||
cd "$tmp_dir/adminfront"
|
||||
npm ci --ignore-scripts
|
||||
) 2>&1 | tee reports/adminfront-install.log
|
||||
install_exit_code=${PIPESTATUS[0]}
|
||||
@@ -71,8 +97,8 @@ fi
|
||||
|
||||
set +e
|
||||
(
|
||||
cd adminfront
|
||||
"${playwright_install_cmd[@]}"
|
||||
cd "$tmp_dir/adminfront"
|
||||
PLAYWRIGHT_BROWSERS_PATH="$playwright_browsers_path" "${playwright_install_cmd[@]}"
|
||||
) 2>&1 | tee reports/adminfront-provision.log
|
||||
provision_exit_code=${PIPESTATUS[0]}
|
||||
set -e
|
||||
@@ -106,13 +132,16 @@ if ! is_port_available "$port"; then
|
||||
fi
|
||||
echo "==> adminfront using PORT=$port"
|
||||
(
|
||||
cd adminfront
|
||||
PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \
|
||||
cd "$tmp_dir/adminfront"
|
||||
PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" PLAYWRIGHT_BROWSERS_PATH="$playwright_browsers_path" \
|
||||
node ./node_modules/playwright/cli.js test
|
||||
) 2>&1 | tee reports/adminfront-test.log
|
||||
test_exit_code=${PIPESTATUS[0]}
|
||||
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
|
||||
{
|
||||
echo "# Adminfront Test Failure Report"
|
||||
|
||||
Reference in New Issue
Block a user