diff --git a/.changeset/eighty-pans-remain.md b/.changeset/eighty-pans-remain.md new file mode 100644 index 0000000000..963280e5a5 --- /dev/null +++ b/.changeset/eighty-pans-remain.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Added `noHtml5Validate` prop to `FormProps` on `NextScaffolderPage` diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 7611e952dc..3fe1208ba9 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -168,7 +168,10 @@ export interface FieldSchema { } // @alpha -export type FormProps = Pick; +export type FormProps = Pick< + FormProps_3, + 'transformErrors' | 'noHtml5Validate' +>; // @public export type LayoutComponent<_TInputProps> = () => null; diff --git a/plugins/scaffolder/src/next/Router/Router.test.tsx b/plugins/scaffolder/src/next/Router/Router.test.tsx index 0e890005ac..89f8f6ecd3 100644 --- a/plugins/scaffolder/src/next/Router/Router.test.tsx +++ b/plugins/scaffolder/src/next/Router/Router.test.tsx @@ -54,11 +54,16 @@ describe('Router', () => { expect(TemplateWizardPage).toHaveBeenCalled(); }); - it('should pass through the transformErrors property', async () => { + it('should pass through the FormProps property', async () => { const transformErrorsMock = jest.fn(); await renderInTestApp( - , + , { routeEntries: ['/templates/default/foo'], }, @@ -66,13 +71,12 @@ describe('Router', () => { const mock = TemplateWizardPage as jest.Mock; - const [ - { - FormProps: { transformErrors }, - }, - ] = mock.mock.calls[0]; + const [{ FormProps }] = mock.mock.calls[0]; - expect(transformErrors).toEqual(transformErrors); + expect(FormProps).toEqual({ + transformErrors: transformErrorsMock, + noHtml5Validate: true, + }); }); it('should extract the fieldExtensions and pass them through', async () => { diff --git a/plugins/scaffolder/src/next/types.ts b/plugins/scaffolder/src/next/types.ts index d0d3ed1011..32d0fe85f0 100644 --- a/plugins/scaffolder/src/next/types.ts +++ b/plugins/scaffolder/src/next/types.ts @@ -20,4 +20,7 @@ import type { FormProps as SchemaFormProps } from '@rjsf/core-v5'; * * @alpha */ -export type FormProps = Pick; +export type FormProps = Pick< + SchemaFormProps, + 'transformErrors' | 'noHtml5Validate' +>;