Implement typed template library and rendering
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type { PlatformWebModule } from "@govoplan/core-webui";
|
||||
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: "Templates",
|
||||
version: "0.1.14",
|
||||
optionalDependencies: ["files", "dist_lists", "campaigns", "audit"],
|
||||
navItems: [{
|
||||
to: "/templates",
|
||||
label: "Templates",
|
||||
iconName: "layout-template",
|
||||
anyOf: readScopes,
|
||||
order: 75
|
||||
}],
|
||||
routes: [{
|
||||
path: "/templates",
|
||||
anyOf: readScopes,
|
||||
order: 75,
|
||||
render: ({ settings, auth }) => createElement(TemplatesPage, { settings, auth })
|
||||
}]
|
||||
};
|
||||
|
||||
export default templatesModule;
|
||||
Reference in New Issue
Block a user