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