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 () => { reloadViewMetaHook?.on(async () => {
alert('reloadViewMetaHook') // alert('reloadViewMetaHook')
await loadMapMeta() await loadMapMeta()
}) })
reloadViewDataHook?.on(async () => { reloadViewDataHook?.on(async () => {
alert('reloadViewDataHook') // alert('reloadViewDataHook')
await loadMapData() await loadMapData()
}) })

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

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

Loading…
Cancel
Save