From dcd80ac2c47a8371400917ebb04dcea0ed839f97 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 14:08:08 +0100 Subject: [PATCH 1/6] Update deployment status message to not confuse user --- packages/builder/src/components/deploy/DeployModal.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index 6ea7e44981..caa19a4ed7 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -24,11 +24,13 @@ async function deployApp() { try { - notifications.info(`Deployment started. Please wait.`) const response = await api.post("/api/deploy") const json = await response.json() if (response.status !== 200) { + console.log(json) throw new Error() + } else { + notifications.success(`Application published successfully`) } if (analytics.requestFeedbackOnDeploy()) { @@ -36,7 +38,7 @@ } } catch (err) { analytics.captureException(err) - notifications.error("Deployment unsuccessful. Please try again later.") + notifications.error(`Error publishing app: ${err}`) } } From 882c17f38440483bdf9dc42e6141096a1f8dc241 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 14:08:55 +0100 Subject: [PATCH 2/6] Update deployment status message on error --- packages/builder/src/components/deploy/DeployModal.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index caa19a4ed7..400f0dca4f 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -25,10 +25,8 @@ async function deployApp() { try { const response = await api.post("/api/deploy") - const json = await response.json() if (response.status !== 200) { - console.log(json) - throw new Error() + throw new Error(`status ${response.status}`) } else { notifications.success(`Application published successfully`) } From 270de9896cac22f8c9c2d5cbd14a0d81d40962bf Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 14:09:19 +0100 Subject: [PATCH 3/6] Stop / route screen being called Login when set to public access --- .../NavigationPanel/ComponentNavigationTree/PathTree.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte index c9ce885c3e..841d8970f4 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte @@ -14,7 +14,9 @@ const ROUTE_NAME_MAP = { "/": { BASIC: "Home", - PUBLIC: "Login", + PUBLIC: "Home", + ADMIN: "Home", + POWER: "Home", }, } From c5d409d778de82ca2da702f14ae48d017084fe14 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 14:11:45 +0100 Subject: [PATCH 4/6] Add real updated timestamp to app table view --- packages/builder/src/components/start/AppCard.svelte | 2 -- packages/builder/src/components/start/AppRow.svelte | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/start/AppCard.svelte b/packages/builder/src/components/start/AppCard.svelte index c5937c5637..e41ffc4469 100644 --- a/packages/builder/src/components/start/AppCard.svelte +++ b/packages/builder/src/components/start/AppCard.svelte @@ -9,8 +9,6 @@ StatusLight, } from "@budibase/bbui" import { gradient } from "actions" - import { auth } from "stores/portal" - import { AppStatus } from "constants" import { processStringSync } from "@budibase/string-templates" export let app diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 8bc24be624..85bad84376 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -8,6 +8,7 @@ MenuItem, StatusLight, } from "@budibase/bbui" + import { processStringSync } from "@budibase/string-templates" export let app export let exportApp @@ -27,7 +28,13 @@
- Updated {Math.round(Math.random() * 10 + 1)} months ago + {#if app.updatedAt} + {processStringSync("Updated {{ duration time 'millisecond' }} ago", { + time: new Date().getTime() - new Date(app.updatedAt).getTime(), + })} + {:else} + Never updated + {/if}
Date: Mon, 24 May 2021 14:16:28 +0100 Subject: [PATCH 5/6] Implement real sorting by app updated timestamp --- .../builder/src/pages/builder/portal/apps/index.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 7857cd658f..9802d5ec36 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -51,12 +51,16 @@ } return a.status === AppStatus.DEPLOYED ? -1 : 1 }) - } else if (sortBy === "name") { + } else if (sortBy === "updated") { + return enrichedApps.sort((a, b) => { + const aUpdated = a.updatedAt || "9999" + const bUpdated = b.updatedAt || "9999" + return aUpdated < bUpdated ? 1 : -1 + }) + } else { return enrichedApps.sort((a, b) => { return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1 }) - } else { - return enrichedApps } } From b4c0191e2b02387ec742767f3214938f376feb82 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 15:47:55 +0100 Subject: [PATCH 6/6] Add real updated timestamp to non-builder app list --- .../builder/src/pages/builder/apps/index.svelte | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index 7311c112b8..5fb75a43be 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -2,7 +2,6 @@ import { Heading, Layout, - Select, Divider, ActionMenu, MenuItem, @@ -19,6 +18,7 @@ import { gradient } from "actions" import UpdateUserInfoModal from "components/settings/UpdateUserInfoModal.svelte" import ChangePasswordModal from "components/settings/ChangePasswordModal.svelte" + import { processStringSync } from "@budibase/string-templates" let loaded = false let userInfoModal @@ -83,7 +83,18 @@
{app.name} - Updated {Math.round(Math.random() * 10 + 1)} months ago + {#if app.updatedAt} + {processStringSync( + "Updated {{ duration time 'millisecond' }} ago", + { + time: + new Date().getTime() - + new Date(app.updatedAt).getTime(), + } + )} + {:else} + Never updated + {/if}