Skip to content

Commit

Permalink
grabbing ASR Integration from redux
Browse files Browse the repository at this point in the history
  • Loading branch information
ydahal1 committed Feb 2, 2024
1 parent 5e4da54 commit e4b3b39
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const AddEditJobMonitoringModal = ({
jobMonitorings,
setEditingData,
isEditing,
asrIntegration,
erroneousTabs,
setErroneousTabs,
setErroneousScheduling,
Expand Down Expand Up @@ -79,16 +78,13 @@ const AddEditJobMonitoringModal = ({
setCronMessage={setCronMessage}
erroneousScheduling={erroneousScheduling}
monitoringScope={monitoringScope}
asrIntegration={asrIntegration}
/>
),
},
{
label: 'Notifications',
id: 3,
component: () => (
<JobMonitoringNotificationTab form={form} teamsHooks={teamsHooks} asrIntegration={asrIntegration} />
),
component: () => <JobMonitoringNotificationTab form={form} teamsHooks={teamsHooks} />,
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//Packages
import React from 'react';
import { useSelector } from 'react-redux';
import { Form, Card, Select } from 'antd';
import { isEmail } from 'validator';

Expand All @@ -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 (
<Card>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import { useSelector } from 'react-redux';
import { Checkbox, Card, Form, Input } from 'antd';

import './jobMonitoring.css';
Expand All @@ -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 (
<div>
{/* Cluster wide monitoring does not require scheduling because all you are doing is monitoring the new work units in cluster that meet notification conditions */}
Expand Down Expand Up @@ -64,7 +71,7 @@ function JobMonitoringTab({
},
},
]}>
<Input type="number" min={1} max={1440} style={{ width: '100%' }} placeholder="Threshold (in minutes)" />
<Input type="number" min={1} max={1440} style={{ width: '50%' }} placeholder="Threshold (in minutes)" />
</Form.Item>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ function JobMonitoring() {
}
}, [editingData]);

//TODO - Grab ASR integration flag from redux
const asrIntegration = true;

// Create form instance
const [form] = Form.useForm();

Expand Down Expand Up @@ -289,7 +286,6 @@ function JobMonitoring() {
jobMonitorings={jobMonitorings}
setEditingData={setEditingData}
isEditing={editingData.isEditing}
asrIntegration={asrIntegration}
erroneousTabs={erroneousTabs}
setErroneousTabs={setErroneousTabs}
setErroneousScheduling={setErroneousScheduling}
Expand Down

0 comments on commit e4b3b39

Please sign in to comment.