diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml index 463074e836..d86d301507 100644 --- a/.github/workflows/deploy-featurebranch.yml +++ b/.github/workflows/deploy-featurebranch.yml @@ -23,7 +23,6 @@ jobs: PAYLOAD_BRANCH: ${{ github.head_ref }} PAYLOAD_PR_NUMBER: ${{ github.event.pull_request.number }} PAYLOAD_LICENSE_TYPE: "free" - PAYLOAD_DEPLOY: true with: repository: budibase/budibase-deploys event: featurebranch-qa-deploy diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 2b099d01f5..4d0560312f 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -184,6 +184,10 @@ spec: - name: NODE_DEBUG value: {{ .Values.services.apps.nodeDebug | quote }} {{ end }} + {{ if .Values.services.apps.xssSafeMode }} + - name: XSS_SAFE_MODE + value: {{ .Values.services.apps.xssSafeMode | quote }} + {{ end }} {{ if .Values.globals.datadogApmEnabled }} - name: DD_LOGS_INJECTION value: {{ .Values.globals.datadogApmEnabled | quote }} diff --git a/lerna.json b/lerna.json index a4bcb56d38..55721b6b2d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "2.32.11", + "version": "2.32.12", "npmClient": "yarn", "packages": [ "packages/*", diff --git a/packages/account-portal b/packages/account-portal index 3e24f6293f..8cd052ce82 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 3e24f6293ff5ee5f9b42822e001504e3bbf19cc0 +Subproject commit 8cd052ce8288f343812a514d06c5a9459b3ba1a8 diff --git a/packages/backend-core/tests/core/utilities/structures/accounts.ts b/packages/backend-core/tests/core/utilities/structures/accounts.ts index 29453ad60a..daf4965c81 100644 --- a/packages/backend-core/tests/core/utilities/structures/accounts.ts +++ b/packages/backend-core/tests/core/utilities/structures/accounts.ts @@ -6,9 +6,6 @@ import { AccountSSOProviderType, AuthType, CloudAccount, - CreateAccount, - CreatePassswordAccount, - CreateVerifiableSSOAccount, Hosting, SSOAccount, } from "@budibase/types" @@ -19,6 +16,7 @@ export const account = (partial: Partial = {}): Account => { accountId: uuid(), tenantId: generator.word(), email: generator.email({ domain: "example.com" }), + accountName: generator.word(), tenantName: generator.word(), hosting: Hosting.SELF, createdAt: Date.now(), @@ -84,62 +82,3 @@ export function verifiableSsoAccount( thirdPartyProfile: { id: "abc123" }, } } - -export const cloudCreateAccount: CreatePassswordAccount = { - email: "cloud@budibase.com", - tenantId: "cloud", - hosting: Hosting.CLOUD, - authType: AuthType.PASSWORD, - password: "Password123!", - tenantName: "cloud", - name: "Budi Armstrong", - size: "10+", - profession: "Software Engineer", -} - -export const cloudSSOCreateAccount: CreateAccount = { - email: "cloud-sso@budibase.com", - tenantId: "cloud-sso", - hosting: Hosting.CLOUD, - authType: AuthType.SSO, - tenantName: "cloudsso", - name: "Budi Armstrong", - size: "10+", - profession: "Software Engineer", -} - -export const cloudVerifiableSSOCreateAccount: CreateVerifiableSSOAccount = { - email: "cloud-sso@budibase.com", - tenantId: "cloud-sso", - hosting: Hosting.CLOUD, - authType: AuthType.SSO, - tenantName: "cloudsso", - name: "Budi Armstrong", - size: "10+", - profession: "Software Engineer", - provider: AccountSSOProvider.MICROSOFT, - thirdPartyProfile: { id: "abc123" }, -} - -export const selfCreateAccount: CreatePassswordAccount = { - email: "self@budibase.com", - tenantId: "self", - hosting: Hosting.SELF, - authType: AuthType.PASSWORD, - password: "Password123!", - tenantName: "self", - name: "Budi Armstrong", - size: "10+", - profession: "Software Engineer", -} - -export const selfSSOCreateAccount: CreateAccount = { - email: "self-sso@budibase.com", - tenantId: "self-sso", - hosting: Hosting.SELF, - authType: AuthType.SSO, - tenantName: "selfsso", - name: "Budi Armstrong", - size: "10+", - profession: "Software Engineer", -} diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index d8edf0cbb1..4186cb54cc 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -66,6 +66,7 @@ let insertAtPos let targetMode = null let expressionResult + let expressionError let evaluating = false $: useSnippets = allowSnippets && !$licensing.isFreePlan @@ -142,10 +143,22 @@ } const debouncedEval = Utils.debounce((expression, context, snippets) => { - expressionResult = processStringSync(expression || "", { - ...context, - snippets, - }) + try { + expressionError = null + expressionResult = processStringSync( + expression || "", + { + ...context, + snippets, + }, + { + noThrow: false, + } + ) + } catch (err) { + expressionResult = null + expressionError = err + } evaluating = false }, 260) @@ -370,6 +383,7 @@ {:else if sidePanel === SidePanels.Evaluation} diff --git a/packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte b/packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte index 2c4e6a0991..ffb8f45297 100644 --- a/packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte +++ b/packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte @@ -3,26 +3,37 @@ import { Icon, ProgressCircle, notifications } from "@budibase/bbui" import { copyToClipboard } from "@budibase/bbui/helpers" import { fade } from "svelte/transition" + import { UserScriptError } from "@budibase/string-templates" export let expressionResult + export let expressionError export let evaluating = false export let expression = null - $: error = expressionResult === "Error while executing JS" + $: error = expressionError != null $: empty = expression == null || expression?.trim() === "" $: success = !error && !empty $: highlightedResult = highlight(expressionResult) + const formatError = err => { + if (err.code === UserScriptError.code) { + return err.userScriptError.toString() + } + return err.toString() + } + const highlight = json => { if (json == null) { return "" } - // Attempt to parse and then stringify, in case this is valid JSON + + // Attempt to parse and then stringify, in case this is valid result try { json = JSON.stringify(JSON.parse(json), null, 2) } catch (err) { // Ignore } + return formatHighlight(json, { keyColor: "#e06c75", numberColor: "#e5c07b", @@ -34,7 +45,7 @@ } const copy = () => { - let clipboardVal = expressionResult + let clipboardVal = expressionResult.result if (typeof clipboardVal === "object") { clipboardVal = JSON.stringify(clipboardVal, null, 2) } @@ -73,6 +84,8 @@
{#if empty} Your expression will be evaluated here + {:else if error} + {formatError(expressionError)} {:else} {@html highlightedResult} diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 9a073d041f..ddd37dc4a3 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -26,6 +26,7 @@ licensing, environment, enrichedApps, + sortBy, } from "stores/portal" import { goto } from "@roxi/routify" import AppRow from "components/start/AppRow.svelte" @@ -247,7 +248,7 @@