Browse Source

refactor: rename `Link` to `Links`

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
3a7c97bde7
  1. 2
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 2
      packages/nc-gui/utils/virtualCell.ts
  3. 6
      packages/nocodb-sdk/src/lib/Api.ts
  4. 4
      packages/nocodb-sdk/src/lib/UITypes.ts
  5. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts
  6. 2
      packages/nocodb/src/helpers/columnHelpers.ts
  7. 4
      packages/nocodb/src/models/Column.ts
  8. 6
      packages/nocodb/src/schema/swagger.json

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" /> <LazySmartsheetColumnDateTimeOptions v-if="formState.uidt === UITypes.DateTime" v-model:value="formState" />
<LazySmartsheetColumnRollupOptions v-if="formState.uidt === UITypes.Rollup" v-model:value="formState" /> <LazySmartsheetColumnRollupOptions v-if="formState.uidt === UITypes.Rollup" v-model:value="formState" />
<LazySmartsheetColumnLinkedToAnotherRecordOptions <LazySmartsheetColumnLinkedToAnotherRecordOptions
v-if="!isEdit && (formState.uidt === UITypes.LinkToAnotherRecord || formState.uidt === UITypes.Link)" v-if="!isEdit && (formState.uidt === UITypes.LinkToAnotherRecord || formState.uidt === UITypes.Links)"
v-model:value="formState" v-model:value="formState"
/> />
<LazySmartsheetColumnSpecificDBTypeOptions v-if="formState.uidt === UITypes.SpecificDBType" /> <LazySmartsheetColumnSpecificDBTypeOptions v-if="formState.uidt === UITypes.SpecificDBType" />

2
packages/nc-gui/utils/virtualCell.ts

@ -19,4 +19,4 @@ export const isFormula = (column: ColumnType) => column.uidt === UITypes.Formula
export const isQrCode = (column: ColumnType) => column.uidt === UITypes.QrCode export const isQrCode = (column: ColumnType) => column.uidt === UITypes.QrCode
export const isBarcode = (column: ColumnType) => column.uidt === UITypes.Barcode export const isBarcode = (column: ColumnType) => column.uidt === UITypes.Barcode
export const isCount = (column: ColumnType) => column.uidt === UITypes.Count export const isCount = (column: ColumnType) => column.uidt === UITypes.Count
export const isLink = (column: ColumnType) => column.uidt === UITypes.Link export const isLink = (column: ColumnType) => column.uidt === UITypes.Links

6
packages/nocodb-sdk/src/lib/Api.ts

@ -434,7 +434,7 @@ export interface ColumnType {
| 'URL' | 'URL'
| 'Year' | 'Year'
| 'QrCode' | 'QrCode'
| 'Link'; | 'Links';
/** Is Unsigned? */ /** Is Unsigned? */
un?: BoolType; un?: BoolType;
/** Is unique? */ /** Is unique? */
@ -1469,7 +1469,7 @@ export interface LinkToAnotherColumnReqType {
/** The type of the relationship */ /** The type of the relationship */
type: 'bt' | 'hm' | 'mm'; type: 'bt' | 'hm' | 'mm';
/** Abstract type of the relationship */ /** Abstract type of the relationship */
uidt: 'LinkToAnotherRecord' | 'Link'; uidt: 'LinkToAnotherRecord' | 'Links';
/** Is this relationship virtual? */ /** Is this relationship virtual? */
virtual?: BoolType; virtual?: BoolType;
} }
@ -1722,7 +1722,7 @@ export interface NormalColumnRequestType {
| 'URL' | 'URL'
| 'Year' | 'Year'
| 'QrCode' | 'QrCode'
| 'Link'; | 'Links';
/** Is this column unique? */ /** Is this column unique? */
un?: BoolType; un?: BoolType;
/** Is this column unique? */ /** Is this column unique? */

4
packages/nocodb-sdk/src/lib/UITypes.ts

@ -38,7 +38,7 @@ enum UITypes {
Barcode = 'Barcode', Barcode = 'Barcode',
QrCode = 'QrCode', QrCode = 'QrCode',
Button = 'Button', Button = 'Button',
Link = 'Link', Links = 'Links',
} }
export const numericUITypes = [ export const numericUITypes = [
@ -80,7 +80,7 @@ export function isVirtualCol(
UITypes.Barcode, UITypes.Barcode,
UITypes.Rollup, UITypes.Rollup,
UITypes.Lookup, UITypes.Lookup,
UITypes.Link, UITypes.Links,
// UITypes.Count, // UITypes.Count,
].includes(<UITypes>(typeof col === 'object' ? col?.uidt : col)); ].includes(<UITypes>(typeof col === 'object' ? col?.uidt : col));
} }

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -1777,7 +1777,7 @@ class BaseModelSqlv2 {
} }
break; break;
case UITypes.Rollup: case UITypes.Rollup:
case UITypes.Link: case UITypes.Links:
qb.select( qb.select(
( (
await genRollupSelectv2({ await genRollupSelectv2({

2
packages/nocodb/src/helpers/columnHelpers.ts

@ -228,7 +228,7 @@ export async function populateRollupForLTAR({ column }: { column: Column }) {
relatedModel.primaryKey?.id || (await relatedModel.getColumns())[0]?.id; relatedModel.primaryKey?.id || (await relatedModel.getColumns())[0]?.id;
await Column.insert<RollupColumn>({ await Column.insert<RollupColumn>({
uidt: UITypes.Link, uidt: UITypes.Links,
title: getUniqueColumnAliasName( title: getUniqueColumnAliasName(
await model.getColumns(), await model.getColumns(),
`${relatedModel.title} Count`, `${relatedModel.title} Count`,

4
packages/nocodb/src/models/Column.ts

@ -193,7 +193,7 @@ export default class Column<T = any> implements ColumnType {
); );
break; break;
} }
case UITypes.Link: case UITypes.Links:
case UITypes.Rollup: { case UITypes.Rollup: {
await RollupColumn.insert( await RollupColumn.insert(
{ {
@ -418,7 +418,7 @@ export default class Column<T = any> implements ColumnType {
res = await LookupColumn.read(this.id, ncMeta); res = await LookupColumn.read(this.id, ncMeta);
break; break;
case UITypes.Rollup: case UITypes.Rollup:
case UITypes.Link: case UITypes.Links:
res = await RollupColumn.read(this.id, ncMeta); res = await RollupColumn.read(this.id, ncMeta);
break; break;
case UITypes.LinkToAnotherRecord: case UITypes.LinkToAnotherRecord:

6
packages/nocodb/src/schema/swagger.json

@ -14888,7 +14888,7 @@
"URL", "URL",
"Year", "Year",
"QrCode", "QrCode",
"Link" "Links"
], ],
"type": "string" "type": "string"
}, },
@ -17425,7 +17425,7 @@
"description": "The type of the relationship" "description": "The type of the relationship"
}, },
"uidt": { "uidt": {
"enum": ["LinkToAnotherRecord", "Link"], "enum": ["LinkToAnotherRecord", "Links"],
"type": "string", "type": "string",
"description": "Abstract type of the relationship" "description": "Abstract type of the relationship"
}, },
@ -17976,7 +17976,7 @@
"URL", "URL",
"Year", "Year",
"QrCode", "QrCode",
"Link" "Links"
], ],
"type": "string", "type": "string",
"description": "UI Data Type" "description": "UI Data Type"

Loading…
Cancel
Save