Merge pull request #13687 from Budibase/rename-data-types

Update naming of some data types and update order
This commit is contained in:
Andrew Kingston 2024-05-15 10:32:15 +01:00 committed by GitHub
commit 2a09e591dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 30 deletions

View File

@ -398,44 +398,50 @@
if (!externalTable) {
return [
FIELDS.STRING,
FIELDS.BARCODEQR,
FIELDS.LONGFORM,
FIELDS.NUMBER,
FIELDS.OPTIONS,
FIELDS.ARRAY,
FIELDS.NUMBER,
FIELDS.BIGINT,
FIELDS.BOOLEAN,
FIELDS.DATETIME,
FIELDS.ATTACHMENT_SINGLE,
FIELDS.ATTACHMENTS,
FIELDS.LINK,
FIELDS.FORMULA,
FIELDS.JSON,
FIELDS.LONGFORM,
FIELDS.USER,
FIELDS.USERS,
FIELDS.ATTACHMENT_SINGLE,
FIELDS.ATTACHMENTS,
FIELDS.FORMULA,
FIELDS.JSON,
FIELDS.BARCODEQR,
FIELDS.BIGINT,
FIELDS.AUTO,
]
} else {
let fields = [
FIELDS.STRING,
FIELDS.BARCODEQR,
FIELDS.LONGFORM,
FIELDS.OPTIONS,
FIELDS.DATETIME,
FIELDS.NUMBER,
FIELDS.OPTIONS,
FIELDS.ARRAY,
FIELDS.BOOLEAN,
FIELDS.FORMULA,
FIELDS.BIGINT,
FIELDS.DATETIME,
FIELDS.LINK,
FIELDS.LONGFORM,
FIELDS.USER,
FIELDS.USERS,
FIELDS.FORMULA,
FIELDS.BARCODEQR,
FIELDS.BIGINT,
]
if (datasource && datasource.source !== SourceName.GOOGLE_SHEETS) {
fields.push(FIELDS.USERS)
// Filter out multiple users for google sheets
if (datasource?.source === SourceName.GOOGLE_SHEETS) {
fields = fields.filter(x => x !== FIELDS.USERS)
}
// no-sql or a spreadsheet
if (!externalTable || table.sql) {
fields = [...fields, FIELDS.LINK, FIELDS.ARRAY]
// Filter out SQL-specific types for non-SQL datasources
if (!table.sql) {
fields = fields.filter(x => x !== FIELDS.LINK && x !== FIELDS.ARRAY)
}
return fields
}
}

View File

@ -33,7 +33,7 @@ export const FIELDS = {
},
},
BARCODEQR: {
name: "Barcode/QR",
name: "Barcode / QR",
type: FieldType.BARCODEQR,
icon: TypeIconMap[FieldType.BARCODEQR],
constraints: {
@ -43,7 +43,7 @@ export const FIELDS = {
},
},
LONGFORM: {
name: "Long Form Text",
name: "Long form text",
type: FieldType.LONGFORM,
icon: TypeIconMap[FieldType.LONGFORM],
constraints: {
@ -53,7 +53,7 @@ export const FIELDS = {
},
},
OPTIONS: {
name: "Options",
name: "Single select",
type: FieldType.OPTIONS,
icon: TypeIconMap[FieldType.OPTIONS],
constraints: {
@ -63,7 +63,7 @@ export const FIELDS = {
},
},
ARRAY: {
name: "Multi-select",
name: "Multi select",
type: FieldType.ARRAY,
icon: TypeIconMap[FieldType.ARRAY],
constraints: {
@ -83,7 +83,7 @@ export const FIELDS = {
},
},
BIGINT: {
name: "BigInt",
name: "Big integer",
type: FieldType.BIGINT,
icon: TypeIconMap[FieldType.BIGINT],
},
@ -97,7 +97,7 @@ export const FIELDS = {
},
},
DATETIME: {
name: "Date/Time",
name: "Date / time",
type: FieldType.DATETIME,
icon: TypeIconMap[FieldType.DATETIME],
constraints: {
@ -111,7 +111,7 @@ export const FIELDS = {
},
},
ATTACHMENT_SINGLE: {
name: "Attachment",
name: "Single attachment",
type: FieldType.ATTACHMENT_SINGLE,
icon: TypeIconMap[FieldType.ATTACHMENT_SINGLE],
constraints: {
@ -119,7 +119,7 @@ export const FIELDS = {
},
},
ATTACHMENTS: {
name: "Attachment List",
name: "Multi attachment",
type: FieldType.ATTACHMENTS,
icon: TypeIconMap[FieldType.ATTACHMENTS],
constraints: {
@ -137,7 +137,7 @@ export const FIELDS = {
},
},
AUTO: {
name: "Auto Column",
name: "Auto column",
type: FieldType.AUTO,
icon: TypeIconMap[FieldType.AUTO],
constraints: {},
@ -158,7 +158,7 @@ export const FIELDS = {
},
},
USER: {
name: "User",
name: "Single user",
type: FieldType.BB_REFERENCE_SINGLE,
subtype: BBReferenceFieldSubType.USER,
icon: TypeIconMap[FieldType.BB_REFERENCE_SINGLE][
@ -166,7 +166,7 @@ export const FIELDS = {
],
},
USERS: {
name: "User List",
name: "Multi user",
type: FieldType.BB_REFERENCE,
subtype: BBReferenceFieldSubType.USER,
icon: TypeIconMap[FieldType.BB_REFERENCE][BBReferenceFieldSubType.USER],