Browse Source

fix(gui-v2): isAnyFieldHidden indicator

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/3268/head
mertmit 2 years ago
parent
commit
e82fa79658
  1. 26
      packages/nc-gui-v2/composables/useViewColumns.ts

26
packages/nc-gui-v2/composables/useViewColumns.ts

@ -23,6 +23,18 @@ export function useViewColumns(view: Ref<ViewType> | undefined, meta: ComputedRe
() => isPublic.value || !isUIAllowed('hideAllColumns') || !isUIAllowed('showAllColumns') || isSharedBase.value,
)
const metaColumnById = computed<Record<string, ColumnType>>(() => {
if (!meta.value?.columns) return {}
return meta.value?.columns?.reduce(
(acc: ColumnType, curr: ColumnType) => ({
...acc,
[curr.id!]: curr,
}),
{} as any,
)
})
const loadViewColumns = async () => {
if (!meta || !view) return
@ -48,7 +60,7 @@ export function useViewColumns(view: Ref<ViewType> | undefined, meta: ComputedRe
fk_column_id: column.id,
...currentColumnField,
order: currentColumnField.order || order++,
system: isSystemColumn(currentColumnField.type || false),
system: isSystemColumn(metaColumnById?.value?.[currentColumnField.fk_column_id!]),
}
})
.sort((a: Field, b: Field) => a.order - b.order)
@ -129,18 +141,6 @@ export function useViewColumns(view: Ref<ViewType> | undefined, meta: ComputedRe
reloadData?.()
}
const metaColumnById = computed<Record<string, ColumnType>>(() => {
if (!meta.value?.columns) return {}
return meta.value?.columns?.reduce(
(acc: ColumnType, curr: ColumnType) => ({
...acc,
[curr.id!]: curr,
}),
{} as any,
)
})
const showSystemFields = computed({
get() {
// todo: show_system_fields missing from ViewType

Loading…
Cancel
Save