ソースを参照

wip getting info from db

Steven Fukase 4 年 前
コミット
b73c7ce0be

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

@@ -39,7 +39,6 @@ const CustomBotWithProxySettings = (props) => {
     retrieveProxyUri();
   }, [retrieveProxyUri]);
 
-
   // TODO: Multiple accordion logic
   const [accordionComponentsCount, setAccordionComponentsCount] = useState(0);
   const addAccordionHandler = () => {

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

@@ -32,6 +32,7 @@ const SlackIntegration = (props) => {
   const fetchSlackIntegrationData = useCallback(async() => {
     try {
       const { data } = await appContainer.apiv3.get('/slack-integration-settings');
+      console.log(data);
       const {
         slackSigningSecret, slackBotToken, slackSigningSecretEnvVars, slackBotTokenEnvVars,
       } = data.settings;

+ 11 - 9
src/client/js/components/Admin/SlackIntegration/WithProxyAccordions.jsx

@@ -85,15 +85,17 @@ const GeneratingTokensAndRegisteringProxyServiceProcess = withUnstatedContainers
   const { t } = useTranslation();
   const growiUrl = props.appContainer.config.crowi.url;
 
-  let discardTokenHandler;
-  if (props.discardTokenHandler != null) {
-    discardTokenHandler = props.discardTokenHandler;
-  }
+  const generateTokenHandler = () => {
+    if (props.generateTokenHandler != null) {
+      props.generateTokenHandler();
+    }
+  };
 
-  let generateTokenHandler;
-  if (props.generateTokenHandler != null) {
-    generateTokenHandler = props.generateTokenHandler;
-  }
+  const discardTokenHandler = () => {
+    if (props.discardTokenHandler != null) {
+      props.discardTokenHandler();
+    }
+  };
 
   return (
     <div className="py-4 px-5">
@@ -133,7 +135,7 @@ const GeneratingTokensAndRegisteringProxyServiceProcess = withUnstatedContainers
             type="button"
             className="btn btn-outline-secondary mx-2"
             onClick={discardTokenHandler}
-            disabled={!tokenGtoP || !tokenPtoG}
+            disabled={props.tokenGtoP == null || props.tokenPtoG == null}
           >
             { t('admin:slack_integration.access_token_settings.discard') }
           </button>