From f28eb054f38b66c40b33d9b9f946481c15b3556f Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:59:51 +0000 Subject: [PATCH 1/3] Set the relationship type (#12275) * Set the relationship type * Add users type * Set user relationship type saveColumn * Set relationshipType for users type on save * Add relatioshipType to schema * Refactor * Check isUsersColumn * Make relationshipType optional --------- Co-authored-by: Michael Drury --- .../backend/DataTable/modals/CreateEditColumn.svelte | 10 ++++++++++ packages/types/src/documents/app/table/schema.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index d5a9aba488..4eb1f962f0 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -44,6 +44,8 @@ const NUMBER_TYPE = FIELDS.NUMBER.type const JSON_TYPE = FIELDS.JSON.type const DATE_TYPE = FIELDS.DATETIME.type + const USER_TYPE = FIELDS.USER.subtype + const USERS_TYPE = FIELDS.USERS.subtype const dispatch = createEventDispatcher() const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] @@ -287,6 +289,14 @@ if (saveColumn.type !== LINK_TYPE) { delete saveColumn.fieldName } + if (isUsersColumn(saveColumn)) { + if (saveColumn.subtype === USER_TYPE) { + saveColumn.relationshipType = RelationshipType.ONE_TO_MANY + } else if (saveColumn.subtype === USERS_TYPE) { + saveColumn.relationshipType = RelationshipType.MANY_TO_MANY + } + } + try { await tables.saveField({ originalName, diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts index 755ccf61e7..19a7303072 100644 --- a/packages/types/src/documents/app/table/schema.ts +++ b/packages/types/src/documents/app/table/schema.ts @@ -102,6 +102,7 @@ export interface BBReferenceFieldMetadata extends Omit { type: FieldType.BB_REFERENCE subtype: FieldSubtype.USER | FieldSubtype.USERS + relationshipType?: RelationshipType } export interface FieldConstraints { From dc59245b39da5c4b8ed95cebba5931adf8028d4c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 7 Nov 2023 12:20:21 +0000 Subject: [PATCH 2/3] Bump version to 2.13.2 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 2126adac29..bfcac5633c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.13.1", + "version": "2.13.2", "npmClient": "yarn", "packages": [ "packages/*" From 7dd4521ea83a3089902c66c8c9968668b7cbcf7a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 7 Nov 2023 13:55:34 +0100 Subject: [PATCH 3/3] Fix fetching tag --- .github/workflows/tag-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 78c07a037c..13d59d1019 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -45,8 +45,8 @@ jobs: BUMP_TYPE=${BUMP_TYPE_INPUT:-"patch"} ./versionCommit.sh $BUMP_TYPE - - new_version=$(./getCurrentVersion.sh) + cd .. + new_version=$(./scripts/getCurrentVersion.sh) echo "version=$new_version" >> $GITHUB_OUTPUT trigger-release: