Browse Source

fix: add missing tooltip for one to one

pull/8399/head
Pranav C 6 months ago
parent
commit
b72ee44379
  1. 9
      packages/nc-gui/components/smartsheet/header/VirtualCell.vue
  2. 1
      packages/nc-gui/lang/en.json

9
packages/nc-gui/components/smartsheet/header/VirtualCell.vue

@ -3,10 +3,10 @@ import {
type ColumnReqType, type ColumnReqType,
type ColumnType, type ColumnType,
type FormulaType, type FormulaType,
isLinksOrLTAR,
type LinkToAnotherRecordType, type LinkToAnotherRecordType,
type LookupType, type LookupType,
type RollupType type RollupType,
isLinksOrLTAR,
} from 'nocodb-sdk' } from 'nocodb-sdk'
import { RelationTypes, UITypes, UITypesName, substituteColumnIdWithAliasInFormula } from 'nocodb-sdk' import { RelationTypes, UITypes, UITypesName, substituteColumnIdWithAliasInFormula } from 'nocodb-sdk'
import { import {
@ -20,6 +20,7 @@ import {
isHm, isHm,
isLookup, isLookup,
isMm, isMm,
isOo,
isRollup, isRollup,
isVirtualColRequired, isVirtualColRequired,
provide, provide,
@ -65,7 +66,7 @@ const colOptions = computed(() => column.value?.colOptions)
const tableTile = computed(() => meta?.value?.title) const tableTile = computed(() => meta?.value?.title)
const relationColumnOptions = computed<LinkToAnotherRecordType | null>(() => { const relationColumnOptions = computed<LinkToAnotherRecordType | null>(() => {
if (isMm(column.value) || isHm(column.value) || isBt(column.value)) { if (isLinksOrLTAR(column.value)) {
return column.value?.colOptions as LinkToAnotherRecordType return column.value?.colOptions as LinkToAnotherRecordType
} else if ((column?.value?.colOptions as LookupType | RollupType)?.fk_relation_column_id) { } else if ((column?.value?.colOptions as LookupType | RollupType)?.fk_relation_column_id) {
return meta?.value?.columns?.find( return meta?.value?.columns?.find(
@ -109,6 +110,8 @@ const tooltipMsg = computed(() => {
return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.manyToMany')}` return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.manyToMany')}`
} else if (isBt(column.value)) { } else if (isBt(column.value)) {
return `'${column?.value?.title}' ${t('labels.belongsTo')} '${relatedTableTitle.value}'` return `'${column?.value?.title}' ${t('labels.belongsTo')} '${relatedTableTitle.value}'`
} else if (isOo(column.value)) {
return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.oneToOne')}`
} else if (isLookup(column.value)) { } else if (isLookup(column.value)) {
return `'${childColumn.value.title}' from '${relatedTableTitle.value}' (${childColumn.value.uidt})` return `'${childColumn.value.title}' from '${relatedTableTitle.value}' (${childColumn.value.uidt})`
} else if (isFormula(column.value)) { } else if (isFormula(column.value)) {

1
packages/nc-gui/lang/en.json

@ -714,6 +714,7 @@
"hasMany": "has many", "hasMany": "has many",
"belongsTo": "belongs to", "belongsTo": "belongs to",
"manyToMany": "have many to many relation", "manyToMany": "have many to many relation",
"oneToOne": "have one to one relation",
"extraConnectionParameters": "Extra connection parameters", "extraConnectionParameters": "Extra connection parameters",
"commentsOnly": "Comments only", "commentsOnly": "Comments only",
"documentation": "Documentation", "documentation": "Documentation",

Loading…
Cancel
Save