Release govoplan-views v0.1.22: unify interface contracts and documentation
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
apiPath,
|
||||
type ApiSettings,
|
||||
type EffectiveViewProjection,
|
||||
type NavigationPreferences,
|
||||
type ViewPresentation
|
||||
} from "@govoplan/core-webui";
|
||||
|
||||
@@ -17,6 +18,7 @@ export type ViewRevision = {
|
||||
surface_contract_version: string;
|
||||
visible_surface_ids: string[];
|
||||
presentation: {
|
||||
navigation?: NavigationPreferences | null;
|
||||
navigation_mode?: "grouped" | "flat";
|
||||
product_area_order?: string[];
|
||||
product_area_labels?: Record<string, string>;
|
||||
@@ -260,10 +262,11 @@ export function createViewRevision(
|
||||
);
|
||||
}
|
||||
|
||||
function presentationFromApi(
|
||||
export function presentationFromApi(
|
||||
value: ViewRevision["presentation"] | undefined
|
||||
): ViewPresentation {
|
||||
return {
|
||||
navigation: value?.navigation ?? null,
|
||||
navigationMode: value?.navigation_mode,
|
||||
productAreaOrder: value?.product_area_order ?? [],
|
||||
productAreaLabels: value?.product_area_labels ?? {},
|
||||
@@ -276,6 +279,7 @@ export function presentationToApi(
|
||||
value: ViewPresentation
|
||||
): ViewRevision["presentation"] {
|
||||
return {
|
||||
navigation: value.navigation ?? null,
|
||||
navigation_mode: value.navigationMode ?? "grouped",
|
||||
product_area_order: value.productAreaOrder ?? [],
|
||||
product_area_labels: value.productAreaLabels ?? {},
|
||||
|
||||
Reference in New Issue
Block a user