소스 검색

move inputTestChannelHandler

zahmis 4 년 전
부모
커밋
1c684234d0

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

@@ -43,6 +43,10 @@ const CustomBotWithoutProxySettings = (props) => {
     }
   };
 
+  const inputTestChannelHandler = (channel) => {
+    setTestChannel(channel);
+  };
+
   useEffect(() => {
     const siteName = appContainer.config.crowi.title;
     setSiteName(siteName);
@@ -77,7 +81,7 @@ const CustomBotWithoutProxySettings = (props) => {
           connectionErrorCode={connectionErrorCode}
           testChannel={testChannel}
           testConnection={testConnection}
-          onSetTestChannel={setTestChannel}
+          inputTestChannelHandler={inputTestChannelHandler}
 
         />
       </div>

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

@@ -19,8 +19,8 @@ const CustomBotWithoutProxySettingsAccordion = ({
   appContainer, activeStep,
   connectionMessage, connectionErrorCode, testChannel, slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
   isRegisterSlackCredentials, isSendTestMessage,
-  fetchSlackIntegrationData, testConnection,
-  onSetSlackSigningSecret, onSetSlackBotToken, onSetTestChannel,
+  fetchSlackIntegrationData, testConnection, inputTestChannelHandler,
+  onSetSlackSigningSecret, onSetSlackBotToken,
 }) => {
   const { t } = useTranslation();
   // TODO: GW-5644 Store default open accordion
@@ -60,12 +60,6 @@ const CustomBotWithoutProxySettingsAccordion = ({
     }
   };
 
-  const inputTestChannelHandler = (channel) => {
-    if (onSetTestChannel != null) {
-      onSetTestChannel(channel);
-    }
-  };
-
   const submitForm = (e) => {
     e.preventDefault();
 
@@ -209,9 +203,9 @@ CustomBotWithoutProxySettingsAccordion.propTypes = {
   isSendTestMessage: PropTypes.bool,
   fetchSlackIntegrationData: PropTypes.func,
   testConnection: PropTypes.func,
+  inputTestChannelHandler: PropTypes.func,
   onSetSlackSigningSecret: PropTypes.func,
   onSetSlackBotToken: PropTypes.func,
-  onSetTestChannel:  PropTypes.func,
   connectionMessage: PropTypes.string,
   connectionErrorCode: PropTypes.string,
   adminAppContainer: PropTypes.instanceOf(AdminAppContainer).isRequired,