From 5742f15e28da22c7804878a9e99877d332c7708f Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 10 Nov 2023 13:04:20 +0100 Subject: [PATCH] Refactor Issue actions and related components --- src/components/Comment.svelte | 68 +-- src/components/CommentToggleInput.svelte | 23 +- src/components/ReactionSelector.svelte | 17 +- src/components/Reactions.svelte | 22 +- src/components/Thread.svelte | 85 +-- src/lib/reactions.ts | 17 + src/views/projects/Cob/AssigneeInput.svelte | 25 +- src/views/projects/Cob/CobHeader.svelte | 51 +- src/views/projects/Cob/CobStateButton.svelte | 10 +- src/views/projects/Cob/LabelInput.svelte | 26 +- src/views/projects/Issue.svelte | 565 ++++++++++--------- src/views/projects/Issue/New.svelte | 61 +- tests/e2e/project/issues.spec.ts | 2 +- 13 files changed, 521 insertions(+), 451 deletions(-) create mode 100644 src/lib/reactions.ts diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index f1da05c52..976edb92c 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -1,9 +1,10 @@
- {#each reactions as [reaction, nids]} + {#each reactions as [reaction, { all: nids }]} { - if (clickable) { - dispatch("remove", { nids, reaction }); + on:click={async () => { + if (handleReaction) { + await handleReaction(nids, reaction); } }}>
diff --git a/src/components/Thread.svelte b/src/components/Thread.svelte index 3d537c4c1..3f2fa25dd 100644 --- a/src/components/Thread.svelte +++ b/src/components/Thread.svelte @@ -1,18 +1,50 @@ - + +