Fix import Export Server loading issue, affected due to SchemaView component changes.

This commit is contained in:
Khushboo Vashi 2024-08-12 11:27:21 +05:30 committed by GitHub
parent ccaea82341
commit fb0022923a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,8 +62,14 @@ export default function ImportExportServers({onClose}) {
const [summaryData, setSummaryData] = React.useState([]); const [summaryData, setSummaryData] = React.useState([]);
const [summaryText, setSummaryText] = React.useState(''); const [summaryText, setSummaryText] = React.useState('');
const [noteText, setNoteText] = React.useState(''); const [noteText, setNoteText] = React.useState('');
const [selectionSchemaInstance, setSelectionSchemaInstance] = React.useState();
const api = getApiInstance(); const api = getApiInstance();
React.useEffect(() => {
const impExpSchema = new ImportExportSelectionSchema();
setSelectionSchemaInstance(impExpSchema);
}, []);
const onSave = () => { const onSave = () => {
let post_data = {'filename': selectionFormData.filename}, let post_data = {'filename': selectionFormData.filename},
save_url = url_for('import_export_servers.save'); save_url = url_for('import_export_servers.save');
@ -211,18 +217,20 @@ export default function ImportExportServers({onClose}) {
beforeNext={onBeforeNext} beforeNext={onBeforeNext}
> >
<WizardStep stepId={0}> <WizardStep stepId={0}>
<SchemaView {selectionSchemaInstance &&
formType={'dialog'} <SchemaView
getInitData={() => {/*This is intentional (SonarQube)*/}} formType={'dialog'}
viewHelperProps={{ mode: 'create' }} getInitData={() => {/*This is intentional (SonarQube)*/}}
schema={new ImportExportSelectionSchema()} viewHelperProps={{ mode: 'create' }}
showFooter={false} schema={selectionSchemaInstance}
isTabView={false} showFooter={false}
formClassName='ImportExportServers-Background' isTabView={false}
onDataChange={(isChanged, changedData) => { formClassName='ImportExportServers-Background'
setSelectionFormData(changedData); onDataChange={(isChanged, changedData) => {
}} setSelectionFormData(changedData);
/> }}
/>
}
<FormFooterMessage type={MESSAGE_TYPE.ERROR} message={errMsg} onClose={onErrClose} /> <FormFooterMessage type={MESSAGE_TYPE.ERROR} message={errMsg} onClose={onErrClose} />
</WizardStep> </WizardStep>
<WizardStep stepId={1} className='ImportExportServers-noOverflow'> <WizardStep stepId={1} className='ImportExportServers-noOverflow'>