Browse Source

Merge pull request #3671 from weseek/fix/gw5764-proptypes-warning

fix error
Kaori Tokashiki 5 years ago
parent
commit
e1214c9459

+ 33 - 37
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxyIntegrationCard.jsx

@@ -7,57 +7,53 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
   const { t } = useTranslation();
 
   return (
-    <>
-
-      <div className="d-flex justify-content-center my-5 bot-integration">
-        <div className="card rounded shadow border-0 w-50 admin-bot-card mb-0">
-          <h5 className="card-title font-weight-bold mt-3 ml-4">Slack</h5>
-          <div className="card-body p-2 w-50 mx-auto">
-            {props.slackWSNameInWithoutProxy && (
-              <div className="card slack-work-space-name-card">
-                <div className="m-2 text-center">
-                  <h5 className="font-weight-bold">{ props.slackWSNameInWithoutProxy }</h5>
-                  <img width={20} height={20} src="/images/slack-integration/growi-bot-kun-icon.png" />
-                </div>
-              </div>
-            )}
+    <div className="d-flex justify-content-center my-5 bot-integration">
+      <div className="card rounded shadow border-0 w-50 admin-bot-card mb-0">
+        <h5 className="card-title font-weight-bold mt-3 ml-4">Slack</h5>
+        <div className="card-body p-2 w-50 mx-auto">
+          {props.slackWSNameInWithoutProxy != null && (
+          <div className="card slack-work-space-name-card">
+            <div className="m-2 text-center">
+              <h5 className="font-weight-bold">{ props.slackWSNameInWithoutProxy }</h5>
+              <img width={20} height={20} src="/images/slack-integration/growi-bot-kun-icon.png" />
+            </div>
           </div>
+            )}
         </div>
+      </div>
 
-        <div className="text-center w-25">
-          {props.isSetupSlackBot && (
-            <div className="mt-5">
-              <p className="text-success"><small className="fa fa-check"> {t('admin:slack_integration.integration_sentence.integration_successful')}</small></p>
-              <hr className="align-self-center admin-border-success border-success"></hr>
-            </div>
+      <div className="text-center w-25">
+        {props.isSetupSlackBot && (
+        <div className="mt-5">
+          <p className="text-success"><small className="fa fa-check"> {t('admin:slack_integration.integration_sentence.integration_successful')}</small></p>
+          <hr className="align-self-center admin-border-success border-success"></hr>
+        </div>
           )}
-          {!props.isSetupSlackBot && (
-            <div className="mt-4">
-              <small
-                className="text-secondary m-0"
+        {!props.isSetupSlackBot && (
+        <div className="mt-4">
+          <small
+            className="text-secondary m-0"
                 // eslint-disable-next-line react/no-danger
-                dangerouslySetInnerHTML={{ __html: t('admin:slack_integration.integration_sentence.integration_is_not_complete') }}
-              />
-              <hr className="align-self-center admin-border-danger border-danger"></hr>
-            </div>
-          )}
+            dangerouslySetInnerHTML={{ __html: t('admin:slack_integration.integration_sentence.integration_is_not_complete') }}
+          />
+          <hr className="align-self-center admin-border-danger border-danger"></hr>
         </div>
+          )}
+      </div>
 
-        <div className="card rounded-lg shadow border-0 w-50 admin-bot-card mb-0">
-          <h5 className="card-title font-weight-bold mt-3 ml-4">GROWI App</h5>
-          <div className="card-body p-4 mb-5 text-center">
-            <div className="btn btn-primary">{ props.siteName }</div>
-          </div>
+      <div className="card rounded-lg shadow border-0 w-50 admin-bot-card mb-0">
+        <h5 className="card-title font-weight-bold mt-3 ml-4">GROWI App</h5>
+        <div className="card-body p-4 mb-5 text-center">
+          <div className="btn btn-primary">{ props.siteName }</div>
         </div>
       </div>
-
-    </>
+    </div>
   );
 };
 
 CustomBotWithoutProxyIntegrationCard.propTypes = {
   siteName: PropTypes.string.isRequired,
-  slackWSNameInWithoutProxy: PropTypes,
+  slackWSNameInWithoutProxy: PropTypes.string,
   isSetupSlackBot: PropTypes.bool.isRequired,
 };
 

+ 1 - 0
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -196,6 +196,7 @@ const CustomBotWithoutProxySettingsAccordion = ({
               <textarea
                 className="form-control card border-info slack-connection-log-body rounded-lg"
                 value={value}
+                readOnly
               />
             </div>
           </div>

+ 1 - 2
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -170,9 +170,8 @@ const SlackIntegration = (props) => {
         <div className="row my-5 flex-wrap-reverse justify-content-center">
           {botTypes.map((botType) => {
             return (
-              <div className="m-3">
+              <div key={botType} className="m-3">
                 <BotTypeCard
-                  key={botType}
                   botType={botType}
                   isActive={currentBotType === botType}
                   handleBotTypeSelect={handleBotTypeSelect}