diff --git a/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md b/workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md index 39816322..6d335672 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 a5058622..10e55764 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 cf5cae95..cb23a5f5 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 ( - + );