From e4b3b39737d6267c694aba8f226d93d15e770b03 Mon Sep 17 00:00:00 2001 From: yadhap Dahal Date: Fri, 2 Feb 2024 13:33:03 -0500 Subject: [PATCH] grabbing ASR Integration from redux --- .../jobMonitoring/AddEditJobMonitoringModal.jsx | 6 +----- .../jobMonitoring/JobMonitoringNotificationTab.jsx | 9 ++++++++- .../application/jobMonitoring/JobMonitoringTab.jsx | 11 +++++++++-- .../components/application/jobMonitoring/index.jsx | 4 ---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/client-reactjs/src/components/application/jobMonitoring/AddEditJobMonitoringModal.jsx b/client-reactjs/src/components/application/jobMonitoring/AddEditJobMonitoringModal.jsx index 081f0e815..ad3590b40 100644 --- a/client-reactjs/src/components/application/jobMonitoring/AddEditJobMonitoringModal.jsx +++ b/client-reactjs/src/components/application/jobMonitoring/AddEditJobMonitoringModal.jsx @@ -30,7 +30,6 @@ const AddEditJobMonitoringModal = ({ jobMonitorings, setEditingData, isEditing, - asrIntegration, erroneousTabs, setErroneousTabs, setErroneousScheduling, @@ -79,16 +78,13 @@ const AddEditJobMonitoringModal = ({ setCronMessage={setCronMessage} erroneousScheduling={erroneousScheduling} monitoringScope={monitoringScope} - asrIntegration={asrIntegration} /> ), }, { label: 'Notifications', id: 3, - component: () => ( - - ), + component: () => , }, ]; diff --git a/client-reactjs/src/components/application/jobMonitoring/JobMonitoringNotificationTab.jsx b/client-reactjs/src/components/application/jobMonitoring/JobMonitoringNotificationTab.jsx index 755e1f0c6..4caf47394 100644 --- a/client-reactjs/src/components/application/jobMonitoring/JobMonitoringNotificationTab.jsx +++ b/client-reactjs/src/components/application/jobMonitoring/JobMonitoringNotificationTab.jsx @@ -1,5 +1,6 @@ //Packages import React from 'react'; +import { useSelector } from 'react-redux'; import { Form, Card, Select } from 'antd'; import { isEmail } from 'validator'; @@ -16,7 +17,13 @@ const jobStatuses = [ { label: 'Threshold Exceeded', value: 'ThresholdExceeded' }, //TODO - If threshold exceed option is selected make threshold time input value required ]; -function JobMonitoringNotificationTab({ form, teamsHooks, asrIntegration }) { +function JobMonitoringNotificationTab({ form, teamsHooks }) { + //Redux + const { + applicationReducer: { integrations }, + } = useSelector((state) => state); + const asrIntegration = integrations?.find((integration) => integration.name === 'ASR') !== undefined; + // JSX return ( diff --git a/client-reactjs/src/components/application/jobMonitoring/JobMonitoringTab.jsx b/client-reactjs/src/components/application/jobMonitoring/JobMonitoringTab.jsx index 7731b1fdc..8b6c5d0a2 100644 --- a/client-reactjs/src/components/application/jobMonitoring/JobMonitoringTab.jsx +++ b/client-reactjs/src/components/application/jobMonitoring/JobMonitoringTab.jsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; import { Checkbox, Card, Form, Input } from 'antd'; import './jobMonitoring.css'; @@ -17,10 +18,16 @@ function JobMonitoringTab({ setCronMessage, erroneousScheduling, monitoringScope, - asrIntegration, }) { const [activateMonitoring, setActivateMonitoring] = useState(false); + //Redux + const { + applicationReducer: { integrations }, + } = useSelector((state) => state); + + const asrIntegration = integrations?.find((integration) => integration.name === 'ASR') !== undefined; + return (
{/* Cluster wide monitoring does not require scheduling because all you are doing is monitoring the new work units in cluster that meet notification conditions */} @@ -64,7 +71,7 @@ function JobMonitoringTab({ }, }, ]}> - + )} diff --git a/client-reactjs/src/components/application/jobMonitoring/index.jsx b/client-reactjs/src/components/application/jobMonitoring/index.jsx index 8cad1870b..90197b225 100644 --- a/client-reactjs/src/components/application/jobMonitoring/index.jsx +++ b/client-reactjs/src/components/application/jobMonitoring/index.jsx @@ -94,9 +94,6 @@ function JobMonitoring() { } }, [editingData]); - //TODO - Grab ASR integration flag from redux - const asrIntegration = true; - // Create form instance const [form] = Form.useForm(); @@ -289,7 +286,6 @@ function JobMonitoring() { jobMonitorings={jobMonitorings} setEditingData={setEditingData} isEditing={editingData.isEditing} - asrIntegration={asrIntegration} erroneousTabs={erroneousTabs} setErroneousTabs={setErroneousTabs} setErroneousScheduling={setErroneousScheduling}