Browse Source

fix: show Links column in ERD

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
8d8ed60c88
  1. 2
      packages/nc-gui/components/erd/View.vue
  2. 2
      packages/nc-gui/components/erd/utils.ts

2
packages/nc-gui/components/erd/View.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { UITypes, isLinksOrLTAR } from 'nocodb-sdk'
import { isLinksOrLTAR } from 'nocodb-sdk'
import type { ERDConfig } from './utils'
import { reactive, ref, storeToRefs, useMetas, useProject, watch } from '#imports'

2
packages/nc-gui/components/erd/utils.ts

@ -174,7 +174,7 @@ export function useErdElements(tables: MaybeRef<TableType[]>, props: MaybeRef<ER
const columns =
metasWithIdAsKey.value[table.id].columns?.filter(
(col) => config.showAllColumns || (!config.showAllColumns && col.uidt === UITypes.LinkToAnotherRecord),
(col) => config.showAllColumns || (!config.showAllColumns && isLinksOrLTAR(col)),
) || []
const pkAndFkColumns = columns.filter(() => config.showPkAndFk).filter((col) => col.pk || col.uidt === UITypes.ForeignKey)

Loading…
Cancel
Save