From 337f0591b5ee8c71508618db8b3ef7e64d3038d9 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 2 Oct 2020 12:22:49 +0100 Subject: [PATCH] Update settings to use new modal --- .../src/components/settings/Link.svelte | 28 ++++---------- .../{Modal.svelte => SettingsModal.svelte} | 37 +++++-------------- .../settings/tabs/DangerZone.svelte | 24 ++++-------- 3 files changed, 23 insertions(+), 66 deletions(-) rename packages/builder/src/components/settings/{Modal.svelte => SettingsModal.svelte} (56%) diff --git a/packages/builder/src/components/settings/Link.svelte b/packages/builder/src/components/settings/Link.svelte index 1d702d032b..1550815c33 100644 --- a/packages/builder/src/components/settings/Link.svelte +++ b/packages/builder/src/components/settings/Link.svelte @@ -1,31 +1,17 @@ - + + + + diff --git a/packages/builder/src/components/settings/tabs/DangerZone.svelte b/packages/builder/src/components/settings/tabs/DangerZone.svelte index e8b6706d5a..6807f4289e 100644 --- a/packages/builder/src/components/settings/tabs/DangerZone.svelte +++ b/packages/builder/src/components/settings/tabs/DangerZone.svelte @@ -2,6 +2,7 @@ import { params, goto } from "@sveltech/routify" import { Input, TextArea, Button, Body } from "@budibase/bbui" import { del } from "builderStore/api" + import { ModalFooter } from "components/common/Modal" let value = "" let loading = false @@ -9,16 +10,9 @@ async function deleteApp() { loading = true const id = $params.application - const res = await del(`/api/${id}`) - const json = await res.json() - + await del(`/api/${id}`) loading = false - if (res.ok) { - $goto("/") - return json - } else { - throw new Error(json) - } + $goto("/") } @@ -35,13 +29,12 @@ thin disabled={loading} placeholder="" /> - + showCancelButton={false} + confirmText="Delete Entire App" + onConfirm={deleteApp} />