|
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
import { Collapse } from 'reactstrap';
|
|
import { Collapse } from 'reactstrap';
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
+import { toastSuccess } from '../../../util/apiNotification';
|
|
|
|
|
|
|
|
const CustomBotWithoutProxySettingsAccordion = (props) => {
|
|
const CustomBotWithoutProxySettingsAccordion = (props) => {
|
|
|
const { appContainer } = props;
|
|
const { appContainer } = props;
|
|
@@ -11,7 +12,7 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
|
|
|
const [openAccordionIndexes, setOpenAccordionIndexes] = useState(new Set());
|
|
const [openAccordionIndexes, setOpenAccordionIndexes] = useState(new Set());
|
|
|
const [connectionErrorCode, setConnectionErrorCode] = useState(null);
|
|
const [connectionErrorCode, setConnectionErrorCode] = useState(null);
|
|
|
const [connectionErrorMessage, setConnectionErrorMessage] = useState(null);
|
|
const [connectionErrorMessage, setConnectionErrorMessage] = useState(null);
|
|
|
- const [connectionSuccessMessage, setConnectionSuccessMessage] = useState(null);
|
|
|
|
|
|
|
+ // const [connectionSuccessMessage, setConnectionSuccessMessage] = useState(null);
|
|
|
const [testChannel, setTestChannel] = useState('');
|
|
const [testChannel, setTestChannel] = useState('');
|
|
|
|
|
|
|
|
const onToggleAccordionHandler = (i) => {
|
|
const onToggleAccordionHandler = (i) => {
|
|
@@ -28,14 +29,13 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
|
|
|
const onTestConnectionHandler = async() => {
|
|
const onTestConnectionHandler = async() => {
|
|
|
setConnectionErrorCode(null);
|
|
setConnectionErrorCode(null);
|
|
|
setConnectionErrorMessage(null);
|
|
setConnectionErrorMessage(null);
|
|
|
- setConnectionSuccessMessage(null);
|
|
|
|
|
|
|
+ // setConnectionSuccessMessage(null);
|
|
|
try {
|
|
try {
|
|
|
const res = await appContainer.apiv3.post('slack-integration/notification-test-to-slack-work-space', {
|
|
const res = await appContainer.apiv3.post('slack-integration/notification-test-to-slack-work-space', {
|
|
|
// TODO put proper request
|
|
// TODO put proper request
|
|
|
channel: testChannel,
|
|
channel: testChannel,
|
|
|
});
|
|
});
|
|
|
- console.log(res.data.message);
|
|
|
|
|
- setConnectionSuccessMessage(res.data.message);
|
|
|
|
|
|
|
+ toastSuccess(res.data.message);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
setConnectionErrorCode(err[0].code);
|
|
setConnectionErrorCode(err[0].code);
|
|
@@ -183,7 +183,6 @@ const CustomBotWithoutProxySettingsAccordion = (props) => {
|
|
|
<div className="card border-info slack-connection-error-log-body rounded-lg px-5 py-4">
|
|
<div className="card border-info slack-connection-error-log-body rounded-lg px-5 py-4">
|
|
|
<p className="m-0">{connectionErrorCode}</p>
|
|
<p className="m-0">{connectionErrorCode}</p>
|
|
|
<p className="m-0">{connectionErrorMessage}</p>
|
|
<p className="m-0">{connectionErrorMessage}</p>
|
|
|
- <p className="m-0">{connectionSuccessMessage}</p>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|