diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 560b273668..229396dacb 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -51,6 +51,7 @@ services: INTERNAL_API_KEY: ${INTERNAL_API_KEY} REDIS_URL: redis-service:6379 REDIS_PASSWORD: ${REDIS_PASSWORD} + ACCOUNT_PORTAL_URL: https://portal.budi.live volumes: - ./logs:/logs depends_on: diff --git a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml index 703d59c075..6c165872c8 100644 --- a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml @@ -87,6 +87,8 @@ spec: {{ end }} - name: SELF_HOSTED value: {{ .Values.globals.selfHosted | quote }} + - name: ACCOUNT_PORTAL_URL + value: {{ .Values.globals.accountPortalUrl | quote }} image: budibase/worker imagePullPolicy: Always name: bbworker diff --git a/hosting/kubernetes/budibase/values.yaml b/hosting/kubernetes/budibase/values.yaml index 30594f95e3..6a9d84c0b0 100644 --- a/hosting/kubernetes/budibase/values.yaml +++ b/hosting/kubernetes/budibase/values.yaml @@ -89,6 +89,7 @@ globals: sentryDSN: "" logLevel: info selfHosted: 1 + accountPortalUrL: "" createSecrets: true # creates an internal API key, JWT secrets and redis password for you # if createSecrets is set to false, you can hard-code your secrets here diff --git a/lerna.json b/lerna.json index 1de84eca6d..ba5c97f9eb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.125-alpha.5", + "version": "0.9.125-alpha.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index f8d9d1789e..f87c3715aa 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,8 @@ "release:helm": "./scripts/release_helm_chart.sh", "multi:enable": "lerna run multi:enable", "multi:disable": "lerna run multi:disable", + "selfhost:enable": "lerna run selfhost:enable", + "selfhost:disable": "lerna run selfhost:disable", "postinstall": "husky install" } } diff --git a/packages/auth/package.json b/packages/auth/package.json index afc0e99301..fae075e1ed 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.125-alpha.5", + "version": "0.9.125-alpha.6", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index a060614934..3e5d80d179 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.125-alpha.5", + "version": "0.9.125-alpha.6", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index 83f71d385b..b518ac3d92 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -12,6 +12,7 @@ export let dataCy = null export let size = "M" export let active = false + export let fullWidth = false function longPress(element) { if (!longPressable) return @@ -40,6 +41,7 @@ class:spectrum-ActionButton--quiet={quiet} class:spectrum-ActionButton--emphasized={emphasized} class:is-selected={selected} + class:fullWidth class="spectrum-ActionButton spectrum-ActionButton--size{size}" class:active {disabled} @@ -71,6 +73,9 @@ diff --git a/packages/builder/assets/discord.svg b/packages/builder/assets/discord.svg new file mode 100644 index 0000000000..3efe1ec110 --- /dev/null +++ b/packages/builder/assets/discord.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/builder/assets/integromat.png b/packages/builder/assets/integromat.png new file mode 100644 index 0000000000..1fbbe63e74 Binary files /dev/null and b/packages/builder/assets/integromat.png differ diff --git a/packages/builder/assets/n8n.png b/packages/builder/assets/n8n.png new file mode 100644 index 0000000000..b9dad93e5a Binary files /dev/null and b/packages/builder/assets/n8n.png differ diff --git a/packages/builder/assets/slack.svg b/packages/builder/assets/slack.svg new file mode 100644 index 0000000000..c37dc5eb49 --- /dev/null +++ b/packages/builder/assets/slack.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/builder/assets/zapier.png b/packages/builder/assets/zapier.png new file mode 100644 index 0000000000..3805331440 Binary files /dev/null and b/packages/builder/assets/zapier.png differ diff --git a/packages/builder/package.json b/packages/builder/package.json index 66c1acdf67..d61b068394 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.125-alpha.5", + "version": "0.9.125-alpha.6", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.125-alpha.5", - "@budibase/client": "^0.9.125-alpha.5", + "@budibase/bbui": "^0.9.125-alpha.6", + "@budibase/client": "^0.9.125-alpha.6", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.125-alpha.5", + "@budibase/string-templates": "^0.9.125-alpha.6", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/builderStore/store/automation/Automation.js b/packages/builder/src/builderStore/store/automation/Automation.js index a9dce88258..dcbb747e38 100644 --- a/packages/builder/src/builderStore/store/automation/Automation.js +++ b/packages/builder/src/builderStore/store/automation/Automation.js @@ -13,6 +13,10 @@ export default class Automation { return this.automation.definition.trigger } + addTestData(data) { + this.automation.testData = data + } + addBlock(block) { // Make sure to add trigger if doesn't exist if (!this.hasTrigger() && block.type === "TRIGGER") { diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index f8e7db04a0..db06ce1726 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -17,7 +17,6 @@ const automationActions = store => ({ state.blockDefinitions = { TRIGGER: jsonResponses[1].trigger, ACTION: jsonResponses[1].action, - LOGIC: jsonResponses[1].logic, } // if previously selected find the new obj and select it if (selected) { @@ -80,9 +79,14 @@ const automationActions = store => ({ const { _id } = automation return await api.post(`/api/automations/${_id}/trigger`) }, - test: async ({ automation }) => { + test: async ({ automation }, testData) => { const { _id } = automation - return await api.post(`/api/automations/${_id}/test`) + const response = await api.post(`/api/automations/${_id}/test`, testData) + const json = await response.json() + store.update(state => { + state.selectedAutomation.testResults = json + return state + }) }, select: automation => { store.update(state => { @@ -91,6 +95,12 @@ const automationActions = store => ({ return state }) }, + addTestDataToAutomation: data => { + store.update(state => { + state.selectedAutomation.addTestData(data) + return state + }) + }, addBlockToAutomation: block => { store.update(state => { const newBlock = state.selectedAutomation.addBlock(cloneDeep(block)) @@ -132,7 +142,6 @@ export const getAutomationStore = () => { blockDefinitions: { TRIGGER: [], ACTION: [], - LOGIC: [], }, selectedAutomation: null, } diff --git a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte index 62faff3caa..7ce77a58e3 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte @@ -1,10 +1,8 @@ {#if automation} - {/if} diff --git a/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte b/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte deleted file mode 100644 index a04541cfad..0000000000 --- a/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte +++ /dev/null @@ -1,114 +0,0 @@ - - -
- {#each tabs as tab, idx} -
- onChangeTab(idx)} - > - {tab.label} - -
- {/each} -
- (selectedIndex = null)} - bind:this={popover} - {anchor} - align="left" -> - - {#each blocks as [stepId, blockDefinition]} - addBlockToAutomation(stepId, blockDefinition)} - /> - {/each} - - - - - - - diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte new file mode 100644 index 0000000000..3a58d8c5fd --- /dev/null +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -0,0 +1,149 @@ + + + { + blockComplete = true + addBlockToAutomation() + }} +> + Select an app or event. + + Apps + +
+ {#each Object.entries(externalActions) as [idx, action]} +
selectAction(action)} + > +
+ val.name === idx).logo} + alt="zapier" + /> + + {idx.charAt(0).toUpperCase() + idx.slice(1)} +
+
+ {/each} +
+ + Actions + +
+ {#each Object.entries(internalActions) as [idx, action]} +
selectAction(action)} + > +
+ + + {action.name} +
+
+ {/each} +
+
+
+ + diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte index 931490b197..5aec39abeb 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte @@ -6,6 +6,7 @@ xmlns="http://www.w3.org/2000/svg" > diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ExternalActions.js b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ExternalActions.js new file mode 100644 index 0000000000..e03b3ad4c7 --- /dev/null +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ExternalActions.js @@ -0,0 +1,13 @@ +import DiscordLogo from "assets/discord.svg" +import ZapierLogo from "assets/zapier.png" +import IntegromatLogo from "assets/integromat.png" +import SlackLogo from "assets/slack.svg" +import n8nlogo from "assets/n8n.png" + +export const externalActions = { + zapier: { name: "zapier", icon: ZapierLogo }, + discord: { name: "discord", icon: DiscordLogo }, + slack: { name: "slack", icon: SlackLogo }, + integromat: { name: "integromat", icon: IntegromatLogo }, + n8n: { name: "n8n", icon: n8nlogo }, +} diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index e960271b87..c969ef823d 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -1,13 +1,27 @@ -{#if !blocks.length}Add a trigger to your automation to get started{/if} -
- {#each blocks as block, idx (block.id)} -
- - {#if idx !== blocks.length - 1} - - {/if} +
+
+
+
+ {automation.name} +
+ deleteAutomation()} class="iconPadding"> + + + testDataModal.show()} + icon="MultipleCheck" + size="S">Run test +
+
- {/each} -
+ {#each blocks as block, idx (block.id)} +
+ + {#if idx !== blocks.length - 1} +
+ +
+ {/if} +
+ {/each} +
+ + + +
diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 439db62639..5e34dd7d55 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -1,86 +1,200 @@
onSelect(block)} + on:click={() => { + onSelect(block) + }} > -
- {#if block.type === "TRIGGER"} - - When this happens... - {:else if block.type === "ACTION"} - - Do this... - {:else if block.type === "LOGIC"} - - Only continue if... - {/if} -
- {#if block.type === "TRIGGER"}Trigger{:else}Step {blockIdx + 1}{/if} +
+
{ + blockComplete = !blockComplete + }} + class="splitHeader" + > +
+ {#if externalActions[block.stepId]} + {externalActions[block.stepId].name} + {:else} + + + + {/if} +
+ When this happens: + + {block?.name?.toUpperCase() || ""} +
+
+ {#if testResult} + resultsModal.show()}> + View response + + {/if}
- {#if block.type !== "TRIGGER" || allowDeleteTrigger} -
- {/if} -
-
-

- -

+
+ {#if !blockComplete} + +
+ +
+
{ + setupToggled = !setupToggled + }} + class="toggle" + > + {#if setupToggled} + + {:else} + + {/if} + Setup +
+ {#if !isTrigger} +
deleteStep()}> + +
+ {/if} +
+ + {#if setupToggled} + + {#if lastStep} + + {/if} + + {/if} +
+
+ {/if} + + + + + + + + + + + + diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte new file mode 100644 index 0000000000..d7d9951f54 --- /dev/null +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte @@ -0,0 +1,88 @@ + + + +
+
+ {#if isTrigger || testResult[0].outputs.success} + + {:else} + + {/if} +
+
+ +
{ + inputToggled = !inputToggled + }} + class="toggle splitHeader" + > +
+
+ + Input + +
+
+
+ {#if inputToggled} + + {:else} + + {/if} +
+
+ {#if inputToggled} +