From b9514970742fc5d9f375a18ad7ca151d8643830a Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 10 Aug 2023 22:07:18 +0200 Subject: [PATCH] fix: create deployment dropdown --- src/lib/commandCenter/searchers/functions.ts | 4 +- .../function-[function]/+layout.svelte | 5 +-- .../function-[function]/+page.svelte | 41 ++++++++++--------- .../function-[function]/create.svelte | 24 +++++++---- .../function-[function]/createManual.svelte | 2 +- .../functions/function-[function]/store.ts | 2 + 6 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/lib/commandCenter/searchers/functions.ts b/src/lib/commandCenter/searchers/functions.ts index f9626a9aa..cb5f23646 100644 --- a/src/lib/commandCenter/searchers/functions.ts +++ b/src/lib/commandCenter/searchers/functions.ts @@ -5,7 +5,7 @@ import { get } from 'svelte/store'; import type { Searcher } from '../commands'; import type { Models } from '@appwrite.io/console'; import { page } from '$app/stores'; -import { showCreateDeployment } from '$routes/console/project-[project]/functions/function-[function]/+page.svelte'; +import { showCreateDeployment } from '$routes/console/project-[project]/functions/function-[function]/store'; const getFunctionCommand = (fn: Models.Function, projectId: string) => { return { @@ -37,7 +37,7 @@ export const functionsSearcher = (async (query: string) => { if (!$page.url.pathname.endsWith(func.$id)) { await goto(`/console/project-${projectId}/functions/function-${func.$id}`); } - showCreateDeployment(); + showCreateDeployment.set(true); }, group: 'functions', icon: 'plus' diff --git a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte index 46c1233ba..c12446590 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+layout.svelte @@ -1,11 +1,10 @@ - - - { showCreateGit = true; - showCreate = false; + show = false; }}>Git { showCreateCli = true; - showCreate = false; + show = false; }}>CLI { showCreateManual = true; - showCreate = false; + show = false; }}>Manual diff --git a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte index f0d8249bf..136588a97 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/createManual.svelte @@ -49,7 +49,7 @@ - Create Deployment + Create deployment = writable(false);