diff --git a/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md b/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md index 398163223..6d3356726 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md +++ b/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md @@ -20,7 +20,7 @@ export type FormDecoratorProps = Pick, 'formD // @public export interface OrchestratorFormApi { - getFormDecorator(schema: JSONSchema7, uiSchema: UiSchema): OrchestratorFormDecorator; + getFormDecorator(schema: JSONSchema7, uiSchema: UiSchema, initialFormData?: JsonObject): OrchestratorFormDecorator; } // @public diff --git a/workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts b/workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts index a50586220..10e557649 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts @@ -74,6 +74,7 @@ export interface OrchestratorFormApi { getFormDecorator( schema: JSONSchema7, uiSchema: UiSchema, + initialFormData?: JsonObject, ): OrchestratorFormDecorator; } diff --git a/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx b/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx index cf5cae954..cb23a5f5d 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx +++ b/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx @@ -150,16 +150,19 @@ const FormComponent = (decoratorProps: FormDecoratorProps) => { const OrchestratorFormWrapper = ({ schema, uiSchema, + formData, ...props }: OrchestratorFormWrapperProps) => { const formApi = useApiHolder().get(orchestratorFormApiRef) || defaultFormExtensionsApi; const NewComponent = React.useMemo(() => { - const formDecorator = formApi.getFormDecorator(schema, uiSchema); + const formDecorator = formApi.getFormDecorator(schema, uiSchema, formData); return formDecorator(FormComponent); - }, [schema, formApi, uiSchema]); + }, [schema, formApi, uiSchema, formData]); return ( - + );