From 99287b9a5ae58b6aed52c787e0fd4b95a3669d06 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 6 Feb 2023 12:08:28 +0000 Subject: [PATCH 1/4] don't coerce options type to array when switching to bindings --- .../src/components/automation/SetupPanel/RowSelector.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index 5a47ac3ce9..c14455b7fc 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -70,7 +70,7 @@ return Number(value) } if (type === "options") { - return [value] + return value } if (type === "array") { if (Array.isArray(value)) { From 2320bd574e3e0cc46e2b445f3b0d1ab0ec3cf47d Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 6 Feb 2023 14:35:12 +0000 Subject: [PATCH 2/4] don't load env vars when license isn't enabled --- .../builder/src/stores/portal/environment.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/stores/portal/environment.js b/packages/builder/src/stores/portal/environment.js index 458eea27be..b3e46cf7bf 100644 --- a/packages/builder/src/stores/portal/environment.js +++ b/packages/builder/src/stores/portal/environment.js @@ -1,6 +1,7 @@ -import { writable } from "svelte/store" +import { writable, get } from "svelte/store" import { API } from "api" import { Constants } from "@budibase/frontend-core" +import { licensing } from "stores/portal" export function createEnvironmentStore() { const { subscribe, update } = writable({ @@ -17,12 +18,14 @@ export function createEnvironmentStore() { } async function loadVariables() { - const envVars = await API.fetchEnvironmentVariables() - const mappedVars = envVars.variables.map(name => ({ name })) - update(store => { - store.variables = mappedVars - return store - }) + if (get(licensing).environmentVariablesEnabled) { + const envVars = await API.fetchEnvironmentVariables() + const mappedVars = envVars.variables.map(name => ({ name })) + update(store => { + store.variables = mappedVars + return store + }) + } } async function createVariable(data) { From 4e88981ce8b9ee79b40aec1791e164394b45d26e Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 6 Feb 2023 16:36:03 +0000 Subject: [PATCH 3/4] fix issue with regex on safari --- packages/bbui/src/Form/Core/EnvDropdown.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index 8701facc08..0c647a1911 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -25,7 +25,7 @@ let open = false //eslint-disable-next-line - const STRIP_NAME_REGEX = /(?<=\.)(.*?)(?=\ })/g + const STRIP_NAME_REGEX = /(\w+?)(?=\ })/g // Strips the name out of the value which is {{ env.Variable }} resulting in an array like ["Variable"] $: hbsValue = String(value)?.match(STRIP_NAME_REGEX) || [] From 2df1d52fbd12291187063062ac61bf364aa7aa85 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 6 Feb 2023 17:14:42 +0000 Subject: [PATCH 4/4] Fix expected html code --- .../src/config/internal-api/TestConfiguration/applications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 9c1eec7663..1e3658dcd2 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -112,7 +112,7 @@ export default class AppApi { async delete(appId: string): Promise { const response = await this.api.del(`/applications/${appId}`) - expect(response).toHaveStatusCode(204) + expect(response).toHaveStatusCode(200) return response }