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 show delete msg for admin users

shuai5471704b51db
diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 987d76de..c2158947 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -1410,8 +1410,10 @@ ui:
reputation: reputation
votes: votes
prompt:
- leave_page: "Are you sure you want to leave the page?"
- changes_not_save: "Your changes may not be saved."
+ leave_page: Are you sure you want to leave the page?
+ changes_not_save: Your changes may not be saved.
draft:
- discard_confirm: "Are you sure you want to discard your draft?"
+ discard_confirm: Are you sure you want to discard your draft?
+ messages:
+ post_deleted: This post has been deleted.
diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
index 1fb5f5d0..7da9f028 100644
--- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
@@ -1,5 +1,5 @@
import { memo, FC, useEffect, useRef } from 'react';
-import { Button } from 'react-bootstrap';
+import { Button, Alert } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import { Link, useSearchParams } from 'react-router-dom';
@@ -72,6 +72,11 @@ const Index: FC<Props> = ({
}
return (
<div id={data.id} ref={answerRef} className="answer-item py-4">
+ {data.status === 10 && (
+ <Alert variant="danger" className="mb-4">
+ {t('post_deleted', { keyPrefix: 'messages' })}
+ </Alert>
+ )}
<article
dangerouslySetInnerHTML={{ __html: data?.html }}
className="fmt text-break text-wrap"