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

delete isSendTestMessage and setIsSendTestMessage

zahmis 4 лет назад
Родитель
Сommit
4d240af2ec

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

@@ -9,7 +9,7 @@ import CustomBotWithoutProxyIntegrationCard from './CustomBotWithoutProxyIntegra
 import DeleteSlackBotSettingsModal from './DeleteSlackBotSettingsModal';
 import DeleteSlackBotSettingsModal from './DeleteSlackBotSettingsModal';
 
 
 const CustomBotWithoutProxySettings = (props) => {
 const CustomBotWithoutProxySettings = (props) => {
-  const { appContainer, onResetSettings, onSetIsSendTestMessage } = props;
+  const { appContainer, onResetSettings } = props;
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const [siteName, setSiteName] = useState('');
   const [siteName, setSiteName] = useState('');
@@ -32,13 +32,11 @@ const CustomBotWithoutProxySettings = (props) => {
     try {
     try {
       await appContainer.apiv3.post('/slack-integration-settings/without-proxy/test', { channel: testChannel });
       await appContainer.apiv3.post('/slack-integration-settings/without-proxy/test', { channel: testChannel });
       setConnectionMessage('Send the message to slack work space.');
       setConnectionMessage('Send the message to slack work space.');
-      onSetIsSendTestMessage(true);
       setIsIntegrationSuccess(true);
       setIsIntegrationSuccess(true);
     }
     }
     catch (err) {
     catch (err) {
       setConnectionErrorCode(err[0].code);
       setConnectionErrorCode(err[0].code);
       setConnectionMessage(err[0].message);
       setConnectionMessage(err[0].message);
-      onSetIsSendTestMessage(false);
       setIsIntegrationSuccess(false);
       setIsIntegrationSuccess(false);
     }
     }
   };
   };
@@ -79,6 +77,7 @@ const CustomBotWithoutProxySettings = (props) => {
           activeStep={botInstallationStep.CREATE_BOT}
           activeStep={botInstallationStep.CREATE_BOT}
           connectionMessage={connectionMessage}
           connectionMessage={connectionMessage}
           connectionErrorCode={connectionErrorCode}
           connectionErrorCode={connectionErrorCode}
+          isIntegrationSuccess={isIntegrationSuccess}
           testChannel={testChannel}
           testChannel={testChannel}
           testConnection={testConnection}
           testConnection={testConnection}
           inputTestChannelHandler={inputTestChannelHandler}
           inputTestChannelHandler={inputTestChannelHandler}
@@ -108,7 +107,6 @@ CustomBotWithoutProxySettings.propTypes = {
   isIntegrationSuccess: PropTypes.bool,
   isIntegrationSuccess: PropTypes.bool,
   slackWSNameInWithoutProxy: PropTypes.string,
   slackWSNameInWithoutProxy: PropTypes.string,
   onResetSettings: PropTypes.func,
   onResetSettings: PropTypes.func,
-  onSetIsSendTestMessage: PropTypes.func,
 };
 };
 
 
 export default CustomBotWithoutProxySettingsWrapper;
 export default CustomBotWithoutProxySettingsWrapper;

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

@@ -18,7 +18,7 @@ export const botInstallationStep = {
 const CustomBotWithoutProxySettingsAccordion = ({
 const CustomBotWithoutProxySettingsAccordion = ({
   appContainer, activeStep,
   appContainer, activeStep,
   connectionMessage, connectionErrorCode, testChannel, slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
   connectionMessage, connectionErrorCode, testChannel, slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
-  isRegisterSlackCredentials, isSendTestMessage,
+  isRegisterSlackCredentials, isIntegrationSuccess,
   fetchSlackIntegrationData, testConnection, inputTestChannelHandler,
   fetchSlackIntegrationData, testConnection, inputTestChannelHandler,
   onSetSlackSigningSecret, onSetSlackBotToken,
   onSetSlackSigningSecret, onSetSlackBotToken,
 }) => {
 }) => {
@@ -136,7 +136,7 @@ const CustomBotWithoutProxySettingsAccordion = ({
       <Accordion
       <Accordion
         defaultIsActive={defaultOpenAccordionKeys.has(botInstallationStep.CONNECTION_TEST)}
         defaultIsActive={defaultOpenAccordionKeys.has(botInstallationStep.CONNECTION_TEST)}
         // eslint-disable-next-line max-len
         // eslint-disable-next-line max-len
-        title={<><span className="mr-2">④</span>{t('admin:slack_integration.accordion.test_connection')}{isSendTestMessage && <i className="ml-3 text-success fa fa-check"></i>}</>}
+        title={<><span className="mr-2">④</span>{t('admin:slack_integration.accordion.test_connection')}{isIntegrationSuccess && <i className="ml-3 text-success fa fa-check"></i>}</>}
       >
       >
         <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">
@@ -200,7 +200,7 @@ CustomBotWithoutProxySettingsAccordion.propTypes = {
   slackBotTokenEnv: PropTypes.string,
   slackBotTokenEnv: PropTypes.string,
   testChannel: PropTypes.string,
   testChannel: PropTypes.string,
   isRegisterSlackCredentials: PropTypes.bool,
   isRegisterSlackCredentials: PropTypes.bool,
-  isSendTestMessage: PropTypes.bool,
+  isIntegrationSuccess: PropTypes.bool,
   fetchSlackIntegrationData: PropTypes.func,
   fetchSlackIntegrationData: PropTypes.func,
   testConnection: PropTypes.func,
   testConnection: PropTypes.func,
   inputTestChannelHandler: PropTypes.func,
   inputTestChannelHandler: PropTypes.func,

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

@@ -24,7 +24,6 @@ const SlackIntegration = (props) => {
   const [slackSigningSecretEnv, setSlackSigningSecretEnv] = useState('');
   const [slackSigningSecretEnv, setSlackSigningSecretEnv] = useState('');
   const [slackBotTokenEnv, setSlackBotTokenEnv] = useState('');
   const [slackBotTokenEnv, setSlackBotTokenEnv] = useState('');
   const [isRegisterSlackCredentials, setIsRegisterSlackCredentials] = useState(false);
   const [isRegisterSlackCredentials, setIsRegisterSlackCredentials] = useState(false);
-  const [isSendTestMessage, setIsSendTestMessage] = useState(false);
   const [slackWSNameInWithoutProxy, setSlackWSNameInWithoutProxy] = useState(null);
   const [slackWSNameInWithoutProxy, setSlackWSNameInWithoutProxy] = useState(null);
   const [isDeleteConfirmModalShown, setIsDeleteConfirmModalShown] = useState(false);
   const [isDeleteConfirmModalShown, setIsDeleteConfirmModalShown] = useState(false);
   const [slackAppIntegrations, setSlackAppIntegrations] = useState();
   const [slackAppIntegrations, setSlackAppIntegrations] = useState();
@@ -93,7 +92,6 @@ const SlackIntegration = (props) => {
       setIsRegisterSlackCredentials(false);
       setIsRegisterSlackCredentials(false);
       setSlackSigningSecret(null);
       setSlackSigningSecret(null);
       setSlackBotToken(null);
       setSlackBotToken(null);
-      setIsSendTestMessage(false);
       setSlackWSNameInWithoutProxy(null);
       setSlackWSNameInWithoutProxy(null);
     }
     }
     catch (err) {
     catch (err) {
@@ -129,7 +127,6 @@ const SlackIntegration = (props) => {
     case 'customBotWithoutProxy':
     case 'customBotWithoutProxy':
       settingsComponent = (
       settingsComponent = (
         <CustomBotWithoutProxySettings
         <CustomBotWithoutProxySettings
-          isSendTestMessage={isSendTestMessage}
           isRegisterSlackCredentials={isRegisterSlackCredentials}
           isRegisterSlackCredentials={isRegisterSlackCredentials}
           slackBotTokenEnv={slackBotTokenEnv}
           slackBotTokenEnv={slackBotTokenEnv}
           slackBotToken={slackBotToken}
           slackBotToken={slackBotToken}
@@ -138,7 +135,6 @@ const SlackIntegration = (props) => {
           slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
           slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
           onSetSlackSigningSecret={setSlackSigningSecret}
           onSetSlackSigningSecret={setSlackSigningSecret}
           onSetSlackBotToken={setSlackBotToken}
           onSetSlackBotToken={setSlackBotToken}
-          onSetIsSendTestMessage={setIsSendTestMessage}
           onResetSettings={resetWithOutSettings}
           onResetSettings={resetWithOutSettings}
           fetchSlackIntegrationData={fetchSlackIntegrationData}
           fetchSlackIntegrationData={fetchSlackIntegrationData}
         />
         />