From ffc4a890e157cd9f0407b70b1b4460cc606f769b Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Fri, 31 Mar 2023 22:23:52 +0530 Subject: [PATCH 1/4] Added Rebuild button for function view when build fails during deployment. --- .../function-[function]/+page.svelte | 18 ++++++++ .../function-[function]/rebuild.svelte | 46 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index 4bf39c8279..bbadee285d 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -32,6 +32,7 @@ import type { PageData } from './$types'; import Delete from './delete.svelte'; import Create from './create.svelte'; + import Rebuild from './rebuild.svelte'; import Activate from './activate.svelte'; import { browser } from '$app/environment'; import { sdk } from '$lib/stores/sdk'; @@ -44,6 +45,7 @@ let showDropdown = []; let showDelete = false; let showActivate = false; + let showRebuild = false; let selectedDeployment: Models.Deployment = null; @@ -51,6 +53,10 @@ invalidate(Dependencies.DEPLOYMENTS); } + function handleRebuild() { + invalidate(Dependencies.DEPLOYMENTS); + } + $: activeDeployment = data.deployments.deployments.find((d) => d.$id === $func?.deployment); if (browser) { @@ -215,6 +221,17 @@ }}> Activate + {#if ['failed'].includes(deployment.status)} + { + selectedDeployment = deployment; + showRebuild = true; + showDropdown = []; + }}> + Re-Build + + {/if} { @@ -281,4 +298,5 @@ {#if selectedDeployment} + {/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte new file mode 100644 index 0000000000..341c32fc2a --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte @@ -0,0 +1,46 @@ + + + + Re-build Deployment +

Are you sure you want to re-build this deployment?

+ + + + +
From 2120d77f27964ecab7d048607c2ca9d107fc5d72 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Sun, 16 Apr 2023 15:55:48 +0530 Subject: [PATCH 2/4] Updating Re-Build to Retry Build --- .../functions/function-[function]/+page.svelte | 4 ++-- .../functions/function-[function]/rebuild.svelte | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index bbadee285d..119a813a4b 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -221,7 +221,7 @@ }}> Activate
- {#if ['failed'].includes(deployment.status)} + {#if 'failed' === deployment.status} { @@ -229,7 +229,7 @@ showRebuild = true; showDropdown = []; }}> - Re-Build + Retry Build {/if} - Re-build Deployment -

Are you sure you want to re-build this deployment?

+ Retry build Deployment +

Are you sure you want to retry build this deployment?

- +
From 25299adfc339c788ae58a48850ddc4f27029b610 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Fri, 21 Apr 2023 22:25:54 +0530 Subject: [PATCH 3/4] Updated library name from @aw-labs/appwrite-console to @appwrite.io/console for rebuild.svelte --- .../functions/function-[function]/rebuild.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte index 877a06e6ce..255e50e49e 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte @@ -4,7 +4,7 @@ import { Button } from '$lib/elements/forms'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; - import type { Models } from '@aw-labs/appwrite-console'; + import type { Models } from '@appwrite.io/console'; import { createEventDispatcher } from 'svelte'; export let showRebuild = false; From 9ef1cef8d3e8936aa5a6e85622c76d85d74388e8 Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Wed, 26 Apr 2023 23:38:24 +0530 Subject: [PATCH 4/4] Fixing the typo for rebuild Modal --- .../functions/function-[function]/rebuild.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte index 255e50e49e..a3d1b4e1d6 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/rebuild.svelte @@ -37,8 +37,8 @@ - Retry build Deployment -

Are you sure you want to retry build this deployment?

+ Retry build +

Are you sure you want to retry building this deployment?