itizawa 5 лет назад
Родитель
Сommit
4122a9165d

+ 3 - 2
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettings.jsx

@@ -7,7 +7,7 @@ import { withUnstatedContainers } from '../../UnstatedUtils';
 import { toastSuccess, toastError } from '../../../util/apiNotification';
 import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 import SlackGrowiBridging from './SlackGrowiBridging';
-import CustomBotWithoutProxySettingsAccordion from './CustomBotWithoutProxySettingsAccordion';
+import CustomBotWithoutProxySettingsAccordion, { botInstallationStep } from './CustomBotWithoutProxySettingsAccordion';
 
 
 const CustomBotWithoutProxySettings = (props) => {
@@ -152,7 +152,8 @@ const CustomBotWithoutProxySettings = (props) => {
       <AdminUpdateButtonRow onClick={updateHandler} disabled={false} />
 
       <div className="my-5 mx-3">
-        <CustomBotWithoutProxySettingsAccordion />
+        {/* TODO GW-5644 active create bot step temporary */}
+        <CustomBotWithoutProxySettingsAccordion activeStep={botInstallationStep.CREATE_BOT} />
       </div>
 
     </>

+ 10 - 3
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -1,17 +1,20 @@
 import React, { useState } from 'react';
 import { useTranslation } from 'react-i18next';
+import PropTypes from 'prop-types';
+
 import { Collapse } from 'reactstrap';
 
-const botInstallationStep = {
+export const botInstallationStep = {
   CREATE_BOT: 'create-bot',
   INSTALL_BOT: 'install-bot',
   REGISTER_SLACK_CONFIGURATION: 'register-slack-configuration',
   CONNECTION_TEST: 'connection-test',
 };
 
-const CustomBotWithoutSettingsAccordion = () => {
+const CustomBotWithoutSettingsAccordion = ({ activeStep }) => {
   const { t } = useTranslation('admin');
-  const [openAccordionIndexes, setOpenAccordionIndexes] = useState(new Set());
+
+  const [openAccordionIndexes, setOpenAccordionIndexes] = useState(new Set([activeStep]));
 
   const onToggleAccordionHandler = (installationStep) => {
     const accordionIndexes = new Set(openAccordionIndexes);
@@ -129,4 +132,8 @@ const CustomBotWithoutSettingsAccordion = () => {
 };
 
 
+CustomBotWithoutSettingsAccordion.propTypes = {
+  activeStep: PropTypes.oneOf(Object.values(botInstallationStep)).isRequired,
+};
+
 export default CustomBotWithoutSettingsAccordion;