From d02c910d69de9d124cb8d3a87f6aca88b990a191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B0=B8=E5=BC=BA?= <11704063+s-yongqiang@user.noreply.gitee.com> Date: Thu, 28 Nov 2024 18:31:04 +0800 Subject: [PATCH] optimize ui --- frontend/src/components/common/notice-item.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/frontend/src/components/common/notice-item.js b/frontend/src/components/common/notice-item.js index a9869b1df89..07ef05920f7 100644 --- a/frontend/src/components/common/notice-item.js +++ b/frontend/src/components/common/notice-item.js @@ -368,9 +368,20 @@ class NoticeItem extends React.Component { let avatar_url = detail.avatar_url; let notice = detail.comment; let username = detail.user_name; + let is_resolved = detail.is_resolved; + let sdoc_name = detail.sdoc_name; + const repo_id = detail.repo_id; + const sdoc_path = detail.sdoc_path; + const sdoc_href = siteRoot + 'lib/' + repo_id + '/file' + sdoc_path; + let sdoc_link = '' + sdoc_name + ''; processor.process(notice, (error, vfile) => { notice = String(vfile); }); + if (is_resolved) { + notice = 'Marked "' + detail.resolve_comment + '" as resolved in document ' + sdoc_link; + } else { + notice = 'Added a new comment in document ' + sdoc_link + ':' + notice; + } return { avatar_url, username, notice }; } @@ -378,9 +389,20 @@ class NoticeItem extends React.Component { let avatar_url = detail.avatar_url; let notice = detail.reply; let username = detail.user_name; + let is_resolved = detail.is_resolved; + let sdoc_name = detail.sdoc_name; + const repo_id = detail.repo_id; + const sdoc_path = detail.sdoc_path; + const sdoc_href = siteRoot + 'lib/' + repo_id + '/file' + sdoc_path; + let sdoc_link = '' + sdoc_name + ''; processor.process(notice, (error, vfile) => { notice = String(vfile); }); + if (is_resolved) { + notice = 'Marked "' + detail.resolve_comment + '" as resolved in document ' + sdoc_link; + } else { + notice = 'Added a new reply in document ' + sdoc_link + ':' + notice; + } return { avatar_url, username, notice }; }