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

Cleanup and also added without proxy

Steven Fukase 4 лет назад
Родитель
Сommit
31bed0e7ab

+ 4 - 8
src/client/js/components/Admin/SlackIntegration/CustomBotWithProxySettingsAccordion.jsx

@@ -174,7 +174,6 @@ const CustomBotWithProxySettingsAccordion = () => {
         <div className="d-flex justify-content-center">
         <div className="d-flex justify-content-center">
           <form className="form-row justify-content-center" onSubmit={e => submitForm(e)}>
           <form className="form-row justify-content-center" onSubmit={e => submitForm(e)}>
             <div className="input-group col-8">
             <div className="input-group col-8">
-
               <div className="input-group-prepend">
               <div className="input-group-prepend">
                 <span className="input-group-text" id="slack-channel-addon"><i className="fa fa-hashtag" /></span>
                 <span className="input-group-text" id="slack-channel-addon"><i className="fa fa-hashtag" /></span>
               </div>
               </div>
@@ -186,7 +185,6 @@ const CustomBotWithProxySettingsAccordion = () => {
                 // TODO: Handle test button
                 // TODO: Handle test button
                 onChange={e => inputTestChannelHandler(e.target.value)}
                 onChange={e => inputTestChannelHandler(e.target.value)}
               />
               />
-
             </div>
             </div>
             <button
             <button
               type="submit"
               type="submit"
@@ -194,22 +192,20 @@ const CustomBotWithProxySettingsAccordion = () => {
               disabled={testChannel.trim() === ''}
               disabled={testChannel.trim() === ''}
             >Test
             >Test
             </button>
             </button>
-
           </form>
           </form>
         </div>
         </div>
-        {connectionErrorMessage == null
+        {connectionErrorMessage != null
           && <p className="text-danger text-center my-4">{t('admin:slack_integration.accordion.error_check_logs_below')}</p>}
           && <p className="text-danger text-center my-4">{t('admin:slack_integration.accordion.error_check_logs_below')}</p>}
-        {connectionSuccessMessage == null
+        {connectionSuccessMessage != null
           && <p className="text-info text-center my-4">{t('admin:slack_integration.accordion.send_message_to_slack_work_space')}</p>}
           && <p className="text-info text-center my-4">{t('admin:slack_integration.accordion.send_message_to_slack_work_space')}</p>}
         <form>
         <form>
           <div className="row my-3 justify-content-center">
           <div className="row my-3 justify-content-center">
-            <div className="form-group slack-connection-log col-sm-4">
+            <div className="form-group slack-connection-log col-md-4">
               <label className="mb-1"><p className="border-info slack-connection-log-title pl-2 m-0">Logs</p></label>
               <label className="mb-1"><p className="border-info slack-connection-log-title pl-2 m-0">Logs</p></label>
               <textarea
               <textarea
                 className="form-control card border-info slack-connection-log-body rounded-lg"
                 className="form-control card border-info slack-connection-log-body rounded-lg"
                 // TODO: Show test logs
                 // TODO: Show test logs
-                value="Test Error Message"
-                // value={value}
+                value={value}
                 readOnly
                 readOnly
               />
               />
             </div>
             </div>

+ 16 - 18
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -161,38 +161,36 @@ const CustomBotWithoutProxySettingsAccordion = ({
         <p className="text-center m-4">{t('admin:slack_integration.accordion.test_connection_by_pressing_button')}</p>
         <p className="text-center m-4">{t('admin:slack_integration.accordion.test_connection_by_pressing_button')}</p>
         <div className="d-flex justify-content-center">
         <div className="d-flex justify-content-center">
           <form className="form-row align-items-center" onSubmit={e => submitForm(e)}>
           <form className="form-row align-items-center" onSubmit={e => submitForm(e)}>
-            <div className="col-8 input-group-prepend">
-              <span className="input-group-text" id="slack-channel-addon"><i className="fa fa-hashtag" /></span>
+            <div className="input-group col-8">
+              <div className="input-group-prepend">
+                <span className="input-group-text" id="slack-channel-addon"><i className="fa fa-hashtag" /></span>
+              </div>
               <input
               <input
-                className="form-control w-100"
+                className="form-control"
                 type="text"
                 type="text"
                 value={testChannel}
                 value={testChannel}
                 placeholder="Slack Channel"
                 placeholder="Slack Channel"
                 onChange={e => inputTestChannelHandler(e.target.value)}
                 onChange={e => inputTestChannelHandler(e.target.value)}
               />
               />
             </div>
             </div>
-            <div className="col-4">
-              <button
-                type="submit"
-                className="btn btn-info mx-3 font-weight-bold"
-                disabled={testChannel.trim() === ''}
-              >Test
-              </button>
-            </div>
+            <button
+              type="submit"
+              className="btn btn-info mx-3 font-weight-bold"
+              disabled={testChannel.trim() === ''}
+            >Test
+            </button>
           </form>
           </form>
         </div>
         </div>
-        {/* {connectionErrorMessage != null */}
-        {connectionErrorMessage == null
+        {connectionErrorMessage != null
           && <p className="text-danger text-center my-4">{t('admin:slack_integration.accordion.error_check_logs_below')}</p>}
           && <p className="text-danger text-center my-4">{t('admin:slack_integration.accordion.error_check_logs_below')}</p>}
-        {/* {connectionSuccessMessage != null */}
-        {connectionSuccessMessage == null
+        {connectionSuccessMessage != null
           && <p className="text-info text-center my-4">{t('admin:slack_integration.accordion.send_message_to_slack_work_space')}</p>}
           && <p className="text-info text-center my-4">{t('admin:slack_integration.accordion.send_message_to_slack_work_space')}</p>}
         <form>
         <form>
           <div className="row my-3 justify-content-center">
           <div className="row my-3 justify-content-center">
-            <div className="form-group slack-connection-log">
-              <label className="mb-1"><p className="border-info slack-connection-log-title pl-2 mb-1">Logs</p></label>
+            <div className="form-group slack-connection-log col-md-4">
+              <label className="mb-1"><p className="border-info slack-connection-log-title pl-2 m-0">Logs</p></label>
               <textarea
               <textarea
-                className="col-md form-control card border-info slack-connection-log-body rounded-lg"
+                className="form-control card border-info slack-connection-log-body rounded-lg"
                 value={value}
                 value={value}
                 readOnly
                 readOnly
               />
               />