forked from p15670423/monkey
Improved configuration export and fixed the bug of modal not closing on export.
This commit is contained in:
parent
624fda10cb
commit
8b86e40259
|
@ -8,7 +8,7 @@ import '../../styles/components/configuration-components/ExportConfigModal.scss'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
show: boolean,
|
show: boolean,
|
||||||
onClick: () => void
|
onHide: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfigExportModal = (props: Props) => {
|
const ConfigExportModal = (props: Props) => {
|
||||||
|
@ -45,12 +45,13 @@ const ConfigExportModal = (props: Props) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
FileSaver.saveAs(configToExport, 'monkey.conf');
|
FileSaver.saveAs(configToExport, 'monkey.conf');
|
||||||
|
props.onHide();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal show={props.show}
|
<Modal show={props.show}
|
||||||
onHide={props.onClick}
|
onHide={props.onHide}
|
||||||
size={'lg'}
|
size={'lg'}
|
||||||
className={'config-export-modal'}>
|
className={'config-export-modal'}>
|
||||||
<Modal.Header closeButton>
|
<Modal.Header closeButton>
|
||||||
|
|
|
@ -228,16 +228,14 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
|
|
||||||
renderConfigExportModal = () => {
|
renderConfigExportModal = () => {
|
||||||
return (<ConfigExportModal show={this.state.showConfigExportModal}
|
return (<ConfigExportModal show={this.state.showConfigExportModal}
|
||||||
onClick={this.onExport}/>)
|
onHide={() => {
|
||||||
}
|
this.setState({showConfigExportModal: false});
|
||||||
|
}}/>);
|
||||||
onExport = () => {
|
|
||||||
this.setState({showConfigExportModal: false})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderConfigImportModal = () => {
|
renderConfigImportModal = () => {
|
||||||
return (<ConfigImportModal show={this.state.showConfigImportModal}
|
return (<ConfigImportModal show={this.state.showConfigImportModal}
|
||||||
onClose={this.onClose}/>)
|
onClose={this.onClose}/>);
|
||||||
}
|
}
|
||||||
|
|
||||||
onClose = (importSuccessful) => {
|
onClose = (importSuccessful) => {
|
||||||
|
|
Loading…
Reference in New Issue