@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
import { CButton , CCallout , CCol , CForm , CRow , CSpinner , CTooltip } from '@coreui/react'
3
3
import { useSelector } from 'react-redux'
4
4
import { Field , Form , FormSpy } from 'react-final-form'
5
- import { RFFCFormSwitch } from 'src/components/forms'
5
+ import { RFFCFormInput , RFFCFormSwitch } from 'src/components/forms'
6
6
import {
7
7
useGenericGetRequestQuery ,
8
8
useLazyGenericGetRequestQuery ,
@@ -14,7 +14,6 @@ import { CippContentCard, CippPage, CippPageList } from 'src/components/layout'
14
14
import { CellTip } from 'src/components/tables/CellGenericFormat'
15
15
import 'react-datepicker/dist/react-datepicker.css'
16
16
import { CippActionsOffcanvas , ModalService , TenantSelector } from 'src/components/utilities'
17
- import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas'
18
17
import arrayMutators from 'final-form-arrays'
19
18
const alertsList = [
20
19
{ name : 'MFAAlertUsers' , label : 'Alert on users without any form of MFA' } ,
@@ -30,12 +29,14 @@ const alertsList = [
30
29
label : 'Alert on % mailbox quota used' ,
31
30
requiresInput : true ,
32
31
inputLabel : 'Enter quota percentage' ,
32
+ inputName : 'QuotaUsedQuota' ,
33
33
} ,
34
34
{
35
35
name : 'SharePointQuota' ,
36
36
label : 'Alert on % SharePoint quota used' ,
37
37
requiresInput : true ,
38
38
inputLabel : 'Enter quota percentage' ,
39
+ inputName : 'SharePointQuotaQuota' ,
39
40
} ,
40
41
{ name : 'ExpiringLicenses' , label : 'Alert on licenses expiring in 30 days' } ,
41
42
{ name : 'SecDefaultsUpsell' , label : 'Alert on Security Defaults automatic enablement' } ,
@@ -215,16 +216,13 @@ const ListClassicAlerts = () => {
215
216
{ alert . requiresInput && (
216
217
< FormSpy subscription = { { values : true } } >
217
218
{ ( { values } ) => {
218
- // Check if the switch for this alert is turned on before showing the input
219
219
if ( values [ alert . name ] ) {
220
220
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 } ` }
225
223
placeholder = { alert . inputLabel }
226
224
initialValue = { alert . defaultValue } // Set the initial value
227
- parse = { ( value ) => Number ( value ) } // Ensure value is a number
225
+ type = " number"
228
226
/>
229
227
)
230
228
}
0 commit comments