Import Skylinks from json file

This commit is contained in:
2021-03-18 23:57:03 -05:00
parent e8fb5bd53d
commit 59ad33b381
5 changed files with 69 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import ImportList from './ImportList/ImportList';
import IPCContainer from '../IPCContainer/IPCContainer';
import { notifyApplicationBusy } from '../../redux/actions/common_actions';
import { notifyError, notifyInfo } from '../../redux/actions/error_actions';
import { promptLocationAndReadFile } from '../../utils';
const Constants = require('../../constants');
@@ -79,6 +80,13 @@ export default connect(
this.props.notifyInfo('Import Syntax', msg);
};
handleLoadFile = () => {
const data = promptLocationAndReadFile(this.props.notifyError);
if (data) {
this.setState({ import_text: data });
}
};
handleNavigation = () => {
if (this.state.second_stage) {
try {
@@ -253,6 +261,18 @@ export default connect(
{'Back'}
</Button>
) : null}
{!this.state.second_stage ? (
<Button
buttonStyles={{
height: 'auto',
marginLeft: 'var(--default_spacing)',
marginTop: 'var(--default_spacing)',
width: 'auto',
}}
clicked={this.handleLoadFile}>
{'Import File...'}
</Button>
) : null}
<Button
buttonStyles={{
height: 'auto',