Browse Source

feat: add Links option in column create

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
5937b8377b
  1. 2
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 12
      packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue
  3. 5
      packages/nc-gui/utils/columnUtils.ts

2
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -209,7 +209,7 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<LazySmartsheetColumnDateTimeOptions v-if="formState.uidt === UITypes.DateTime" v-model:value="formState" />
<LazySmartsheetColumnRollupOptions v-if="formState.uidt === UITypes.Rollup" v-model:value="formState" />
<LazySmartsheetColumnLinkedToAnotherRecordOptions
v-if="!isEdit && (formState.uidt === UITypes.LinkToAnotherRecord)"
v-if="!isEdit && (formState.uidt === UITypes.LinkToAnotherRecord||formState.uidt === UITypes.Links)"
v-model:value="formState"
/>
<LazySmartsheetColumnLinkOptions

12
packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ModelTypes, MssqlUi, SqliteUi } from 'nocodb-sdk'
import { ModelTypes, MssqlUi, SqliteUi, UITypes } from 'nocodb-sdk'
import { MetaInj, inject, ref, storeToRefs, useProject, useVModel } from '#imports'
import MdiPlusIcon from '~icons/mdi/plus-circle-outline'
import MdiMinusIcon from '~icons/mdi/minus-circle-outline'
@ -50,6 +50,8 @@ const refTables = $computed(() => {
})
const filterOption = (value: string, option: { key: string }) => option.key.toLowerCase().includes(value.toLowerCase())
const isLinks = $computed(() => vModel.value.uidt.type === UITypes.Links)
</script>
<template>
@ -85,12 +87,6 @@ const filterOption = (value: string, option: { key: string }) => option.key.toLo
</a-select-option>
</a-select>
</a-form-item>
<LazySmartsheetColumnLinkOptions
v-model:value="vModel"
/>
</div>
<template v-if="!isXcdbBase">
<div
@ -103,6 +99,8 @@ const filterOption = (value: string, option: { key: string }) => option.key.toLo
</div>
<div v-if="advancedOptions" class="flex flex-col p-6 gap-4 border-2 mt-2">
<LazySmartsheetColumnLinkOptions v-model:value="vModel" class="-my-2" />
<div class="flex flex-row space-x-2">
<a-form-item class="flex w-1/2" :label="$t('labels.onUpdate')">
<a-select

5
packages/nc-gui/utils/columnUtils.ts

@ -5,6 +5,11 @@ import LinkVariant from '~icons/mdi/link-variant'
import ID from '~icons/mdi/identifier'
const uiTypes = [
{
name: UITypes.Links,
icon: iconMap.link,
virtual: 1,
},
{
name: UITypes.LinkToAnotherRecord,
icon: iconMap.link,

Loading…
Cancel
Save