From 20cba6ee9bc1daa902b04d6e2ddcb31d04fbf805 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Tue, 20 Apr 2021 16:30:10 +0200 Subject: [PATCH] feat(UI): canc press to delete selected rows --- .../components/WorkspaceQueryTable.vue | 40 +++++++++++++++++-- .../components/WorkspaceQueryTableContext.vue | 35 +--------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/renderer/components/WorkspaceQueryTable.vue b/src/renderer/components/WorkspaceQueryTable.vue index d8b44786..b8c03953 100644 --- a/src/renderer/components/WorkspaceQueryTable.vue +++ b/src/renderer/components/WorkspaceQueryTable.vue @@ -1,16 +1,18 @@ @@ -85,6 +104,7 @@ import { TEXT, LONG_TEXT, BLOB } from 'common/fieldTypes'; import BaseVirtualScroll from '@/components/BaseVirtualScroll'; import WorkspaceQueryTableRow from '@/components/WorkspaceQueryTableRow'; import TableContext from '@/components/WorkspaceQueryTableContext'; +import ConfirmModal from '@/components/BaseConfirmModal'; import { mapActions, mapGetters } from 'vuex'; import moment from 'moment'; @@ -93,7 +113,8 @@ export default { components: { BaseVirtualScroll, WorkspaceQueryTableRow, - TableContext + TableContext, + ConfirmModal }, props: { results: Array, @@ -106,6 +127,7 @@ export default { resultsSize: 1000, localResults: [], isContext: false, + isDeleteConfirmModal: false, contextEvent: null, selectedCell: null, selectedRows: [], @@ -322,7 +344,17 @@ export default { }; this.$emit('update-field', params); }, + closeContext () { + this.isContext = false; + }, + showDeleteConfirmModal () { + this.isDeleteConfirmModal = true; + }, + hideDeleteConfirmModal () { + this.isDeleteConfirmModal = false; + }, deleteSelected () { + this.closeContext(); const rows = this.localResults.filter(row => this.selectedRows.includes(row._id)).map(row => { delete row._id; return row; diff --git a/src/renderer/components/WorkspaceQueryTableContext.vue b/src/renderer/components/WorkspaceQueryTableContext.vue index cb3e6d46..edb42153 100644 --- a/src/renderer/components/WorkspaceQueryTableContext.vue +++ b/src/renderer/components/WorkspaceQueryTableContext.vue @@ -17,61 +17,30 @@ {{ $tc('message.deleteRows', selectedRows.length) }} - - - -
-
- {{ $tc('message.confirmToDeleteRows', selectedRows.length) }} -
-
-