|
|
@@ -1,7 +1,6 @@
|
|
|
import React, { useMemo, useState } from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
-import { TabContent, TabPane } from 'reactstrap';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
@@ -11,8 +10,6 @@ import { withLoadingSppiner } from '../../SuspenseUtils';
|
|
|
|
|
|
import AdminNotificationContainer from '~/client/services/AdminNotificationContainer';
|
|
|
|
|
|
-import { CustomNavTab } from '../../CustomNavigation/CustomNav';
|
|
|
-
|
|
|
import SlackConfiguration from './SlackConfiguration';
|
|
|
|
|
|
const logger = loggerFactory('growi:NotificationSetting');
|
|
|
@@ -21,14 +18,6 @@ let retrieveErrors = null;
|
|
|
function LegacySlackIntegration(props) {
|
|
|
const { adminNotificationContainer } = props;
|
|
|
|
|
|
- const [activeTab, setActiveTab] = useState('slack_configuration');
|
|
|
- const [activeComponents, setActiveComponents] = useState(new Set(['slack_configuration']));
|
|
|
-
|
|
|
- const switchActiveTab = (selectedTab) => {
|
|
|
- setActiveTab(selectedTab);
|
|
|
- setActiveComponents(activeComponents.add(selectedTab));
|
|
|
- };
|
|
|
-
|
|
|
if (adminNotificationContainer.state.webhookUrl === adminNotificationContainer.dummyWebhookUrl) {
|
|
|
throw (async() => {
|
|
|
try {
|
|
|
@@ -48,26 +37,8 @@ function LegacySlackIntegration(props) {
|
|
|
throw new Error(`${retrieveErrors.length} errors occured`);
|
|
|
}
|
|
|
|
|
|
- const navTabMapping = useMemo(() => {
|
|
|
- return {
|
|
|
- slack_configuration: {
|
|
|
- Icon: () => <i className="icon-settings" />,
|
|
|
- i18n: 'Slack configuration',
|
|
|
- index: 0,
|
|
|
- },
|
|
|
- };
|
|
|
- }, []);
|
|
|
-
|
|
|
return (
|
|
|
- <>
|
|
|
- <CustomNavTab activeTab={activeTab} navTabMapping={navTabMapping} onNavSelected={switchActiveTab} hideBorderBottom />
|
|
|
-
|
|
|
- <TabContent activeTab={activeTab} className="p-5">
|
|
|
- <TabPane tabId="slack_configuration">
|
|
|
- {activeComponents.has('slack_configuration') && <SlackConfiguration />}
|
|
|
- </TabPane>
|
|
|
- </TabContent>
|
|
|
- </>
|
|
|
+ <SlackConfiguration />
|
|
|
);
|
|
|
}
|
|
|
|