default value for layouts in export function transformSchemaToProps

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-09-13 17:52:18 +01:00
committed by blam
parent 392b15ad27
commit 4cd0f45a85
3 changed files with 3 additions and 5 deletions
@@ -193,8 +193,6 @@ export const MultistepJsonForm = (props: Props) => {
<>
<Stepper activeStep={activeStep} orientation="vertical">
{steps.map(({ title, schema, ...formProps }, index) => {
const schemaProps = transformSchemaToProps(schema, layouts);
return (
<StepUI key={title}>
<StepLabel
@@ -219,7 +217,7 @@ export const MultistepJsonForm = (props: Props) => {
if (e.errors.length === 0) handleNext();
}}
{...formProps}
{...schemaProps}
{...transformSchemaToProps(schema, layouts)}
>
<Button disabled={activeStep === 0} onClick={handleBack}>
Back
@@ -102,7 +102,7 @@ function extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {
export function transformSchemaToProps(
inputSchema: JsonObject,
layouts: LayoutOptions[],
layouts: LayoutOptions[] = [],
): {
schema: FormProps<any>['schema'];
uiSchema: FormProps<any>['uiSchema'];
+1 -1
View File
@@ -118,7 +118,7 @@ export const Router = (props: RouterProps) => {
);
/**
* This component can be deleted once the older routes havest been deprecated.
* This component can be deleted once the older routes have been deprecated.
*/
const RedirectingComponent = () => {
const { templateName } = useRouteRefParams(legacySelectedTemplateRouteRef);