fix: Fixed bug in template parsing in the useTemplateSchema hook by completely removing title from step instead of setting it to undefined

Signed-off-by: Iain van der Wiel <iain.vanderwiel@gmail.com>
This commit is contained in:
Iain van der Wiel
2025-10-10 13:37:06 +02:00
parent dc258c990d
commit 5a33f640c2
2 changed files with 4 additions and 5 deletions
@@ -368,13 +368,11 @@ describe('useTemplateSchema', () => {
expect(first.schema).toEqual({
dependencies: firstStepDependencies,
properties: expect.anything(),
title: undefined,
type: 'object',
});
expect(second.schema).toEqual({
dependencies: secondStepDependencies,
title: undefined,
});
});
});
@@ -60,12 +60,13 @@ export const useTemplateSchema = (
})
// Then filter out the properties that are not enabled with feature flag
.map(step => {
// Title is rendered at the top of the page, so let's ignore this from jsonschemaform
const { title, ...stepSchema } = step.schema;
const strippedSchema = {
...step,
schema: {
...step.schema,
// Title is rendered at the top of the page, so let's ignore this from jsonschemaform
title: undefined,
...stepSchema,
},
} as ParsedTemplateSchema;