diff --git a/src/renderer/components/WorkspacePropsOptionsModal.vue b/src/renderer/components/WorkspacePropsOptionsModal.vue new file mode 100644 index 00000000..29d5e1fa --- /dev/null +++ b/src/renderer/components/WorkspacePropsOptionsModal.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/renderer/components/WorkspacePropsTab.vue b/src/renderer/components/WorkspacePropsTab.vue index cc0d79c1..9aa19d4d 100644 --- a/src/renderer/components/WorkspacePropsTab.vue +++ b/src/renderer/components/WorkspacePropsTab.vue @@ -32,7 +32,7 @@ {{ $t('word.add') }} - @@ -61,92 +61,15 @@ @remove-field="removeField" /> - - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
+ @options-update="optionsUpdate" + /> @@ -155,13 +78,13 @@ import { mapGetters, mapActions } from 'vuex'; import { uidGen } from 'common/libs/uidGen'; import Tables from '@/ipc-api/Tables'; import WorkspacePropsTable from '@/components/WorkspacePropsTable'; -import ConfirmModal from '@/components/BaseConfirmModal'; +import WorkspacePropsOptionsModal from '@/components/WorkspacePropsOptionsModal'; export default { name: 'WorkspacePropsTab', components: { WorkspacePropsTable, - ConfirmModal + WorkspacePropsOptionsModal }, props: { connection: Object, @@ -181,7 +104,7 @@ export default { localKeyUsage: [], originalIndexes: [], localIndexes: [], - localOptions: [], + localOptions: {}, lastTable: null }; }, @@ -210,9 +133,6 @@ export default { return JSON.stringify(this.originalFields) !== JSON.stringify(this.localFields) || JSON.stringify(this.originalKeyUsage) !== JSON.stringify(this.localKeyUsage) || JSON.stringify(this.tableOptions) !== JSON.stringify(this.localOptions); - }, - isTableNameValid () { - return this.localOptions.name !== ''; } }, watch: { @@ -385,27 +305,14 @@ export default { removeField (uid) { this.localFields = this.localFields.filter(field => field._id !== uid); }, - showAddModal () { - this.isAddModal = true; - }, - hideAddModal () { - this.isAddModal = false; - }, showOptionsModal () { this.isOptionsModal = true; }, hideOptionsModal () { - if (this.isOptionsChanging && !this.isTableNameValid) { - this.isOptionsChanging = false; - return; - } - this.isOptionsModal = false; - if (!this.isOptionsChanging) this.localOptions = JSON.parse(JSON.stringify(this.tableOptions)); - this.isOptionsChanging = false; }, - confirmOptionsChange () { - this.isOptionsChanging = true; + optionsUpdate (options) { + this.localOptions = options; } } }; diff --git a/src/renderer/i18n/en-US.js b/src/renderer/i18n/en-US.js index f9d44526..dafee136 100644 --- a/src/renderer/i18n/en-US.js +++ b/src/renderer/i18n/en-US.js @@ -101,7 +101,9 @@ module.exports = { zeroFill: 'Zero fill', customValue: 'Custom value', onUpdate: 'On update', - deleteField: 'Delete field' + deleteField: 'Delete field', + createNewIndex: 'Create new index', + addToIndex: 'Add to index' }, // Date and Time short: {