From da98f976de106da0f1cbd20c2c771109b991e585 Mon Sep 17 00:00:00 2001 From: Zac Richards <107489668+Zacgoose@users.noreply.github.com> Date: Tue, 5 Aug 2025 18:49:41 +0800 Subject: [PATCH] Add start date-time picker to alert configuration Introduces a date-time picker for specifying the desired start time of an alert. The start time is parsed from the alert data if available and included in form state and submission payload. --- .../alert-configuration/alert.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pages/tenant/administration/alert-configuration/alert.jsx b/src/pages/tenant/administration/alert-configuration/alert.jsx index fc3950a47a4e..44e85901284f 100644 --- a/src/pages/tenant/administration/alert-configuration/alert.jsx +++ b/src/pages/tenant/administration/alert-configuration/alert.jsx @@ -132,6 +132,13 @@ const AlertWizard = () => { }; } + // Parse the original desired start date-time from DesiredStartTime field if it exists + let startDateTimeForForm = null; + if (alert.RawAlert.DesiredStartTime && alert.RawAlert.DesiredStartTime !== "0") { + const desiredStartEpoch = parseInt(alert.RawAlert.DesiredStartTime); + startDateTimeForForm = desiredStartEpoch; + } + // Create the reset object with all the form values const resetObject = { tenantFilter: tenantFilterForForm, @@ -139,6 +146,7 @@ const AlertWizard = () => { command: { value: usedCommand, label: usedCommand.label }, recurrence: recurrenceOption, postExecution: postExecutionValue, + startDateTime: startDateTimeForForm, }; // Parse Parameters field if it exists and is a string @@ -332,6 +340,7 @@ const AlertWizard = () => { Command: { value: `Get-CIPPAlert${values.command.value.name}` }, Parameters: getInputParams(), ScheduledTime: Math.floor(new Date().getTime() / 1000) + 60, + DesiredStartTime: values.startDateTime ? values.startDateTime.toString() : null, Recurrence: values.recurrence, PostExecution: values.postExecution, }; @@ -700,6 +709,15 @@ const AlertWizard = () => { options={recurrenceOptions} // Use the state-managed recurrenceOptions here /> + + + {commandValue?.value?.requiresInput && (