feat: harden governed runs and add dashboard integration
This commit is contained in:
+62
-2
@@ -1,11 +1,59 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type { PlatformWebModule } from "@govoplan/core-webui";
|
||||
import type {
|
||||
DashboardWidgetsUiCapability,
|
||||
PlatformWebModule
|
||||
} from "@govoplan/core-webui";
|
||||
import DataflowPipelinesWidget from "./features/dataflow/DataflowPipelinesWidget";
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import "./styles/dataflow.css";
|
||||
|
||||
const DataflowPage = lazy(() => import("./features/dataflow/DataflowPage"));
|
||||
|
||||
const readScopes = ["dataflow:pipeline:read", "dataflow:pipeline:admin"];
|
||||
const dataflowDashboardWidgets: DashboardWidgetsUiCapability = {
|
||||
widgets: [
|
||||
{
|
||||
id: "dataflow.pipelines",
|
||||
surfaceId: "dataflow.widget.pipelines",
|
||||
title: "Dataflows",
|
||||
description: "Active and recently edited dataflow definitions.",
|
||||
moduleId: "dataflow",
|
||||
category: "Automation",
|
||||
order: 70,
|
||||
defaultVisible: false,
|
||||
defaultSize: "medium",
|
||||
supportedSizes: ["medium", "wide"],
|
||||
anyOf: readScopes,
|
||||
refreshIntervalMs: 60_000,
|
||||
defaultConfiguration: {
|
||||
maxItems: 5,
|
||||
includeDrafts: true
|
||||
},
|
||||
configurationFields: [
|
||||
{
|
||||
id: "maxItems",
|
||||
label: "Maximum dataflows",
|
||||
kind: "number",
|
||||
min: 1,
|
||||
max: 12,
|
||||
step: 1,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
id: "includeDrafts",
|
||||
label: "Include drafts",
|
||||
kind: "boolean"
|
||||
}
|
||||
],
|
||||
render: ({ settings, refreshKey, configuration }) =>
|
||||
createElement(DataflowPipelinesWidget, {
|
||||
settings,
|
||||
refreshKey,
|
||||
configuration
|
||||
})
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const dataflowModule: PlatformWebModule = {
|
||||
id: "dataflow",
|
||||
@@ -22,6 +70,15 @@ export const dataflowModule: PlatformWebModule = {
|
||||
"risk_compliance",
|
||||
"workflow"
|
||||
],
|
||||
viewSurfaces: [
|
||||
{
|
||||
id: "dataflow.widget.pipelines",
|
||||
moduleId: "dataflow",
|
||||
kind: "section",
|
||||
label: "Dataflows widget",
|
||||
order: 70
|
||||
}
|
||||
],
|
||||
navItems: [
|
||||
{ to: "/dataflow", label: "Dataflow", iconName: "waypoints", anyOf: readScopes, order: 72 }
|
||||
],
|
||||
@@ -32,7 +89,10 @@ export const dataflowModule: PlatformWebModule = {
|
||||
order: 72,
|
||||
render: ({ settings, auth }) => createElement(DataflowPage, { settings, auth })
|
||||
}
|
||||
]
|
||||
],
|
||||
uiCapabilities: {
|
||||
"dashboard.widgets": dataflowDashboardWidgets
|
||||
}
|
||||
};
|
||||
|
||||
export default dataflowModule;
|
||||
|
||||
Reference in New Issue
Block a user