Browse Source

refactor: rename `Link` to `Links`

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 2 years 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" />
<LazySmartsheetColumnRollupOptions v-if="formState.uidt === UITypes.Rollup" v-model:value="formState" />
<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"
/>
<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 isBarcode = (column: ColumnType) => column.uidt === UITypes.Barcode
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'
| 'Year'
| 'QrCode'
| 'Link';
| 'Links';
/** Is Unsigned? */
un?: BoolType;
/** Is unique? */
@ -1469,7 +1469,7 @@ export interface LinkToAnotherColumnReqType {
/** The type of the relationship */
type: 'bt' | 'hm' | 'mm';
/** Abstract type of the relationship */
uidt: 'LinkToAnotherRecord' | 'Link';
uidt: 'LinkToAnotherRecord' | 'Links';
/** Is this relationship virtual? */
virtual?: BoolType;
}
@ -1722,7 +1722,7 @@ export interface NormalColumnRequestType {
| 'URL'
| 'Year'
| 'QrCode'
| 'Link';
| 'Links';
/** Is this column unique? */
un?: BoolType;
/** Is this column unique? */

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

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

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

@ -1777,7 +1777,7 @@ class BaseModelSqlv2 {
}
break;
case UITypes.Rollup:
case UITypes.Link:
case UITypes.Links:
qb.select(
(
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;
await Column.insert<RollupColumn>({
uidt: UITypes.Link,
uidt: UITypes.Links,
title: getUniqueColumnAliasName(
await model.getColumns(),
`${relatedModel.title} Count`,

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

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

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

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

Loading…
Cancel
Save