From 463cee560b51d4d3d6cdaf36fd03a257d4ee5e4d Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Tue, 21 Nov 2023 13:19:19 +0000 Subject: [PATCH 1/5] Disable preview and publish for apps with no screens (#12384) * disable preview and publish for apps with no screens * PR feedback * linting * PR Feedback --- packages/bbui/src/Link/Link.svelte | 3 +- .../src/components/deploy/AppActions.svelte | 16 ++++- .../portal/apps/[appId]/ErrorSVG.svelte | 65 +++++++++++++++++++ .../builder/portal/apps/[appId]/index.svelte | 50 +++++++++++++- 4 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/apps/[appId]/ErrorSVG.svelte diff --git a/packages/bbui/src/Link/Link.svelte b/packages/bbui/src/Link/Link.svelte index 5eaeceaf76..58f999473a 100644 --- a/packages/bbui/src/Link/Link.svelte +++ b/packages/bbui/src/Link/Link.svelte @@ -16,10 +16,9 @@ const dispatch = createEventDispatcher() - const onClick = e => { + const onClick = () => { if (!disabled) { dispatch("click") - e.stopPropagation() } } diff --git a/packages/builder/src/components/deploy/AppActions.svelte b/packages/builder/src/components/deploy/AppActions.svelte index 7259e7e402..7d14fd0e87 100644 --- a/packages/builder/src/components/deploy/AppActions.svelte +++ b/packages/builder/src/components/deploy/AppActions.svelte @@ -20,7 +20,12 @@ import analytics, { Events, EventSource } from "analytics" import { API } from "api" import { apps } from "stores/portal" - import { deploymentStore, store, isOnlyUser } from "builderStore" + import { + deploymentStore, + store, + isOnlyUser, + sortedScreens, + } from "builderStore" import TourWrap from "components/portal/onboarding/TourWrap.svelte" import { TOUR_STEP_KEYS } from "components/portal/onboarding/tours.js" import { goto } from "@roxi/routify" @@ -48,7 +53,7 @@ $store.upgradableVersion && $store.version && $store.upgradableVersion !== $store.version - $: canPublish = !publishing && loaded + $: canPublish = !publishing && loaded && $sortedScreens.length > 0 $: lastDeployed = getLastDeployedString($deploymentStore) const initialiseApp = async () => { @@ -175,7 +180,12 @@
- + Preview
diff --git a/packages/builder/src/pages/builder/portal/apps/[appId]/ErrorSVG.svelte b/packages/builder/src/pages/builder/portal/apps/[appId]/ErrorSVG.svelte new file mode 100644 index 0000000000..1366484495 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/apps/[appId]/ErrorSVG.svelte @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/builder/src/pages/builder/portal/apps/[appId]/index.svelte b/packages/builder/src/pages/builder/portal/apps/[appId]/index.svelte index 1458b69aec..e87c1104dd 100644 --- a/packages/builder/src/pages/builder/portal/apps/[appId]/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/[appId]/index.svelte @@ -1,8 +1,10 @@
@@ -45,6 +59,7 @@ {/if} window.open(iframeUrl, "_blank")} @@ -52,7 +67,19 @@ Fullscreen
-