From 3c346d4cae882b5a5ec851a539d1dd20f180c909 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 29 Jan 2024 10:45:47 +0100 Subject: [PATCH] Use table id for events Signed-off-by: Cleopatra Enjeck M --- src/modules/main/partials/TableView.vue | 16 ++++++++++ src/modules/main/sections/MainWrapper.vue | 12 +++++++ src/modules/modals/DeleteRows.vue | 2 +- src/shared/components/ncTable/NcTable.vue | 32 ++++++++++++------- .../ncTable/sections/CustomTable.vue | 14 +++++--- .../components/ncTable/sections/Options.vue | 6 +++- 6 files changed, 64 insertions(+), 18 deletions(-) diff --git a/src/modules/main/partials/TableView.vue b/src/modules/main/partials/TableView.vue index 5d67d168e..2690b425c 100644 --- a/src/modules/main/partials/TableView.vue +++ b/src/modules/main/partials/TableView.vue @@ -2,6 +2,7 @@ r.id === rowId), columns: this.columns }) }, deleteSelectedRows(rows) { + this.setActiveElement() emit('tables:row:delete', rows) }, toggleShare() { + this.setActiveElement() emit('tables:sidebar:sharing', { open: true, tab: 'sharing' }) }, actionShowIntegration() { + this.setActiveElement() emit('tables:sidebar:integration', { open: true, tab: 'integration' }) }, openImportModal(element) { diff --git a/src/modules/main/sections/MainWrapper.vue b/src/modules/main/sections/MainWrapper.vue index a28b9d009..58b9155da 100644 --- a/src/modules/main/sections/MainWrapper.vue +++ b/src/modules/main/sections/MainWrapper.vue @@ -14,6 +14,7 @@ @toggle-share="toggleShare" @show-integration="showIntegration" /> r.id === this.activeRowId), columns: this.columns }) } this.localLoading = false diff --git a/src/modules/modals/DeleteRows.vue b/src/modules/modals/DeleteRows.vue index df303f8d7..7d7bf0675 100644 --- a/src/modules/modals/DeleteRows.vue +++ b/src/modules/modals/DeleteRows.vue @@ -46,7 +46,7 @@ export default { if (error) { showError(t('tables', 'Error occurred while deleting rows.')) } - emit('tables:selected-rows:deselect', {}) + emit('tables:selected-rows:deselect', this.activeElement.id) this.$emit('cancel') }, }, diff --git a/src/shared/components/ncTable/NcTable.vue b/src/shared/components/ncTable/NcTable.vue index 0316b58fe..be9724e9f 100644 --- a/src/shared/components/ncTable/NcTable.vue +++ b/src/shared/components/ncTable/NcTable.vue @@ -41,26 +41,28 @@ deselect-all-rows -> unselect all rows, e.g. after deleting selected rows
+ @delete-selected-rows="rowIds => $emit('delete-selected-rows', rowIds, tableId)" />