From 8544d33540e69fb57488beb7aeb10d87e8691f28 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Jun 2023 18:02:02 +0000 Subject: [PATCH 1/5] Bump version to 2.7.7-alpha.0 --- lerna.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lerna.json b/lerna.json index 2a367d9d55..11719e4275 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.6", + "version": "2.7.7-alpha.0", "npmClient": "yarn", "packages": [ "packages/backend-core", @@ -31,4 +31,4 @@ "loadEnvFiles": false } } -} +} \ No newline at end of file From 532583e66eb87e7f8826ce82ae6c569e37c2edf2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 8 Jun 2023 13:47:16 +0100 Subject: [PATCH 2/5] Fixing develop currentapp.spec.js test case, when packages within backend-core import all of backend-core they can create cyclics that cause issues. --- .../src/middleware/passport/datasource/google.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/backend-core/src/middleware/passport/datasource/google.ts b/packages/backend-core/src/middleware/passport/datasource/google.ts index 2f91e01d9a..ae6b3b4913 100644 --- a/packages/backend-core/src/middleware/passport/datasource/google.ts +++ b/packages/backend-core/src/middleware/passport/datasource/google.ts @@ -1,10 +1,11 @@ import * as google from "../sso/google" import { Cookie } from "../../../constants" -import { clearCookie, getCookie } from "../../../utils" import * as configs from "../../../configs" -import { BBContext, SSOProfile } from "@budibase/types" +import * as cache from "../../../cache" +import * as utils from "../../../utils" +import { UserCtx, SSOProfile } from "@budibase/types" import { ssoSaveUserNoOp } from "../sso/sso" -import { cache, utils } from "../../../" + const GoogleStrategy = require("passport-google-oauth").OAuth2Strategy type Passport = { @@ -22,7 +23,7 @@ async function fetchGoogleCreds() { export async function preAuth( passport: Passport, - ctx: BBContext, + ctx: UserCtx, next: Function ) { // get the relevant config @@ -49,7 +50,7 @@ export async function preAuth( export async function postAuth( passport: Passport, - ctx: BBContext, + ctx: UserCtx, next: Function ) { // get the relevant config @@ -57,7 +58,7 @@ export async function postAuth( const platformUrl = await configs.getPlatformUrl({ tenantAware: false }) let callbackUrl = `${platformUrl}/api/global/auth/datasource/google/callback` - const authStateCookie = getCookie(ctx, Cookie.DatasourceAuth) + const authStateCookie = utils.getCookie(ctx, Cookie.DatasourceAuth) return passport.authenticate( new GoogleStrategy( @@ -72,7 +73,7 @@ export async function postAuth( _profile: SSOProfile, done: Function ) => { - clearCookie(ctx, Cookie.DatasourceAuth) + utils.clearCookie(ctx, Cookie.DatasourceAuth) done(null, { accessToken, refreshToken }) } ), From e1ede8edbe120576eafb57488fc78f86555083c3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 8 Jun 2023 13:09:49 +0000 Subject: [PATCH 3/5] Bump version to 2.7.7-alpha.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 11719e4275..7e8c55649b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.7-alpha.0", + "version": "2.7.7-alpha.1", "npmClient": "yarn", "packages": [ "packages/backend-core", From c0578d4cc2a5999fa56f9289455349cf8c3dd1f3 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:25:35 +0100 Subject: [PATCH 4/5] Send meeting invite via automation email smtp (#10787) * Pass calendar props into sendSmtpEmail * Add calendar event to message * Add Checkbox and DatePicker automation field UI * Add URL prop * Add url to sendSmtpEmail unit test * Refactor * Code review comments * Make location optional * Add EmailInvite type --------- Co-authored-by: mike12345567 --- .../SetupPanel/AutomationBlockSetup.svelte | 412 ++++++++++-------- .../src/automations/steps/sendSmtpEmail.ts | 59 ++- .../automations/tests/sendSmtpEmail.spec.js | 71 --- .../automations/tests/sendSmtpEmail.spec.ts | 74 ++++ .../server/src/utilities/workerRequests.ts | 29 +- .../types/src/documents/app/automation.ts | 30 ++ packages/worker/package.json | 1 + .../src/api/controllers/global/email.ts | 2 + packages/worker/src/utilities/email.ts | 41 +- yarn.lock | 12 + 10 files changed, 437 insertions(+), 294 deletions(-) delete mode 100644 packages/server/src/automations/tests/sendSmtpEmail.spec.js create mode 100644 packages/server/src/automations/tests/sendSmtpEmail.spec.ts diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 6ab750c3d6..a8fa700b90 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -13,6 +13,8 @@ Modal, notifications, Icon, + Checkbox, + DatePicker, } from "@budibase/bbui" import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte" import { automationStore, selectedAutomation } from "builderStore" @@ -306,6 +308,11 @@ drawer.hide() } + function canShowField(key, value) { + const dependsOn = value.dependsOn + return !dependsOn || !!inputData[dependsOn] + } + onMount(async () => { try { await environment.loadVariables() @@ -317,210 +324,233 @@
{#each deprecatedSchemaProperties as [key, value]} -
- {#if key !== "fields"} - - {/if} - {#if value.type === "string" && value.enum} - onChange(e, key)} - value={inputData[key]} - options={Object.keys(table?.schema || {})} - /> - {:else if value.customType === "filters"} - Define filters - - - (tempFilters = e.detail)} - /> - - {:else if value.customType === "password"} - onChange(e, key)} - value={inputData[key]} - /> - {:else if value.customType === "email"} - {#if isTestModal} - onChange(e, key)} - {bindings} - fillWidth - updateOnChange={false} - /> - {:else} - onChange(e, key)} - {bindings} - allowJS={false} - updateOnChange={false} - drawerLeft="260px" - /> + {#if canShowField(key, value)} +
+ {#if key !== "fields" && value.type !== "boolean"} + {/if} - {:else if value.customType === "query"} - onChange(e, key)} - value={inputData[key]} - /> - {:else if value.customType === "cron"} - onChange(e, key)} value={inputData[key]} /> - {:else if value.customType === "queryParams"} - onChange(e, key)} - value={inputData[key]} - {bindings} - /> - {:else if value.customType === "table"} - onChange(e, key)} - /> - {:else if value.customType === "row"} - { - if (e.detail?.key) { - onChange(e, e.detail.key) - } else { - onChange(e, key) - } - }} - {bindings} - {isTestModal} - {isUpdateRow} - /> - {:else if value.customType === "webhookUrl"} - onChange(e, key)} - value={inputData[key]} - /> - {:else if value.customType === "fields"} - onChange(e, key)} - {bindings} - {isTestModal} - /> - {:else if value.customType === "triggerSchema"} - onChange(e, key)} value={inputData[key]} /> - {:else if value.customType === "code"} - - { - // need to pass without the value inside - onChange({ detail: e.detail }, key) - inputData[key] = e.detail - }} - completions={[ - jsAutocomplete([ - ...bindingsToCompletions(bindings, EditorModes.JS), - ]), - ]} - mode={EditorModes.JS} - height={500} - /> -
- -
-
Add available bindings by typing $
-
-
-
- {:else if value.customType === "loopOption"} - onChange(e, key)} + value={inputData[key]} + options={Object.keys(table?.schema || {})} + /> + {:else if value.customType === "filters"} + Define filters + + + (tempFilters = e.detail)} + /> + + {:else if value.customType === "password"} + onChange(e, key)} + value={inputData[key]} + /> + {:else if value.customType === "email"} + {#if isTestModal} + onChange(e, key)} + {bindings} + fillWidth + updateOnChange={false} + /> + {:else} onChange(e, key)} {bindings} + allowJS={false} updateOnChange={false} - placeholder={value.customType === "queryLimit" ? queryLimit : ""} drawerLeft="260px" /> -
+ {/if} + {:else if value.customType === "query"} + onChange(e, key)} + value={inputData[key]} + /> + {:else if value.customType === "cron"} + onChange(e, key)} + value={inputData[key]} + /> + {:else if value.customType === "queryParams"} + onChange(e, key)} + value={inputData[key]} + {bindings} + /> + {:else if value.customType === "table"} + onChange(e, key)} + /> + {:else if value.customType === "row"} + { + if (e.detail?.key) { + onChange(e, e.detail.key) + } else { + onChange(e, key) + } + }} + {bindings} + {isTestModal} + {isUpdateRow} + /> + {:else if value.customType === "webhookUrl"} + onChange(e, key)} + value={inputData[key]} + /> + {:else if value.customType === "fields"} + onChange(e, key)} + {bindings} + {isTestModal} + /> + {:else if value.customType === "triggerSchema"} + onChange(e, key)} + value={inputData[key]} + /> + {:else if value.customType === "code"} + + { + // need to pass without the value inside + onChange({ detail: e.detail }, key) + inputData[key] = e.detail + }} + completions={[ + jsAutocomplete([ + ...bindingsToCompletions(bindings, EditorModes.JS), + ]), + ]} + mode={EditorModes.JS} + height={500} + /> +
+ +
+
Add available bindings by typing $
+
+
+
+ {:else if value.customType === "loopOption"} +