31 lines
1.4 KiB
TypeScript
31 lines
1.4 KiB
TypeScript
import { createElement, lazy } from "react";
|
|
import type { PlatformWebModule } from "@govoplan/core-webui";
|
|
import { generatedTranslations } from "./i18n/generatedTranslations";
|
|
|
|
const DocsPage = lazy(() => import("./features/docs/DocsPage"));
|
|
const SemanticDocumentationPage = lazy(() => import("./features/docs/SemanticDocumentationPage"));
|
|
|
|
const docsReadScopes = ["docs:documentation:read", "docs:documentation:admin", "system:settings:read", "admin:settings:read"];
|
|
const semanticEditorScopes = ["docs:semantic:create", "docs:semantic:edit", "docs:semantic:publish", "docs:semantic:supersede", "docs:semantic:retire"];
|
|
|
|
const translations = {
|
|
en: generatedTranslations.en,
|
|
de: generatedTranslations.de
|
|
};
|
|
|
|
export const docsModule: PlatformWebModule = {
|
|
id: "docs",
|
|
label: "i18n:govoplan-docs.docs.68a41942",
|
|
version: "0.1.19",
|
|
dependencies: ["access"],
|
|
optionalDependencies: ["policy", "audit", "ops", "workflow", "search"],
|
|
translations,
|
|
navItems: [{ to: "/docs", label: "i18n:govoplan-docs.docs.68a41942", iconName: "reports", anyOf: docsReadScopes, order: 880 }],
|
|
routes: [
|
|
{ path: "/docs", anyOf: docsReadScopes, order: 880, render: ({ settings }) => createElement(DocsPage, { settings }) },
|
|
{ path: "/docs/semantic", anyOf: semanticEditorScopes, order: 881, render: ({ settings }) => createElement(SemanticDocumentationPage, { settings }) }]
|
|
|
|
};
|
|
|
|
export default docsModule;
|