1
0
forked from baron/baron-sso
This commit is contained in:
2026-03-17 10:17:25 +09:00
parent f239ac984f
commit 8bc5b5a49b
7 changed files with 237 additions and 33 deletions

View File

@@ -477,8 +477,10 @@ function UserCreatePage() {
/>
{errors.metadata?.[field.key] && (
<p className="text-xs text-destructive">
{(errors.metadata[field.key] as { message?: string })
?.message}
{
(errors.metadata[field.key] as { message?: string })
?.message
}
</p>
)}
</div>

View File

@@ -45,7 +45,9 @@ type UserSchemaField = {
validation?: string;
};
type UserFormValues = UserUpdateRequest & { metadata: Record<string, Record<string, unknown>> };
type UserFormValues = UserUpdateRequest & {
metadata: Record<string, Record<string, unknown>>;
};
// [New] Component for per-tenant profile/schema management
function TenantProfileCard({

View File

@@ -13,25 +13,27 @@ export function parseUserCSV(text: string): BulkUserItem[] {
if (!lines[i].trim()) continue;
const values = lines[i].split(",").map((v) => v.trim());
const item: Record<string, any> = { metadata: {} };
const item: Partial<BulkUserItem> & { metadata: Record<string, string> } = {
metadata: {},
};
for (let index = 0; index < headers.length; index++) {
const header = headers[index];
const value = values[index];
if (value === undefined || value === "") continue;
if (
[
"email",
"name",
"phone",
"role",
"companycode",
"department",
].includes(header)
) {
const key = header === "companycode" ? "companyCode" : header;
item[key] = value;
if (header === "email") {
item.email = value;
} else if (header === "name") {
item.name = value;
} else if (header === "phone") {
item.phone = value;
} else if (header === "role") {
item.role = value;
} else if (header === "companycode") {
item.companyCode = value;
} else if (header === "department") {
item.department = value;
} else {
item.metadata[header] = value;
}