chore(dashboard): remove unused _parentRequired param from flattenSchema

This commit is contained in:
2026-05-15 08:25:39 +08:00
parent f5977c46c6
commit 9822e68c55
@@ -43,7 +43,6 @@ function flattenSchema(
depth: number, depth: number,
parentPrefix: string, parentPrefix: string,
keyPrefix: string, keyPrefix: string,
_parentRequired: Set<string>,
): SchemaRow[] { ): SchemaRow[] {
const rows: SchemaRow[] = []; const rows: SchemaRow[] = [];
@@ -122,20 +121,20 @@ function flattenProperty(
if (prop.type === "object" && prop.properties !== undefined) { if (prop.type === "object" && prop.properties !== undefined) {
const childPrefix = depth > 0 ? `${parentPrefix} ` : " "; const childPrefix = depth > 0 ? `${parentPrefix} ` : " ";
rows.push(...flattenSchema(prop as Record<string, unknown>, depth + 1, childPrefix, `${keyPrefix}${name}-`, required)); rows.push(...flattenSchema(prop as Record<string, unknown>, depth + 1, childPrefix, `${keyPrefix}${name}-`));
} }
if (prop.type === "array") { if (prop.type === "array") {
const items = prop.items as Record<string, unknown> | undefined; const items = prop.items as Record<string, unknown> | undefined;
if (items !== undefined && items.type === "object" && items.properties !== undefined) { if (items !== undefined && items.type === "object" && items.properties !== undefined) {
const childPrefix = depth > 0 ? `${parentPrefix} ` : " "; const childPrefix = depth > 0 ? `${parentPrefix} ` : " ";
rows.push(...flattenSchema(items, depth + 1, childPrefix, `${keyPrefix}${name}-`, new Set())); rows.push(...flattenSchema(items, depth + 1, childPrefix, `${keyPrefix}${name}-`));
} }
} }
if (hasOneOf) { if (hasOneOf) {
const childPrefix = depth > 0 ? `${parentPrefix} ` : " "; const childPrefix = depth > 0 ? `${parentPrefix} ` : " ";
rows.push(...flattenSchema(prop as Record<string, unknown>, depth + 1, childPrefix, `${keyPrefix}${name}-`, required)); rows.push(...flattenSchema(prop as Record<string, unknown>, depth + 1, childPrefix, `${keyPrefix}${name}-`));
} }
return rows; return rows;
@@ -150,7 +149,7 @@ function RoleCard({
roleName: string; roleName: string;
role: WorkflowRoleDescriptor; role: WorkflowRoleDescriptor;
}) { }) {
const rows = flattenSchema(role.schema, 0, "", `${roleName}-`, new Set()); const rows = flattenSchema(role.schema, 0, "", `${roleName}-`);
return ( return (
<div <div
id={`role-${roleName}`} id={`role-${roleName}`}