From 6e67c57035c9fd2bf5f7d589f2b6ff019afa2536 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Wed, 7 Feb 2024 22:08:15 +0700 Subject: [PATCH] UBERF-5348: Fix new status creation (#4567) Signed-off-by: Andrey Sobolev --- packages/ui/src/components/ButtonMenu.svelte | 4 +- packages/ui/src/components/EmojiPopup.svelte | 6 +- .../src/components/CreateStatePopup.svelte | 143 +++++++++++------- .../components/state/StatePresenter.svelte | 28 ++-- .../state/StatesProjectEditor.svelte | 135 ++--------------- .../taskTypes/TaskTypeEditor.svelte | 25 ++- .../src/components/IconPicker.svelte | 1 + 7 files changed, 144 insertions(+), 198 deletions(-) diff --git a/packages/ui/src/components/ButtonMenu.svelte b/packages/ui/src/components/ButtonMenu.svelte index c46c5ce997..3285af1741 100644 --- a/packages/ui/src/components/ButtonMenu.svelte +++ b/packages/ui/src/components/ButtonMenu.svelte @@ -13,12 +13,12 @@ // limitations under the License. --> { @@ -157,28 +186,19 @@
- - -
-
- - + on:selected={(it) => { + category = it.detail + }} + />
@@ -192,9 +212,17 @@ kind={'secondary'} size={'small'} on:selected={(event) => { - if (event.detail) selected = items.findIndex((it) => it.id === event.detail) + if (event.detail) { + selected = items.findIndex((it) => it.id === event.detail) + if (selected === 1) { + icon = undefined + } + } }} /> + {#if icon === iconWithEmoji} + + {/if}
{#if selected === 0} @@ -204,13 +232,16 @@ columns={'auto'} on:close={(evt) => { color = evt.detail + icon = undefined }} /> {:else} { color = evt.detail.codePointAt(0) + icon = iconWithEmoji }} /> {/if} diff --git a/plugins/task-resources/src/components/state/StatePresenter.svelte b/plugins/task-resources/src/components/state/StatePresenter.svelte index 0abb4dcf8e..afda5fe411 100644 --- a/plugins/task-resources/src/components/state/StatePresenter.svelte +++ b/plugins/task-resources/src/components/state/StatePresenter.svelte @@ -15,6 +15,7 @@ --> {#if value} diff --git a/plugins/task-resources/src/components/state/StatesProjectEditor.svelte b/plugins/task-resources/src/components/state/StatesProjectEditor.svelte index 8a29d6e507..c5ee4eee1a 100644 --- a/plugins/task-resources/src/components/state/StatesProjectEditor.svelte +++ b/plugins/task-resources/src/components/state/StatesProjectEditor.svelte @@ -13,36 +13,21 @@ // limitations under the License. --> @@ -224,27 +130,15 @@
{#each states as state, i} - {@const color = getColor(type, state, categoriesMap)} -