Skip to content

Commit 8a43c7a

Browse files
ilaifMidnighter
andcommitted
feat: add hydrate to system context view
Co-authored-by: Midnighter <[email protected]>
1 parent fdb7c35 commit 8a43c7a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/structurizr/view/static_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
from abc import ABC, abstractmethod
2020
from typing import Iterable, List, Optional, Union
2121

22+
from ..model import Element, Person, SoftwareSystem
2223
from .animation import Animation, AnimationIO
2324
from .view import View, ViewIO
24-
from ..model import Element, Person, SoftwareSystem
2525

2626

2727
__all__ = ("StaticView", "StaticViewIO")

src/structurizr/view/system_context_view.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
from pydantic import Field
2020

21+
from structurizr.view.element_view import ElementView
22+
from structurizr.view.relationship_view import RelationshipView
23+
2124
from .static_view import StaticView, StaticViewIO
2225

2326

@@ -67,8 +70,16 @@ def hydrate(
6770
) -> "SystemContextView":
6871
""""""
6972
return cls(
70-
enterprise_boundary_visible=system_context_view_io.enterprise_boundary_visible,
71-
description=system_context_view_io.description,
73+
element_views=map(
74+
ElementView.hydrate, system_context_view_io.element_views
75+
),
76+
relationship_views=map(
77+
RelationshipView.hydrate, system_context_view_io.relationship_views
78+
),
7279
key=system_context_view_io.key,
73-
software_system=system_context_view_io.software_system,
80+
description=system_context_view_io.description,
81+
enterprise_boundary_visible=(
82+
system_context_view_io.enterprise_boundary_visible
83+
),
84+
# software_system=system_context_view_io.software_system,
7485
)

0 commit comments

Comments
 (0)