Migrate Templates interface patterns

This commit is contained in:
2026-08-03 13:34:37 +02:00
parent 3551c48e14
commit 72fafa23c7
7 changed files with 399 additions and 28 deletions
+11 -2
View File
@@ -1,5 +1,6 @@
import { createElement, lazy } from "react";
import type { PlatformWebModule } from "@govoplan/core-webui";
import { generatedTranslations } from "./i18n/generatedTranslations";
import "./styles/templates.css";
const TemplatesPage = lazy(() => import("./features/templates/TemplatesPage"));
@@ -14,12 +15,19 @@ const readScopes = [
export const templatesModule: PlatformWebModule = {
id: "templates",
label: "Templates",
label: "i18n:govoplan-templates.templates",
version: "0.1.14",
optionalDependencies: ["files", "dist_lists", "campaigns", "audit"],
translations: generatedTranslations,
viewSurfaces: [
{ id: "templates.page", moduleId: "templates", kind: "route", label: "i18n:govoplan-templates.templates", order: 75 },
{ id: "templates.library", moduleId: "templates", kind: "section", label: "i18n:govoplan-templates.library", parentId: "templates.page", order: 10 },
{ id: "templates.editor", moduleId: "templates", kind: "section", label: "i18n:govoplan-templates.editor", parentId: "templates.page", order: 20 },
{ id: "templates.preview", moduleId: "templates", kind: "section", label: "i18n:govoplan-templates.preview", parentId: "templates.page", order: 30 }
],
navItems: [{
to: "/templates",
label: "Templates",
label: "i18n:govoplan-templates.templates",
iconName: "layout-template",
anyOf: readScopes,
order: 75
@@ -28,6 +36,7 @@ export const templatesModule: PlatformWebModule = {
path: "/templates",
anyOf: readScopes,
order: 75,
surfaceId: "templates.page",
render: ({ settings, auth }) => createElement(TemplatesPage, { settings, auth })
}]
};