diff --git a/src/containers/Configuration/Configuration.js b/src/containers/Configuration/Configuration.js index 732975b..11b03c4 100644 --- a/src/containers/Configuration/Configuration.js +++ b/src/containers/Configuration/Configuration.js @@ -96,29 +96,29 @@ class Configuration extends IPCContainer { createItemList = (config, template) => { const objectList = []; const itemList = Object - .keys(config) - .map(key => { - return { - advanced: template[key] ? template[key].advanced : false, - hide_remote: template[key] ? template[key].hide_remote : false, - label: key, - remote: template[key] ? template[key].remote : false, - type: template[key] ? template[key].type : null, - value: (template[key] && (template[key].type === 'object')) ? + .keys(config) + .map(key => { + return { + advanced: template[key] ? template[key].advanced : false, + hide_remote: template[key] ? template[key].hide_remote : false, + label: key, + remote: template[key] ? template[key].remote : false, + type: template[key] ? template[key].type : null, + value: (template[key] && (template[key].type === 'object')) ? + config[key] : + (template[key] && (template[key].type === 'string_array')) ? config[key] : - (template[key] && (template[key].type === 'string_array')) ? - config[key] : - config[key].toString(), - }; - }) - .filter(i=> { - let ret = template[i.label]; - if (ret && (template[i.label].type === 'object')) { - objectList.push(i); - ret = false; - } - return ret; - }); + config[key].toString(), + }; + }) + .filter(i => { + let ret = template[i.label]; + if (ret && (template[i.label].type === 'object')) { + objectList.push(i); + ret = false; + } + return ret; + }); return { ObjectList: objectList, ItemList: itemList, @@ -190,7 +190,7 @@ class Configuration extends IPCContainer { if (arg.data.Success) { this.setState({ Template: arg.data.Template, - }, ()=> { + }, () => { this.sendRequest(Constants.IPC_Get_Config, { Provider: this.props.DisplayConfiguration, Remote: this.props.DisplayRemoteConfiguration, @@ -214,7 +214,7 @@ class Configuration extends IPCContainer { saveAndClose = () => { this.setState({ Saving: true, - }, ()=> { + }, () => { const changedItems = []; for (const item of this.state.ChangedItems) { changedItems.push({ @@ -274,12 +274,17 @@ class Configuration extends IPCContainer {

Save Changes?

- +
+ - - + + -
+
+ +
); @@ -301,7 +306,7 @@ class Configuration extends IPCContainer { (!k.advanced || (this.state.ShowAdvanced && k.advanced && !k.remote) || this.showRemoteConfigItem(k, this.state.ObjectLookup[key])) ? this.handleObjectItemChanged(e, key, i)} + changed={e => this.handleObjectItemChanged(e, key, i)} grouping={key} items={this.state.Template[key].template[k.label].items} key={i} @@ -318,23 +323,23 @@ class Configuration extends IPCContainer { } const configurationItems = this.state.ItemList - .map((k, i) => { - const shouldFocus = autoFocus; - autoFocus = false; - return ( - ((!this.state.IsRemoteMount || !k.hide_remote) && (!k.advanced || (this.state.ShowAdvanced && k.advanced))) ? - this.handleItemChanged(e, i)} - grouping={'Settings'} - items={this.state.Template[k.label].items} - key={i} - label={k.label} - template={this.state.Template[k.label]} - value={k.value}/> : - null - ); - }); + .map((k, i) => { + const shouldFocus = autoFocus; + autoFocus = false; + return ( + ((!this.state.IsRemoteMount || !k.hide_remote) && (!k.advanced || (this.state.ShowAdvanced && k.advanced))) ? + this.handleItemChanged(e, i)} + grouping={'Settings'} + items={this.state.Template[k.label].items} + key={i} + label={k.label} + template={this.state.Template[k.label]} + value={k.value}/> : + null + ); + }); return (
@@ -355,14 +360,16 @@ class Configuration extends IPCContainer {

{( this.props.DisplayRemoteConfiguration ? this.props.DisplayConfiguration.substr(6) : - this.props.DisplayConfiguration) + ' Configuration '} { - this.props.displayPinnedManager(true); - return false; - }}>Pinned Files + this.props.DisplayConfiguration) + ' Configuration '}

+ {this.props.MState.Mounted ? : null} +
{objectItems} {(configurationItems.length > 0) ?

Settings

: null} {configurationItems} @@ -378,6 +385,7 @@ const mapStateToProps = state => { DisplayConfiguration: state.mounts.DisplayConfiguration, DisplayRemoteConfiguration: state.mounts.DisplayRemoteConfiguration, DisplayS3Configuration: state.mounts.DisplayS3Configuration, + MState: state.mounts.MountState[state.mounts.DisplayConfiguration], Platform: state.common.Platform, } }; diff --git a/src/containers/PinnedManager/PinnedManager.js b/src/containers/PinnedManager/PinnedManager.js index 27138d1..67d4e20 100644 --- a/src/containers/PinnedManager/PinnedManager.js +++ b/src/containers/PinnedManager/PinnedManager.js @@ -25,7 +25,7 @@ const mapDispatchToProps = dispatch => { return { displayPinnedManager: display => dispatch(displayPinnedManager(display)), notifyApplicationBusy: busy => dispatch(notifyApplicationBusy(busy, true)), - notifyError: msg => dispatch(notifyError(msg)), + notifyError: (msg, cb) => dispatch(notifyError(msg, false, cb)), notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg)), } }; @@ -63,7 +63,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon .map(i => { return { ...i, - name: i.path === '..' ? i.path : '\'' + i.path.substr(i.path.lastIndexOf('/') + 1) + '\'', + name: i.path === '..' ? i.path : i.path.substr(i.path.lastIndexOf('/') + 1), meta: { ...i.meta, pinned: i.meta.pinned === '1', @@ -74,7 +74,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon items, }); } else { - this.props.notifyError(data.Error, false, () => { + this.props.notifyError(data.Error, () => { this.props.displayPinnedManager(false); }); } @@ -159,7 +159,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon style={{cursor: 'pointer'}}>X

{'Pinned File Manager'}

-

{this.state.active_directory}

+
{this.state.active_directory}
{ this.state.items.map((i, k) => {