|
@@ -10,25 +10,12 @@ import CustomBotWithoutProxyIntegrationCard from './CustomBotWithoutProxyIntegra
|
|
|
import DeleteSlackBotSettingsModal from './DeleteSlackBotSettingsModal';
|
|
import DeleteSlackBotSettingsModal from './DeleteSlackBotSettingsModal';
|
|
|
|
|
|
|
|
const CustomBotWithoutProxySettings = (props) => {
|
|
const CustomBotWithoutProxySettings = (props) => {
|
|
|
- const { appContainer, slackSettingsErrors } = props;
|
|
|
|
|
|
|
+ const { appContainer, isSlackScopeSet } = props;
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
const [siteName, setSiteName] = useState('');
|
|
const [siteName, setSiteName] = useState('');
|
|
|
const [isDeleteConfirmModalShown, setIsDeleteConfirmModalShown] = useState(false);
|
|
const [isDeleteConfirmModalShown, setIsDeleteConfirmModalShown] = useState(false);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- const onSetIsSetupSlackBot = () => {
|
|
|
|
|
- if (props.onSetIsSetupSlackBot != null) {
|
|
|
|
|
- props.onSetIsSetupSlackBot();
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const onSetIsSlackScopeSet = () => {
|
|
|
|
|
- if (props.onSetIsSlackScopeSet != null) {
|
|
|
|
|
- props.onSetIsSlackScopeSet();
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const deleteSlackSettingsHandler = async() => {
|
|
const deleteSlackSettingsHandler = async() => {
|
|
|
try {
|
|
try {
|
|
|
await appContainer.apiv3.put('/slack-integration-settings/custom-bot-without-proxy', {
|
|
await appContainer.apiv3.put('/slack-integration-settings/custom-bot-without-proxy', {
|
|
@@ -36,8 +23,6 @@ const CustomBotWithoutProxySettings = (props) => {
|
|
|
slackBotToken: '',
|
|
slackBotToken: '',
|
|
|
currentBotType: '',
|
|
currentBotType: '',
|
|
|
});
|
|
});
|
|
|
- onSetIsSetupSlackBot(false);
|
|
|
|
|
- onSetIsSlackScopeSet(false);
|
|
|
|
|
toastSuccess('success');
|
|
toastSuccess('success');
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
@@ -57,12 +42,12 @@ const CustomBotWithoutProxySettings = (props) => {
|
|
|
<CustomBotWithoutProxyIntegrationCard
|
|
<CustomBotWithoutProxyIntegrationCard
|
|
|
siteName={siteName}
|
|
siteName={siteName}
|
|
|
slackWSNameInWithoutProxy={props.slackWSNameInWithoutProxy}
|
|
slackWSNameInWithoutProxy={props.slackWSNameInWithoutProxy}
|
|
|
- slackSettingsErrors={slackSettingsErrors}
|
|
|
|
|
|
|
+ isSlackScopeSet={isSlackScopeSet}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<h2 className="admin-setting-header">{t('admin:slack_integration.custom_bot_without_proxy_settings')}</h2>
|
|
<h2 className="admin-setting-header">{t('admin:slack_integration.custom_bot_without_proxy_settings')}</h2>
|
|
|
|
|
|
|
|
- {!slackSettingsErrors.includes(false) && (
|
|
|
|
|
|
|
+ {props.isSlackScopeSet && (
|
|
|
<button
|
|
<button
|
|
|
className="mx-3 pull-right btn text-danger border-danger"
|
|
className="mx-3 pull-right btn text-danger border-danger"
|
|
|
type="button"
|
|
type="button"
|
|
@@ -96,10 +81,8 @@ CustomBotWithoutProxySettings.propTypes = {
|
|
|
slackBotToken: PropTypes.string,
|
|
slackBotToken: PropTypes.string,
|
|
|
slackBotTokenEnv: PropTypes.string,
|
|
slackBotTokenEnv: PropTypes.string,
|
|
|
isRgisterSlackCredentials: PropTypes.bool,
|
|
isRgisterSlackCredentials: PropTypes.bool,
|
|
|
- slackSettingsErrors: PropTypes.array,
|
|
|
|
|
|
|
+ isSlackScopeSet: PropTypes.bool,
|
|
|
slackWSNameInWithoutProxy: PropTypes.string,
|
|
slackWSNameInWithoutProxy: PropTypes.string,
|
|
|
- onSetIsSetupSlackBot: PropTypes.func,
|
|
|
|
|
- onSetIsSlackScopeSet: PropTypes.func,
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default CustomBotWithoutProxySettingsWrapper;
|
|
export default CustomBotWithoutProxySettingsWrapper;
|