zahmis vor 4 Jahren
Ursprung
Commit
64df7dcc41

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

@@ -10,7 +10,7 @@ import CustomBotWithoutProxyIntegrationCard from './CustomBotWithoutProxyIntegra
 import DeleteSlackCredentialsModal from './DeleteSlackCredentialsModal';
 
 const CustomBotWithoutProxySettings = (props) => {
-  const { appContainer, /* isSlackScopeSet, */ isSetupSlackBot } = props;
+  const { appContainer, isSlackScopeSet, isSetupSlackBot } = props;
   const { t } = useTranslation();
 
   const [siteName, setSiteName] = useState('');
@@ -23,7 +23,7 @@ const CustomBotWithoutProxySettings = (props) => {
         slackBotToken: '',
         currentBotType: 'customBotWithoutProxy',
       });
-      props.onSetIsSetupSlackBot(false);
+      // props.onSetIsSetupSlackBot(false);
       props.fetchSlackIntegrationData();
       toastSuccess('success');
     }
@@ -49,7 +49,7 @@ const CustomBotWithoutProxySettings = (props) => {
 
       <h2 className="admin-setting-header">{t('admin:slack_integration.custom_bot_without_proxy_settings')}</h2>
 
-      {isSetupSlackBot && (
+      {isSlackScopeSet && (
       <button
         className="pull-right btn text-danger border-danger"
         type="button"

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

@@ -19,7 +19,7 @@ const CustomBotWithoutProxySettingsAccordion = ({
   appContainer, activeStep, fetchSlackIntegrationData,
   slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
   isRegisterSlackCredentials, isSendTestMessage,
-  onSetSlackSigningSecret, onSetSlackBotToken, onSetIsSendTestMessage,
+  onSetSlackSigningSecret, onSetSlackBotToken, onSetIsSendTestMessage, /*  onSetIsSlackScopeSet, */
 }) => {
   const { t } = useTranslation();
   // TODO: GW-5644 Store default open accordion
@@ -43,6 +43,7 @@ const CustomBotWithoutProxySettingsAccordion = ({
       if (fetchSlackIntegrationData == null) {
         return null;
       }
+      // onSetIsSlackScopeSet(true);
       fetchSlackIntegrationData();
       toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
     }

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

@@ -33,10 +33,11 @@ const SlackIntegration = (props) => {
     if (!isConnectedToSlack) {
       return setSlackWSNameInWithoutProxy(null);
     }
+
     try {
       const res = await appContainer.apiv3.get('/slack-integration/custom-bot-without-proxy/slack-workspace-name');
       setSlackWSNameInWithoutProxy(res.data.slackWorkSpaceName);
-      setIsSlackScopeSet(true);
+      // setIsSlackScopeSet(true);
     }
     catch (err) {
       if (err[0].message === 'missing_scope') {
@@ -66,6 +67,7 @@ const SlackIntegration = (props) => {
       setSlackBotTokenEnv(slackBotTokenEnvVars);
       setIsConnectedToSlack(isConnectedToSlack);
       setIsSetupSlackBot(isSetupSlackBot);
+      setIsSlackScopeSet(isSlackScopeSet);
 
       fetchSlackWorkSpaceNameInWithoutProxy();
 
@@ -81,7 +83,7 @@ const SlackIntegration = (props) => {
     catch (err) {
       toastError(err);
     }
-  }, [appContainer.apiv3, fetchSlackWorkSpaceNameInWithoutProxy]);
+  }, [appContainer.apiv3, fetchSlackWorkSpaceNameInWithoutProxy, isSlackScopeSet]);
 
 
   useEffect(() => {
@@ -147,6 +149,7 @@ const SlackIntegration = (props) => {
           slackSigningSecret={slackSigningSecret}
           slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
           onSetIsSetupSlackBot={setIsSetupSlackBot}
+          // onSetIsSlackScopeSet={setIsSlackScopeSet}
           onSetSlackSigningSecret={setSlackSigningSecret}
           onSetSlackBotToken={setSlackBotToken}
           onSetIsSendTestMessage={setIsSendTestMessage}