|
@@ -16,10 +16,10 @@ export const botInstallationStep = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const CustomBotWithoutProxySettingsAccordion = ({
|
|
const CustomBotWithoutProxySettingsAccordion = ({
|
|
|
- appContainer, activeStep,
|
|
|
|
|
|
|
+ appContainer, activeStep, fetchSlackIntegrationData,
|
|
|
slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
|
|
slackSigningSecret, slackSigningSecretEnv, slackBotToken, slackBotTokenEnv,
|
|
|
- isRegisterSlackCredentials, isSendTestMessage, isConnectedToSlack,
|
|
|
|
|
- onSetSlackSigningSecret, onSetSlackBotToken, onSetIsSendTestMessage, onSetIsRegisterSlackCredentials,
|
|
|
|
|
|
|
+ isRegisterSlackCredentials, isSendTestMessage,
|
|
|
|
|
+ onSetSlackSigningSecret, onSetSlackBotToken, onSetIsSendTestMessage,
|
|
|
}) => {
|
|
}) => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
// TODO: GW-5644 Store default open accordion
|
|
// TODO: GW-5644 Store default open accordion
|
|
@@ -31,6 +31,7 @@ const CustomBotWithoutProxySettingsAccordion = ({
|
|
|
const [testChannel, setTestChannel] = useState('');
|
|
const [testChannel, setTestChannel] = useState('');
|
|
|
const currentBotType = 'customBotWithoutProxy';
|
|
const currentBotType = 'customBotWithoutProxy';
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const updateSecretTokenHandler = async() => {
|
|
const updateSecretTokenHandler = async() => {
|
|
|
try {
|
|
try {
|
|
|
await appContainer.apiv3.put('/slack-integration/custom-bot-without-proxy', {
|
|
await appContainer.apiv3.put('/slack-integration/custom-bot-without-proxy', {
|
|
@@ -39,17 +40,13 @@ const CustomBotWithoutProxySettingsAccordion = ({
|
|
|
currentBotType,
|
|
currentBotType,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if (isConnectedToSlack) {
|
|
|
|
|
- onSetIsRegisterSlackCredentials(true);
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- onSetIsRegisterSlackCredentials(false);
|
|
|
|
|
- onSetIsSendTestMessage(false);
|
|
|
|
|
|
|
+ if (fetchSlackIntegrationData == null) {
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ fetchSlackIntegrationData();
|
|
|
toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
|
|
toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
- onSetIsRegisterSlackCredentials(false);
|
|
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -215,6 +212,7 @@ CustomBotWithoutProxySettingsAccordion.propTypes = {
|
|
|
isRegisterSlackCredentials: PropTypes.bool,
|
|
isRegisterSlackCredentials: PropTypes.bool,
|
|
|
isSendTestMessage: PropTypes.bool,
|
|
isSendTestMessage: PropTypes.bool,
|
|
|
isConnectedToSlack: PropTypes.bool,
|
|
isConnectedToSlack: PropTypes.bool,
|
|
|
|
|
+ fetchSlackIntegrationData: PropTypes.func,
|
|
|
onSetSlackSigningSecret: PropTypes.func,
|
|
onSetSlackSigningSecret: PropTypes.func,
|
|
|
onSetSlackBotToken: PropTypes.func,
|
|
onSetSlackBotToken: PropTypes.func,
|
|
|
onSetIsSendTestMessage: PropTypes.func,
|
|
onSetIsSendTestMessage: PropTypes.func,
|