@@ -132,13 +132,21 @@ const AlertWizard = () => {
132
132
} ;
133
133
}
134
134
135
+ // Parse the original desired start date-time from DesiredStartTime field if it exists
136
+ let startDateTimeForForm = null ;
137
+ if ( alert . RawAlert . DesiredStartTime && alert . RawAlert . DesiredStartTime !== "0" ) {
138
+ const desiredStartEpoch = parseInt ( alert . RawAlert . DesiredStartTime ) ;
139
+ startDateTimeForForm = desiredStartEpoch ;
140
+ }
141
+
135
142
// Create the reset object with all the form values
136
143
const resetObject = {
137
144
tenantFilter : tenantFilterForForm ,
138
145
excludedTenants : excludedTenantsFormatted ,
139
146
command : { value : usedCommand , label : usedCommand . label } ,
140
147
recurrence : recurrenceOption ,
141
148
postExecution : postExecutionValue ,
149
+ startDateTime : startDateTimeForForm ,
142
150
} ;
143
151
144
152
// Parse Parameters field if it exists and is a string
@@ -332,6 +340,7 @@ const AlertWizard = () => {
332
340
Command : { value : `Get-CIPPAlert${ values . command . value . name } ` } ,
333
341
Parameters : getInputParams ( ) ,
334
342
ScheduledTime : Math . floor ( new Date ( ) . getTime ( ) / 1000 ) + 60 ,
343
+ DesiredStartTime : values . startDateTime ? values . startDateTime . toString ( ) : null ,
335
344
Recurrence : values . recurrence ,
336
345
PostExecution : values . postExecution ,
337
346
} ;
@@ -700,6 +709,15 @@ const AlertWizard = () => {
700
709
options = { recurrenceOptions } // Use the state-managed recurrenceOptions here
701
710
/>
702
711
</ Grid >
712
+ < Grid size = { 12 } >
713
+ < CippFormComponent
714
+ type = "datePicker"
715
+ name = "startDateTime"
716
+ formControl = { formControl }
717
+ label = "When should the first alert run?"
718
+ dateTimeType = "datetime"
719
+ />
720
+ </ Grid >
703
721
< Grid size = { 12 } >
704
722
{ commandValue ?. value ?. requiresInput && (
705
723
< CippFormComponent
0 commit comments