|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|