From fa116cedd9ad2e726307f40a8880034912daa752 Mon Sep 17 00:00:00 2001 From: MehringTing Date: Mon, 16 Dec 2024 14:20:01 +0800 Subject: [PATCH 1/2] feat(web): create tags on the fly a --- web/src/lib/components/forms/tag-asset-form.svelte | 2 +- web/src/lib/components/shared-components/combobox.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/lib/components/forms/tag-asset-form.svelte b/web/src/lib/components/forms/tag-asset-form.svelte index eb208ea6e2..3c8c900656 100644 --- a/web/src/lib/components/forms/tag-asset-form.svelte +++ b/web/src/lib/components/forms/tag-asset-form.svelte @@ -37,7 +37,7 @@ selectedIds.add(option.value); } else { const [newTag] = await upsertTags({ tagUpsertDto: { tags: [option.label] } }); - allTags = await getAllTags(); + allTags.push(newTag); selectedIds.add(newTag.id); } }; diff --git a/web/src/lib/components/shared-components/combobox.svelte b/web/src/lib/components/shared-components/combobox.svelte index fe1efe32e1..54f16c1979 100644 --- a/web/src/lib/components/shared-components/combobox.svelte +++ b/web/src/lib/components/shared-components/combobox.svelte @@ -362,7 +362,7 @@ id={`${listboxId}-${0}`} onclick={() => closeDropdown()} > - {allowCreate ? searchQuery : 112} + {allowCreate ? searchQuery : $t('no_results')} {/if} {#each filteredOptions as option, index (option.id || option.label)} From 160345899927464ce4a7b7de397d033fd4c3875d Mon Sep 17 00:00:00 2001 From: MehringTing Date: Tue, 24 Dec 2024 13:54:15 +0800 Subject: [PATCH 2/2] clean unused code and add comments --- web/src/lib/components/forms/tag-asset-form.svelte | 11 ----------- .../lib/components/shared-components/combobox.svelte | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/web/src/lib/components/forms/tag-asset-form.svelte b/web/src/lib/components/forms/tag-asset-form.svelte index 3c8c900656..3419e62a18 100644 --- a/web/src/lib/components/forms/tag-asset-form.svelte +++ b/web/src/lib/components/forms/tag-asset-form.svelte @@ -53,17 +53,6 @@ -
-

- -

-
void; }