apply hidden fields after ui schema

This commit is contained in:
Josh Hawkins
2026-02-27 09:40:21 -06:00
parent 123e12cee8
commit 72ccd397f9
2 changed files with 19 additions and 0 deletions
@@ -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
@@ -24,6 +24,9 @@ const snapshots: SectionConfigOverrides = {
},
},
},
global: {
hiddenFields: ["enabled_in_config", "required_zones"],
},
};
export default snapshots;