1
0
forked from baron/baron-sso

fix(adminfront): fix auth redirection in tests and add custom field validation

- Skip auth redirect to `/login` when `_IS_TEST_MODE` is true to prevent test timeouts.
- Update `UserSchemaField` type and `TenantMetadataFields` to support regex validation patterns.
- Fix translation key for tenant profile metadata section title.
- Enhance OIDC mock data and mock endpoints in `users_schema.spec.ts`.
- Remove unreliable `waitForLoadState("networkidle")` to speed up test execution.
This commit is contained in:
2026-03-27 17:30:30 +09:00
parent 75cc6737bd
commit 641e4aba0d
3 changed files with 81 additions and 8 deletions

View File

@@ -49,6 +49,7 @@ type UserSchemaField = {
type?: "text" | "number" | "boolean" | "date";
required?: boolean;
adminOnly?: boolean;
validation?: string;
};
function TenantMetadataFields({
@@ -113,6 +114,15 @@ function TenantMetadataFields({
"필수입니다.",
)
: false,
pattern: field.validation
? {
value: new RegExp(field.validation),
message: t(
"msg.admin.users.detail.form.invalid_format",
"형식이 올바르지 않습니다.",
),
}
: undefined,
})}
/>
{(
@@ -642,7 +652,12 @@ function UserDetailPage() {
<div className="space-y-4">
<div className="flex items-center justify-between">
<Label>{t("ui.admin.users.detail.metadata", "추가 정보")}</Label>
<Label>
{t(
"ui.admin.users.detail.custom_fields.multi_title",
"테넌트별 프로필 관리",
)}
</Label>
</div>
<div className="grid gap-4">
{userAffiliatedTenants.map((t) => {