apply hidden fields after ui schema

This commit is contained in:
Josh Hawkins 2026-02-01 11:48:05 -06:00
parent 123e12cee8
commit 72ccd397f9
2 changed files with 19 additions and 0 deletions

View File

@ -251,6 +251,21 @@ export function ConfigForm({
? { norender: false }
: { norender: true };
// Ensure hiddenFields take precedence over any custom uiSchema overrides
// Build path-based overrides for hidden fields and apply them after merging
if (hiddenFields && hiddenFields.length > 0) {
const hiddenOverrides = hiddenFields.map((field) => ({
path: field.split("."),
value: { "ui:widget": "hidden" } as UiSchema,
}));
return applyUiSchemaPathOverrides(
merged,
transformedSchema,
hiddenOverrides,
);
}
return merged;
}, [
generatedUiSchema,
@ -259,6 +274,7 @@ export function ConfigForm({
baseUiSchema,
showSubmit,
fieldGroups,
hiddenFields,
]);
// Create error transformer for user-friendly error messages

View File

@ -24,6 +24,9 @@ const snapshots: SectionConfigOverrides = {
},
},
},
global: {
hiddenFields: ["enabled_in_config", "required_zones"],
},
};
export default snapshots;