Merge pull request #31382 from iainvdw/fix/fix-template-schema-parsing-in-scaffolder
fix: fix template parsing issue preventing proper function of RJSF allOf / oneOf / anyOf with nested if / else fields
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-react': patch
|
||||
---
|
||||
|
||||
Fixed a bug in the Scaffolder's template parsing in the `useTemplateSchema` hook by removing the title instead of setting it to `undefined`
|
||||
@@ -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