File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
administration/alert-configuration
gdap-management/onboarding Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,7 @@ export const CippWizardOffboarding = (props) => {
300
300
onPreviousStep = { onPreviousStep }
301
301
onNextStep = { onNextStep }
302
302
formControl = { formControl }
303
+ replacementBehaviour = "removeNulls"
303
304
/>
304
305
</ Stack >
305
306
) ;
Original file line number Diff line number Diff line change @@ -13,14 +13,24 @@ export const CippWizardStepButtons = (props) => {
13
13
formControl,
14
14
noNextButton = false ,
15
15
noSubmitButton = false ,
16
+ replacementBehaviour,
16
17
queryKeys,
17
18
...other
18
19
} = props ;
19
20
const { isValid, isSubmitted, isSubmitting } = useFormState ( { control : formControl . control } ) ;
20
21
const sendForm = ApiPostCall ( { relatedQueryKeys : queryKeys } ) ;
21
22
const handleSubmit = ( ) => {
22
23
const values = formControl . getValues ( ) ;
23
- sendForm . mutate ( { url : postUrl , data : values } ) ;
24
+ const newData = { } ;
25
+ Object . keys ( values ) . forEach ( ( key ) => {
26
+ const value = values [ key ] ;
27
+ if ( replacementBehaviour !== "removeNulls" ) {
28
+ newData [ key ] = value ;
29
+ } else if ( row [ value ] !== undefined ) {
30
+ newData [ key ] = row [ value ] ;
31
+ }
32
+ } ) ;
33
+ sendForm . mutate ( { url : postUrl , data : newData } ) ;
24
34
} ;
25
35
26
36
return (
Original file line number Diff line number Diff line change @@ -206,12 +206,21 @@ const AlertWizard = () => {
206
206
} ;
207
207
208
208
const handleScriptSubmit = ( values ) => {
209
+ const getInputParams = ( ) => {
210
+ if ( values . command . value . requiresInput ) {
211
+ return {
212
+ [ values . command . value . inputName ] : values [ values . command . value . inputName ] ,
213
+ } ;
214
+ }
215
+ return { } ;
216
+ } ;
217
+
209
218
const postObject = {
210
219
RowKey : router . query . clone ? undefined : router . query . id ? router . query . id : undefined ,
211
220
tenantFilter : values . tenantFilter ?. value ,
212
221
Name : `${ values . tenantFilter . value } : ${ values . command . label } ` ,
213
222
Command : { value : `Get-CIPPAlert${ values . command . value . name } ` } ,
214
- Parameters : { } ,
223
+ Parameters : getInputParams ( ) ,
215
224
ScheduledTime : Math . floor ( new Date ( ) . getTime ( ) / 1000 ) + 60 ,
216
225
Recurrence : values . recurrence ,
217
226
PostExecution : values . postExecution ,
Original file line number Diff line number Diff line change @@ -205,8 +205,8 @@ const Page = () => {
205
205
} ) ;
206
206
207
207
var missingDefaults = [ ] ;
208
- relationshipRoles . forEach ( ( role ) => {
209
- if ( ! cippDefaults ?. find ( ( defaultRole ) => defaultRole . value === role . roleDefinitionId ) ) {
208
+ cippDefaults . forEach ( ( defaultRole ) => {
209
+ if ( ! relationshipRoles ?. find ( ( role ) => defaultRole . value === role . roleDefinitionId ) ) {
210
210
missingDefaults . push ( role ) ;
211
211
}
212
212
} ) ;
You can’t perform that action at this time.
0 commit comments