From 076fc7046d8feeb3499d814025b4464dc4e5063c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 7 Jan 2024 13:38:27 +0100 Subject: [PATCH] Fix TypeAheadSearch.svelte, Remove Logout --- .../admin/components/TypeAheadSearch.svelte | 5 +++-- src/components/admin/pages/Edit.svelte | 4 ++-- src/components/admin/pages/Home.svelte | 15 --------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/components/admin/components/TypeAheadSearch.svelte b/src/components/admin/components/TypeAheadSearch.svelte index 4631d31..27ad50c 100644 --- a/src/components/admin/components/TypeAheadSearch.svelte +++ b/src/components/admin/components/TypeAheadSearch.svelte @@ -23,6 +23,7 @@ export let selected: string | null = null export let items: {name: string, value: string}[] = [] export let maxItems = 5; + export let leftText: boolean = false; export let searchValue = items.find(item => item.value === selected)?.name || '' let open = false @@ -36,13 +37,13 @@ } - +
open = true} on:keydown={() => open = true}/>
{#each filteredItems as item (item)} - {/each} diff --git a/src/components/admin/pages/Edit.svelte b/src/components/admin/pages/Edit.svelte index 0161760..98346e2 100644 --- a/src/components/admin/pages/Edit.svelte +++ b/src/components/admin/pages/Edit.svelte @@ -34,7 +34,7 @@ let searchValue: string = ""; let dirty = false; - let selectedPath: string = ""; + let selectedPath: string | null = null; let pathSearchValue: string = ""; $: availableBranches = $branches.map((branch) => ({ @@ -121,7 +121,7 @@
- ({value, name: value}))} bind:selected={selectedPath} bind:searchValue={pathSearchValue} maxItems={Number.MAX_VALUE} /> + ({value, name: value}))} bind:selected={selectedPath} bind:searchValue={pathSearchValue} maxItems={Number.MAX_VALUE} leftText={true} />
{#if selectedBranch !== "master"} diff --git a/src/components/admin/pages/Home.svelte b/src/components/admin/pages/Home.svelte index 927ed61..567ebcb 100644 --- a/src/components/admin/pages/Home.svelte +++ b/src/components/admin/pages/Home.svelte @@ -28,13 +28,7 @@ let events = $eventRepo.listEvents() let showAdd = false - let showLogoutModal = false let millis = Date.now() - - function logout() { - $tokenStore = "" - replace("/login") - } @@ -47,20 +41,11 @@ Edit Pages Permissions - showLogoutModal = true} class="cursor-pointer select-none">Logout events = $eventRepo.listEvents()}/> - -

Do you really want to logout?

- - - - -
- {#await events}