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 {
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;
}

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

@ -57,6 +57,7 @@
<shared-views-list
v-else-if="type === 'shared-views'"
:selected-view="selectedView"
:model-name="table"
:nodes="nodes"
/>
@ -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) {

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

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

Loading…
Cancel
Save