mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Add review comments and replies
This commit is contained in:
@@ -525,6 +525,12 @@
|
||||
</div>
|
||||
</CommentComponent>
|
||||
</div>
|
||||
{#if review.threads.length > 0}
|
||||
{#each review.threads as thread}
|
||||
<div class="connector"></div>
|
||||
<Thread {baseUrl} {thread} rawPath={rawPath(revisionBase)} />
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -15,8 +15,12 @@
|
||||
replies: Comment[];
|
||||
}
|
||||
|
||||
interface ReviewWithThreads extends Review {
|
||||
threads: Thread[];
|
||||
}
|
||||
|
||||
interface TimelineReview {
|
||||
inner: [string, Review];
|
||||
inner: [string, ReviewWithThreads];
|
||||
type: "review";
|
||||
timestamp: number;
|
||||
}
|
||||
@@ -186,11 +190,21 @@
|
||||
revisionDescription: rev.description,
|
||||
},
|
||||
[
|
||||
...rev.reviews.map<TimelineReview>(review => ({
|
||||
timestamp: review.timestamp,
|
||||
type: "review",
|
||||
inner: [review.author.id, review],
|
||||
})),
|
||||
...rev.reviews.map<TimelineReview>(review => {
|
||||
const reviewThreads: Thread[] = review.comments
|
||||
.filter(comment => !comment.replyTo)
|
||||
.map(thread => ({
|
||||
root: thread,
|
||||
replies: review.comments
|
||||
.filter(comment => comment.replyTo === thread.id)
|
||||
.sort((a, b) => a.timestamp - b.timestamp),
|
||||
}));
|
||||
return {
|
||||
timestamp: review.timestamp,
|
||||
type: "review",
|
||||
inner: [review.author.id, { ...review, threads: reviewThreads }],
|
||||
};
|
||||
}),
|
||||
...patch.merges
|
||||
.filter(merge => merge.revision === rev.id)
|
||||
.map<TimelineMerge>(inner => ({
|
||||
|
||||
Reference in New Issue
Block a user