Files
govoplan-templates/webui/src/module.ts
T

45 lines
1.7 KiB
TypeScript

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"));
const readScopes = [
"templates:template:read",
"templates:template:write",
"templates:template:publish",
"templates:template:render",
"templates:template:admin"
];
export const templatesModule: PlatformWebModule = {
id: "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: "i18n:govoplan-templates.templates",
iconName: "layout-template",
anyOf: readScopes,
order: 75
}],
routes: [{
path: "/templates",
anyOf: readScopes,
order: 75,
surfaceId: "templates.page",
render: ({ settings, auth }) => createElement(TemplatesPage, { settings, auth })
}]
};
export default templatesModule;