diff --git a/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.test.tsx b/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.test.tsx index f18dcd919c..a3fcecbe2b 100644 --- a/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.test.tsx +++ b/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.test.tsx @@ -435,6 +435,35 @@ describe('ReviewState', () => { ).not.toBeInTheDocument(); }); + it('should allow using the title property', async () => { + const formState = { + foo: 'test', + }; + + const schemas: ParsedTemplateSchema[] = [ + { + mergedSchema: { + type: 'object', + properties: { + foo: { + type: 'string', + title: 'Test Thing', + }, + }, + }, + schema: {}, + title: 'test', + uiSchema: {}, + }, + ]; + + const { queryByRole } = render( + , + ); + + expect(queryByRole('row', { name: 'Test Thing test' })).toBeInTheDocument(); + }); + it('should allow custom review name', async () => { const formState = { foo: 'test', diff --git a/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.tsx b/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.tsx index 8969ae234b..7d2c6042dc 100644 --- a/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.tsx +++ b/plugins/scaffolder-react/src/next/components/ReviewState/ReviewState.tsx @@ -41,7 +41,10 @@ function processSchema( data: formState, }); - const name = definitionInSchema?.['ui:backstage']?.review?.name ?? key; + const name = + definitionInSchema?.['ui:backstage']?.review?.name ?? + definitionInSchema?.title ?? + key; if (definitionInSchema) { const backstageReviewOptions = definitionInSchema['ui:backstage']?.review;