Import Skylinks from json file
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user