default value for layouts in export function transformSchemaToProps
Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
@@ -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'];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user