Browse Source

refactor: hide Link to another record option from uidt

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
985a35fcc6
  1. 6
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 1
      packages/nc-gui/utils/columnUtils.ts

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

@ -64,9 +64,11 @@ const geoDataToggleCondition = (t: { name: UITypes }) => {
return betaFeatureToggleState.show ? betaFeatureToggleState.show : !t.name.includes(UITypes.GeoData)
}
const showDeprecated = $ref(false)
const uiTypesOptions = computed<typeof uiTypes>(() => {
return [
...uiTypes.filter((t) => geoDataToggleCondition(t) && (!isEdit.value || !t.virtual)),
...uiTypes.filter((t) => geoDataToggleCondition(t) && (!isEdit.value || !t.virtual) && (!t.deprecated || showDeprecated)),
...(!isEdit.value && meta?.value?.columns?.every((c) => !c.pk)
? [
{
@ -187,11 +189,13 @@ useEventListener('keydown', (e: KeyboardEvent) => {
:disabled="isKanban"
dropdown-class-name="nc-dropdown-column-type"
@change="onUidtOrIdTypeChange"
@dblclick="showDeprecated = !showDeprecated"
>
<a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt">
<div class="flex gap-1 items-center">
<component :is="opt.icon" class="text-grey" />
{{ opt.name }}
<span v-if="opt.deprecated" class="!text-xs !text-gray-300">(Deprecated)</span>
</div>
</a-select-option>
</a-select>

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

@ -14,6 +14,7 @@ const uiTypes = [
name: UITypes.LinkToAnotherRecord,
icon: iconMap.link,
virtual: 1,
deprecated: 1,
},
{
name: UITypes.Lookup,

Loading…
Cancel
Save