diff --git a/CliClient/app/app.js b/CliClient/app/app.js index ced43a4d0..176aea69b 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -62,10 +62,13 @@ class Application { let output = await this.loadItems(type, pattern, options); if (output.length > 1) { + output.sort((a, b) => { return a.user_updated_time < b.user_updated_time ? +1 : -1; }); + let answers = { 0: _('[Cancel]') }; for (let i = 0; i < output.length; i++) { answers[i + 1] = output[i].title; } + let msg = _('More than one item match "%s". Please select one:', pattern); const response = await cliUtils.promptMcq(msg, answers); if (!response) return null; diff --git a/CliClient/app/command-done.js b/CliClient/app/command-done.js index d23e0bb86..41943a7ce 100644 --- a/CliClient/app/command-done.js +++ b/CliClient/app/command-done.js @@ -32,7 +32,7 @@ class Command extends BaseCommand { } async action(args) { - Command.handleAction(args, true); + await Command.handleAction(args, true); } } diff --git a/CliClient/app/command-undone.js b/CliClient/app/command-undone.js index 8c3c7012c..6a6d77420 100644 --- a/CliClient/app/command-undone.js +++ b/CliClient/app/command-undone.js @@ -19,7 +19,7 @@ class Command extends BaseCommand { } async action(args) { - CommandDone.handleAction(args, false); + await CommandDone.handleAction(args, false); } } diff --git a/ReactNativeClient/lib/components/screen-header.js b/ReactNativeClient/lib/components/screen-header.js index 636733e95..643878a02 100644 --- a/ReactNativeClient/lib/components/screen-header.js +++ b/ReactNativeClient/lib/components/screen-header.js @@ -239,20 +239,22 @@ class ScreenHeaderComponent extends Component { ); } - if (menuOptionComponents.length) { - menuOptionComponents.push(); + if (this.props.showAdvancedOptions) { + if (menuOptionComponents.length) { + menuOptionComponents.push(); + } + + menuOptionComponents.push( + this.log_press()} key={'menuOption_' + key++} style={this.styles().contextMenuItem}> + {_('Log')} + ); + + menuOptionComponents.push( + this.status_press()} key={'menuOption_' + key++} style={this.styles().contextMenuItem}> + {_('Status')} + ); } - menuOptionComponents.push( - this.log_press()} key={'menuOption_' + key++} style={this.styles().contextMenuItem}> - {_('Log')} - ); - - menuOptionComponents.push( - this.status_press()} key={'menuOption_' + key++} style={this.styles().contextMenuItem}> - {_('Status')} - ); - if (menuOptionComponents.length) { menuOptionComponents.push(); } @@ -316,6 +318,7 @@ const ScreenHeader = connect( historyCanGoBack: state.historyCanGoBack, locale: state.settings.locale, theme: state.settings.theme, + showAdvancedOptions: state.settings.showAdvancedOptions, }; } )(ScreenHeaderComponent) diff --git a/ReactNativeClient/lib/components/screens/note.js b/ReactNativeClient/lib/components/screens/note.js index ae17184af..6528527f6 100644 --- a/ReactNativeClient/lib/components/screens/note.js +++ b/ReactNativeClient/lib/components/screens/note.js @@ -220,6 +220,8 @@ class NoteScreenComponent extends BaseScreenComponent { }); if (isNew) Note.updateGeolocation(note.id); this.refreshNoteMetadata(); + + Keyboard.dismiss(); } async saveOneProperty(name, value) { @@ -385,7 +387,7 @@ class NoteScreenComponent extends BaseScreenComponent { // } output.push({ title: isTodo ? _('Convert to regular note') : _('Convert to todo'), onPress: () => { this.toggleIsTodo_onPress(); } }); - output.push({ title: this.state.showNoteMetadata ? _('Hide metadata') : _('Show metadata'), onPress: () => { this.showMetadata_onPress(); } }); + if (this.props.showAdvancedOptions) output.push({ title: this.state.showNoteMetadata ? _('Hide metadata') : _('Show metadata'), onPress: () => { this.showMetadata_onPress(); } }); output.push({ title: _('View location on map'), onPress: () => { this.showOnMap_onPress(); } }); return output; @@ -555,6 +557,7 @@ const NoteScreen = connect( itemType: state.selectedItemType, folders: state.folders, theme: state.settings.theme, + showAdvancedOptions: state.settings.showAdvancedOptions, }; } )(NoteScreenComponent) diff --git a/ReactNativeClient/lib/models/setting.js b/ReactNativeClient/lib/models/setting.js index f60ea2068..5d03b276e 100644 --- a/ReactNativeClient/lib/models/setting.js +++ b/ReactNativeClient/lib/models/setting.js @@ -334,6 +334,7 @@ Setting.metadata_ = { nonCompleted: _('Non-completed ones only'), })}, 'uncompletedTodosOnTop': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Show uncompleted todos on top of the lists') }, + 'showAdvancedOptions': { value: false, type: Setting.TYPE_BOOL, public: true, appTypes: ['mobile'], label: () => _('Show advanced options') }, 'trackLocation': { value: true, type: Setting.TYPE_BOOL, public: true, label: () => _('Save location with notes') }, 'sync.interval': { value: 300, type: Setting.TYPE_INT, isEnum: true, public: true, appTypes: ['mobile'], label: () => _('Synchronisation interval'), options: () => { return {