diff --git a/.changeset/big-chefs-provide.md b/.changeset/big-chefs-provide.md new file mode 100644 index 0000000000..24fcc0dd54 --- /dev/null +++ b/.changeset/big-chefs-provide.md @@ -0,0 +1,5 @@ +--- +'@frontside/backstage-plugin-scaffolder-workflow': minor +--- + +Allow passing formContext through the FormProps to scaffolder form. diff --git a/plugins/scaffolder-frontend-workflow/src/components/Form/Form.tsx b/plugins/scaffolder-frontend-workflow/src/components/Form/Form.tsx index ab51769b9c..e3ae26ba85 100644 --- a/plugins/scaffolder-frontend-workflow/src/components/Form/Form.tsx +++ b/plugins/scaffolder-frontend-workflow/src/components/Form/Form.tsx @@ -62,7 +62,7 @@ export const Form = ({ uiSchema={step.uiSchema} fields={fields} formData={formData} - formContext={{ formData }} + formContext={{ ...props.formContext, formData }} onSubmit={onSubmit} onChange={handleChange} {...props} diff --git a/plugins/scaffolder-frontend-workflow/src/components/Form/RJSFForm.tsx b/plugins/scaffolder-frontend-workflow/src/components/Form/RJSFForm.tsx index 450b943bd2..b3204ef5c0 100644 --- a/plugins/scaffolder-frontend-workflow/src/components/Form/RJSFForm.tsx +++ b/plugins/scaffolder-frontend-workflow/src/components/Form/RJSFForm.tsx @@ -4,5 +4,5 @@ export const RJSFForm = withTheme(require('@rjsf/material-ui').Theme); export type RJSFFormProps = Pick< FormProps, - 'transformErrors' | 'extraErrors' | 'className' | 'ref' + 'transformErrors' | 'extraErrors' | 'formContext' | 'className' | 'ref' >;