Browse Source

refactor: allow hm & mm lookup creation

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
d91a0cadc6
  1. 11
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue

11
packages/nc-gui/components/smartsheet/column/LookupOptions.vue

@ -20,8 +20,6 @@ const { tables } = $(storeToRefs(useProject()))
const { metas } = $(useMetas())
const deprecatedEnabled = $(ref(false))
setAdditionalValidations({
fk_relation_column_id: [{ required: true, message: 'Required' }],
fk_lookup_column_id: [{ required: true, message: 'Required' }],
@ -36,13 +34,7 @@ const refTables = $computed(() => {
}
const _refTables = meta.columns
.filter(
(column) =>
isLinksOrLTAR(column) &&
(deprecatedEnabled || column.colOptions?.type === RelationTypes.BELONGS_TO) &&
!column.system &&
column.base_id === meta?.base_id,
)
.filter((column) => isLinksOrLTAR(column) && !column.system && column.base_id === meta?.base_id)
.map((column) => ({
col: column.colOptions,
column,
@ -88,7 +80,6 @@ const cellIcon = (column: ColumnType) =>
v-model:value="vModel.fk_relation_column_id"
dropdown-class-name="!w-64 nc-dropdown-relation-table"
@change="onRelationColChange"
@dblclick="deprecatedEnabled = !deprecatedEnabled"
>
<a-select-option v-for="(table, i) of refTables" :key="i" :value="table.col.fk_column_id">
<div class="flex flex-row space-x-0.5 h-full pb-0.5 items-center justify-between">

Loading…
Cancel
Save