chore: sync GovOPlaN module split state

This commit is contained in:
2026-07-10 12:51:21 +02:00
parent 670f0d9b6f
commit 5413ddfc32
22 changed files with 2732 additions and 27 deletions

View File

@@ -0,0 +1,146 @@
from __future__ import annotations
from govoplan_core.core.modules import (
DocumentationLink,
DocumentationTopic,
FrontendModule,
FrontendRoute,
ModuleContext,
ModuleManifest,
NavItem,
PermissionDefinition,
RoleTemplate,
)
DOCS_READ_SCOPE = "docs:documentation:read"
DOCS_READ_SCOPES = (DOCS_READ_SCOPE, "system:settings:read", "admin:settings:read")
def _permission(scope: str, label: str, description: str) -> PermissionDefinition:
module_id, resource, action = scope.split(":", 2)
return PermissionDefinition(
scope=scope,
label=label,
description=description,
category="Documentation",
level="tenant",
module_id=module_id,
resource=resource,
action=action,
)
def _route_factory(context: ModuleContext):
del context
from govoplan_docs.backend.api.v1.routes import router
return router
manifest = ModuleManifest(
id="docs",
name="Docs",
version="0.1.6",
dependencies=("access",),
optional_dependencies=("policy", "audit", "ops", "workflow", "search"),
permissions=(
_permission(
DOCS_READ_SCOPE,
"View configured documentation",
"Read documentation generated from installed modules, visible routes, permissions, and evidence sources.",
),
),
role_templates=(
RoleTemplate(
slug="docs_reader",
name="Documentation reader",
description="Read the configured-system documentation browser.",
permissions=(DOCS_READ_SCOPE,),
),
),
route_factory=_route_factory,
nav_items=(NavItem(path="/docs", label="Docs", icon="reports", required_any=DOCS_READ_SCOPES, order=880),),
frontend=FrontendModule(
module_id="docs",
package_name="@govoplan/docs-webui",
routes=(FrontendRoute(path="/docs", component="DocsPage", required_any=DOCS_READ_SCOPES, order=880),),
nav_items=(NavItem(path="/docs", label="Docs", icon="reports", required_any=DOCS_READ_SCOPES, order=880),),
),
documentation=(
DocumentationTopic(
id="docs.configured-system-documentation",
title="Configured system documentation",
summary="This documentation page starts with installed modules, active configuration, visible routes, and permissions for the current actor.",
body="Module manifests can contribute durable documentation topics. Modules can also register runtime documentation providers when content depends on tenant policy, installed integrations, or operational settings.",
layer="always",
documentation_types=("admin", "user"),
audience=("tenant_admin", "operator", "module_admin"),
order=10,
i18n_key="docs.topic.configured_system_documentation",
translations={
"de": {
"title": "Dokumentation dieses Systems",
"summary": "Diese Dokumentation beginnt mit den installierten Modulen, der aktiven Konfiguration und den Funktionen, die fuer diese Rolle sichtbar sind.",
"body": "Module koennen feste Dokumentationsabschnitte beitragen. Wenn Inhalte von Tenant-Regeln, installierten Integrationen oder Betriebsoptionen abhaengen, kann ein Modul laufzeitbasierte Dokumentation registrieren.",
},
},
links=(
DocumentationLink(
label="Public GovOPlaN module documentation",
href="https://govplan.add-ideas.de/",
kind="public",
),
DocumentationLink(
label="Documentation layer concept",
href="govoplan-docs/docs/DOCUMENTATION_LAYER_CONCEPT.md",
kind="repository",
),
DocumentationLink(
label="Instance-aware documentation contract",
href="govoplan-docs/docs/INSTANCE_AWARE_DOCUMENTATION.md",
kind="repository",
),
),
metadata={"kind": "system"},
),
DocumentationTopic(
id="docs.pattern.field-help",
title="Field help marker",
summary="A small help marker next to a label gives local context without turning dense forms into manuals.",
body="Use the marker for short explanations of a field, option, or compact term. Link to a workflow or reference topic when the reader needs steps, API mapping, policy provenance, or operational detail.",
layer="always",
documentation_types=("admin", "user"),
audience=("user", "tenant_admin", "operator", "module_admin"),
order=20,
i18n_key="docs.topic.pattern.field_help",
links=(
DocumentationLink(
label="Documentation experience concept",
href="govoplan-docs/docs/DOCUMENTATION_EXPERIENCE_CONCEPT.md",
kind="repository",
),
),
metadata={
"kind": "pattern",
"pattern_id": "field-help-marker",
"purpose": "Keep labels scannable while making short explanations available on demand.",
"when_used": "Form labels, toggle labels, effective-value rows, and compact admin terms.",
"user_explanation": "Open the marker when a label is unclear. It should explain the local choice in one or two sentences.",
"admin_explanation": "Field help stays local. Longer procedural, API, or policy explanations belong in linked workflow or reference topics.",
"component_refs": [
"govoplan-core/webui/src/components/help/FieldLabel.tsx",
"govoplan-core/webui/src/components/help/InlineHelp.tsx",
"govoplan-core/webui/src/utils/fieldHelp.ts",
],
"related_topic_ids": [
"access.reference.admin-access-fields",
"access.workflow.grant-user-access",
],
},
),
),
)
def get_manifest() -> ModuleManifest:
return manifest