From 504ddac47081ca81ebf22c13105acc6bf90c4e42 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 15:24:44 +0100 Subject: [PATCH 01/35] Fix background color of datasource status button --- .../_components/EditDatasourceConfigButton.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte index 8ce30fddfd..154957a561 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte @@ -74,7 +74,7 @@ border: 1px solid var(--spectrum-global-color-gray-300); border-radius: 5px; width: 100%; - background-color: #00000047; + background-color: var(--spectrum-global-color-gray-50); color: white; overflow: hidden; padding: 12px 16px; From a2238911fa5ad766d75fd08efdf62624790cd75f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:14:49 +0100 Subject: [PATCH 02/35] Fix link to users portal --- .../backend/DataTable/modals/CreateEditUser.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte index 01964aed75..c18ba313e0 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte @@ -95,9 +95,9 @@ {#if !creating}
A user's email, role, first and last names cannot be changed from within - the app builder. Please go to the user portal to do this. + the app builder. Please go to the + user portal + to do this.
{/if} Date: Tue, 18 Jul 2023 16:14:59 +0100 Subject: [PATCH 03/35] Fix getting started checklist links --- packages/worker/src/api/controllers/global/configs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/worker/src/api/controllers/global/configs.ts b/packages/worker/src/api/controllers/global/configs.ts index b061d110f5..462aa3060d 100644 --- a/packages/worker/src/api/controllers/global/configs.ts +++ b/packages/worker/src/api/controllers/global/configs.ts @@ -507,17 +507,17 @@ export async function configChecklist(ctx: Ctx) { smtp: { checked: !!smtpConfig, label: "Set up email", - link: "/builder/portal/manage/email", + link: "/builder/portal/settings/email", }, adminUser: { checked: userExists, label: "Create your first user", - link: "/builder/portal/manage/users", + link: "/builder/portal/users/users", }, sso: { checked: !!googleConfig || !!oidcConfig, label: "Set up single sign-on", - link: "/builder/portal/manage/auth", + link: "/builder/portal/settings/auth", }, } } From 6df0ff57a42ccecd9182bd249096045d1504e943 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:18:02 +0100 Subject: [PATCH 04/35] Fix edit icons being shown in preview results table --- packages/builder/src/components/backend/DataTable/Table.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 3c5b93df89..4569586762 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -109,6 +109,7 @@ {disableSorting} {customPlaceholder} allowEditRows={allowEditing} + allowEditColumns={allowEditing} showAutoColumns={!hideAutocolumns} {allowClickRows} on:clickrelationship={e => selectRelationship(e.detail)} From f10da702339322807d7fe2d673726c3cbb997dd1 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:19:50 +0100 Subject: [PATCH 05/35] Fix DND in component tree --- packages/builder/src/components/common/NavItem.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 7d61751364..6590463408 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -132,7 +132,6 @@ flex-direction: row; justify-content: flex-start; align-items: stretch; - position: relative; } .nav-item.scrollable { flex-direction: column; From bada64126281de16aa42c3fa4dc8ca7404aeadc8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:47:43 +0100 Subject: [PATCH 06/35] Fix bug in checkboxgroup due to reassignment of value prop --- .../bbui/src/Form/Core/CheckboxGroup.svelte | 23 ++++++++++--------- .../app/forms/MultiFieldSelect.svelte | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/bbui/src/Form/Core/CheckboxGroup.svelte b/packages/bbui/src/Form/Core/CheckboxGroup.svelte index 640d5d99cd..2b8a1e438a 100644 --- a/packages/bbui/src/Form/Core/CheckboxGroup.svelte +++ b/packages/bbui/src/Form/Core/CheckboxGroup.svelte @@ -12,23 +12,24 @@ export let getOptionValue = option => option const dispatch = createEventDispatcher() + const onChange = e => { - let tempValue = value - let isChecked = e.target.checked - if (!tempValue.includes(e.target.value) && isChecked) { - tempValue.push(e.target.value) + const optionValue = e.target.value + if (e.target.checked && !value.includes(optionValue)) { + dispatch("change", [...value, optionValue]) + } else { + dispatch( + "change", + value.filter(x => x !== optionValue) + ) } - value = tempValue - dispatch( - "change", - tempValue.filter(val => val !== e.target.value || isChecked) - ) }
{#if options && Array.isArray(options)} {#each options as option} + {@const optionValue = getOptionValue(option)}
value.trim()) } From faa00fa64df836178bf2b8beb0bb6211480c2387 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:05:04 +0100 Subject: [PATCH 07/35] Fix release and prerelease tag triggers --- .github/workflows/release-develop.yml | 2 +- .github/workflows/release-master.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index a7bf041eb5..e8d88fa136 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - v*-alpha.* + - ".*-alpha.*" workflow_dispatch: env: diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index c8810b7442..3c33dfcd86 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -6,9 +6,9 @@ concurrency: on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+" # Exclude all pre-releases - - "!v*[0-9]+.[0-9]+.[0-9]+-*" + - "!*[0-9]+.[0-9]+.[0-9]+-*" env: # Posthog token used by ui at build time From ba5002f7421bc4ad1f83bbbd266f1a1c274ff3ff Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:18:00 +0100 Subject: [PATCH 08/35] Adjust tag regex for prerelease --- .github/workflows/release-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index e8d88fa136..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - ".*-alpha.*" + - "*-alpha.*" workflow_dispatch: env: From 5d0918a6cb1ceaf468b59da90e2b3ed884182f3a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 20 Jul 2023 12:21:09 +0100 Subject: [PATCH 09/35] Prevent invalid characters in column names when importing tables --- packages/bbui/src/Icon/Icon.svelte | 12 ++--- .../DataTable/modals/CreateEditColumn.svelte | 3 +- .../TableNavigator/TableDataImport.svelte | 46 ++++++++++--------- packages/server/src/utilities/schema.ts | 8 ++++ packages/shared-core/src/constants.ts | 1 + 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/packages/bbui/src/Icon/Icon.svelte b/packages/bbui/src/Icon/Icon.svelte index 452a8c74a1..a2cf8a1b3a 100644 --- a/packages/bbui/src/Icon/Icon.svelte +++ b/packages/bbui/src/Icon/Icon.svelte @@ -47,7 +47,7 @@ {#if tooltip && showTooltip}
- +
{/if}
@@ -80,15 +80,9 @@ position: absolute; pointer-events: none; left: 50%; - top: calc(100% + 4px); - width: 100vw; - max-width: 150px; + bottom: calc(100% + 4px); transform: translateX(-50%); text-align: center; - } - - .spectrum-Icon--sizeXS { - width: 10px; - height: 10px; + z-index: 1; } diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 6ffd7f8bb3..f319f09b16 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -33,6 +33,7 @@ import { getBindings } from "components/backend/DataTable/formula" import { getContext } from "svelte" import JSONSchemaModal from "./JSONSchemaModal.svelte" + import { ValidColumnNameRegex } from "@budibase/shared-core" const AUTO_TYPE = "auto" const FORMULA_TYPE = FIELDS.FORMULA.type @@ -379,7 +380,7 @@ const newError = {} if (!external && fieldInfo.name?.startsWith("_")) { newError.name = `Column name cannot start with an underscore.` - } else if (fieldInfo.name && !fieldInfo.name.match(/^[_a-zA-Z0-9\s]*$/g)) { + } else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) { newError.name = `Illegal character; must be alpha-numeric.` } else if (PROHIBITED_COLUMN_NAMES.some(name => fieldInfo.name === name)) { newError.name = `${PROHIBITED_COLUMN_NAMES.join( diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index f34a3e9c98..1191f92b31 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -1,5 +1,5 @@
@@ -127,10 +129,8 @@ on:change={handleFile} />
{/each} From 6e974861160f4bcf0bcf472e1ea40565541fc9f3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 14:12:28 +0000 Subject: [PATCH 14/35] Bump version to 2.8.18 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 4dd30fd5f7..d97372e035 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.17", + "version": "2.8.18", "npmClient": "yarn", "packages": [ "packages/*" From 73ae3d44d45b65375a266b452c04a87c87f95250 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 21 Jul 2023 07:50:42 +0000 Subject: [PATCH 15/35] Bump version to 2.8.19 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index d97372e035..a74cf9934d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.18", + "version": "2.8.19", "npmClient": "yarn", "packages": [ "packages/*" From b5a656e350be385623b41c3e8e883b37849f0117 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 Jul 2023 09:06:55 +0100 Subject: [PATCH 16/35] Update datasource config button hover styles to fix issues in light theme --- .../_components/EditDatasourceConfigButton.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte index 154957a561..9e50ab8da3 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte @@ -74,11 +74,12 @@ border: 1px solid var(--spectrum-global-color-gray-300); border-radius: 5px; width: 100%; - background-color: var(--spectrum-global-color-gray-50); + background: var(--spectrum-global-color-gray-50); color: white; overflow: hidden; padding: 12px 16px; box-sizing: border-box; + transition: background 130ms ease-out; } .left { flex: 1; @@ -94,7 +95,7 @@ } .button:hover { cursor: pointer; - filter: brightness(1.2); + background: var(--spectrum-global-color-gray-100); } .connected { display: flex; From af8be511dfac26a4e0935c57d85889729d0cfeac Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 Jul 2023 10:39:58 +0100 Subject: [PATCH 17/35] Add back in XS icons --- packages/bbui/src/Icon/Icon.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bbui/src/Icon/Icon.svelte b/packages/bbui/src/Icon/Icon.svelte index a2cf8a1b3a..11dc9963d5 100644 --- a/packages/bbui/src/Icon/Icon.svelte +++ b/packages/bbui/src/Icon/Icon.svelte @@ -85,4 +85,9 @@ text-align: center; z-index: 1; } + + .spectrum-Icon--sizeXS { + width: var(--spectrum-global-dimension-size-150); + height: var(--spectrum-global-dimension-size-150); + } From c5a0711dd891726c9cc9ce999128315d1cc98fa5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 21 Jul 2023 10:12:39 +0000 Subject: [PATCH 18/35] Bump version to 2.8.20 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index a74cf9934d..db1b6dc3f5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.19", + "version": "2.8.20", "npmClient": "yarn", "packages": [ "packages/*" From a56f0c91dd60fde7f3b8ac8fa7e0ef6ff8f12b3e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 21 Jul 2023 12:15:33 +0100 Subject: [PATCH 19/35] Quick improvement to table types, before now the field schema was quite difficult to parse/work out what components of the schema were used for what, this at least separates them into particularly grouped bits of metadata, so it is obvious which parts are used for which. In future we should really flip this a bit, so that FieldSchema is the base implementation, and then each of the types has its own schema extending that base - but that would be a more serious refactor (need to cast to the correct type when using based on the 'type' property. --- packages/types/src/documents/app/table.ts | 97 ------------------ .../src/documents/app/table/constants.ts | 9 ++ .../types/src/documents/app/table/index.ts | 3 + .../types/src/documents/app/table/schema.ts | 98 +++++++++++++++++++ .../types/src/documents/app/table/table.ts | 30 ++++++ 5 files changed, 140 insertions(+), 97 deletions(-) delete mode 100644 packages/types/src/documents/app/table.ts create mode 100644 packages/types/src/documents/app/table/constants.ts create mode 100644 packages/types/src/documents/app/table/index.ts create mode 100644 packages/types/src/documents/app/table/schema.ts create mode 100644 packages/types/src/documents/app/table/table.ts diff --git a/packages/types/src/documents/app/table.ts b/packages/types/src/documents/app/table.ts deleted file mode 100644 index 18b415da5f..0000000000 --- a/packages/types/src/documents/app/table.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Document } from "../document" -import { View } from "./view" -import { RenameColumn } from "../../sdk" -import { FieldType } from "./row" - -export enum RelationshipTypes { - ONE_TO_MANY = "one-to-many", - MANY_TO_ONE = "many-to-one", - MANY_TO_MANY = "many-to-many", -} - -export enum AutoReason { - FOREIGN_KEY = "foreign_key", -} - -export interface FieldSchema { - type: FieldType - externalType?: string - fieldName?: string - name: string - sortable?: boolean - tableId?: string - relationshipType?: RelationshipTypes - through?: string - foreignKey?: string - icon?: string - autocolumn?: boolean - autoReason?: AutoReason - subtype?: string - throughFrom?: string - throughTo?: string - formula?: string - formulaType?: string - main?: boolean - ignoreTimezones?: boolean - timeOnly?: boolean - lastID?: number - useRichText?: boolean | null - order?: number - width?: number - meta?: { - toTable: string - toKey: string - } - constraints?: { - type?: string - email?: boolean - inclusion?: string[] - length?: { - minimum?: string | number | null - maximum?: string | number | null - } - numericality?: { - greaterThanOrEqualTo: string | null - lessThanOrEqualTo: string | null - } - presence?: - | boolean - | { - allowEmpty?: boolean - } - datetime?: { - latest: string - earliest: string - } - } -} - -export interface TableSchema { - [key: string]: FieldSchema -} - -export interface Table extends Document { - type?: string - views?: { [key: string]: View } - name: string - primary?: string[] - schema: TableSchema - primaryDisplay?: string - sourceId?: string - relatedFormula?: string[] - constrained?: string[] - sql?: boolean - indexes?: { [key: string]: any } - rows?: { [key: string]: any } - created?: boolean - rowHeight?: number -} - -export interface ExternalTable extends Table { - sourceId: string -} - -export interface TableRequest extends Table { - _rename?: RenameColumn - created?: boolean -} diff --git a/packages/types/src/documents/app/table/constants.ts b/packages/types/src/documents/app/table/constants.ts new file mode 100644 index 0000000000..12a347c715 --- /dev/null +++ b/packages/types/src/documents/app/table/constants.ts @@ -0,0 +1,9 @@ +export enum RelationshipTypes { + ONE_TO_MANY = "one-to-many", + MANY_TO_ONE = "many-to-one", + MANY_TO_MANY = "many-to-many", +} + +export enum AutoReason { + FOREIGN_KEY = "foreign_key", +} diff --git a/packages/types/src/documents/app/table/index.ts b/packages/types/src/documents/app/table/index.ts new file mode 100644 index 0000000000..c22788d269 --- /dev/null +++ b/packages/types/src/documents/app/table/index.ts @@ -0,0 +1,3 @@ +export * from "./table" +export * from "./schema" +export * from "./constants" diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts new file mode 100644 index 0000000000..188a2fddd3 --- /dev/null +++ b/packages/types/src/documents/app/table/schema.ts @@ -0,0 +1,98 @@ +// all added by grid/table when defining the +// column size, position and whether it can be viewed +import { FieldType } from "../row" +import { AutoReason, RelationshipTypes } from "./constants" + +export interface UIFieldMetadata { + order?: number + width?: number + visible?: boolean + icon?: string +} + +export interface RelationshipFieldMetadata { + main?: boolean + fieldName?: string + tableId?: string + // below is used for SQL relationships, needed to define the foreign keys + // or the tables used for many-to-many relationships (through) + relationshipType?: RelationshipTypes + through?: string + foreignKey?: string + throughFrom?: string + throughTo?: string +} + +export interface AutoColumnFieldMetadata { + autocolumn?: boolean + subtype?: string + lastID?: number + // if the column was turned to an auto-column for SQL, explains why (primary, foreign etc) + autoReason?: AutoReason +} + +export interface NumberFieldMetadata { + // used specifically when Budibase generates external tables, this denotes if a number field + // is a foreign key used for a many-to-many relationship + meta?: { + toTable: string + toKey: string + } +} + +export interface DateFieldMetadata { + ignoreTimezones?: boolean + timeOnly?: boolean +} + +export interface StringFieldMetadata { + useRichText?: boolean | null +} + +export interface FormulaFieldMetadata { + formula?: string + formulaType?: string +} + +export interface FieldConstraints { + type?: string + email?: boolean + inclusion?: string[] + length?: { + minimum?: string | number | null + maximum?: string | number | null + } + numericality?: { + greaterThanOrEqualTo: string | null + lessThanOrEqualTo: string | null + } + presence?: + | boolean + | { + allowEmpty?: boolean + } + datetime?: { + latest: string + earliest: string + } +} + +export interface FieldSchema + extends UIFieldMetadata, + DateFieldMetadata, + RelationshipFieldMetadata, + AutoColumnFieldMetadata, + StringFieldMetadata, + FormulaFieldMetadata, + NumberFieldMetadata { + type: FieldType + name: string + sortable?: boolean + // only used by external databases, to denote the real type + externalType?: string + constraints?: FieldConstraints +} + +export interface TableSchema { + [key: string]: FieldSchema +} diff --git a/packages/types/src/documents/app/table/table.ts b/packages/types/src/documents/app/table/table.ts new file mode 100644 index 0000000000..f4dc790267 --- /dev/null +++ b/packages/types/src/documents/app/table/table.ts @@ -0,0 +1,30 @@ +import { Document } from "../../document" +import { View } from "../view" +import { RenameColumn } from "../../../sdk" +import { TableSchema } from "./schema" + +export interface Table extends Document { + type?: string + views?: { [key: string]: View } + name: string + primary?: string[] + schema: TableSchema + primaryDisplay?: string + sourceId?: string + relatedFormula?: string[] + constrained?: string[] + sql?: boolean + indexes?: { [key: string]: any } + rows?: { [key: string]: any } + created?: boolean + rowHeight?: number +} + +export interface ExternalTable extends Table { + sourceId: string +} + +export interface TableRequest extends Table { + _rename?: RenameColumn + created?: boolean +} From d77a4062c7f4c7bc2674ab2a8821cd500e83a553 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Fri, 21 Jul 2023 12:32:23 +0100 Subject: [PATCH 20/35] Update CONTRIBUTING.md --- docs/CONTRIBUTING.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index ac35929be1..2fb4c36fa8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -231,18 +231,33 @@ An overview of the CI pipelines can be found [here](../.github/workflows/README. ### Pro -@budibase/pro is the closed source package that supports licensed features in budibase. By default the package will be pulled from NPM and will not normally need to be touched in local development. If you require to update code inside the pro package it can be cloned to the same root level as budibase, e.g. +@budibase/pro is the closed source package that supports licensed features in budibase. By default the package will be pulled from NPM and will not normally need to be touched in local development. If you need to make an update to pro and have access to the repo, then you can update your submodule within the mono-repo by running `git submodule update --init` - from here you can use normal submodule flow to develop a change within pro. + +Once you have updated to use the pro submodule, it will be linked into all of your local dependencies by NX as with all other monorepo packages. If you have been using the NPM version of `@budibase/pro` then you may need to run a `git reset --hard` to fix all of the pro versions back to `0.0.0` to be monorepo aware. + +From here - to develop a change in pro, you can follow the below flow: ``` -. -|_ budibase -|_ budibase-pro +# enter the pro submodule +cd packages/pro +# get the base branch you are working from (same as monorepo) +git fetch +git checkout +# create a branch, named the same as the branch in your monorepo +git checkout -b +... make changes +# commit the changes you've made, with a message for pro +git commit +# within the monorepo, add the pro reference to your branch, commit it with a message like "Update pro ref" +cd ../.. +git add packages/pro +git commit ``` +From here, you will have created a branch in the pro repository and commited the reference to your branch on the monorepo. When you eventually PR this work back into the mainline branch, you will need to first merge your pro PR to the pro mainline, then go into your PR in the monorepo and update the reference again to the new mainline. + Note that only budibase maintainers will be able to access the pro repo. -By default, NX will make sure that dependencies are replaced with local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. - ### Troubleshooting Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above to create a fresh Budibase installation. From 7673673db26d77640ef33e54f6df99d1143901e4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 21 Jul 2023 12:57:47 +0100 Subject: [PATCH 21/35] Updating RelationshipTypes -> RelationshipType. --- .../DataTable/modals/CreateEditColumn.svelte | 12 +++---- .../Datasources/CreateEditRelationship.svelte | 30 ++++++++-------- .../backend/Datasources/relationshipErrors.js | 4 +-- .../builder/src/constants/backend/index.js | 2 +- packages/server/specs/resources/table.ts | 8 ++--- .../api/controllers/row/ExternalRequest.ts | 4 +-- .../src/api/controllers/table/external.ts | 20 +++++------ packages/server/src/constants/index.ts | 2 +- .../db/defaultData/datasource_bb_default.ts | 6 ++-- .../src/db/linkedRows/LinkController.ts | 20 +++++------ .../src/db/tests/linkController.spec.js | 30 ++++++++-------- .../src/integration-test/postgres.spec.ts | 36 +++++++++---------- .../server/src/integrations/base/sqlTable.ts | 6 ++-- .../server/src/sdk/app/tables/validation.ts | 6 ++-- .../src/documents/app/table/constants.ts | 2 +- .../types/src/documents/app/table/schema.ts | 4 +-- 16 files changed, 93 insertions(+), 99 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 208739a540..dfb028d38d 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -18,7 +18,7 @@ import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { FIELDS, - RelationshipTypes, + RelationshipType, ALLOWABLE_STRING_OPTIONS, ALLOWABLE_NUMBER_OPTIONS, ALLOWABLE_STRING_TYPES, @@ -183,7 +183,7 @@ dispatch("updatecolumns") if ( saveColumn.type === LINK_TYPE && - saveColumn.relationshipType === RelationshipTypes.MANY_TO_MANY + saveColumn.relationshipType === RelationshipType.MANY_TO_MANY ) { // Fetching the new tables tables.fetch() @@ -237,7 +237,7 @@ // Default relationships many to many if (editableColumn.type === LINK_TYPE) { - editableColumn.relationshipType = RelationshipTypes.MANY_TO_MANY + editableColumn.relationshipType = RelationshipType.MANY_TO_MANY } if (editableColumn.type === FORMULA_TYPE) { editableColumn.formulaType = "dynamic" @@ -285,17 +285,17 @@ { name: `Many ${thisName} rows → many ${linkName} rows`, alt: `Many ${table.name} rows → many ${linkTable.name} rows`, - value: RelationshipTypes.MANY_TO_MANY, + value: RelationshipType.MANY_TO_MANY, }, { name: `One ${linkName} row → many ${thisName} rows`, alt: `One ${linkTable.name} rows → many ${table.name} rows`, - value: RelationshipTypes.ONE_TO_MANY, + value: RelationshipType.ONE_TO_MANY, }, { name: `One ${thisName} row → many ${linkName} rows`, alt: `One ${table.name} rows → many ${linkTable.name} rows`, - value: RelationshipTypes.MANY_TO_ONE, + value: RelationshipType.MANY_TO_ONE, }, ] } diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 53fcf56e7f..36c6a32801 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -1,5 +1,5 @@