Skip to content

Commit 30f82f9

Browse files
committed
include "Maankäytön kohde" feature type also for general plan types, update feature dock when plan is edited
1 parent 02a777a commit 30f82f9

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

arho_feature_template/core/plan_manager.py

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def edit_plan(self):
253253
feature = save_plan(attribute_form.model)
254254
if feature:
255255
self.update_active_plan_regulation_group_library()
256+
self.new_feature_dock.set_plan(feature["id"]) # Update feature dock in case plan type changed
256257

257258
def edit_lifecycles(self):
258259
plan_layer = PlanLayer.get_from_project()

arho_feature_template/gui/components/new_feature_grid_widget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self):
3636
def initialize_buttons(self, exclude: list | None = None):
3737
self.clear()
3838

39-
exclude = exclude if exclude else []
39+
exclude = exclude or []
4040
self.buttons = {
4141
feature_type: FeatureButton(feature_type) for feature_type in FEATURE_TYPES if feature_type not in exclude
4242
}

arho_feature_template/gui/docks/new_feature_dock.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ def initialize_feature_template_libraries(self, feature_template_libraries: list
6161

6262
def set_plan(self, plan_id: str):
6363
regional_plan_type_names = ["Kokonaismaakuntakaava", "Vaihemaakuntakaava"]
64-
if PlanLayer.get_plan_type_name(plan_id) not in regional_plan_type_names:
64+
general_plan_type_names = [
65+
"Yleiskaava",
66+
"Vaiheyleiskaava",
67+
"Osayleiskaava",
68+
"Kuntien yhteinen yleiskaava",
69+
"Maanalainen yleiskaava",
70+
]
71+
if PlanLayer.get_plan_type_name(plan_id) not in regional_plan_type_names + general_plan_type_names:
6572
self.new_feature_grid.initialize_buttons(exclude=["Maankäytön kohde"])
6673
else:
6774
self.new_feature_grid.initialize_buttons()

0 commit comments

Comments
 (0)