diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 503fc53194..a7bf041eb5 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -48,19 +48,8 @@ jobs: - run: yarn install --frozen-lockfile - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn - - run: yarn build --configuration=production + run: ./scripts/updateVersions.sh + - run: yarn build - run: yarn build:sdk - name: Publish budibase packages to NPM diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index a4e679e7bf..68625ad7af 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -41,20 +41,9 @@ jobs: - run: yarn install --frozen-lockfile - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn + run: ./scripts/updateVersions.sh - run: yarn lint - - run: yarn build --configuration=production + - run: yarn build - run: yarn build:sdk - name: Publish budibase packages to NPM diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index 7a56748dfb..f4524e99dc 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -17,6 +17,8 @@ jobs: - uses: actions/checkout@v2 with: + submodules: true + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 - name: Fail if tag is not in master diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index fbf972a866..5408b48ef8 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -5,7 +5,7 @@ on: env: CI: true - PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} REGISTRY_URL: registry.hub.docker.com jobs: build: @@ -24,6 +24,8 @@ jobs: - name: "Checkout" uses: actions/checkout@v2 with: + submodules: true + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 - name: Fail if tag is not in master @@ -32,7 +34,7 @@ jobs: echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" exit 1 fi - + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -44,10 +46,12 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Run Yarn run: yarn - - name: Run Yarn Bootstrap - run: yarn bootstrap + - name: Update versions + run: ./scripts/updateVersions.sh - name: Runt Yarn Lint run: yarn lint + - name: Update versions + run: ./scripts/updateVersions.sh - name: Run Yarn Build run: yarn build:docker:pre - name: Login to Docker Hub diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index 64a6b01365..56df8185a9 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-slim as build +FROM node:14-slim as build # install node-gyp dependencies RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python @@ -11,12 +11,16 @@ RUN chmod +x /cleanup.sh # build server WORKDIR /app ADD packages/server . -RUN yarn install --frozen-lockfile --production=true && /cleanup.sh +COPY yarn.lock . +RUN yarn install --production=true +RUN /cleanup.sh # build worker WORKDIR /worker ADD packages/worker . -RUN yarn install --frozen-lockfile --production=true && /cleanup.sh +COPY yarn.lock . +RUN yarn install --production=true +RUN /cleanup.sh FROM budibase/couchdb ARG TARGETARCH diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index 0bd377cd7f..d980202f88 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -17,6 +17,7 @@ declare -a DOCKER_VARS=("APP_PORT" "APPS_URL" "ARCHITECTURE" "BUDIBASE_ENVIRONME [[ -z "${WORKER_PORT}" ]] && export WORKER_PORT=4002 [[ -z "${WORKER_URL}" ]] && export WORKER_URL=http://localhost:4002 [[ -z "${APPS_URL}" ]] && export APPS_URL=http://localhost:4001 +[[ -z "${SERVER_TOP_LEVEL_PATH}" ]] && export SERVER_TOP_LEVEL_PATH=/app # export CUSTOM_DOMAIN=budi001.custom.com # Azure App Service customisations diff --git a/lerna.json b/lerna.json index 21ffea6191..eded0d214d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.1-alpha.1", + "version": "2.7.7-alpha.2", "npmClient": "yarn", "packages": [ "packages/backend-core", diff --git a/package.json b/package.json index ffb3fa775a..56f015f8c0 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "dev:noserver": "yarn run kill-builder && lerna run --stream dev:stack:up && lerna run --stream --parallel dev:builder --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker", "dev:server": "yarn run kill-server && lerna run --stream --parallel dev:builder --scope @budibase/worker --scope @budibase/server", "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream --parallel dev:built", - "dev:docker": "yarn build && docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0", + "dev:docker": "yarn build:docker:pre && docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0", "test": "lerna run --stream test --stream", "lint:eslint": "eslint packages && eslint qa-core", "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --check \"qa-core/**/*.{js,ts,svelte}\"", @@ -62,7 +62,7 @@ "lint:fix": "yarn run lint:fix:prettier && yarn run lint:fix:eslint", "build:specs": "lerna run --stream specs", "build:docker": "lerna run --stream build:docker && yarn build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION && cd -", - "build:docker:pre": "lerna run --stream build && lerna run --stream predocker", + "build:docker:pre": "yarn build && lerna run --stream predocker", "build:docker:proxy": "docker build hosting/proxy -t proxy-service", "build:docker:selfhost": "lerna run --stream build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh latest && cd -", "build:docker:develop": "node scripts/pinVersions && lerna run --stream build:docker && yarn build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -", 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 }) } ), 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"} +