Partial import processing
This commit is contained in:
@@ -4,7 +4,7 @@ import './SkynetImport.css'
|
||||
import Box from '../../components/UI/Box/Box';
|
||||
import Button from '../../components/UI/Button/Button';
|
||||
import {displaySkynetImport} from '../../redux/actions/skynet_actions';
|
||||
//import {ImportList} from './ImportList/ImportList'
|
||||
import ImportList from './ImportList/ImportList'
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||
import {
|
||||
@@ -14,11 +14,12 @@ import {
|
||||
|
||||
const Constants = require('../../constants');
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
AppBusy: state.common.AppBusy,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
displaySkynetImport: display => dispatch(displaySkynetImport(display)),
|
||||
@@ -73,21 +74,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
||||
this.props.notifyInfo(msg)
|
||||
}
|
||||
|
||||
onImportSkylinksReply = (_, arg) => {
|
||||
this.props.notifyApplicationBusy(false);
|
||||
if (arg.data.Success) {
|
||||
console.log(arg.data.Result);
|
||||
this.setState({
|
||||
import_text: '',
|
||||
imports_array: [],
|
||||
second_stage: false,
|
||||
});
|
||||
} else {
|
||||
this.props.notifyError(arg.data.Error);
|
||||
}
|
||||
};
|
||||
|
||||
processNext = () => {
|
||||
handleNavigation = () => {
|
||||
if (this.state.second_stage) {
|
||||
try {
|
||||
this.props.notifyApplicationBusy(true);
|
||||
@@ -151,8 +138,21 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
||||
}
|
||||
}
|
||||
|
||||
onImportSkylinksReply = (_, arg) => {
|
||||
this.props.notifyApplicationBusy(false);
|
||||
if (arg.data.Success) {
|
||||
console.log(arg.data.Result);
|
||||
this.setState({
|
||||
import_text: '',
|
||||
imports_array: [],
|
||||
second_stage: false,
|
||||
});
|
||||
} else {
|
||||
this.props.notifyError(arg.data.Error);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
//<ImportList data={this.state.imports_array}/>
|
||||
return this.props.AppBusy ? (<div/>) : (
|
||||
<Box dxDark dxStyle={{
|
||||
height: 'auto',
|
||||
@@ -165,10 +165,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
||||
onClick={() => this.props.displaySkynetImport(false)}
|
||||
style={{cursor: 'pointer'}}>X</a>
|
||||
</div>
|
||||
<h1 className={'SkynetImportHeading'}>Import List</h1>
|
||||
<h1 className={'SkynetImportHeading'}>{this.state.second_stage ? 'Verify Imports' : 'Import List'}</h1>
|
||||
{
|
||||
this.state.second_stage ? (
|
||||
<div/>
|
||||
<ImportList imports_array={this.state.imports_array}/>
|
||||
) : (
|
||||
<textarea autoFocus={true}
|
||||
className={'SkynetImportTextArea'}
|
||||
@@ -182,12 +182,26 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
||||
<div className={'SkynetImportButtons'}>
|
||||
<Button buttonStyles={{height: 'auto', marginTop: 'var(--default_spacing)', width: 'auto'}}
|
||||
clicked={this.displaySyntax}>Import Syntax...</Button>
|
||||
<Button buttonStyles={{
|
||||
height: 'auto',
|
||||
marginLeft: 'var(--default_spacing)',
|
||||
marginTop: 'var(--default_spacing)',
|
||||
width: 'auto'
|
||||
}} clicked={this.processNext}>{this.state.second_stage ? 'Import' : 'Next'}</Button>
|
||||
<div className={'SkynetActionButtons'}>
|
||||
{
|
||||
this.state.second_stage ?
|
||||
<Button buttonStyles={{
|
||||
height: 'auto',
|
||||
marginLeft: 'var(--default_spacing)',
|
||||
marginTop: 'var(--default_spacing)',
|
||||
width: 'auto'
|
||||
}} clicked={() => this.setState({
|
||||
second_stage: false,
|
||||
})}>{'Back'}</Button> :
|
||||
null
|
||||
}
|
||||
<Button buttonStyles={{
|
||||
height: 'auto',
|
||||
marginLeft: 'var(--default_spacing)',
|
||||
marginTop: 'var(--default_spacing)',
|
||||
width: 'auto'
|
||||
}} clicked={this.handleNavigation}>{this.state.second_stage ? 'Import' : 'Next'}</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user