Add governed view revision resolution
This commit is contained in:
+3
-3
@@ -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": {
|
||||
|
||||
@@ -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
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user