forked from baron/baron-sso
Format adminfront code check targets
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"node_modules",
|
||||
"tsconfig*.json",
|
||||
"test-results",
|
||||
"test-results.nobody-backup",
|
||||
"playwright-report"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ describe("DomainTagInput", () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
await user.type(screen.getByPlaceholderText("example.com"), "samaneng.com ");
|
||||
await user.type(
|
||||
screen.getByPlaceholderText("example.com"),
|
||||
"samaneng.com ",
|
||||
);
|
||||
|
||||
expect(
|
||||
await screen.findByText(
|
||||
|
||||
@@ -71,8 +71,7 @@ export function normalizeSchemaField(field: unknown): SchemaField {
|
||||
type,
|
||||
required: Boolean(source.required),
|
||||
adminOnly: Boolean(source.adminOnly),
|
||||
validation:
|
||||
typeof source.validation === "string" ? source.validation : "",
|
||||
validation: typeof source.validation === "string" ? source.validation : "",
|
||||
unsigned: Boolean(source.unsigned),
|
||||
isLoginId,
|
||||
indexed: isLoginId || Boolean(source.indexed),
|
||||
|
||||
@@ -54,6 +54,9 @@ export function formatDomainConflictMessage(
|
||||
const tenantName =
|
||||
"tenant" in conflict
|
||||
? conflict.tenant.name
|
||||
: conflict.tenantName || conflict.tenantSlug || conflict.tenantId || "다른";
|
||||
: conflict.tenantName ||
|
||||
conflict.tenantSlug ||
|
||||
conflict.tenantId ||
|
||||
"다른";
|
||||
return `${conflict.domain} 도메인은 ${tenantName} 테넌트에 이미 설정되어 있습니다. 그래도 현재 테넌트에도 추가하시겠습니까?`;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,10 @@ export function buildTenantImportPreview(
|
||||
candidates[0] && candidates[0].score >= 0.95
|
||||
? candidates[0].tenantId
|
||||
: "",
|
||||
defaultCreateSlug: suggestUniqueTenantSlug(row.slug || row.name, tenants),
|
||||
defaultCreateSlug: suggestUniqueTenantSlug(
|
||||
row.slug || row.name,
|
||||
tenants,
|
||||
),
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
@@ -148,10 +151,7 @@ export function serializeTenantImportCSV(
|
||||
const sortedRows = [...previewRows].sort(
|
||||
(a, b) => a.row.rowNumber - b.row.rowNumber,
|
||||
);
|
||||
const targetTenantIds = buildTargetTenantIds(
|
||||
sortedRows,
|
||||
selectedTenantIds,
|
||||
);
|
||||
const targetTenantIds = buildTargetTenantIds(sortedRows, selectedTenantIds);
|
||||
|
||||
for (const preview of sortedRows) {
|
||||
const resolution = selectedTenantIds[preview.row.rowNumber] ?? "";
|
||||
@@ -241,7 +241,9 @@ function remapParentTenantId(
|
||||
return targetTenantIds.bySourceId.get(parentTenantId) ?? parentTenantId;
|
||||
}
|
||||
if (parentTenantSlug) {
|
||||
return targetTenantIds.bySourceSlug.get(parentTenantSlug.toLowerCase()) ?? "";
|
||||
return (
|
||||
targetTenantIds.bySourceSlug.get(parentTenantSlug.toLowerCase()) ?? ""
|
||||
);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -159,10 +159,7 @@ function UserListPage() {
|
||||
},
|
||||
onError: () => {
|
||||
toast.error(
|
||||
t(
|
||||
"msg.admin.users.export_error",
|
||||
"사용자 내보내기에 실패했습니다.",
|
||||
),
|
||||
t("msg.admin.users.export_error", "사용자 내보내기에 실패했습니다."),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -400,10 +400,7 @@ export function UserBulkUploadModal({ onSuccess }: UserBulkUploadModalProps) {
|
||||
data-testid="user-import-tenant-resolution"
|
||||
>
|
||||
<div className="mb-2 font-medium">
|
||||
{t(
|
||||
"ui.admin.users.bulk.tenant_resolution",
|
||||
"테넌트 매핑",
|
||||
)}
|
||||
{t("ui.admin.users.bulk.tenant_resolution", "테넌트 매핑")}
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
{tenantPreviewRows.map((preview) => (
|
||||
@@ -487,7 +484,9 @@ export function UserBulkUploadModal({ onSuccess }: UserBulkUploadModalProps) {
|
||||
<td className="p-2">
|
||||
<input
|
||||
className="h-8 w-full min-w-[180px] rounded-md border border-input bg-background px-2 font-mono text-xs"
|
||||
value={hanmacEmailPreviews[index]?.finalEmail ?? u.email}
|
||||
value={
|
||||
hanmacEmailPreviews[index]?.finalEmail ?? u.email
|
||||
}
|
||||
onChange={(event) =>
|
||||
setPreviewData((prev) =>
|
||||
prev.map((item, itemIndex) =>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
export type UserSchemaFieldType =
|
||||
| "text"
|
||||
| "number"
|
||||
| "boolean"
|
||||
| "date"
|
||||
| "float"
|
||||
| "datetime";
|
||||
| "text"
|
||||
| "number"
|
||||
| "boolean"
|
||||
| "date"
|
||||
| "float"
|
||||
| "datetime";
|
||||
|
||||
export type UserSchemaField = {
|
||||
key: string;
|
||||
label?: string;
|
||||
type?: UserSchemaFieldType;
|
||||
required?: boolean;
|
||||
adminOnly?: boolean;
|
||||
validation?: string;
|
||||
isLoginId?: boolean;
|
||||
indexed?: boolean;
|
||||
key: string;
|
||||
label?: string;
|
||||
type?: UserSchemaFieldType;
|
||||
required?: boolean;
|
||||
adminOnly?: boolean;
|
||||
validation?: string;
|
||||
isLoginId?: boolean;
|
||||
indexed?: boolean;
|
||||
};
|
||||
|
||||
@@ -148,9 +148,11 @@ test.describe("Tenant Allowed Domains", () => {
|
||||
|
||||
await page.getByRole("button", { name: "저장" }).click();
|
||||
|
||||
await expect.poll(() => savedPayload).toMatchObject({
|
||||
domains: ["samaneng.com"],
|
||||
forceDomainConflicts: ["samaneng.com"],
|
||||
});
|
||||
await expect
|
||||
.poll(() => savedPayload)
|
||||
.toMatchObject({
|
||||
domains: ["samaneng.com"],
|
||||
forceDomainConflicts: ["samaneng.com"],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -288,9 +288,7 @@ test.describe("Tenants Management", () => {
|
||||
await page
|
||||
.getByTestId("tenant-import-match-select-3")
|
||||
.selectOption("__create__");
|
||||
await page
|
||||
.getByTestId("tenant-import-create-slug-3")
|
||||
.fill("child-created");
|
||||
await page.getByTestId("tenant-import-create-slug-3").fill("child-created");
|
||||
await page.getByTestId("tenant-import-confirm-btn").click();
|
||||
|
||||
await expect(page.getByTestId("tenant-import-result")).toContainText(
|
||||
|
||||
@@ -38,8 +38,9 @@ test.describe("Tenants CSV live E2E", () => {
|
||||
await page.route("**/api/v1/**", async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
const liveUrl = `${baseURL}${requestUrl.pathname}${requestUrl.search}`;
|
||||
const headers = { ...route.request().headers() };
|
||||
delete headers.authorization;
|
||||
const { authorization: _authorization, ...headers } = route
|
||||
.request()
|
||||
.headers();
|
||||
headers["x-test-role"] = "super_admin";
|
||||
const response = await route.fetch({ url: liveUrl, headers });
|
||||
await route.fulfill({ response });
|
||||
|
||||
@@ -368,7 +368,9 @@ test.describe("User Management", () => {
|
||||
"외부 기업 회원",
|
||||
"개인 회원",
|
||||
]);
|
||||
await expect(page.getByRole("tab", { name: /외부 기업 회원/i })).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("tab", { name: /외부 기업 회원/i }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("tab", { name: /한맥가족 구성원/i }),
|
||||
).toBeVisible();
|
||||
@@ -376,9 +378,7 @@ test.describe("User Management", () => {
|
||||
await expect(
|
||||
page.getByRole("tab", { name: /한맥가족 구성원/i }),
|
||||
).toHaveAttribute("data-state", "active");
|
||||
await expect(
|
||||
page.getByLabel(/한맥 가족 구성원으로 등록/i),
|
||||
).toHaveCount(0);
|
||||
await expect(page.getByLabel(/한맥 가족 구성원으로 등록/i)).toHaveCount(0);
|
||||
|
||||
// Select Tenant first (important for schema fields to show up)
|
||||
await page.getByRole("tab", { name: /외부 기업 회원/i }).click();
|
||||
@@ -527,9 +527,7 @@ test.describe("User Management", () => {
|
||||
await expect(
|
||||
page.getByRole("tab", { name: /한맥가족 구성원/i }),
|
||||
).toHaveAttribute("data-state", "active");
|
||||
await expect(
|
||||
page.getByLabel(/한맥 가족 구성원으로 등록/i),
|
||||
).toHaveCount(0);
|
||||
await expect(page.getByLabel(/한맥 가족 구성원으로 등록/i)).toHaveCount(0);
|
||||
await expect(page.locator("select#role")).toHaveCount(0);
|
||||
await expect(page.locator("input#department")).toHaveCount(0);
|
||||
|
||||
@@ -722,9 +720,7 @@ test.describe("User Management", () => {
|
||||
await expect(
|
||||
page.getByRole("tab", { name: /한맥가족 구성원/i }),
|
||||
).toHaveAttribute("data-state", "active");
|
||||
await expect(
|
||||
page.getByLabel(/한맥 가족 구성원으로 등록/i),
|
||||
).toHaveCount(0);
|
||||
await expect(page.getByLabel(/한맥 가족 구성원으로 등록/i)).toHaveCount(0);
|
||||
await expect(page.getByTestId("detail-appointment-row-0")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("detail-appointment-tenant-owner-line-0"),
|
||||
|
||||
@@ -177,9 +177,9 @@ test.describe("Users Bulk Upload", () => {
|
||||
),
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("user-import-tenant-resolution")).toContainText(
|
||||
/신규 생성|Create new/i,
|
||||
);
|
||||
await expect(
|
||||
page.getByTestId("user-import-tenant-resolution"),
|
||||
).toContainText(/신규 생성|Create new/i);
|
||||
await page.getByTestId("bulk-start-btn").click();
|
||||
|
||||
await expect(page.getByText("new@test.com")).toBeVisible();
|
||||
|
||||
@@ -39,8 +39,9 @@ test.describe("Users CSV live E2E", () => {
|
||||
await page.route("**/api/v1/**", async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
const liveUrl = `${baseURL}${requestUrl.pathname}${requestUrl.search}`;
|
||||
const headers = { ...route.request().headers() };
|
||||
delete headers.authorization;
|
||||
const { authorization: _authorization, ...headers } = route
|
||||
.request()
|
||||
.headers();
|
||||
headers["x-test-role"] = "super_admin";
|
||||
const response = await route.fetch({ url: liveUrl, headers });
|
||||
await route.fulfill({ response });
|
||||
@@ -75,7 +76,9 @@ test.describe("Users CSV live E2E", () => {
|
||||
expect(path).toBeTruthy();
|
||||
|
||||
const csv = fs.readFileSync(path as string, "utf8");
|
||||
expect(csv).toContain("ID,Email,Name,Phone,Status,Tenant,Position,JobTitle,CreatedAt");
|
||||
expect(csv).toContain(
|
||||
"ID,Email,Name,Phone,Status,Tenant,Position,JobTitle,CreatedAt",
|
||||
);
|
||||
expect(csv).not.toContain("Role");
|
||||
expect(csv).not.toContain("Department");
|
||||
});
|
||||
|
||||
@@ -230,5 +230,4 @@ test.describe("User Schema Dynamic Form", () => {
|
||||
.first();
|
||||
await expect(errorMsg).toBeVisible();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user