From 9234b93a4c39f9cfa80452dfc0d051a0c655d849 Mon Sep 17 00:00:00 2001 From: Lukas Lengler Date: Thu, 9 Jan 2025 11:27:35 +0100 Subject: [PATCH] notifications: fix empty space being shown in stage 2 recap Change-Id: Ibb15fa76470ce940270cab2cc77fbbac3a974d0e --- cmk/gui/wato/pages/notifications/quick_setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmk/gui/wato/pages/notifications/quick_setup.py b/cmk/gui/wato/pages/notifications/quick_setup.py index aa405b7fa2f..7c05ff05ea1 100644 --- a/cmk/gui/wato/pages/notifications/quick_setup.py +++ b/cmk/gui/wato/pages/notifications/quick_setup.py @@ -421,6 +421,19 @@ def _get_condition_choices() -> dict[str, ConditionGroup]: return choices +def custom_recap_formspec_filter_for_hosts_and_services( + quick_setup_id: QuickSetupId, + stage_index: StageIndex, + all_stages_form_data: ParsedFormData, +) -> Sequence[Widget]: + cleaned_stages_form_data = { + form_spec_wrapper_id: form_data + for form_spec_wrapper_id, form_data in all_stages_form_data.items() + if len(form_data) > 0 + } + return recaps.recaps_form_spec(quick_setup_id, stage_index, cleaned_stages_form_data) + + def filter_for_hosts_and_services() -> QuickSetupStage: def _components() -> Sequence[Widget]: return [ @@ -805,7 +818,7 @@ def _components() -> Sequence[Widget]: QuickSetupStageAction( id=ActionId("action"), custom_validators=[], - recap=[recaps.recaps_form_spec], + recap=[custom_recap_formspec_filter_for_hosts_and_services], next_button_label=_("Next step: Notification method (plug-in)"), ) ],