Skip to content

Commit

Permalink
Pass formContext through scaffolder FormProps (#369)
Browse files Browse the repository at this point in the history
* allow passing form context to scaffolder form

* change file
  • Loading branch information
jbolda authored Dec 5, 2023
1 parent c045bc0 commit d578189
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-chefs-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@frontside/backstage-plugin-scaffolder-workflow': minor
---

Allow passing formContext through the FormProps to scaffolder form.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
>;

0 comments on commit d578189

Please sign in to comment.