Implement native BPMN workflows and guided modes

This commit is contained in:
2026-07-31 02:48:57 +02:00
parent c505e81006
commit f4974b4949
40 changed files with 8203 additions and 489 deletions
+68 -2
View File
@@ -1,13 +1,67 @@
import { createElement, lazy } from "react";
import type { PlatformWebModule } from "@govoplan/core-webui";
import type {
DashboardWidgetsUiCapability,
PlatformWebModule
} from "@govoplan/core-webui";
import "@xyflow/react/dist/style.css";
import "./styles/workflow.css";
const WorkflowPage = lazy(() => import("./features/workflow/WorkflowPage"));
const WorkflowOpenWorkWidget = lazy(
() => import("./features/workflow/WorkflowOpenWorkWidget")
);
const readScopes = [
"workflow:definition:read",
"workflow:instance:admin"
];
const instanceReadScopes = [
"workflow:instance:read",
"workflow:instance:admin"
];
const workflowDashboardWidgets: DashboardWidgetsUiCapability = {
widgets: [
{
id: "workflow.open-work",
surfaceId: "workflow.widget.open-work",
title: "Open workflow work",
description: "Running workflows and steps that require attention.",
moduleId: "workflow",
category: "Work",
order: 42,
defaultVisible: false,
defaultSize: "medium",
supportedSizes: ["medium", "wide"],
anyOf: instanceReadScopes,
refreshIntervalMs: 60_000,
defaultConfiguration: {
maxItems: 6,
includeRunning: true
},
configurationFields: [
{
id: "maxItems",
label: "Maximum items",
kind: "number",
min: 1,
max: 20,
step: 1,
required: true
},
{
id: "includeRunning",
label: "Include running steps",
kind: "boolean"
}
],
render: ({ settings, refreshKey, configuration }) =>
createElement(WorkflowOpenWorkWidget, {
settings,
refreshKey,
configuration
})
}
]
};
export const workflowModule: PlatformWebModule = {
id: "workflow",
@@ -22,6 +76,15 @@ export const workflowModule: PlatformWebModule = {
"policy",
"tasks"
],
viewSurfaces: [
{
id: "workflow.widget.open-work",
moduleId: "workflow",
kind: "section",
label: "Open workflow work widget",
order: 76
}
],
navItems: [
{
to: "/workflow",
@@ -39,7 +102,10 @@ export const workflowModule: PlatformWebModule = {
render: ({ settings, auth }) =>
createElement(WorkflowPage, { settings, auth })
}
]
],
uiCapabilities: {
"dashboard.widgets": workflowDashboardWidgets
}
};
export default workflowModule;