|
@@ -1,18 +1,12 @@
|
|
|
/* eslint-disable no-console */
|
|
/* eslint-disable no-console */
|
|
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
-
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
-
|
|
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
-
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
import { toastSuccess, toastError } from '../../../util/apiNotification';
|
|
import { toastSuccess, toastError } from '../../../util/apiNotification';
|
|
|
import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
|
|
import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const CustomBotNonProxySettings = (props) => {
|
|
const CustomBotNonProxySettings = (props) => {
|
|
|
const { appContainer } = props;
|
|
const { appContainer } = props;
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
@@ -21,7 +15,6 @@ const CustomBotNonProxySettings = (props) => {
|
|
|
const [slackBotToken, setSlackBotToken] = useState('');
|
|
const [slackBotToken, setSlackBotToken] = useState('');
|
|
|
const [slackSigningSecretEnv, setSlackSigningSecretEnv] = useState('');
|
|
const [slackSigningSecretEnv, setSlackSigningSecretEnv] = useState('');
|
|
|
const [slackBotTokenEnv, setSlackBotTokenEnv] = useState('');
|
|
const [slackBotTokenEnv, setSlackBotTokenEnv] = useState('');
|
|
|
-
|
|
|
|
|
const botType = 'non-proxy';
|
|
const botType = 'non-proxy';
|
|
|
|
|
|
|
|
const fetchData = useCallback(async() => {
|
|
const fetchData = useCallback(async() => {
|
|
@@ -39,12 +32,12 @@ const CustomBotNonProxySettings = (props) => {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
}, [appContainer]);
|
|
}, [appContainer]);
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
fetchData();
|
|
fetchData();
|
|
|
|
|
|
|
|
}, [fetchData]);
|
|
}, [fetchData]);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
async function updateHandler() {
|
|
async function updateHandler() {
|
|
|
try {
|
|
try {
|
|
|
await appContainer.apiv3.put('/slack-integration/custom-bot-non-proxy', {
|
|
await appContainer.apiv3.put('/slack-integration/custom-bot-non-proxy', {
|
|
@@ -96,7 +89,6 @@ const CustomBotNonProxySettings = (props) => {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
<AdminUpdateButtonRow onClick={updateHandler} disabled={false} />
|
|
<AdminUpdateButtonRow onClick={updateHandler} disabled={false} />
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|