From f4fdba1bbb59a3c552c1a2f1bfb0a3e3444d0ec3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 13 Jan 2025 09:23:22 -0600 Subject: [PATCH] fix: add "Other" menu, for e.g. integration system links --- src/sideshow/web/menus.py | 11 +++++++++++ tests/web/test_menus.py | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/sideshow/web/menus.py b/src/sideshow/web/menus.py index 2c319cc..c8256fc 100644 --- a/src/sideshow/web/menus.py +++ b/src/sideshow/web/menus.py @@ -39,6 +39,7 @@ class SideshowMenuHandler(base.MenuHandler): self.make_customers_menu(request), self.make_products_menu(request), self.make_batch_menu(request), + self.make_other_menu(request), self.make_admin_menu(request), ] @@ -127,6 +128,16 @@ class SideshowMenuHandler(base.MenuHandler): ], } + def make_other_menu(self, request, **kwargs): + """ + Generate the "Other" menu. + """ + return { + 'title': "Other", + 'type': 'menu', + 'items': [], + } + def make_admin_menu(self, request, **kwargs): """ """ kwargs['include_people'] = True diff --git a/tests/web/test_menus.py b/tests/web/test_menus.py index 36fdc56..ed64232 100644 --- a/tests/web/test_menus.py +++ b/tests/web/test_menus.py @@ -9,4 +9,12 @@ class TestSideshowMenuHandler(WebTestCase): def test_make_menus(self): handler = mod.SideshowMenuHandler(self.config) menus = handler.make_menus(self.request) - self.assertEqual(len(menus), 5) + titles = [menu['title'] for menu in menus] + self.assertEqual(titles, [ + 'Orders', + 'Customers', + 'Products', + 'Batches', + 'Other', + 'Admin', + ])