From f2b1125e0ba55425207f2d4280390c73aef86ef5 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 27 Jul 2021 17:34:18 +0200 Subject: [PATCH] rename an app --- .../src/components/start/AppCard.svelte | 4 + .../src/components/start/AppRow.svelte | 2 + .../components/start/UpdateAppModal.svelte | 111 ++++++++++++++++++ .../pages/builder/portal/apps/index.svelte | 14 +++ packages/builder/src/stores/portal/apps.js | 19 +++ 5 files changed, 150 insertions(+) create mode 100644 packages/builder/src/components/start/UpdateAppModal.svelte diff --git a/packages/builder/src/components/start/AppCard.svelte b/packages/builder/src/components/start/AppCard.svelte index e41ffc4469..3e19bfa022 100644 --- a/packages/builder/src/components/start/AppCard.svelte +++ b/packages/builder/src/components/start/AppCard.svelte @@ -15,6 +15,7 @@ export let exportApp export let viewApp export let editApp + export let updateApp export let deleteApp export let unpublishApp export let releaseLock @@ -53,6 +54,9 @@ {/if} {#if !app.deployed} + updateApp(app)} icon="Edit"> + Update + deleteApp(app)} icon="Delete"> Delete diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 85bad84376..f8ecbf3320 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -14,6 +14,7 @@ export let exportApp export let viewApp export let editApp + export let updateApp export let deleteApp export let unpublishApp export let releaseLock @@ -82,6 +83,7 @@ {/if} {#if !app.deployed} + updateApp(app)} icon="Edit">Update deleteApp(app)} icon="Delete">Delete {/if} diff --git a/packages/builder/src/components/start/UpdateAppModal.svelte b/packages/builder/src/components/start/UpdateAppModal.svelte new file mode 100644 index 0000000000..6977b42a32 --- /dev/null +++ b/packages/builder/src/components/start/UpdateAppModal.svelte @@ -0,0 +1,111 @@ + + + + + Give your new app a name, and choose which groups have access (paid plans + only). + + ($touched.name = true)} + on:change={() => dirty = true} + label="Name" + /> + + diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 6c229c1980..02260e19ec 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -14,6 +14,7 @@ Body, } from "@budibase/bbui" import CreateAppModal from "components/start/CreateAppModal.svelte" + import UpdateAppModal from "components/start/UpdateAppModal.svelte" import api, { del } from "builderStore/api" import analytics from "analytics" import { onMount } from "svelte" @@ -30,6 +31,7 @@ let template let selectedApp let creationModal + let updatingModal let deletionModal let unpublishModal let creatingApp = false @@ -164,6 +166,11 @@ selectedApp = null } + const updateApp = async app => { + selectedApp = app + updatingModal.show() + } + const releaseLock = async app => { try { const response = await del(`/api/dev/${app.devId}/lock`) @@ -236,6 +243,7 @@ {editApp} {exportApp} {deleteApp} + {updateApp} /> {/each} @@ -289,6 +297,12 @@ Are you sure you want to unpublish the app {selectedApp?.name}? + + +