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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user