diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index d271462f3e..f3ae207cb4 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -29,7 +29,11 @@ import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte" import { getBindings } from "components/backend/DataTable/formula" import JSONSchemaModal from "./JSONSchemaModal.svelte" - import { FieldType, FieldSubtype, SourceName } from "@budibase/types" + import { + FieldType, + BBReferenceFieldSubType, + SourceName, + } from "@budibase/types" import RelationshipSelector from "components/common/RelationshipSelector.svelte" import { RowUtils } from "@budibase/frontend-core" import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte" @@ -41,8 +45,6 @@ const NUMBER_TYPE = FieldType.NUMBER const JSON_TYPE = FieldType.JSON const DATE_TYPE = FieldType.DATETIME - const USER_TYPE = FieldSubtype.USER - const USERS_TYPE = FieldSubtype.USERS const dispatch = createEventDispatcher() const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] @@ -263,9 +265,9 @@ delete saveColumn.fieldName } if (isUsersColumn(saveColumn)) { - if (saveColumn.subtype === USER_TYPE) { + if (saveColumn.subtype === BBReferenceFieldSubType.USER) { saveColumn.relationshipType = RelationshipType.ONE_TO_MANY - } else if (saveColumn.subtype === USERS_TYPE) { + } else if (saveColumn.subtype === BBReferenceFieldSubType.USERS) { saveColumn.relationshipType = RelationshipType.MANY_TO_MANY } } @@ -375,7 +377,7 @@ const isUsers = editableColumn.type === FieldType.BB_REFERENCE && - editableColumn.subtype === FieldSubtype.USERS + editableColumn.subtype === BBReferenceFieldSubType.USERS if (!externalTable) { return [ @@ -485,7 +487,9 @@ function isUsersColumn(column) { return ( column.type === FieldType.BB_REFERENCE && - [FieldSubtype.USER, FieldSubtype.USERS].includes(column.subtype) + [BBReferenceFieldSubType.USER, BBReferenceFieldSubType.USERS].includes( + column.subtype + ) ) } @@ -688,12 +692,14 @@ > {:else if isUsersColumn(editableColumn) && datasource?.source !== SourceName.GOOGLE_SHEETS} handleTypeChange( makeFieldId( FieldType.BB_REFERENCE, - e.detail ? FieldSubtype.USERS : FieldSubtype.USER + e.detail + ? BBReferenceFieldSubType.USERS + : BBReferenceFieldSubType.USER ) )} disabled={!isCreating} diff --git a/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte index 6901503071..b7fa243c07 100644 --- a/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte @@ -1,5 +1,5 @@