From 60797acdecd3c0cdceb30843ded85c1d88a23f23 Mon Sep 17 00:00:00 2001 From: Jose Naranjo Date: Tue, 17 Dec 2024 15:24:00 +0100 Subject: [PATCH] New ideas menu item Change-Id: I9836bd9698d1e1ebaaead6ca0a4882fc33caf9b2 --- cmk/gui/help_menu.py | 15 +++++++++++++++ .../src/themes/facelift/images/icon_lightbulb.svg | 3 +++ .../facelift/images/icon_lightbulb_idea.svg | 7 +++++++ tests/gui_e2e/test_menu_help.py | 5 +++++ tests/testlib/playwright/plugin.py | 6 +++++- tests/testlib/playwright/pom/page.py | 4 ++++ 6 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb.svg create mode 100644 packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb_idea.svg diff --git a/cmk/gui/help_menu.py b/cmk/gui/help_menu.py index 212cf2c4dae..03c3d58295e 100644 --- a/cmk/gui/help_menu.py +++ b/cmk/gui/help_menu.py @@ -178,6 +178,21 @@ def _fun(): icon="developer_resources", items=developer_items(), ), + TopicMenuTopic( + name="ideas_portal", + title=_("Ideas Portal"), + icon="lightbulb", + items=[ + TopicMenuItem( + name="suggest_product_improvement", + title=_("Suggest a product improvement"), + url="https://ideas.checkmk.com", + target="_blank", + sort_index=10, + icon="lightbulb_idea", + ), + ], + ), TopicMenuTopic( name="about_checkmk", title=_("About Checkmk"), diff --git a/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb.svg b/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb.svg new file mode 100644 index 00000000000..4e959748b08 --- /dev/null +++ b/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb_idea.svg b/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb_idea.svg new file mode 100644 index 00000000000..8de8052ecda --- /dev/null +++ b/packages/cmk-frontend/src/themes/facelift/images/icon_lightbulb_idea.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/gui_e2e/test_menu_help.py b/tests/gui_e2e/test_menu_help.py index b3c7753ccea..6e5756e7a8f 100644 --- a/tests/gui_e2e/test_menu_help.py +++ b/tests/gui_e2e/test_menu_help.py @@ -29,6 +29,11 @@ id="saas_status_page", marks=skip_if_not_saas_edition, ), + pytest.param( + "help_suggest_product_improvement", + "ideas.checkmk.com", + id="suggest_product_improvement", + ), ], ) def test_help_menu( diff --git a/tests/testlib/playwright/plugin.py b/tests/testlib/playwright/plugin.py index 2695b5c316f..88db21665c5 100644 --- a/tests/testlib/playwright/plugin.py +++ b/tests/testlib/playwright/plugin.py @@ -100,7 +100,11 @@ def fixture_context_launch_kwargs(pytestconfig: pytest.Config) -> dict[str, t.An .. _BrowserContext: https://playwright.dev/python/docs/api/class-browsercontext """ - kwargs = {"locale": pytestconfig.getoption("--locale")} + kwargs = { + "locale": pytestconfig.getoption("--locale"), + "user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 " + "Firefox/133.0", # Test test_help_menu.suggest_product_improvement needs it + } if pytestconfig.getoption("--video"): kwargs["record_video_dir"] = str(pytestconfig.getoption("--output")) kwargs["record_video_size"] = {"width": 1280, "height": 960} diff --git a/tests/testlib/playwright/pom/page.py b/tests/testlib/playwright/pom/page.py index 972dc8d113b..4cd3ce045ce 100644 --- a/tests/testlib/playwright/pom/page.py +++ b/tests/testlib/playwright/pom/page.py @@ -316,6 +316,10 @@ def help_info(self) -> Locator: def help_saas_status_page(self) -> Locator: return self.help_menu("Status page") + @property + def help_suggest_product_improvement(self) -> Locator: + return self.help_menu("Suggest a product improvement") + @property def help_werks(self) -> Locator: return self.help_menu("Change log (Werks)")