Migrate Datasources interface patterns

This commit is contained in:
2026-08-03 13:46:58 +02:00
parent 98d93e707f
commit 6406ce70f1
7 changed files with 516 additions and 37 deletions
+13 -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/datasources.css";
const DatasourcesPage = lazy(() => import("./features/datasources/DatasourcesPage"));
@@ -8,7 +9,7 @@ const readScopes = ["datasources:catalogue:read", "datasources:source:admin"];
export const datasourcesModule: PlatformWebModule = {
id: "datasources",
label: "Datasources",
label: "i18n:govoplan-datasources.datasources",
version: "0.1.14",
optionalDependencies: [
"access",
@@ -18,10 +19,19 @@ export const datasourcesModule: PlatformWebModule = {
"notifications",
"policy"
],
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: "Datasources",
label: "i18n:govoplan-datasources.datasources",
iconName: "database-zap",
anyOf: readScopes,
order: 70
@@ -32,6 +42,7 @@ export const datasourcesModule: PlatformWebModule = {
path: "/datasources",
anyOf: readScopes,
order: 70,
surfaceId: "datasources.page",
render: ({ settings, auth }) => createElement(DatasourcesPage, { settings, auth })
}
]