This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/main by this push:
     new 57e93f2d fix: issue-609 (#614)
57e93f2d is described below

commit 57e93f2dec3c70af337d27ef6612383c6dc8ef03
Author: kelvinkuo <[email protected]>
AuthorDate: Fri Nov 10 12:16:38 2023 +0800

    fix: issue-609 (#614)
    
    fix #609
---
 i18n/en_US.yaml                             | 3 +++
 ui/src/pages/Questions/Ask/index.tsx        | 5 ++++-
 ui/src/pages/Questions/EditAnswer/index.tsx | 5 ++++-
 ui/src/pages/Tags/Edit/index.tsx            | 5 ++++-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 2666b720..315bc70c 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -720,6 +720,7 @@ ui:
   edit_tag:
     title: Edit Tag
     default_reason: Edit tag
+    default_first_reason: Add tag
     form:
       fields:
         revision:
@@ -768,6 +769,7 @@ ui:
   edit_answer:
     title: Edit Answer
     default_reason: Edit answer
+    default_first_reason: Add answer
     form:
       fields:
         revision:
@@ -799,6 +801,7 @@ ui:
     title: Add Question
     edit_title: Edit Question
     default_reason: Edit question
+    default_first_reason: Add question
     similar_questions: Similar questions
     form:
       fields:
diff --git a/ui/src/pages/Questions/Ask/index.tsx 
b/ui/src/pages/Questions/Ask/index.tsx
index 49f462f5..f24385fc 100644
--- a/ui/src/pages/Questions/Ask/index.tsx
+++ b/ui/src/pages/Questions/Ask/index.tsx
@@ -383,7 +383,10 @@ const Ask = () => {
                     return (
                       <option key={`${create_at}`} value={index}>
                         {`${date} - ${user_info.display_name} - ${
-                          reason || t('default_reason')
+                          reason ||
+                          (index === revisions.length - 1
+                            ? t('default_first_reason')
+                            : t('default_reason'))
                         }`}
                       </option>
                     );
diff --git a/ui/src/pages/Questions/EditAnswer/index.tsx 
b/ui/src/pages/Questions/EditAnswer/index.tsx
index b5ca2f94..d693794d 100644
--- a/ui/src/pages/Questions/EditAnswer/index.tsx
+++ b/ui/src/pages/Questions/EditAnswer/index.tsx
@@ -250,7 +250,10 @@ const Index = () => {
                   return (
                     <option key={`${create_at}`} value={index}>
                       {`${date} - ${user_info.display_name} - ${
-                        reason || t('default_reason')
+                        reason ||
+                        (index === revisions.length - 1
+                          ? t('default_first_reason')
+                          : t('default_reason'))
                       }`}
                     </option>
                   );
diff --git a/ui/src/pages/Tags/Edit/index.tsx b/ui/src/pages/Tags/Edit/index.tsx
index 32ce788d..c1f51487 100644
--- a/ui/src/pages/Tags/Edit/index.tsx
+++ b/ui/src/pages/Tags/Edit/index.tsx
@@ -222,7 +222,10 @@ const Index = () => {
                   return (
                     <option key={`${create_at}`} value={index}>
                       {`${date} - ${user_info.display_name} - ${
-                        reason || t('default_reason')
+                        reason ||
+                        (index === revisions.length - 1
+                          ? t('default_first_reason')
+                          : t('default_reason'))
                       }`}
                     </option>
                   );

Reply via email to