Skip to content

Commit 9489fbb

Browse files
for now, this'll do.
1 parent c313de9 commit 9489fbb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/views/tenant/administration/ListAlertsQueue.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
22
import { CButton, CCallout, CCol, CForm, CRow, CSpinner, CTooltip } from '@coreui/react'
33
import { useSelector } from 'react-redux'
44
import { Field, Form, FormSpy } from 'react-final-form'
5-
import { RFFCFormSwitch } from 'src/components/forms'
5+
import { RFFCFormInput, RFFCFormSwitch } from 'src/components/forms'
66
import {
77
useGenericGetRequestQuery,
88
useLazyGenericGetRequestQuery,
@@ -14,7 +14,6 @@ import { CippContentCard, CippPage, CippPageList } from 'src/components/layout'
1414
import { CellTip } from 'src/components/tables/CellGenericFormat'
1515
import 'react-datepicker/dist/react-datepicker.css'
1616
import { CippActionsOffcanvas, ModalService, TenantSelector } from 'src/components/utilities'
17-
import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas'
1817
import arrayMutators from 'final-form-arrays'
1918
const alertsList = [
2019
{ name: 'MFAAlertUsers', label: 'Alert on users without any form of MFA' },
@@ -30,12 +29,14 @@ const alertsList = [
3029
label: 'Alert on % mailbox quota used',
3130
requiresInput: true,
3231
inputLabel: 'Enter quota percentage',
32+
inputName: 'QuotaUsedQuota',
3333
},
3434
{
3535
name: 'SharePointQuota',
3636
label: 'Alert on % SharePoint quota used',
3737
requiresInput: true,
3838
inputLabel: 'Enter quota percentage',
39+
inputName: 'SharePointQuotaQuota',
3940
},
4041
{ name: 'ExpiringLicenses', label: 'Alert on licenses expiring in 30 days' },
4142
{ name: 'SecDefaultsUpsell', label: 'Alert on Security Defaults automatic enablement' },
@@ -215,16 +216,13 @@ const ListClassicAlerts = () => {
215216
{alert.requiresInput && (
216217
<FormSpy subscription={{ values: true }}>
217218
{({ values }) => {
218-
// Check if the switch for this alert is turned on before showing the input
219219
if (values[alert.name]) {
220220
return (
221-
<Field
222-
name={`${alert.name}Quota`} // Unique name for the input field
223-
component="input"
224-
type="number"
221+
<RFFCFormInput
222+
name={`${alert.inputName}`}
225223
placeholder={alert.inputLabel}
226224
initialValue={alert.defaultValue} // Set the initial value
227-
parse={(value) => Number(value)} // Ensure value is a number
225+
type="number"
228226
/>
229227
)
230228
}

0 commit comments

Comments
 (0)