zahmis 5 лет назад
Родитель
Сommit
f3034442bc

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

@@ -78,6 +78,8 @@ const CustomBotWithoutProxySettings = (props) => {
         <CustomBotWithoutProxySettingsAccordion
           {...props}
           activeStep={botInstallationStep.CREATE_BOT}
+          slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
+          setSlackWSNameInWithoutProxy={setSlackWSNameInWithoutProxy}
         />
       </div>
 

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

@@ -18,8 +18,8 @@ export const botInstallationStep = {
 const CustomBotWithoutProxySettingsAccordion = ({
   appContainer,
   activeStep, slackSigningSecret, slackSigningSecretEnv, slackBotToken,
-  slackBotTokenEnv, isRegisterSlackCredentials, isSendTestMessage,
-  setSlackSigningSecret, setSlackBotToken, setIsSendTestMessage, setIsRegisterSlackCredentials,
+  slackBotTokenEnv, isRegisterSlackCredentials, isSendTestMessage, isConnectedToSlack,
+  setSlackSigningSecret, setSlackBotToken, setIsSendTestMessage, setIsRegisterSlackCredentials, setSlackWSNameInWithoutProxy,
 }) => {
   const { t } = useTranslation();
   // TODO: GW-5644 Store default open accordion
@@ -39,6 +39,10 @@ const CustomBotWithoutProxySettingsAccordion = ({
         currentBotType,
       });
 
+      if (isConnectedToSlack === false) {
+        setSlackWSNameInWithoutProxy(null);
+      }
+
       setIsRegisterSlackCredentials(true);
       if (slackSigningSecret === '' || slackBotToken === '') {
         setIsRegisterSlackCredentials(false);
@@ -213,6 +217,8 @@ CustomBotWithoutProxySettingsAccordion.propTypes = {
   setSlackBotToken: PropTypes.string,
   setIsSendTestMessage: PropTypes.func,
   setIsRegisterSlackCredentials: PropTypes.func,
+  isConnectedToSlack: PropTypes.bool,
+  setSlackWSNameInWithoutProxy: PropTypes.func,
   adminAppContainer: PropTypes.instanceOf(AdminAppContainer).isRequired,
   activeStep: PropTypes.oneOf(Object.values(botInstallationStep)).isRequired,
 };

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

@@ -26,6 +26,7 @@ const SlackIntegration = (props) => {
   const [isRegisterSlackCredentials, setIsRegisterSlackCredentials] = useState(false);
   const [isSendTestMessage, setIsSendTestMessage] = useState(false);
   const [isSetupSlackBot, setIsSetupSlackBot] = useState(false);
+  // const [slackWSNameInWithoutProxy, setSlackWSNameInWithoutProxy] = useState(null);
 
 
   const fetchData = useCallback(async() => {
@@ -113,7 +114,9 @@ const SlackIntegration = (props) => {
           setSlackBotToken={setSlackBotToken}
           setIsSendTestMessage={setIsSendTestMessage}
           setIsRegisterSlackCredentials={setIsRegisterSlackCredentials}
+          // setSlackWSNameInWithoutProxy={setSlackWSNameInWithoutProxy}
           isSetupSlackBot={isSetupSlackBot}
+          // slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
         />
       );
       break;