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) => {
300300 onPreviousStep = { onPreviousStep }
301301 onNextStep = { onNextStep }
302302 formControl = { formControl }
303+ replacementBehaviour = "removeNulls"
303304 />
304305 </ Stack >
305306 ) ;
Original file line number Diff line number Diff line change @@ -13,14 +13,24 @@ export const CippWizardStepButtons = (props) => {
1313 formControl,
1414 noNextButton = false ,
1515 noSubmitButton = false ,
16+ replacementBehaviour,
1617 queryKeys,
1718 ...other
1819 } = props ;
1920 const { isValid, isSubmitted, isSubmitting } = useFormState ( { control : formControl . control } ) ;
2021 const sendForm = ApiPostCall ( { relatedQueryKeys : queryKeys } ) ;
2122 const handleSubmit = ( ) => {
2223 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 } ) ;
2434 } ;
2535
2636 return (
Original file line number Diff line number Diff line change @@ -206,12 +206,21 @@ const AlertWizard = () => {
206206 } ;
207207
208208 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+
209218 const postObject = {
210219 RowKey : router . query . clone ? undefined : router . query . id ? router . query . id : undefined ,
211220 tenantFilter : values . tenantFilter ?. value ,
212221 Name : `${ values . tenantFilter . value } : ${ values . command . label } ` ,
213222 Command : { value : `Get-CIPPAlert${ values . command . value . name } ` } ,
214- Parameters : { } ,
223+ Parameters : getInputParams ( ) ,
215224 ScheduledTime : Math . floor ( new Date ( ) . getTime ( ) / 1000 ) + 60 ,
216225 Recurrence : values . recurrence ,
217226 PostExecution : values . postExecution ,
Original file line number Diff line number Diff line change @@ -205,8 +205,8 @@ const Page = () => {
205205 } ) ;
206206
207207 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 ) ) {
210210 missingDefaults . push ( role ) ;
211211 }
212212 } ) ;
You can’t perform that action at this time.
0 commit comments