From c6514d3f2accd35d9a3c12f0c64573cf11eb11fb Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Fri, 11 Aug 2023 15:41:20 -0400 Subject: [PATCH] adds card details view --- ui/src/CardDetails.svelte | 458 ++++++++++++++++++++++++++++++++++++++ ui/src/KanDoPane.svelte | 68 +++--- 2 files changed, 487 insertions(+), 39 deletions(-) create mode 100644 ui/src/CardDetails.svelte diff --git a/ui/src/CardDetails.svelte b/ui/src/CardDetails.svelte new file mode 100644 index 0000000..0e5318a --- /dev/null +++ b/ui/src/CardDetails.svelte @@ -0,0 +1,458 @@ + +{ + e.preventDefault() + inputElement.focus() + }} + on:sl-request-close={(event)=>{ + if (event.detail.source === 'overlay') { + event.preventDefault(); + }}}> +
+ +
+
+ {#if editingTitle} + props.title = e.target.value} + on:sl-blur={()=>{handleSave(props); editingTitle=false}} + > + {:else} +
+

{editingTitle = true}}>{props.title}

+ +
+ {/if} +
{close()}} + > + +
+
+ +

Description

+ + {#if editingDescription} + editDesc = e.target.value} + > +
+ cancelEditDescription()}> + Cancel + + { + props.description = editDesc + handleSave(props) + editingDescription=false}}> + Save + +
+ {:else} +
+
editDescription()}>{@html Marked.parse(props.description)}
+
+ editDescription()}> + Edit + +
+
+ {/if} + + +
+ {#if categories.length > 0} + +
+ { + setCategory(e.target.value) + }} + > + No Category + {#each categories as category } + {category.name} + {/each} + + + {#if props.category} +
+ {/if} +
+ {/if} + {#if labelTypes.length > 0} +
+ + { + props.labels= labelSelect.value + handleSave(props) + }} + value={selectedLabels.map(l=>l.value)} + label="Labels" + multiple + > + {#each labelOptions as option} + {option.label} + {/each} + + + +
+ {/if} + {#if Object.keys($avatars).length > 0} +
+ { + selectedAvatars = e.target.value + setAgents() + }} + multiple + > + {#each avatarNames() as avatar} + {avatar.label} + {/each} + + +
+ {/if} + + +
+ { + commentDialog.hide() + }}> + Cancel + + { + if (commenting=="new") + addComment(commentingCardId, commentText.value) + else { + updateComment(commentingCardId, commenting, commentText.value) + } + commentDialog.hide() + }}> + Save + +
+
+ +
+

Comments

+ + newComment(cardId)}> +
+
+
+
+ +
+ {#if card} + {#each card.comments as comment} +
+
+
+ {store.timeAgo.format(new Date(comment.timestamp))} + {#if comment.agent==store.myAgentPubKey()} +
+
editComment(cardId, comment)} + > + +
+
deleteComment(cardId, comment.id)} + > + +
+
+ {/if} +
+ {@html Marked.parse(comment.text)} +
+ {/each} + {/if} +
+
+ +
+ {#if handleDelete} + handleDelete(cardId)}> + Delete + + {/if} + {#if handleArchive} + {close();handleArchive()}}> + Archive + + {/if} + {close();}}> + Close + +
+
+
+ diff --git a/ui/src/KanDoPane.svelte b/ui/src/KanDoPane.svelte index 633cb0c..3267866 100644 --- a/ui/src/KanDoPane.svelte +++ b/ui/src/KanDoPane.svelte @@ -1,6 +1,7 @@