app: Add tags to menu and frontpage components

- Add typing information for init methods Info, Shortcut, and Menu to easily
  identify problems.

- Update docstrings for these components.

- Updates test cases to deal with tags instead of short description.

- Update custom shortcuts code to read tags and ignore short description.

- Update API to send tags instead of custom shortcuts.

- OpenVPN special treatment of info.description in Shortcut

Tests:

- All unit tests pass and type checking succeeds.

- All apps show icons with tags in apps and system section.

- In help section cards don't show tags.

- In front page, enabled apps show shortcuts with tags.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
Sunil Mohan Adapa authored and Joseph Nuthalapati committed 2025-01-09 21:08:10 +05:30
1 parent 196a2deb6f
commit 89bce7a344
75 files changed
+278 -318

No files matched your search

+4 -5
View File
@@ -64,7 +64,7 @@ class FeatherWikiApp(app_module.App):
self.add(info)
menu_item = menu.Menu('menu-featherwiki', info.name,
info.short_description, info.icon_filename,
info.icon_filename, info.tags,
'featherwiki:index', parent_url_name='apps')
self.add(menu_item)
@@ -72,11 +72,10 @@ class FeatherWikiApp(app_module.App):
# Expecting a large number of wiki files, so creating a shortcut for
# each file (like in ikiwiki's case) will crowd the front page.
shortcut = frontpage.Shortcut(
'shortcut-featherwiki', info.name,
short_description=info.short_description, icon=info.icon_filename,
'shortcut-featherwiki', info.name, icon=info.icon_filename,
description=info.description, manual_page=info.manual_page,
url='/featherwiki/', clients=info.clients, login_required=True,
allowed_groups=list(groups))
url='/featherwiki/', clients=info.clients, tags=info.tags,
login_required=True, allowed_groups=list(groups))
self.add(shortcut)
dropin_configs = DropinConfigs('dropin-configs-featherwiki', [