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 index d1364c53b..a068abbbe 100644 --- a/client-reactjs/src/components/admin/Integrations/IntegrationForms/ASRForm.js +++ b/client-reactjs/src/components/admin/Integrations/IntegrationForms/ASRForm.js @@ -1,16 +1,29 @@ import React from 'react'; -import { useEffect } from 'react'; -import { Form, Input, Switch, Tabs } from 'antd'; +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(() => { - console.log('setting fields values'); - console.log(selectedIntegration); + //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, @@ -22,7 +35,7 @@ const ASRForm = ({ setNotifications, notifications, setActive, selectedIntegrati return ( <>
- +

General

- - setNotifications({ ...notifications, notificationEmailsSev3: e.target.value }) - }> + rules={[ + { + validator: (_, value) => { + if (!value || value.length === 0) { + return Promise.reject(new Error('Please add at least one email!')); + } + if (value.length > 20) { + return Promise.reject(new Error('Too many emails')); + } + if (!value.every((v) => isEmail(v))) { + return Promise.reject(new Error('One or more emails are invalid')); + } + return Promise.resolve(); + }, + }, + ]}> + setNotifications({ ...notifications, notificationEmails: e.target.value })}> + rules={[ + { + validator: (_, value) => { + if (!value || value.length === 0) { + return Promise.reject(new Error('Please add at least one email!')); + } + if (value.length > 20) { + return Promise.reject(new Error('Too many emails')); + } + if (!value.every((v) => isEmail(v))) { + return Promise.reject(new Error('One or more emails are invalid')); + } + return Promise.resolve(); + }, + }, + ]}> + setNotifications({ ...notifications, notificationWebhooks: e.target.value })}> + validateTrigger={['onChange', 'onBlur']}> +
diff --git a/client-reactjs/src/components/admin/Integrations/Integrations.js b/client-reactjs/src/components/admin/Integrations/Integrations.js index 73c83d07e..5dc6d9f09 100644 --- a/client-reactjs/src/components/admin/Integrations/Integrations.js +++ b/client-reactjs/src/components/admin/Integrations/Integrations.js @@ -25,6 +25,7 @@ const Integrations = () => { if (width > 1500) { setModalWidth('40vw'); } else if (width > 1000) { + integrations; setModalWidth('60vw'); } else { setModalWidth('100vw'); @@ -49,6 +50,7 @@ const Integrations = () => { const response = await fetch(`/api/integrations/get/${applicationId}`, payload); const data = await response.json(); + if (data) { setIntegrations(data); } @@ -62,6 +64,7 @@ const Integrations = () => { await setModalVisible(true); await setSelectedIntegration(record); await setNotifications(record.metaData); + await setActive(record.config?.megaphoneActive); }; const handleSave = async () => { 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() {
) : null} - + } key="1"> } onChange={(activeKey) => this.setState({ selectedTabPaneKey: activeKey })}> diff --git a/client-reactjs/src/components/application/Jobs/ManualJobDetail.jsx b/client-reactjs/src/components/application/Jobs/ManualJobDetail.jsx index 427d01138..a6022c908 100644 --- a/client-reactjs/src/components/application/Jobs/ManualJobDetail.jsx +++ b/client-reactjs/src/components/application/Jobs/ManualJobDetail.jsx @@ -110,7 +110,7 @@ function ManualJobDetail() {
{}: {jobDetails.name}
- + } key="1"> {jobData.map((item, i) => ( diff --git a/client-reactjs/src/components/application/VisualizationDetails.js b/client-reactjs/src/components/application/VisualizationDetails.js index 87a8b20d9..8d856e92f 100644 --- a/client-reactjs/src/components/application/VisualizationDetails.js +++ b/client-reactjs/src/components/application/VisualizationDetails.js @@ -170,7 +170,7 @@ function VisualizationDetails() { return ( - + } key="1"> diff --git a/client-reactjs/src/components/application/actions/actions.jsx b/client-reactjs/src/components/application/actions/actions.jsx index 52081314a..c726b9dae 100644 --- a/client-reactjs/src/components/application/actions/actions.jsx +++ b/client-reactjs/src/components/application/actions/actions.jsx @@ -12,7 +12,7 @@ function Actions() {
- + } key="1"> diff --git a/client-reactjs/src/components/application/clusterMonitoring/index.jsx b/client-reactjs/src/components/application/clusterMonitoring/index.jsx index a7a9a966b..cddffee76 100644 --- a/client-reactjs/src/components/application/clusterMonitoring/index.jsx +++ b/client-reactjs/src/components/application/clusterMonitoring/index.jsx @@ -307,6 +307,7 @@ function ClusterMonitoring() { initialValues={{ msTeamsGroups: [''], emails: [''] }}> { setActiveTab(record); }}> diff --git a/client-reactjs/src/components/application/dashboard/ExportMenu/DashboardModal.jsx b/client-reactjs/src/components/application/dashboard/ExportMenu/DashboardModal.jsx index 452105069..bfd87b14f 100644 --- a/client-reactjs/src/components/application/dashboard/ExportMenu/DashboardModal.jsx +++ b/client-reactjs/src/components/application/dashboard/ExportMenu/DashboardModal.jsx @@ -131,7 +131,7 @@ const DashboardModal = ({ modalVisible, setModalVisible, applicationId, authRedu } footer={false} style={{ marginTop: '200px' }}> - +
diff --git a/client-reactjs/src/components/application/dashboard/clusterUsage/index.js b/client-reactjs/src/components/application/dashboard/clusterUsage/index.js index cb7612da7..6949e67d5 100644 --- a/client-reactjs/src/components/application/dashboard/clusterUsage/index.js +++ b/client-reactjs/src/components/application/dashboard/clusterUsage/index.js @@ -103,6 +103,7 @@ function ClusterUsage() { } activeKey={activeTab} + type="card" onChange={handleTabSwitching}> }> - + {selectedNotificationDetails.map((item) => ( diff --git a/client-reactjs/src/components/application/dashboard/notifications/index.js b/client-reactjs/src/components/application/dashboard/notifications/index.js index 1982b038b..4fd4d73fc 100644 --- a/client-reactjs/src/components/application/dashboard/notifications/index.js +++ b/client-reactjs/src/components/application/dashboard/notifications/index.js @@ -181,6 +181,7 @@ function Index() { return (