Add governed view revision resolution

This commit is contained in:
2026-07-31 02:48:57 +02:00
parent 2df42fb0f8
commit 5c5aeecc19
8 changed files with 496 additions and 43 deletions
+3 -3
View File
@@ -16,9 +16,9 @@
"peerDependencies": {
"@govoplan/core-webui": "^0.1.14",
"lucide-react": "^1.23.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": ">=7.18.2 <8"
"react": ">=19.2.7 <20",
"react-dom": ">=19.2.7 <20",
"react-router": ">=8.3.0 <9"
},
"peerDependenciesMeta": {
"@govoplan/core-webui": {
+24
View File
@@ -163,6 +163,30 @@ export async function selectEffectiveView(
);
}
export async function resolveWorkflowView(
settings: ApiSettings,
context: {
viewId: string;
revisionId?: string | null;
visibleSurfaceIds?: string[];
}
): Promise<EffectiveViewProjection> {
return projection(
await apiFetch<EffectiveViewApiResponse>(
settings,
"/api/v1/views/effective/workflow",
{
method: "POST",
...jsonBody({
view_id: context.viewId,
revision_id: context.revisionId ?? null,
visible_surface_ids: context.visibleSurfaceIds ?? []
})
}
)
);
}
export async function fetchViewDefinitions(
settings: ApiSettings,
scopeType: ViewScopeType,
+7 -1
View File
@@ -7,7 +7,11 @@ import {
type ViewsRuntimeUiCapability
} from "@govoplan/core-webui";
import ViewSelector from "./components/ViewSelector";
import { fetchEffectiveView, selectEffectiveView } from "./api/views";
import {
fetchEffectiveView,
resolveWorkflowView,
selectEffectiveView
} from "./api/views";
import "./styles/views.css";
@@ -68,6 +72,8 @@ const viewsAdminSections: AdminSectionsUiCapability = {
const viewsRuntime: ViewsRuntimeUiCapability = {
loadEffectiveView: (settings) => fetchEffectiveView(settings),
activateView: (settings, viewId) => selectEffectiveView(settings, viewId),
resolveWorkflowView: (settings, context) =>
resolveWorkflowView(settings, context),
Selector: ViewSelector
};