From 60f50f7906f19241497ac00c66db022ad3adb0ed Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Thu, 6 Aug 2026 19:02:55 +0200 Subject: [PATCH] Contribute Postbox to Quick Access --- src/govoplan_postbox/backend/manifest.py | 62 +++++++++++++++++++ .../test_interface_documentation_contract.py | 2 +- webui/src/i18n/generatedTranslations.ts | 2 + webui/src/module.ts | 25 +++++++- 4 files changed, 88 insertions(+), 3 deletions(-) diff --git a/src/govoplan_postbox/backend/manifest.py b/src/govoplan_postbox/backend/manifest.py index ec3184c..03f807d 100644 --- a/src/govoplan_postbox/backend/manifest.py +++ b/src/govoplan_postbox/backend/manifest.py @@ -28,6 +28,8 @@ from govoplan_core.core.modules import ( ModuleManifest, NavItem, PermissionDefinition, + ProductAreaContribution, + QuickAccessTool, RoleTemplate, ) from govoplan_core.core.provider_governance import declared_module_architecture @@ -357,6 +359,39 @@ manifest = ModuleManifest( label="Postbox templates and bindings", order=30, ), + ViewSurface( + id="postbox.quick_access.messages", + module_id=MODULE_ID, + kind="quick_access", + label="Postbox Quick Access", + order=35, + ), + ), + product_areas=( + ProductAreaContribution( + id="communication", + module_id=MODULE_ID, + label="i18n:govoplan-core.product_area.communication", + icon="mail", + description="i18n:govoplan-core.product_area.communication_description", + surface_ids=("postbox.nav.postbox", "postbox.route.postbox"), + order=40, + ), + ), + quick_access_tools=( + QuickAccessTool( + id="postbox.messages", + module_id=MODULE_ID, + category_id="messages", + label="i18n:govoplan-postbox.postbox", + description="i18n:govoplan-postbox.quick_access_description", + surface_id="postbox.quick_access.messages", + icon="inbox", + full_page_path="/postbox", + required_any=(READ_SCOPE,), + order=20, + modes=("browse", "author"), + ), ), ), route_factory=_router, @@ -393,6 +428,33 @@ manifest = ModuleManifest( CAPABILITY_POSTBOX_ROUTING: _configure, }, documentation=( + DocumentationTopic( + id="postbox.quick-access-and-product-area", + title="Postbox in Communication and Messages", + summary="Use function-bound Postboxes in Communication and the shared Messages Quick Access drawer.", + body=( + "Postbox contributes its inbox to Communication. With Quick Access enabled, its owner-rendered unread summary " + "appears beside Mail and future chat providers inside Messages while retaining function assignment, classification, " + "read-receipt, retention, encryption, and evidence semantics in Postbox." + ), + layer="configured", + documentation_types=("user", "admin"), + audience=("administrator", "user", "campaign_manager"), + related_modules=("quick_access", "views", "mail"), + translations={ + "de": { + "title": "Postfach in Kommunikation und Nachrichten", + "summary": "Funktionsgebundene Postfächer in Kommunikation und der gemeinsamen Schnellzugriffseinblendung Nachrichten verwenden.", + "body": ( + "Postbox ordnet seinen Eingang Kommunikation zu. Ist der Schnellzugriff aktiviert, erscheint die vom Modul gerenderte " + "Zusammenfassung ungelesener Nachrichten neben Mail und künftigen Chat-Anbietern unter Nachrichten. " + "Funktionszuordnung, Klassifikation, Lesestatus, Aufbewahrung, Verschlüsselung und Nachweise verbleiben bei Postbox." + ), + } + }, + metadata={"kind": "reference", "help_contexts": ["postbox.quick_access.messages"]}, + order=33, + ), DocumentationTopic( id="postbox.search.messages", title="Search authorized Postbox messages", diff --git a/tests/test_interface_documentation_contract.py b/tests/test_interface_documentation_contract.py index 7efcd35..ad73575 100644 --- a/tests/test_interface_documentation_contract.py +++ b/tests/test_interface_documentation_contract.py @@ -18,6 +18,7 @@ class PostboxInterfaceDocumentationContractTests(unittest.TestCase): "postbox.admin.templates", "postbox.inbox.directory", "postbox.inbox.messages", + "postbox.quick_access.messages", "postbox.widget.inbox", }, {surface.id for surface in frontend.view_surfaces}, # type: ignore[union-attr] @@ -43,4 +44,3 @@ class PostboxInterfaceDocumentationContractTests(unittest.TestCase): if __name__ == "__main__": unittest.main() - diff --git a/webui/src/i18n/generatedTranslations.ts b/webui/src/i18n/generatedTranslations.ts index 235abdf..c58b522 100644 --- a/webui/src/i18n/generatedTranslations.ts +++ b/webui/src/i18n/generatedTranslations.ts @@ -2,6 +2,7 @@ import type { PlatformTranslations } from "@govoplan/core-webui"; const en = { "i18n:govoplan-postbox.postbox": "Postbox", + "i18n:govoplan-postbox.quick_access_description": "Institutional messages addressed to your functions.", "i18n:govoplan-postbox.postboxes": "Postboxes", "i18n:govoplan-postbox.postbox_inbox": "Postbox inbox", "i18n:govoplan-postbox.postbox_inbox_description": "Unread messages across accessible Postboxes.", @@ -235,6 +236,7 @@ const en = { const de = { ...en, "i18n:govoplan-postbox.postbox": "Postfach", + "i18n:govoplan-postbox.quick_access_description": "Institutionelle Nachrichten an Ihre Funktionen.", "i18n:govoplan-postbox.postboxes": "Postfächer", "i18n:govoplan-postbox.postbox_inbox": "Postfach-Eingang", "i18n:govoplan-postbox.postbox_inbox_description": "Ungelesene Nachrichten aus zugänglichen Postfächern.", diff --git a/webui/src/module.ts b/webui/src/module.ts index 58b9489..bdd012b 100644 --- a/webui/src/module.ts +++ b/webui/src/module.ts @@ -3,7 +3,8 @@ import { hasScope, type AdminSectionsUiCapability, type DashboardWidgetsUiCapability, - type PlatformWebModule + type PlatformWebModule, + type QuickAccessToolsUiCapability } from "@govoplan/core-webui"; import { generatedTranslations } from "./i18n/generatedTranslations"; import PostboxInboxWidget from "./features/postbox/PostboxInboxWidget"; @@ -59,6 +60,18 @@ const postboxDashboardWidgets: DashboardWidgetsUiCapability = { } ] }; +const postboxQuickAccessTools: QuickAccessToolsUiCapability = { + tools: [ + { + id: "postbox.messages", + render: ({ settings }) => createElement(PostboxInboxWidget, { + settings, + refreshKey: 0, + configuration: { maxItems: 7 } + }) + } + ] +}; const postboxAdminSections: AdminSectionsUiCapability = { sections: [ @@ -152,11 +165,19 @@ export const postboxModule: PlatformWebModule = { kind: "section", label: "i18n:govoplan-postbox.postbox_templates_bindings", order: 30 + }, + { + id: "postbox.quick_access.messages", + moduleId: "postbox", + kind: "quick_access", + label: "Postbox Quick Access", + order: 35 } ], uiCapabilities: { "admin.sections": postboxAdminSections, - "dashboard.widgets": postboxDashboardWidgets + "dashboard.widgets": postboxDashboardWidgets, + "quickAccess.tools": postboxQuickAccessTools } };