Declare notification View surfaces
This commit is contained in:
@@ -4,8 +4,18 @@ from pathlib import Path
|
||||
|
||||
from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER
|
||||
from govoplan_core.core.module_guards import drop_table_retirement_provider, persistent_table_uninstall_guard
|
||||
from govoplan_core.core.modules import MigrationSpec, ModuleContext, ModuleInterfaceProvider, ModuleManifest, PermissionDefinition, RoleTemplate
|
||||
from govoplan_core.core.modules import (
|
||||
FrontendModule,
|
||||
FrontendRoute,
|
||||
MigrationSpec,
|
||||
ModuleContext,
|
||||
ModuleInterfaceProvider,
|
||||
ModuleManifest,
|
||||
PermissionDefinition,
|
||||
RoleTemplate,
|
||||
)
|
||||
from govoplan_core.core.notifications import CAPABILITY_NOTIFICATIONS_DISPATCH
|
||||
from govoplan_core.core.views import ViewSurface
|
||||
from govoplan_core.db.base import Base
|
||||
from govoplan_notifications.backend.db import models as notification_models # noqa: F401 - populate Notifications ORM metadata
|
||||
|
||||
@@ -82,6 +92,27 @@ manifest = ModuleManifest(
|
||||
role_templates=ROLE_TEMPLATES,
|
||||
route_factory=_notifications_router,
|
||||
tenant_summary_providers=(_tenant_summary,),
|
||||
frontend=FrontendModule(
|
||||
module_id=MODULE_ID,
|
||||
package_name="@govoplan/notifications-webui",
|
||||
routes=(
|
||||
FrontendRoute(
|
||||
path="/notifications",
|
||||
component="NotificationCenterPage",
|
||||
required_any=(READ_SCOPE,),
|
||||
order=59,
|
||||
),
|
||||
),
|
||||
view_surfaces=(
|
||||
ViewSurface(
|
||||
id="notifications.settings.preferences",
|
||||
module_id=MODULE_ID,
|
||||
kind="section",
|
||||
label="Notification preferences",
|
||||
order=40,
|
||||
),
|
||||
),
|
||||
),
|
||||
migration_spec=MigrationSpec(
|
||||
module_id=MODULE_ID,
|
||||
metadata=Base.metadata,
|
||||
|
||||
@@ -12,6 +12,7 @@ const notificationSettingsSections: SettingsSectionsUiCapability = {
|
||||
sections: [
|
||||
{
|
||||
id: "notifications",
|
||||
surfaceId: "notifications.settings.preferences",
|
||||
label: "Notifications",
|
||||
group: "ui",
|
||||
order: 40,
|
||||
@@ -28,6 +29,15 @@ export const notificationsModule: PlatformWebModule = {
|
||||
dependencies: [],
|
||||
optionalDependencies: ["mail", "tasks", "portal", "workflow", "calendar", "scheduling"],
|
||||
translations: generatedTranslations,
|
||||
viewSurfaces: [
|
||||
{
|
||||
id: "notifications.settings.preferences",
|
||||
moduleId: "notifications",
|
||||
kind: "section",
|
||||
label: "Notification preferences",
|
||||
order: 40
|
||||
}
|
||||
],
|
||||
routes: [
|
||||
{ path: "/notifications", anyOf: notificationRead, order: 59, render: ({ settings, auth }) => createElement(NotificationCenterPage, { settings, auth }) }
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user