Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: question detail closed reason

shuai9dfba0a79fbf
diff --git a/ui/src/hooks/useReportModal/index.tsx b/ui/src/hooks/useReportModal/index.tsx
index 88b975f6..0424cfc4 100644
--- a/ui/src/hooks/useReportModal/index.tsx
+++ b/ui/src/hooks/useReportModal/index.tsx
@@ -187,6 +187,11 @@ const useReportModal = (callback?: () => void) => {
}
value={content.value}
isInvalid={content.isInvalid}
+ placeholder={
+ item.content_type === 'text'
+ ? t('input_placeholder')
+ : t('textarea_placeholder')
+ }
onChange={(e) =>
setContent({
value: e.target.value,
diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json
index ea5385a1..31f561ff 100644
--- a/ui/src/i18n/locales/en.json
+++ b/ui/src/i18n/locales/en.json
@@ -199,7 +199,9 @@
},
"msg": {
"empty": "Please select a reason."
- }
+ },
+ "input_placeholder": "Enter the existing question link",
+ "textarea_placeholder": "Let us know specifically what you are concerned about"
},
"tag_modal": {
"title": "Create New Tag",
@@ -590,6 +592,8 @@
"edit": "edit",
"Views": "Views",
"answered": "answered",
+ "closed_in": "Closed in",
+ "show_exist": "Show existing question.",
"answers": {
"title": "Answers",
"score": "Score",
@@ -870,4 +874,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/pages/Questions/Detail/components/Alert/index.tsx b/ui/src/pages/Questions/Detail/components/Alert/index.tsx
index 4b84c797..49cb428a 100644
--- a/ui/src/pages/Questions/Detail/components/Alert/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Alert/index.tsx
@@ -1,15 +1,44 @@
import { memo, FC } from 'react';
import { Alert } from 'react-bootstrap';
+import { useTranslation } from 'react-i18next';
+
+import dayjs from 'dayjs';
interface Props {
data;
}
const Index: FC<Props> = ({ data }) => {
+ const { t } = useTranslation();
return (
<Alert className="mb-4" variant="info">
<div>
- <strong>{data.operation_msg} </strong>
- {data.operation_description}
+ {data.operation_msg.indexOf('http') > -1 ? (
+ <p>
+ {data.operation_description}
+ <a href={data.operation_msg} style={{ color: '#055160' }}>
+ <strong>{t('question_detail.show_exist')}</strong>
+ </a>
+ </p>
+ ) : (
+ <p>
+ {data.operation_msg
+ ? data.operation_msg
+ : data.operation_description}
+ </p>
+ )}
+ <div className="fs-14">
+ {t('question_detail.closed_in')}{' '}
+ <time
+ dateTime={dayjs.unix(data.operation_time).toISOString()}
+ title={dayjs
+ .unix(data.operation_time)
+ .format(t('dates.long_date_with_time'))}>
+ {dayjs
+ .unix(data.operation_time)
+ .format(t('dates.long_date_with_year'))}
+ </time>
+ .
+ </div>
</div>
</Alert>
);