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.

\ @@ -195,6 +206,7 @@ const HostStatusWebhook = ({ name="hostStatusWebhookDaysCount" value={hostStatusWebhookDaysCount} parseTarget + onBlur={validateForm} tooltip={ "\

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.

\ diff --git a/frontend/pages/admin/AppSettingsPage/cards/constants.ts b/frontend/pages/admin/AppSettingsPage/cards/constants.ts index a7c8d77a5..d50121e33 100644 --- a/frontend/pages/admin/AppSettingsPage/cards/constants.ts +++ b/frontend/pages/admin/AppSettingsPage/cards/constants.ts @@ -28,6 +28,8 @@ export interface IAppConfigFormErrors { user_name?: string | null; password?: string | null; destination_url?: string | null; + days_count?: string | null; + host_percentage?: string | null; host_expiry_window?: string | null; agent_options?: string | null; transparency_url?: string | null;