Browse Source

fix(nc-gui): exclude kanban fk_grp_col_id from meta.value.columns

pull/4848/head
Wing-Kam Wong 2 years ago
parent
commit
b9935d14cb
  1. 12
      packages/nc-gui/composables/useSharedView.ts

12
packages/nc-gui/composables/useSharedView.ts

@ -9,7 +9,7 @@ import type {
TableType, TableType,
ViewType, ViewType,
} from 'nocodb-sdk' } from 'nocodb-sdk'
import { UITypes, ViewTypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports' import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView() { export function useSharedView() {
@ -71,16 +71,8 @@ export function useSharedView() {
let order = 1 let order = 1
// include kanban grouping field column to share view
// even it is unselected in Fields
// so that it won't break kanban share view
let kanbanGroupingFieldId = ''
if (viewMeta.type === ViewTypes.KANBAN) {
kanbanGroupingFieldId = (await $api.dbView.kanbanRead(viewMeta.id)).fk_grp_col_id!
}
meta.value!.columns = [...viewMeta.model.columns] meta.value!.columns = [...viewMeta.model.columns]
.filter((c) => c.show || (viewMeta.type === ViewTypes.KANBAN && c.id === kanbanGroupingFieldId)) .filter((c) => c.show)
.map((c) => ({ ...c, order: order++ })) .map((c) => ({ ...c, order: order++ }))
.sort((a, b) => a.order - b.order) .sort((a, b) => a.order - b.order)

Loading…
Cancel
Save