diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 024b97597f..b3385c2ccd 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -69,10 +69,13 @@ jobs: env: KUBECONFIG_FILE: '${{ secrets.RELEASE_KUBECONFIG }}' + - name: Set the base64 kubeconfig + run: echo 'RELEASE_KUBECONFIG=${{ secrets.RELEASE_KUBECONFIG }}' | base64 + - name: Re roll the services uses: actions-hub/kubectl@master env: - KUBE_CONFIG: ${{ secrets.RELEASE_KUBECONFIG }} + KUBE_CONFIG: ${{ env.RELEASE_KUBECONFIG }} with: args: rollout restart deployment proxy-service -n budibase && kubectl rollout restart deployment app-service -n budibase && kubectl rollout restart deployment worker-service -n budibase diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 067d0eb0dd..8d3e9f4021 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -120,11 +120,14 @@ jobs: ] env: KUBECONFIG_FILE: '${{ secrets.RELEASE_KUBECONFIG }}' + + - name: Set the base64 kubeconfig + run: echo 'RELEASE_KUBECONFIG=${{ secrets.RELEASE_KUBECONFIG }}' | base64 - name: Re roll the services uses: actions-hub/kubectl@master env: - KUBE_CONFIG: ${{ secrets.RELEASE_KUBECONFIG }} + KUBE_CONFIG: ${{ env.RELEASE_KUBECONFIG }} with: args: rollout restart deployment proxy-service -n budibase && kubectl rollout restart deployment app-service -n budibase && kubectl rollout restart deployment worker-service -n budibase diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index 492722e2e4..2805c68797 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -62,6 +62,10 @@ http { proxy_pass http://{{ address }}:4001; } + location /preview { + proxy_pass http://{{ address }}:4001; + } + location /builder { proxy_pass http://{{ address }}:3000; rewrite ^/builder(.*)$ /builder/$1 break; diff --git a/lerna.json b/lerna.json index 9fedf86f90..28379208fe 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.2.41-alpha.0", + "version": "1.2.44-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 27246f1828..b95a33703d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.2.41-alpha.0", + "version": "1.2.44-alpha.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.2.41-alpha.0", + "@budibase/types": "1.2.44-alpha.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 79234a65f8..99f58a045b 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": "1.2.41-alpha.0", + "version": "1.2.44-alpha.1", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.2.41-alpha.0", + "@budibase/string-templates": "1.2.44-alpha.1", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 36515acbc5..ffdac08402 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -17,6 +17,7 @@ export let disabled = false export let fileSizeLimit = BYTES_IN_MB * 20 export let processFiles = null + export let deleteAttachments = null export let handleFileTooLarge = null export let handleTooManyFiles = null export let gallery = true @@ -94,6 +95,11 @@ "change", value.filter((x, idx) => idx !== selectedImageIdx) ) + if (deleteAttachments) { + await deleteAttachments( + value.filter((x, idx) => idx === selectedImageIdx).map(item => item.key) + ) + } selectedImageIdx = 0 } diff --git a/packages/bbui/src/Form/Dropzone.svelte b/packages/bbui/src/Form/Dropzone.svelte index f1b548f7f1..5b82c0ebea 100644 --- a/packages/bbui/src/Form/Dropzone.svelte +++ b/packages/bbui/src/Form/Dropzone.svelte @@ -10,6 +10,7 @@ export let error = null export let fileSizeLimit = undefined export let processFiles = undefined + export let deleteAttachments = undefined export let handleFileTooLarge = undefined export let handleTooManyFiles = undefined export let gallery = true @@ -30,6 +31,7 @@ {value} {fileSizeLimit} {processFiles} + {deleteAttachments} {handleFileTooLarge} {handleTooManyFiles} {gallery} diff --git a/packages/builder/package.json b/packages/builder/package.json index 959f302fea..ec8f13a6cb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.2.41-alpha.0", + "version": "1.2.44-alpha.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.2.41-alpha.0", - "@budibase/client": "1.2.41-alpha.0", - "@budibase/frontend-core": "1.2.41-alpha.0", - "@budibase/string-templates": "1.2.41-alpha.0", + "@budibase/bbui": "1.2.44-alpha.1", + "@budibase/client": "1.2.44-alpha.1", + "@budibase/frontend-core": "1.2.44-alpha.1", + "@budibase/string-templates": "1.2.44-alpha.1", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", @@ -96,7 +96,7 @@ "@babel/runtime": "^7.13.10", "@rollup/plugin-replace": "^2.4.2", "@roxi/routify": "2.18.5", - "@sveltejs/vite-plugin-svelte": "1.0.0-next.19", + "@sveltejs/vite-plugin-svelte": "1.0.1", "@testing-library/jest-dom": "^5.11.10", "@testing-library/svelte": "^3.0.0", "babel-jest": "^26.6.3", @@ -118,7 +118,7 @@ "ts-node": "^10.4.0", "tsconfig-paths": "4.0.0", "typescript": "^4.5.5", - "vite": "^2.1.5" + "vite": "^3.0.8" }, "gitHead": "115189f72a850bfb52b65ec61d932531bf327072" } diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index bebd06c6d7..13b749e19f 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -502,11 +502,11 @@ const getRoleBindings = () => { } /** - * Gets all bindable properties exposed in a button actions flow up until + * Gets all bindable properties exposed in an event action flow up until * the specified action ID, as well as context provided for the action * setting as a whole by the component. */ -export const getButtonContextBindings = ( +export const getEventContextBindings = ( asset, componentId, settingKey, @@ -520,10 +520,7 @@ export const getButtonContextBindings = ( const component = findComponent(asset.props, componentId) const settings = getComponentSettings(component?._component) const eventSetting = settings.find(setting => setting.key === settingKey) - if (!eventSetting) { - return bindings - } - if (eventSetting.context?.length) { + if (eventSetting?.context?.length) { eventSetting.context.forEach(contextEntry => { bindings.push({ readableBinding: contextEntry.label, diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index a500c6a5b3..8454f3b3d5 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -28,6 +28,9 @@ let importModal $: showImportButton = false + $: customIntegrations = Object.entries(integrations).filter( + entry => entry[1].custom + ) checkShowImport() @@ -163,17 +166,19 @@ /> {/each} - Custom data source -
- {#each Object.entries(integrations).filter(entry => entry[1].custom) as [integrationType, schema]} - selectIntegration(evt.detail)} - {schema} - bind:integrationType - {integration} - /> - {/each} -
+ {#if customIntegrations.length > 0} + Custom data source +
+ {#each customIntegrations as [integrationType, schema]} + selectIntegration(evt.detail)} + {schema} + bind:integrationType + {integration} + /> + {/each} +
+ {/if} diff --git a/packages/builder/src/components/common/Dropzone.svelte b/packages/builder/src/components/common/Dropzone.svelte index 9a86554b49..fd2359fd91 100644 --- a/packages/builder/src/components/common/Dropzone.svelte +++ b/packages/builder/src/components/common/Dropzone.svelte @@ -27,6 +27,14 @@ return [] } } + + async function deleteAttachments(fileList) { + try { + return await API.deleteBuilderAttachments(fileList) + } catch (error) { + return [] + } + } diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/ButtonActionDrawer.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/ButtonActionDrawer.svelte index 31962077fc..69d5fe60b4 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/ButtonActionDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/ButtonActionDrawer.svelte @@ -11,7 +11,7 @@ } from "@budibase/bbui" import { getAvailableActions } from "./index" import { generate } from "shortid" - import { getButtonContextBindings } from "builderStore/dataBinding" + import { getEventContextBindings } from "builderStore/dataBinding" import { currentAsset, store } from "builderStore" const flipDurationMs = 150 @@ -41,14 +41,14 @@ }, {}) // These are ephemeral bindings which only exist while executing actions - $: buttonContextBindings = getButtonContextBindings( + $: eventContexBindings = getEventContextBindings( $currentAsset, $store.selectedComponentId, key, actions, selectedAction?.id ) - $: allBindings = buttonContextBindings.concat(bindings) + $: allBindings = eventContexBindings.concat(bindings) // Assign a unique ID to each action $: { diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte index 1ca1882963..1d79178784 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte @@ -8,7 +8,6 @@ selectedLayout, currentAsset, } from "builderStore" - import iframeTemplate from "./iframeTemplate" import ConfirmDialog from "components/common/ConfirmDialog.svelte" import { ProgressCircle, @@ -40,12 +39,6 @@ BUDIBASE: "type", } - // Construct iframe template - $: template = iframeTemplate.replace( - /\{\{ CLIENT_LIB_PATH }}/, - $store.clientLibPath - ) - const placeholderScreen = new Screen() .name("Screen Placeholder") .route("/") @@ -300,7 +293,7 @@