You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2025/09/09 02:23:07 UTC
(answer) branch test updated (7f9af840 -> d738ec21)
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git
from 7f9af840 fix: Fix username verification prompt
new f7099684 fix: fixed the incorrect link of the user who was replied in the comment
new d738ec21 feat: add /tags/:tagName/questions route
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
i18n/en_US.yaml | 1 +
ui/src/components/Comment/index.tsx | 17 ++++++++++++-----
ui/src/pages/Tags/Detail/index.tsx | 16 +++++++++++++---
ui/src/router/routes.ts | 4 ++++
4 files changed, 30 insertions(+), 8 deletions(-)
(answer) 02/02: feat: add /tags/:tagName/questions route
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git
commit d738ec2121f350dbfff8804c7b42b00fc820b152
Author: shuai <li...@sifou.com>
AuthorDate: Tue Sep 9 10:22:50 2025 +0800
feat: add /tags/:tagName/questions route
---
i18n/en_US.yaml | 1 +
ui/src/pages/Tags/Detail/index.tsx | 16 +++++++++++++---
ui/src/router/routes.ts | 4 ++++
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 6803f196..8066f186 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -852,6 +852,7 @@ ui:
http_50X: HTTP Error 500
http_403: HTTP Error 403
logout: Log Out
+ posts: Posts
notifications:
title: Notifications
inbox: Inbox
diff --git a/ui/src/pages/Tags/Detail/index.tsx b/ui/src/pages/Tags/Detail/index.tsx
index 8bfd5ee8..dc475667 100644
--- a/ui/src/pages/Tags/Detail/index.tsx
+++ b/ui/src/pages/Tags/Detail/index.tsx
@@ -24,6 +24,7 @@ import {
Link,
useNavigate,
useSearchParams,
+ useMatch,
} from 'react-router-dom';
import { useTranslation } from 'react-i18next';
@@ -65,6 +66,8 @@ const Index: FC = () => {
tagInfo?.tag_id,
tagInfo?.status,
);
+ const matchQuestions = useMatch('/tags/:tagName/questions');
+ const matchPosts = useMatch('/tags/:tagName');
const toggleFollow = () => {
if (!guard.tryNormalLogged(true)) {
return;
@@ -100,9 +103,16 @@ const Index: FC = () => {
}, [tagResp, followResp]);
let pageTitle = '';
if (tagInfo?.display_name) {
- pageTitle = `'${tagInfo.display_name}' ${t('questions', {
- keyPrefix: 'page_title',
- })}`;
+ if (matchQuestions) {
+ pageTitle = `'${tagInfo.display_name}' ${t('questions', {
+ keyPrefix: 'page_title',
+ })}`;
+ }
+ if (matchPosts) {
+ pageTitle = `'${tagInfo.display_name}' ${t('posts', {
+ keyPrefix: 'page_title',
+ })}`;
+ }
}
const keywords: string[] = [];
if (tagInfo?.slug_name) {
diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts
index 3e324815..09ea4838 100644
--- a/ui/src/router/routes.ts
+++ b/ui/src/router/routes.ts
@@ -140,6 +140,10 @@ const routes: RouteNode[] = [
path: 'tags/:tagName',
page: 'pages/Tags/Detail',
},
+ {
+ path: 'tags/:tagName/questions',
+ page: 'pages/Tags/Detail',
+ },
{
path: 'tags/:tagName/info',
page: 'pages/Tags/Info',
(answer) 01/02: fix: fixed the incorrect link of the user who was replied in the comment
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git
commit f7099684633259a96156cacbed8c5ee2a5a810a3
Author: shuai <li...@sifou.com>
AuthorDate: Tue Sep 9 10:11:41 2025 +0800
fix: fixed the incorrect link of the user who was replied in the comment
---
ui/src/components/Comment/index.tsx | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx
index 2a052e28..ec42c562 100644
--- a/ui/src/components/Comment/index.tsx
+++ b/ui/src/components/Comment/index.tsx
@@ -417,11 +417,18 @@ const Comment: FC<IProps> = ({ objectId, mode, commentId, children }) => {
/>
) : (
<div className="d-block">
- {item.reply_user_display_name && (
- <Link to="." className="small me-1 text-nowrap">
- @{item.reply_user_display_name}
- </Link>
- )}
+ {item.reply_user_display_name &&
+ (item.reply_user_status !== 'deleted' ? (
+ <Link
+ to={`/users/${item.reply_username}`}
+ className="small me-1 text-nowrap">
+ @{item.reply_user_display_name}
+ </Link>
+ ) : (
+ <span className="small me-1 text-nowrap">
+ @{item.reply_user_display_name}
+ </span>
+ ))}
<div
className="fmt small text-break text-wrap"