Просмотр исходного кода

fix(AdminHome): Change bug report markdown to host info markdown

Mxchaeltrxn 4 лет назад
Родитель
Сommit
c679f85c64

+ 2 - 2
packages/app/resource/locales/en_US/admin/admin.json

@@ -12,8 +12,8 @@
     "list_of_env_vars":"List of environment variables",
     "env_var_priority": "For environment variables other than security, the value of the database is obtained preferentially.",
     "about_security": "Check <a href='/admin/security'>Security Settings</a> for security environment variables.",
-    "copy_bug_report": {
-      "default": "Copy prefilled bug report",
+    "copy_prefilled_host_information": {
+      "default": "Copy prefilled host information",
       "done": "Copied to clipboard!"
     },
     "bug_report": "Submitting a bug report",

+ 6 - 63
packages/app/src/client/services/AdminHomeContainer.js

@@ -72,9 +72,9 @@ export default class AdminHomeContainer extends Container {
   }
 
   /**
-   * used to set button text when copying bug report
+   * sets button text when copying system information
    */
-  onCopyBugReport() {
+  onCopyPrefilledHostInformation() {
     this.setState(prevState => ({
       ...prevState,
       copyState: this.copyStateValues.DONE,
@@ -89,15 +89,10 @@ export default class AdminHomeContainer extends Container {
   }
 
   /**
-   * generates bug report with prefilled system information
+   * generates prefilled host information as markdown
    */
-  generatePrefilledBugReport() {
-    return `Environment
-------------
-
-### Host
-
-| item     | version |
+  generatePrefilledHostInformationMarkdown() {
+    return `| item     | version |
 | ---      | --- |
 |OS        ||
 |GROWI     |${this.state.growiVersion}|
@@ -109,59 +104,7 @@ export default class AdminHomeContainer extends Container {
 
 [growi-docker-compose]: https://github.com/weseek/growi-docker-compose
 
-*(Accessing https://{GROWI_HOST}/admin helps you to fill in above versions)*
-
-
-### Client
-
-| item     | version |
-| ---      | --- |
-|OS        ||
-|browser   |x.y.z|
-
-
-
-How to reproduce? (再現手順)
----------------------------
-
-1. process 1
-1. process 2
-1. process 3
-    \`\`\`bash
-
-    \`\`\`
-
-1. process 4
-    \`\`\`bash
-
-    \`\`\`
-
-What happens? (症状)
----------------------
-
-- symptom 1
-- symptom 2
-
-\`\`\`
-Stack Trace
-\`\`\`
-
-
-
-What is the expected result? (期待される動作)
--------------------------------------------
-
--
--
-
-
-
-Note
-----
-
--
--
-`;
+*(Accessing https://{GROWI_HOST}/admin helps you to fill in above versions)*`;
   }
 
 }

+ 6 - 3
packages/app/src/components/Admin/AdminHome/AdminHome.jsx

@@ -69,11 +69,14 @@ class AdminHome extends React.Component {
           <div className="col-md-12">
             <h2 className="admin-setting-header">{t('admin:admin_top.bug_report')}</h2>
             <p>
-              <CopyToClipboard text={adminHomeContainer.generatePrefilledBugReport()} onCopy={() => adminHomeContainer.onCopyBugReport()}>
+              <CopyToClipboard
+                text={adminHomeContainer.generatePrefilledHostInformationMarkdown()}
+                onCopy={() => adminHomeContainer.onCopyPrefilledHostInformation()}
+              >
                 <button type="button" className="btn btn-primary">
                   {adminHomeContainer.state.copyState === adminHomeContainer.copyStateValues.DEFAULT
-                    ? t('admin:admin_top:copy_bug_report:default')
-                    : t('admin:admin_top:copy_bug_report:done')}
+                    ? t('admin:admin_top:copy_prefilled_host_information:default')
+                    : t('admin:admin_top:copy_prefilled_host_information:done')}
                 </button>
               </CopyToClipboard>{' '}
               {/* eslint-disable-next-line react/no-danger */}