Преглед изворни кода

delete slackscope use isSetup

zahmis пре 4 година
родитељ
комит
bd16158f8b

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

@@ -11,7 +11,7 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
       <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 && (
+          {props.isSetupSlackBot && 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>
@@ -23,7 +23,7 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
       </div>
 
       <div className="text-center w-25">
-        {props.isSlackScopeSet && props.isSetupSlackBot && (
+        {props.isSetupSlackBot && props.isSlackScopeSet && (
         <div className="mt-5">
           <p className="text-success small">
             <i className="fa fa-check mr-1" />
@@ -32,7 +32,7 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
           <hr className="align-self-center admin-border-success border-success"></hr>
         </div>
           )}
-        {(!props.isSlackScopeSet || !props.isSetupSlackBot) && (
+        {(!props.isSetupSlackBot || !props.isSlackScopeSet) && (
         <div className="mt-4">
           <small
             className="text-secondary m-0"
@@ -58,6 +58,7 @@ CustomBotWithoutProxyIntegrationCard.propTypes = {
   siteName: PropTypes.string.isRequired,
   slackWSNameInWithoutProxy: PropTypes.string,
   isSlackScopeSet: PropTypes.bool.isRequired,
+  isSetupSlackBot: PropTypes.bool.isRequired,
 };
 
 export default CustomBotWithoutProxyIntegrationCard;

+ 1 - 2
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, onSetIsSlackScopeSet,
+  onSetSlackSigningSecret, onSetSlackBotToken, onSetIsSendTestMessage,
 }) => {
   const { t } = useTranslation();
   // TODO: GW-5644 Store default open accordion
@@ -43,7 +43,6 @@ 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') }));
     }

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

@@ -33,6 +33,7 @@ const SlackIntegration = (props) => {
     if (!isConnectedToSlack || !isSetupSlackBot) {
       return setSlackWSNameInWithoutProxy(null);
     }
+
     try {
       const res = await appContainer.apiv3.get('/slack-integration/custom-bot-without-proxy/slack-workspace-name');
       setSlackWSNameInWithoutProxy(res.data.slackWorkSpaceName);
@@ -66,7 +67,6 @@ const SlackIntegration = (props) => {
       setSlackBotTokenEnv(slackBotTokenEnvVars);
       setIsConnectedToSlack(isConnectedToSlack);
       setIsSetupSlackBot(isSetupSlackBot);
-      // setIsSlackScopeSet(isSlackScopeSet);
       fetchSlackWorkSpaceNameInWithoutProxy();
 
       if (isConnectedToSlack) {