From 5a33f640c2a1ac577d7b3bbf036e436a13611f64 Mon Sep 17 00:00:00 2001 From: Iain van der Wiel Date: Fri, 10 Oct 2025 13:37:06 +0200 Subject: [PATCH 1/2] 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 --- .../src/next/hooks/useTemplateSchema.test.tsx | 2 -- .../scaffolder-react/src/next/hooks/useTemplateSchema.ts | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.test.tsx b/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.test.tsx index 704a7d2243..dff5500b51 100644 --- a/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.test.tsx +++ b/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.test.tsx @@ -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, }); }); }); diff --git a/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.ts b/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.ts index af004910be..380d87d7ad 100644 --- a/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.ts +++ b/plugins/scaffolder-react/src/next/hooks/useTemplateSchema.ts @@ -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; From 886a8a1d363b08dd66799446dbbed84d579ba290 Mon Sep 17 00:00:00 2001 From: Iain van der Wiel Date: Fri, 10 Oct 2025 13:53:45 +0200 Subject: [PATCH 2/2] chore: add changeset Signed-off-by: Iain van der Wiel --- .changeset/grumpy-planes-bet.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/grumpy-planes-bet.md diff --git a/.changeset/grumpy-planes-bet.md b/.changeset/grumpy-planes-bet.md new file mode 100644 index 0000000000..bf7d36be41 --- /dev/null +++ b/.changeset/grumpy-planes-bet.md @@ -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`