Partial import processing
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
.ImportOwner {
|
||||||
|
display: flex;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding-bottom: var(--default_spacing);
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import './Import.css'
|
||||||
|
|
||||||
|
export default ({data}) => {
|
||||||
|
return (
|
||||||
|
<div className={'ImportOwner'}>
|
||||||
|
<input readOnly
|
||||||
|
className={'ConfigurationItemInput'}
|
||||||
|
style={{maxWidth: 'calc(33.33% - var(--default_spacing)', marginRight: 'var(--default_spacing)'}}
|
||||||
|
type={'text'}
|
||||||
|
value={data.directory}/>
|
||||||
|
<input readOnly
|
||||||
|
className={'ConfigurationItemInput'}
|
||||||
|
style={{maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))'}}
|
||||||
|
type={'text'}
|
||||||
|
value={data.skylink}/>
|
||||||
|
<input readOnly
|
||||||
|
className={'ConfigurationItemInput'}
|
||||||
|
style={{maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))', marginLeft: 'var(--default_spacing)'}}
|
||||||
|
type={'text'}
|
||||||
|
value={data.token}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
.ImportListOwner {
|
||||||
|
max-height: 56vh;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ImportListHeader {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import './ImportList.css'
|
||||||
|
import Import from './Import/Import'
|
||||||
|
import Text from '../../../components/UI/Text/Text';
|
||||||
|
|
||||||
|
export default ({imports_array}) => {
|
||||||
|
let key = 0;
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div className={'ImportListHeader'}>
|
||||||
|
<Text type={'Heading1'} text={'Directory'} style={{minWidth: '33.33%', maxWidth: '33.33%'}}/>
|
||||||
|
<Text type={'Heading1'} text={'Skylink'} style={{minWidth: '33.33%', maxWidth: '33.33%'}}/>
|
||||||
|
<Text type={'Heading1'} text={'Token'} style={{minWidth: '33.33%', maxWidth: '33.33%'}}/>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div className={'ImportListOwner'}>
|
||||||
|
{
|
||||||
|
imports_array.map(data => {
|
||||||
|
return (
|
||||||
|
<div key={'import_' + key++}>
|
||||||
|
<Import data={data}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.SkynetActionButtons {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
.SkynetImportHeading {
|
.SkynetImportHeading {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-bottom: var(--default_spacing);
|
padding-bottom: var(--default_spacing);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import './SkynetImport.css'
|
|||||||
import Box from '../../components/UI/Box/Box';
|
import Box from '../../components/UI/Box/Box';
|
||||||
import Button from '../../components/UI/Button/Button';
|
import Button from '../../components/UI/Button/Button';
|
||||||
import {displaySkynetImport} from '../../redux/actions/skynet_actions';
|
import {displaySkynetImport} from '../../redux/actions/skynet_actions';
|
||||||
//import {ImportList} from './ImportList/ImportList'
|
import ImportList from './ImportList/ImportList'
|
||||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||||
import {
|
import {
|
||||||
@@ -14,11 +14,12 @@ import {
|
|||||||
|
|
||||||
const Constants = require('../../constants');
|
const Constants = require('../../constants');
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = state => {
|
||||||
return {
|
return {
|
||||||
AppBusy: state.common.AppBusy,
|
AppBusy: state.common.AppBusy,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => {
|
const mapDispatchToProps = dispatch => {
|
||||||
return {
|
return {
|
||||||
displaySkynetImport: display => dispatch(displaySkynetImport(display)),
|
displaySkynetImport: display => dispatch(displaySkynetImport(display)),
|
||||||
@@ -73,21 +74,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
|||||||
this.props.notifyInfo(msg)
|
this.props.notifyInfo(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
onImportSkylinksReply = (_, arg) => {
|
handleNavigation = () => {
|
||||||
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 = () => {
|
|
||||||
if (this.state.second_stage) {
|
if (this.state.second_stage) {
|
||||||
try {
|
try {
|
||||||
this.props.notifyApplicationBusy(true);
|
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() {
|
render() {
|
||||||
//<ImportList data={this.state.imports_array}/>
|
|
||||||
return this.props.AppBusy ? (<div/>) : (
|
return this.props.AppBusy ? (<div/>) : (
|
||||||
<Box dxDark dxStyle={{
|
<Box dxDark dxStyle={{
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
@@ -165,10 +165,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
|||||||
onClick={() => this.props.displaySkynetImport(false)}
|
onClick={() => this.props.displaySkynetImport(false)}
|
||||||
style={{cursor: 'pointer'}}>X</a>
|
style={{cursor: 'pointer'}}>X</a>
|
||||||
</div>
|
</div>
|
||||||
<h1 className={'SkynetImportHeading'}>Import List</h1>
|
<h1 className={'SkynetImportHeading'}>{this.state.second_stage ? 'Verify Imports' : 'Import List'}</h1>
|
||||||
{
|
{
|
||||||
this.state.second_stage ? (
|
this.state.second_stage ? (
|
||||||
<div/>
|
<ImportList imports_array={this.state.imports_array}/>
|
||||||
) : (
|
) : (
|
||||||
<textarea autoFocus={true}
|
<textarea autoFocus={true}
|
||||||
className={'SkynetImportTextArea'}
|
className={'SkynetImportTextArea'}
|
||||||
@@ -182,12 +182,26 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
|
|||||||
<div className={'SkynetImportButtons'}>
|
<div className={'SkynetImportButtons'}>
|
||||||
<Button buttonStyles={{height: 'auto', marginTop: 'var(--default_spacing)', width: 'auto'}}
|
<Button buttonStyles={{height: 'auto', marginTop: 'var(--default_spacing)', width: 'auto'}}
|
||||||
clicked={this.displaySyntax}>Import Syntax...</Button>
|
clicked={this.displaySyntax}>Import Syntax...</Button>
|
||||||
|
<div className={'SkynetActionButtons'}>
|
||||||
|
{
|
||||||
|
this.state.second_stage ?
|
||||||
<Button buttonStyles={{
|
<Button buttonStyles={{
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
marginLeft: 'var(--default_spacing)',
|
marginLeft: 'var(--default_spacing)',
|
||||||
marginTop: 'var(--default_spacing)',
|
marginTop: 'var(--default_spacing)',
|
||||||
width: 'auto'
|
width: 'auto'
|
||||||
}} clicked={this.processNext}>{this.state.second_stage ? 'Import' : 'Next'}</Button>
|
}} 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>
|
</div>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -108,13 +108,16 @@ export default class extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className={'PasswordOwner'}>
|
<div className={'PasswordOwner'} style={{...this.props.style}}>
|
||||||
<a href={'#'}
|
{
|
||||||
|
this.props.readOnly ? null : <a href={'#'}
|
||||||
className={'PasswordLink'}
|
className={'PasswordLink'}
|
||||||
onClick={this.handleActionClick}>
|
onClick={this.handleActionClick}>
|
||||||
<u>{this.state.button_text}</u>
|
<u>{this.state.button_text}</u>
|
||||||
</a>
|
</a>
|
||||||
|
}
|
||||||
<input autoFocus={this.props.autoFocus}
|
<input autoFocus={this.props.autoFocus}
|
||||||
|
readOnly={this.props.readOnly}
|
||||||
className={'PasswordInput'}
|
className={'PasswordInput'}
|
||||||
disabled={this.props.readOnly || (this.state.button_text === 'clear')}
|
disabled={this.props.readOnly || (this.state.button_text === 'clear')}
|
||||||
onChange={this.handlePasswordChanged}
|
onChange={this.handlePasswordChanged}
|
||||||
|
|||||||
Reference in New Issue
Block a user