diff --git a/.github/cla/signatures.json b/.github/cla/signatures.json index 67d475a7a3..8fcde8353e 100644 --- a/.github/cla/signatures.json +++ b/.github/cla/signatures.json @@ -31,6 +31,14 @@ "created_at": "2021-05-01T05:27:53Z", "repoId": 190729906, "pullRequestNo": 1431 + }, + { + "name": "mjashanks", + "id": 3524181, + "comment_id": 844846454, + "created_at": "2021-05-20T08:14:04Z", + "repoId": 190729906, + "pullRequestNo": 1510 } ] } \ No newline at end of file diff --git a/hosting/bootstrap.sh b/hosting/bootstrap.sh deleted file mode 100755 index 4e15481e64..0000000000 --- a/hosting/bootstrap.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -GITHUB_BASE_URL=https://raw.githubusercontent.com/Budibase/budibase/master/hosting - -if ! [ -x "$(command -v wget)" ]; then - echo 'Error: wget is not installed. Please install it for your operating system.' >&2 - exit 1 -fi - -fetch_config_files() { - wget $GITHUB_BASE_URL/docker-compose.yaml - wget $GITHUB_BASE_URL/envoy.yaml - wget $GITHUB_BASE_URL/hosting.properties - wget $GITHUB_BASE_URL/start.sh -} - -fetch_config_files - -# Start budibase -docker-compose --env-file hosting.properties up -d diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 00c93ca1c6..73bbcfc39b 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -48,6 +48,7 @@ services: REDIS_URL: redis-service:6379 REDIS_PASSWORD: ${REDIS_PASSWORD} depends_on: + - redis-service - minio-service - couch-init diff --git a/hosting/start.sh b/hosting/start.sh deleted file mode 100755 index b32098a3b7..0000000000 --- a/hosting/start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -docker-compose --env-file hosting.properties up diff --git a/hosting/update.sh b/hosting/update.sh deleted file mode 100644 index 3ccd5e59d0..0000000000 --- a/hosting/update.sh +++ /dev/null @@ -1 +0,0 @@ -docker-compose --env-file hosting.properties pull && ./start.sh diff --git a/lerna.json b/lerna.json index bf193f9a81..90690dbf98 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.8.16", + "version": "0.8.18", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index 91a682d859..93217277e7 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -34,6 +34,10 @@ exports.APP_PREFIX = DocumentTypes.APP + SEPARATOR exports.APP_DEV_PREFIX = DocumentTypes.APP_DEV + SEPARATOR exports.SEPARATOR = SEPARATOR +function isDevApp(app) { + return app.appId.startsWith(exports.APP_DEV_PREFIX) +} + /** * If creating DB allDocs/query params with only a single top level ID this can be used, this * is usually the case as most of our docs are top level e.g. tables, automations, users and so on. @@ -160,7 +164,7 @@ exports.getDeployedAppID = appId => { * different users/companies apps as there is no security around it - all apps are returned. * @return {Promise} returns the app information document stored in each app database. */ -exports.getAllApps = async (devApps = false) => { +exports.getAllApps = async ({ dev, all } = {}) => { const CouchDB = getCouch() let allDbs = await CouchDB.allDbs() const appDbNames = allDbs.filter(dbName => @@ -176,12 +180,19 @@ exports.getAllApps = async (devApps = false) => { const apps = response .filter(result => result.status === "fulfilled") .map(({ value }) => value) - return apps.filter(app => { - if (devApps) { - return app.appId.startsWith(exports.APP_DEV_PREFIX) - } - return !app.appId.startsWith(exports.APP_DEV_PREFIX) - }) + if (!all) { + return apps.filter(app => { + if (dev) { + return isDevApp(app) + } + return !isDevApp(app) + }) + } else { + return apps.map(app => ({ + ...app, + status: isDevApp(app) ? "development" : "published", + })) + } } } diff --git a/packages/auth/src/utils.js b/packages/auth/src/utils.js index a0ba0d25b5..278ad07174 100644 --- a/packages/auth/src/utils.js +++ b/packages/auth/src/utils.js @@ -112,6 +112,9 @@ exports.isClient = ctx => { * @return {Promise} */ exports.getGlobalUserByEmail = async email => { + if (email == null) { + throw "Must supply an email address to view" + } const db = getDB(StaticDatabases.GLOBAL.name) try { let users = ( diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index 7d564d2a9d..e9a6b56fd9 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -45,3 +45,9 @@ {text || ""} + + diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 5b5c72b809..3315c923f8 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -37,9 +37,28 @@ const fieldId = id || generateID() let selectedImageIdx = 0 let fileDragged = false + let selectedUrl $: selectedImage = value?.[selectedImageIdx] ?? null $: fileCount = value?.length ?? 0 - $: isImage = imageExtensions.includes(selectedImage?.extension?.toLowerCase()) + $: isImage = + imageExtensions.includes(selectedImage?.extension?.toLowerCase()) || + selectedImage?.type?.startsWith("image") + + $: { + if (selectedImage?.url) { + selectedUrl = selectedImage?.url + } else if (selectedImage) { + try { + let reader = new FileReader() + reader.readAsDataURL(selectedImage) + reader.onload = e => { + selectedUrl = e.target.result + } + } catch (error) { + selectedUrl = null + } + } + } async function processFileList(fileList) { if ( @@ -102,11 +121,13 @@