From c32b52430e12c9b9d3113ce73e66ce4c7cf6703e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 17 May 2021 16:33:33 +0100 Subject: [PATCH 1/2] flip bool --- packages/builder/src/components/deploy/DeployModal.svelte | 1 + packages/builder/src/pages/builder/portal/apps/index.svelte | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index 5fffa4cd55..b64a9a0b0d 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -62,6 +62,7 @@ // Required to check any updated deployment statuses between polls function checkIncomingDeploymentStatus(current, incoming) { + console.log(current, incoming) for (let incomingDeployment of incoming) { if (incomingDeployment.status === DeploymentStatus.FAILURE || incomingDeployment.status === DeploymentStatus.SUCCESS) { const currentDeployment = current.find( diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 0136c9cab2..b9b56424cc 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -62,7 +62,7 @@ } const openApp = app => { - if (app.lockedBy && app.lockedBy?.email === $auth.user?.email) { + if (app.lockedBy && app.lockedBy?.email !== $auth.user?.email) { notifications.error(`App locked by ${app.lockedBy.email}. Please allow lock to expire or have them unlock this app.`) return } From ee9a097979fa0e23d3d533143ef74b0f70104a4c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 17 May 2021 21:43:50 +0100 Subject: [PATCH 2/2] lint :sparkles: --- packages/auth/src/db/utils.js | 4 +- packages/auth/src/redis/index.js | 1 - .../src/components/deploy/DeployModal.svelte | 40 ++++++++++--------- .../src/components/deploy/RevertModal.svelte | 28 ++++++++----- .../builder/app/[application]/_layout.svelte | 15 ++++++- .../pages/builder/portal/apps/index.svelte | 6 ++- packages/builder/src/stores/portal/index.js | 2 +- .../server/src/api/controllers/application.js | 2 +- packages/server/src/api/controllers/role.js | 3 -- .../worker/src/api/controllers/admin/roles.js | 6 ++- packages/worker/src/api/controllers/app.js | 2 +- 11 files changed, 66 insertions(+), 43 deletions(-) diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index b5e5242cb5..91a682d859 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -166,7 +166,9 @@ exports.getAllApps = async (devApps = false) => { const appDbNames = allDbs.filter(dbName => dbName.startsWith(exports.APP_PREFIX) ) - const appPromises = appDbNames.map(db => new CouchDB(db).get(DocumentTypes.APP_METADATA)) + const appPromises = appDbNames.map(db => + new CouchDB(db).get(DocumentTypes.APP_METADATA) + ) if (appPromises.length === 0) { return [] } else { diff --git a/packages/auth/src/redis/index.js b/packages/auth/src/redis/index.js index 544f2b729b..5db80a216b 100644 --- a/packages/auth/src/redis/index.js +++ b/packages/auth/src/redis/index.js @@ -143,7 +143,6 @@ class RedisWrapper { } async clear() { - const db = this._db let items = await this.scan() await Promise.all(items.map(obj => this.delete(obj.key))) } diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index b64a9a0b0d..869f4d02ce 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -14,7 +14,6 @@ const POLL_INTERVAL = 1000 - let loading = false let feedbackModal let deployments = [] @@ -64,7 +63,10 @@ function checkIncomingDeploymentStatus(current, incoming) { console.log(current, incoming) for (let incomingDeployment of incoming) { - if (incomingDeployment.status === DeploymentStatus.FAILURE || incomingDeployment.status === DeploymentStatus.SUCCESS) { + if ( + incomingDeployment.status === DeploymentStatus.FAILURE || + incomingDeployment.status === DeploymentStatus.SUCCESS + ) { const currentDeployment = current.find( deployment => deployment._id === incomingDeployment._id ) @@ -77,14 +79,17 @@ if (incomingDeployment.status === DeploymentStatus.FAILURE) { notifications.error(incomingDeployment.err) } else { - notifications.send("Published to Production.", "success", "CheckmarkCircle") + notifications.send( + "Published to Production.", + "success", + "CheckmarkCircle" + ) } } - } + } } } - onMount(() => { fetchDeployments() poll = setInterval(fetchDeployments, POLL_INTERVAL) @@ -93,19 +98,16 @@ onDestroy(() => clearInterval(poll)) - - + - - The changes you have made will be published to the production version of the application. - + + The changes you have made will be published to the production version of + the application. + diff --git a/packages/builder/src/components/deploy/RevertModal.svelte b/packages/builder/src/components/deploy/RevertModal.svelte index c35fbd36c2..d10aa95acf 100644 --- a/packages/builder/src/components/deploy/RevertModal.svelte +++ b/packages/builder/src/components/deploy/RevertModal.svelte @@ -1,6 +1,12 @@ - - - The changes you have made will be deleted and the application reverted back to its production state. - + + The changes you have made will be deleted and the application reverted + back to its production state. + diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index ba4181c6cc..53d6e17130 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -1,7 +1,16 @@