Browse Source

MapView: 'Mapped by' column values should always be delivered - WIP

pull/4749/head
Daniel Spaude 2 years ago
parent
commit
ba507a49dc
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 4
      packages/nc-gui/components/smartsheet/Map.vue
  2. 8
      packages/nc-gui/composables/useViewColumns.ts

4
packages/nc-gui/components/smartsheet/Map.vue

@ -155,12 +155,12 @@ onMounted(async () => {
})
reloadViewMetaHook?.on(async () => {
alert('reloadViewMetaHook')
// alert('reloadViewMetaHook')
await loadMapMeta()
})
reloadViewDataHook?.on(async () => {
alert('reloadViewDataHook')
// alert('reloadViewDataHook')
await loadMapData()
})

8
packages/nc-gui/composables/useViewColumns.ts

@ -1,5 +1,5 @@
import { isSystemColumn, MapType, ViewTypes } from 'nocodb-sdk'
import type { ColumnType, TableType, ViewType } from 'nocodb-sdk'
import { ViewTypes, isSystemColumn } from 'nocodb-sdk'
import type { ColumnType, MapType, TableType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import { IsPublicInj, computed, inject, ref, useNuxtApp, useProject, useUIPermission, watch } from '#imports'
import type { Field } from '~/lib'
@ -25,6 +25,7 @@ export function useViewColumns(
() => isPublic.value || !isUIAllowed('hideAllColumns') || !isUIAllowed('showAllColumns') || isSharedBase.value,
)
// const isColumnOrFieldViewEssential = (columnOrField: { id?: string }) => {
const isColumnViewEssential = (column: ColumnType) => {
// TODO: delegate this via a cleaner design pattern to map view specific check logic
// (on the other hand, the logic complexity is still very low atm - might be overkill)
@ -105,8 +106,9 @@ export function useViewColumns(
if (isLocalMode.value) {
fields.value = fields.value?.map((field: Field) => ({
...field,
show: false,
show: !!field.isViewEssentialField,
}))
console.log('fields.value', fields.value)
reloadData?.()
return
}

Loading…
Cancel
Save