From 973f168159f221c23c31fbd29b4b97e2f2508014 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 21 Oct 2021 16:26:28 +0530 Subject: [PATCH] fix: show shared url in shared view list based on active view fix issue with main view Signed-off-by: Pranav C --- .../spreadsheet/components/sharedViewsList.vue | 15 ++++++++++++--- .../spreadsheet/overlay/additinalFeatures.vue | 3 ++- .../project/spreadsheet/rowsXcDataTable.vue | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue b/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue index 80d12cf2ae..856ddc9e2d 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue @@ -109,7 +109,7 @@ import viewIcons from '~/helpers/viewIcons' export default { name: 'SharedViewsList', - props: ['modelName', 'nodes'], + props: ['modelName', 'nodes', 'selectedView'], data: () => ({ viewsList: null, currentView: null, @@ -136,7 +136,15 @@ export default { model_name: this.modelName }]) - const index = viewsList.findIndex(v => (v.view_name || '').toLowerCase() === (this.$route.query.view || '').toLowerCase()) + const index = viewsList.findIndex((v) => { + if (this.selectedView) { + // if current view is main view compare with model name + return (['table', 'view'].includes(this.selectedView.type) ? this.modelName : this.selectedView.title) === v.view_name + } else { + return (v.view_name || '').toLowerCase() === (this.$route.query.view || '').toLowerCase() + } + }) + if (index > -1) { this.currentView = viewsList.splice(index, 1)[0] } else { @@ -164,7 +172,8 @@ export default { th, td { padding: 0 5px; } -/deep/ .nc-switch-show-all .v-input--selection-controls__input { + +/deep/ .nc-switch-show-all .v-input--selection-controls__input { transform: scale(0.5) !important; } diff --git a/packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue b/packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue index 984d51c4f8..e304ab5e30 100644 --- a/packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue +++ b/packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue @@ -57,6 +57,7 @@ @@ -81,7 +82,7 @@ import SharedViewsList from '@/components/project/spreadsheet/components/sharedV export default { name: 'AdditionalFeatures', components: { SharedViewsList, ViewColumns, Validation, Webhooks, Triggers, Indexes, Columns, TableAcl }, - props: ['value', 'nodes', 'type', 'deleteTable', 'table'], + props: ['value', 'nodes', 'type', 'deleteTable', 'table', 'selectedView'], computed: { show: { set(v) { diff --git a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue index 87abd331af..da2c0fcb4f 100644 --- a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue +++ b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue @@ -514,6 +514,7 @@