aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-31 16:15:58 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 12:54:55 +0200
commitf2b91572b163099b29c940cf6fe5814a047fdc51 (patch)
treea09aff977f67c6ea15edc5b3a1e6180e97e0699f /src/hydrilla/proxy/state_impl
parent55f8688c851d4f5f32a35fd804f31ad2f355be37 (diff)
downloadhaketilo-hydrilla-f2b91572b163099b29c940cf6fe5814a047fdc51.tar.gz
haketilo-hydrilla-f2b91572b163099b29c940cf6fe5814a047fdc51.zip
[proxy] make information about mapping version being frozen available to UI code
Diffstat (limited to 'src/hydrilla/proxy/state_impl')
-rw-r--r--src/hydrilla/proxy/state_impl/items.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/hydrilla/proxy/state_impl/items.py b/src/hydrilla/proxy/state_impl/items.py
index b538dc5..ddfef7c 100644
--- a/src/hydrilla/proxy/state_impl/items.py
+++ b/src/hydrilla/proxy/state_impl/items.py
@@ -128,6 +128,7 @@ class ConcreteMappingRef(st.MappingRef):
ive.active,
ive.is_orphan,
ive.is_local,
+ ms.frozen,
ms.enabled
FROM
item_versions_extra AS ive
@@ -147,7 +148,7 @@ class ConcreteMappingRef(st.MappingRef):
for (item_version_id, definition, repo, repo_iteration,
installed_status, active_status, is_orphan, is_local,
- enabled_status) in rows:
+ frozen_status, enabled_status) in rows:
ref = ConcreteMappingVersionRef(str(item_version_id), self.state)
item_info = item_infos.MappingInfo.load(
@@ -163,7 +164,8 @@ class ConcreteMappingRef(st.MappingRef):
active = st.ActiveStatus(active_status),
is_orphan = is_orphan,
is_local = is_local,
- mapping_enabled = st.EnabledStatus(enabled_status)
+ mapping_enabled = st.EnabledStatus(enabled_status),
+ mapping_frozen = st.FrozenStatus.make(frozen_status)
)
result.append(display_info)
@@ -195,7 +197,8 @@ class ConcreteMappingStore(st.MappingStore):
ive.active,
ive.is_orphan,
ive.is_local,
- ms.enabled
+ ms.enabled,
+ ms.frozen
FROM
items AS i
JOIN mapping_statuses AS ms
@@ -213,7 +216,7 @@ class ConcreteMappingStore(st.MappingStore):
for (item_id, identifier, item_version_id, definition, repo,
repo_iteration, installed_status, active_status, is_orphan,
- is_local, enabled_status) in rows:
+ is_local, enabled_status, frozen_status) in rows:
ref = ConcreteMappingRef(str(item_id), self.state)
active_version: t.Optional[st.MappingVersionDisplayInfo] = None
@@ -237,14 +240,15 @@ class ConcreteMappingStore(st.MappingStore):
active = st.ActiveStatus(active_status),
is_orphan = is_orphan,
is_local = is_local,
- mapping_enabled = st.EnabledStatus(enabled_status)
+ mapping_enabled = st.EnabledStatus(enabled_status),
+ mapping_frozen = st.FrozenStatus.make(frozen_status)
)
-
display_info = st.MappingDisplayInfo(
ref = ref,
identifier = identifier,
enabled = st.EnabledStatus(enabled_status),
+ frozen = st.FrozenStatus.make(frozen_status),
active_version = active_version
)