Browse Source

fix: show shared url in shared view list based on active view

fix issue with main view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/688/head
Pranav C 3 years ago
parent
commit
973f168159
  1. 15
      packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue
  2. 3
      packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue
  3. 1
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

15
packages/nc-gui/components/project/spreadsheet/components/sharedViewsList.vue

@ -109,7 +109,7 @@ import viewIcons from '~/helpers/viewIcons'
export default { export default {
name: 'SharedViewsList', name: 'SharedViewsList',
props: ['modelName', 'nodes'], props: ['modelName', 'nodes', 'selectedView'],
data: () => ({ data: () => ({
viewsList: null, viewsList: null,
currentView: null, currentView: null,
@ -136,7 +136,15 @@ export default {
model_name: this.modelName 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) { if (index > -1) {
this.currentView = viewsList.splice(index, 1)[0] this.currentView = viewsList.splice(index, 1)[0]
} else { } else {
@ -164,7 +172,8 @@ export default {
th, td { th, td {
padding: 0 5px; 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; transform: scale(0.5) !important;
} }

3
packages/nc-gui/components/project/spreadsheet/overlay/additinalFeatures.vue

@ -57,6 +57,7 @@
<shared-views-list <shared-views-list
v-else-if="type === 'shared-views'" v-else-if="type === 'shared-views'"
:selected-view="selectedView"
:model-name="table" :model-name="table"
:nodes="nodes" :nodes="nodes"
/> />
@ -81,7 +82,7 @@ import SharedViewsList from '@/components/project/spreadsheet/components/sharedV
export default { export default {
name: 'AdditionalFeatures', name: 'AdditionalFeatures',
components: { SharedViewsList, ViewColumns, Validation, Webhooks, Triggers, Indexes, Columns, TableAcl }, components: { SharedViewsList, ViewColumns, Validation, Webhooks, Triggers, Indexes, Columns, TableAcl },
props: ['value', 'nodes', 'type', 'deleteTable', 'table'], props: ['value', 'nodes', 'type', 'deleteTable', 'table', 'selectedView'],
computed: { computed: {
show: { show: {
set(v) { set(v) {

1
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -514,6 +514,7 @@
<additional-features <additional-features
v-model="showAddFeatOverlay" v-model="showAddFeatOverlay"
:selected-view="selectedView"
:delete-table="deleteTable" :delete-table="deleteTable"
:nodes="nodes" :nodes="nodes"
:type="featureType" :type="featureType"

Loading…
Cancel
Save