Skip to content

Commit 502e07b

Browse files
yoiteyouCYan1203
andauthored
feat(community): fix discussion list bug and improve icon implementation (#1089)
Co-authored-by: niuran <[email protected]>
1 parent cd7e22a commit 502e07b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed
Lines changed: 4 additions & 0 deletions
Loading

frontend/src/components/community/CommunityPage.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@
5353
const discussionCreateEndpoint = `/${this.repoType}s/${this.repoPath}/discussions`
5454
const { data, error } = await useFetchApi(discussionCreateEndpoint).json()
5555
if (data.value) {
56-
this.cards = data.value.data.discussions || []
56+
const discussions = data.value.data.discussions || []
57+
this.cards = discussions.sort((a, b) => b.id - a.id)
5758
} else {
5859
ElMessage({
5960
message: error.value.msg,
6061
type: 'warning'
6162
})
6263
}
6364
}
65+
},
66+
mounted() {
67+
this.getDiscussion()
6468
}
6569
}
6670
</script>

frontend/src/components/community/DiscussionDetails.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<template #dropdown>
3737
<el-dropdown-menu>
3838
<el-dropdown-item @click="quote(comment.content)">
39-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g opacity="0.12"><path d="M6.66658 11.2C6.66658 11.9467 6.66658 12.3201 6.52126 12.6053C6.39343 12.8562 6.18946 13.0602 5.93857 13.188C5.65336 13.3333 5.27999 13.3333 4.53325 13.3333H3.46659C2.71985 13.3333 2.34648 13.3333 2.06126 13.188C1.81038 13.0602 1.60641 12.8562 1.47858 12.6053C1.33325 12.3201 1.33325 11.9467 1.33325 11.2L1.33325 10.1333C1.33325 9.3866 1.33325 9.01323 1.47858 8.72801C1.60641 8.47713 1.81038 8.27316 2.06126 8.14532C2.34648 8 2.71985 8 3.46659 8H4.53325C5.27999 8 5.65336 8 5.93857 8.14532C6.18946 8.27316 6.39343 8.47713 6.52126 8.72801C6.66658 9.01323 6.66658 9.3866 6.66658 10.1333V11.2Z" fill="#2F384C"/><path d="M14.6666 11.2C14.6666 11.9467 14.6666 12.3201 14.5213 12.6053C14.3934 12.8562 14.1895 13.0602 13.9386 13.188C13.6534 13.3333 13.28 13.3333 12.5333 13.3333L11.4666 13.3333C10.7198 13.3333 10.3465 13.3333 10.0613 13.188C9.81038 13.0602 9.60641 12.8562 9.47858 12.6053C9.33325 12.3201 9.33325 11.9467 9.33325 11.2V10.1333C9.33325 9.3866 9.33325 9.01323 9.47858 8.72801C9.60641 8.47713 9.81038 8.27316 10.0613 8.14532C10.3465 8 10.7198 8 11.4666 8L12.5333 8C13.28 8 13.6534 8 13.9386 8.14532C14.1895 8.27316 14.3934 8.47713 14.5213 8.72801C14.6666 9.01323 14.6666 9.3866 14.6666 10.1333V11.2Z" fill="#2F384C"/></g><path d="M1.33325 10.6665L1.33325 7.98414C1.33325 7.00577 1.33325 6.51659 1.44377 6.05624C1.54176 5.6481 1.70338 5.25792 1.92269 4.90003C2.17006 4.49636 2.51596 4.15046 3.20777 3.45865L3.99992 2.6665M9.33325 10.6665V7.98414C9.33325 7.00577 9.33325 6.51659 9.44377 6.05624C9.54176 5.6481 9.70338 5.25792 9.92269 4.90003C10.1701 4.49636 10.516 4.15046 11.2078 3.45865L11.9999 2.6665M12.5333 13.3332H11.4666C10.7198 13.3332 10.3465 13.3332 10.0613 13.1878C9.81038 13.06 9.60641 12.856 9.47858 12.6052C9.33325 12.3199 9.33325 11.9466 9.33325 11.1998V10.1332C9.33325 9.38643 9.33325 9.01307 9.47858 8.72785C9.60641 8.47697 9.81038 8.27299 10.0613 8.14516C10.3465 7.99984 10.7198 7.99984 11.4666 7.99984L12.5332 7.99984C13.28 7.99984 13.6534 7.99984 13.9386 8.14516C14.1895 8.27299 14.3934 8.47697 14.5213 8.72785C14.6666 9.01307 14.6666 9.38643 14.6666 10.1332V11.1998C14.6666 11.9466 14.6666 12.3199 14.5213 12.6052C14.3934 12.856 14.1895 13.06 13.9386 13.1878C13.6534 13.3332 13.28 13.3332 12.5333 13.3332ZM4.53325 7.99984H3.46659C2.71985 7.99984 2.34648 7.99984 2.06126 8.14516C1.81038 8.27299 1.60641 8.47697 1.47858 8.72785C1.33325 9.01307 1.33325 9.38643 1.33325 10.1332L1.33325 11.1998C1.33325 11.9466 1.33325 12.3199 1.47858 12.6052C1.60641 12.856 1.81038 13.06 2.06126 13.1878C2.34648 13.3332 2.71985 13.3332 3.46659 13.3332H4.53325C5.27999 13.3332 5.65336 13.3332 5.93857 13.1878C6.18946 13.06 6.39343 12.856 6.52126 12.6052C6.66658 12.3199 6.66658 11.9466 6.66658 11.1998V10.1332C6.66658 9.38643 6.66658 9.01307 6.52126 8.72785C6.39343 8.47697 6.18946 8.27299 5.93857 8.14516C5.65336 7.99984 5.27999 7.99984 4.53325 7.99984Z" stroke="#2F384C" stroke-linecap="round" stroke-linejoin="round"/></svg>
39+
<SvgIcon name="discussion-replay-icon" class="w-[16px] h-[16px]" />
4040
<span class="ml-[4px]">{{ $t('community.discussionDetail.reply') }}</span>
4141
</el-dropdown-item>
4242
</el-dropdown-menu>

0 commit comments

Comments
 (0)