Browse Source

refactor: shorten label

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
7843196b97
  1. 14
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue
  2. 3
      packages/nc-gui/components/smartsheet/column/RollupOptions.vue

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

@ -1,8 +1,7 @@
<script setup lang="ts">
import { onMounted } from '@vue/runtime-core'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { isLinksOrLTAR, isSystemColumn, isVirtualCol, RelationTypes } from 'nocodb-sdk'
import { getRelationName } from './utils'
import { RelationTypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import { MetaInj, inject, ref, storeToRefs, useColumnCreateStoreOrThrow, useMetas, useProject, useVModel } from '#imports'
const props = defineProps<{
@ -37,7 +36,13 @@ 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) &&
(deprecatedEnabled || column.colOptions?.type === RelationTypes.BELONGS_TO) &&
!column.system &&
column.base_id === meta?.base_id,
)
.map((column) => ({
col: column.colOptions,
column,
@ -67,7 +72,6 @@ const onRelationColChange = () => {
onDataTypeChange()
}
const cellIcon = (column: ColumnType) =>
h(isVirtualCol(column) ? resolveComponent('SmartsheetHeaderVirtualCellIcon') : resolveComponent('SmartsheetHeaderCellIcon'), {
columnMeta: column,
@ -89,7 +93,7 @@ const cellIcon = (column: ColumnType) =>
<div class="font-semibold text-xs">{{ table.column.title }}</div>
<div class="text-[0.65rem] text-gray-600">
<span v-if="table.col.type !== RelationTypes.BELONGS_TO" class="text-[0.65rem] text-gray-600">(Deprecated)</span>
{{ getRelationName(table.col.type) }} {{ table.title || table.table_name }}
<span class="uppercase">{{ table.col.type }}</span> {{ table.title || table.table_name }}
</div>
</div>
</a-select-option>

3
packages/nc-gui/components/smartsheet/column/RollupOptions.vue

@ -2,7 +2,6 @@
import { onMounted } from '@vue/runtime-core'
import type { ColumnType, LinkToAnotherRecordType, TableType, UITypes } from 'nocodb-sdk'
import { isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import { getRelationName } from './utils'
import { MetaInj, inject, ref, storeToRefs, useColumnCreateStoreOrThrow, useMetas, useProject, useVModel } from '#imports'
const props = defineProps<{
@ -104,7 +103,7 @@ const cellIcon = (column: ColumnType) =>
<div class="flex flex-row space-x-0.5 h-full pb-0.5 items-center justify-between">
<div class="font-semibold text-xs">{{ table.column.title }}</div>
<div class="text-[0.65rem] text-gray-600">
({{ getRelationName(table.col.type) }} {{ table.title || table.table_name }})
(<span class="uppercase">{{ table.col.type }}</span> {{ table.title || table.table_name }})
</div>
</div>
</a-select-option>

Loading…
Cancel
Save