diff --git a/client-reactjs/src/App.js b/client-reactjs/src/App.js
index 86c27c402..86530eb2a 100644
--- a/client-reactjs/src/App.js
+++ b/client-reactjs/src/App.js
@@ -57,7 +57,7 @@ const Regulations = React.lazy(() => import('./components/admin/ControlsAndRegul
const GitHubSettings = React.lazy(() => import('./components/admin/GitHubSettings/GitHubSettings'));
const ScheduledJobsPage = React.lazy(() => import('./components/admin/ScheduledJobsPage'));
const Compliance = React.lazy(() => import('./components/admin/Compliance/Compliance'));
-const Integrations = React.lazy(() => import('./components/admin/Integrations'));
+const Integrations = React.lazy(() => import('./components/admin/Integrations/Integrations'));
const TeamsNotification = React.lazy(() => import('./components/admin/notifications/MsTeams/Teams'));
// Shared layout, etc.
diff --git a/client-reactjs/src/components/admin/ClusterDetails.jsx b/client-reactjs/src/components/admin/ClusterDetails.jsx
index 3891416d5..fb73693b0 100644
--- a/client-reactjs/src/components/admin/ClusterDetails.jsx
+++ b/client-reactjs/src/components/admin/ClusterDetails.jsx
@@ -60,7 +60,7 @@ function ClusterDetails() {
return (
-
+
{clusterMetaData ? (
<>
diff --git a/client-reactjs/src/components/admin/Integrations/IntegrationForms/ASRForm.js b/client-reactjs/src/components/admin/Integrations/IntegrationForms/ASRForm.js
new file mode 100644
index 000000000..a068abbbe
--- /dev/null
+++ b/client-reactjs/src/components/admin/Integrations/IntegrationForms/ASRForm.js
@@ -0,0 +1,137 @@
+import React from 'react';
+import { useEffect, useState } from 'react';
+import { Form, Select, Switch, Tabs, message } from 'antd';
+import { isEmail } from 'validator';
+import { getAllTeamsHook } from '../../../application/jobMonitoring/jobMonitoringUtils';
+
+const { TabPane } = Tabs;
+const { Option } = Select;
+
+const ASRForm = ({ setNotifications, notifications, setActive, selectedIntegration }) => {
+ const [notificationForm] = Form.useForm();
+ const [teamsHooks, setTeamsHook] = useState([]);
+
+ useEffect(() => {
+ //Get all teams hook
+ (async () => {
+ try {
+ const allTeamsHook = await getAllTeamsHook();
+ setTeamsHook(allTeamsHook);
+ } catch (error) {
+ message.error('Error fetching teams hook');
+ }
+ })();
+ }, []);
+
+ useEffect(() => {
+ notificationForm.setFieldsValue({
+ notificationEmailsSev3: selectedIntegration?.metaData?.notificationEmailsSev3,
+ megaphone: selectedIntegration?.config?.megaphoneActive,
+ notificationEmails: selectedIntegration?.metaData?.notificationEmails,
+ notificationWebhooks: selectedIntegration?.metaData?.notificationWebhooks,
+ });
+ }, [selectedIntegration]);
+
+ return (
+ <>
+
+ >
+ );
+};
+export default ASRForm;
diff --git a/client-reactjs/src/components/admin/Integrations.js b/client-reactjs/src/components/admin/Integrations/Integrations.js
similarity index 62%
rename from client-reactjs/src/components/admin/Integrations.js
rename to client-reactjs/src/components/admin/Integrations/Integrations.js
index 9c73ed006..5dc6d9f09 100644
--- a/client-reactjs/src/components/admin/Integrations.js
+++ b/client-reactjs/src/components/admin/Integrations/Integrations.js
@@ -1,11 +1,12 @@
import React, { useState, useEffect } from 'react';
-import { Tooltip, Space, Table, Switch, Modal, Form, Input, Button, message } from 'antd';
+import { Tooltip, Space, Table, Switch, Modal, Button, message } from 'antd';
import { EditOutlined } from '@ant-design/icons';
-import BreadCrumbs from '../common/BreadCrumbs.js';
-import { authHeader } from '../common/AuthHeader.js';
+import BreadCrumbs from '../../common/BreadCrumbs.js';
+import { authHeader } from '../../common/AuthHeader.js';
import { useSelector, useDispatch } from 'react-redux';
-import { applicationActions } from '../../redux/actions/Application.js';
-import useWindowSize from '../../hooks/useWindowSize.js';
+import { applicationActions } from '../../../redux/actions/Application.js';
+import useWindowSize from '../../../hooks/useWindowSize.js';
+import ASRForm from './IntegrationForms/ASRForm.js';
const Integrations = () => {
const [integrations, setIntegrations] = useState([]);
@@ -15,7 +16,7 @@ const Integrations = () => {
const [selectedIntegration, setSelectedIntegration] = useState({});
const [notifications, setNotifications] = useState({});
const [active, setActive] = useState(false);
- const [notificationForm] = Form.useForm();
+
const windowSize = useWindowSize();
// Changes modal size per screen vw
@@ -24,6 +25,7 @@ const Integrations = () => {
if (width > 1500) {
setModalWidth('40vw');
} else if (width > 1000) {
+ integrations;
setModalWidth('60vw');
} else {
setModalWidth('100vw');
@@ -48,6 +50,7 @@ const Integrations = () => {
const response = await fetch(`/api/integrations/get/${applicationId}`, payload);
const data = await response.json();
+
if (data) {
setIntegrations(data);
}
@@ -61,6 +64,7 @@ const Integrations = () => {
await setModalVisible(true);
await setSelectedIntegration(record);
await setNotifications(record.metaData);
+ await setActive(record.config?.megaphoneActive);
};
const handleSave = async () => {
@@ -82,7 +86,6 @@ const Integrations = () => {
setModalVisible(false);
dispatch(applicationActions.getIntegrations(applicationId));
- notificationForm.resetFields();
message.success('Successfully updated Integration');
} else {
message.success('An Error Occured, Integration not updated');
@@ -158,48 +161,17 @@ const Integrations = () => {
destroyOnClose
footer={saveBtn}
title="Integration Settings">
-
- setNotifications({ ...notifications, notificationEmailsSev3: e.target.value })}>
-
-
- Megaphone Notification Settings
-
- {
- setActive(e);
- }}>
-
-
- setNotifications({ ...notifications, notificationEmails: e.target.value })}>
-
-
- setNotifications({ ...notifications, notificationWebhooks: e.target.value })}>
-
-
+ {selectedIntegration?.name === 'ASR' && (
+ <>
+
+ >
+ )}
>
);
diff --git a/client-reactjs/src/components/application/Dataflow/DataflowDetails.js b/client-reactjs/src/components/application/Dataflow/DataflowDetails.js
index 8af266379..bc416e988 100644
--- a/client-reactjs/src/components/application/Dataflow/DataflowDetails.js
+++ b/client-reactjs/src/components/application/Dataflow/DataflowDetails.js
@@ -33,6 +33,7 @@ function DataflowDetails() {