CreateImageWizard: enable passing initial state to CreateImageWizard
This commit is contained in:
parent
c3c7888610
commit
c3f86f3575
2 changed files with 7 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import ImageCreator from './ImageCreator';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
|
||||
import DocumentationButton from '../sharedComponents/DocumentationButton';
|
||||
import './CreateImageWizard.scss';
|
||||
|
|
@ -198,6 +198,7 @@ const onSave = (values) => {
|
|||
const CreateImageWizard = () => {
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
return <ImageCreator
|
||||
onClose={ () => navigate('/') }
|
||||
onSubmit={ ({ values, setIsSaving }) => {
|
||||
|
|
@ -261,7 +262,8 @@ const CreateImageWizard = () => {
|
|||
]
|
||||
}
|
||||
]
|
||||
} } />;
|
||||
} }
|
||||
initialValues={ {} } />;
|
||||
};
|
||||
|
||||
export default CreateImageWizard;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import FileSystemConfigToggle from './formComponents/FileSystemConfigToggle';
|
|||
|
||||
const ImageCreator = ({ schema, onSubmit, onClose, customComponentMapper, customValidatorMapper, defaultArch, className, ...props }) => {
|
||||
return schema ? <FormRenderer
|
||||
initialValues={ props.initialValues }
|
||||
schema={ schema }
|
||||
className={ `image-builder${className ? ` ${className}` : ''}` }
|
||||
subscription={ { values: true } }
|
||||
|
|
@ -57,7 +58,8 @@ ImageCreator.propTypes = {
|
|||
[PropTypes.string]: PropTypes.func
|
||||
}),
|
||||
defaultArch: PropTypes.string,
|
||||
className: PropTypes.string
|
||||
className: PropTypes.string,
|
||||
initialValues: PropTypes.object
|
||||
};
|
||||
|
||||
export default ImageCreator;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue