Fix types

This commit is contained in:
Adria Navarro 2023-01-18 11:50:00 +00:00
parent 1d66110d01
commit 6bc658c1ff
5 changed files with 9 additions and 24 deletions

View File

@ -1,4 +1,5 @@
import { objectStore, roles, constants } from "@budibase/backend-core" import { objectStore, roles, constants } from "@budibase/backend-core"
export { FieldType as FieldTypes } from "@budibase/types"
export enum FilterTypes { export enum FilterTypes {
STRING = "string", STRING = "string",
@ -22,23 +23,6 @@ export const NoEmptyFilterStrings = [
FilterTypes.NOT_CONTAINS, FilterTypes.NOT_CONTAINS,
] ]
export enum FieldTypes {
STRING = "string",
BARCODEQR = "barcodeqr",
LONGFORM = "longform",
OPTIONS = "options",
NUMBER = "number",
BOOLEAN = "boolean",
ARRAY = "array",
DATETIME = "datetime",
ATTACHMENT = "attachment",
LINK = "link",
FORMULA = "formula",
AUTO = "auto",
JSON = "json",
INTERNAL = "internal",
}
export const CanSwitchTypes = [ export const CanSwitchTypes = [
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY], [exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
[ [

View File

@ -190,7 +190,7 @@ export const DEFAULT_INVENTORY_TABLE_SCHEMA: Table = {
}, },
} }
export const DEFAULT_EMPLOYEE_TABLE_SCHEMA = { export const DEFAULT_EMPLOYEE_TABLE_SCHEMA: Table = {
_id: DEFAULT_EMPLOYEE_TABLE_ID, _id: DEFAULT_EMPLOYEE_TABLE_ID,
type: "internal", type: "internal",
views: {}, views: {},
@ -287,7 +287,7 @@ export const DEFAULT_EMPLOYEE_TABLE_SCHEMA = {
sortable: false, sortable: false,
}, },
"Badge Photo": { "Badge Photo": {
type: "attachment", type: FieldTypes.ATTACHMENT,
constraints: { constraints: {
type: FieldTypes.ARRAY, type: FieldTypes.ARRAY,
presence: false, presence: false,
@ -466,7 +466,7 @@ export const DEFAULT_JOBS_TABLE_SCHEMA: Table = {
// sortable: true, // sortable: true,
}, },
"Works End": { "Works End": {
type: "datetime", type: FieldTypes.DATETIME,
constraints: { constraints: {
type: "string", type: "string",
length: {}, length: {},
@ -480,7 +480,7 @@ export const DEFAULT_JOBS_TABLE_SCHEMA: Table = {
ignoreTimezones: true, ignoreTimezones: true,
}, },
"Updated Price": { "Updated Price": {
type: "number", type: FieldTypes.NUMBER,
constraints: { constraints: {
type: "number", type: "number",
presence: false, presence: false,

View File

@ -247,7 +247,7 @@ class OracleIntegration extends Sql implements DatasourcePlus {
) )
} }
private internalConvertType(column: OracleColumn): { type: string } { private internalConvertType(column: OracleColumn): { type: FieldTypes } {
if (this.isBooleanType(column)) { if (this.isBooleanType(column)) {
return { type: FieldTypes.BOOLEAN } return { type: FieldTypes.BOOLEAN }
} }

View File

@ -373,11 +373,11 @@ class TestConfiguration {
// clear any old app // clear any old app
this.appId = null this.appId = null
// @ts-ignore // @ts-ignore
await context.updateAppId(null) context.updateAppId(null)
this.app = await this._req({ name: appName }, null, controllers.app.create) this.app = await this._req({ name: appName }, null, controllers.app.create)
this.appId = this.app.appId this.appId = this.app.appId
// @ts-ignore // @ts-ignore
await context.updateAppId(this.appId) context.updateAppId(this.appId)
// create production app // create production app
this.prodApp = await this.publish() this.prodApp = await this.publish()

View File

@ -14,6 +14,7 @@ export enum FieldType {
AUTO = "auto", AUTO = "auto",
JSON = "json", JSON = "json",
INTERNAL = "internal", INTERNAL = "internal",
BARCODEQR = "barcodeqr",
} }
export interface RowAttachment { export interface RowAttachment {