feat: add personal and group view ownership

This commit is contained in:
2026-07-28 22:13:15 +02:00
parent 34221b633b
commit 3de8d4aa5f
12 changed files with 833 additions and 213 deletions
+5 -2
View File
@@ -5,7 +5,7 @@ import {
type EffectiveViewProjection
} from "@govoplan/core-webui";
export type ViewScopeType = "system" | "tenant";
export type ViewScopeType = "system" | "tenant" | "group" | "user";
export type ViewAssignmentScopeType = "system" | "tenant" | "group" | "user";
export type ViewAssignmentMode = "available" | "default" | "required";
@@ -148,12 +148,14 @@ export async function selectEffectiveView(
export async function fetchViewDefinitions(
settings: ApiSettings,
scopeType: ViewScopeType
scopeType: ViewScopeType,
scopeId?: string | null
): Promise<ViewDefinition[]> {
const response = await apiFetch<{ definitions: ViewDefinition[] }>(
settings,
apiPath("/api/v1/views/definitions", {
scope_type: scopeType,
scope_id: scopeId || undefined,
include_inherited: scopeType === "tenant"
})
);
@@ -164,6 +166,7 @@ export function createViewDefinition(
settings: ApiSettings,
payload: {
scope_type: ViewScopeType;
scope_id?: string | null;
name: string;
description?: string | null;
visible_surface_ids: string[];