53 lines
2.1 KiB
TypeScript
53 lines
2.1 KiB
TypeScript
import { createElement, lazy } from "react";
|
|
import type { PlatformWebModule } from "@govoplan/core-webui";
|
|
import { generatedTranslations } from "./i18n/generatedTranslations";
|
|
import "./styles/datasources.css";
|
|
|
|
const DatasourcesPage = lazy(() => import("./features/datasources/DatasourcesPage"));
|
|
|
|
const readScopes = ["datasources:catalogue:read", "datasources:source:admin"];
|
|
|
|
export const datasourcesModule: PlatformWebModule = {
|
|
id: "datasources",
|
|
label: "i18n:govoplan-datasources.datasources",
|
|
version: "0.1.22",
|
|
optionalDependencies: [
|
|
"access",
|
|
"audit",
|
|
"connectors",
|
|
"files",
|
|
"notifications",
|
|
"policy",
|
|
"search"
|
|
],
|
|
translations: generatedTranslations,
|
|
viewSurfaces: [
|
|
{ id: "datasources.page", moduleId: "datasources", kind: "route", label: "i18n:govoplan-datasources.datasources", order: 70 },
|
|
{ id: "datasources.catalogue", moduleId: "datasources", kind: "section", label: "i18n:govoplan-datasources.catalogue", parentId: "datasources.page", order: 10 },
|
|
{ id: "datasources.staging", moduleId: "datasources", kind: "section", label: "i18n:govoplan-datasources.staging", parentId: "datasources.page", order: 20 },
|
|
{ id: "datasources.origins", moduleId: "datasources", kind: "section", label: "i18n:govoplan-datasources.origins", parentId: "datasources.page", order: 30 },
|
|
{ id: "datasources.governance", moduleId: "datasources", kind: "action", label: "i18n:govoplan-datasources.governance", parentId: "datasources.catalogue", order: 40 },
|
|
{ id: "datasources.preview", moduleId: "datasources", kind: "section", label: "i18n:govoplan-datasources.preview", parentId: "datasources.catalogue", order: 50 }
|
|
],
|
|
navItems: [
|
|
{
|
|
to: "/datasources",
|
|
label: "i18n:govoplan-datasources.datasources",
|
|
iconName: "database-zap",
|
|
anyOf: readScopes,
|
|
order: 70
|
|
}
|
|
],
|
|
routes: [
|
|
{
|
|
path: "/datasources",
|
|
anyOf: readScopes,
|
|
order: 70,
|
|
surfaceId: "datasources.page",
|
|
render: ({ settings, auth }) => createElement(DatasourcesPage, { settings, auth })
|
|
}
|
|
]
|
|
};
|
|
|
|
export default datasourcesModule;
|