diff --git a/changes/bug-7752-save-host-status-webhook b/changes/bug-7752-save-host-status-webhook new file mode 100644 index 000000000..1a1e4e415 --- /dev/null +++ b/changes/bug-7752-save-host-status-webhook @@ -0,0 +1 @@ +* Users cannot save host status webhook without choosing required percent of hosts and days count in the app settings page \ No newline at end of file diff --git a/frontend/pages/admin/AppSettingsPage/cards/HostStatusWebhook/HostStatusWebhook.tsx b/frontend/pages/admin/AppSettingsPage/cards/HostStatusWebhook/HostStatusWebhook.tsx index 0e5925e2d..1f6450070 100644 --- a/frontend/pages/admin/AppSettingsPage/cards/HostStatusWebhook/HostStatusWebhook.tsx +++ b/frontend/pages/admin/AppSettingsPage/cards/HostStatusWebhook/HostStatusWebhook.tsx @@ -57,8 +57,18 @@ const HostStatusWebhook = ({ const validateForm = () => { const errors: IAppConfigFormErrors = {}; - if (enableHostStatusWebhook && !hostStatusWebhookDestinationURL) { - errors.destination_url = "Destination URL must be present"; + if (enableHostStatusWebhook) { + if (!hostStatusWebhookDestinationURL) { + errors.destination_url = "Destination URL must be present"; + } + + if (!hostStatusWebhookDaysCount) { + errors.days_count = "Number of days must be present"; + } + + if (!hostStatusWebhookDaysCount) { + errors.host_percentage = "Percentage of hosts must be present"; + } } setFormErrors(errors); @@ -180,6 +190,7 @@ const HostStatusWebhook = ({ name="hostStatusWebhookHostPercentage" value={hostStatusWebhookHostPercentage} parseTarget + onBlur={validateForm} tooltip={ "\
Select the minimum percentage of hosts that
must fail to check into Fleet in order to trigger
the webhook request.
Select the minimum number of days that the
configured Percentage of hosts must fail to
check into Fleet in order to trigger the
webhook request.