Feature-gate Dynamic Questions and CCS Cases to UAT only
Both are still in progress and shouldn't be reachable in production (or local dev) yet - hide every entry point (nav sidebar, the dashboard's "dynamic concepts due" review card, and the CCS Cases mode card on the study selector) unless step3/deployment_environment is "uat", the same setting that already drives the UAT badge. Added Brand.is_uat_environment() as the shared check.
This commit is contained in:
+5
-4
@@ -154,7 +154,7 @@ func _build_ui() -> void:
|
||||
environment_badge = Label.new()
|
||||
environment_badge.text = "UAT"
|
||||
environment_badge.tooltip_text = "User acceptance testing environment"
|
||||
environment_badge.visible = str(ProjectSettings.get_setting("step3/deployment_environment", "development")) == "uat"
|
||||
environment_badge.visible = Brand.is_uat_environment()
|
||||
environment_badge.add_theme_font_override("font", Brand.font)
|
||||
environment_badge.add_theme_font_size_override("font_size", 13)
|
||||
environment_badge.add_theme_color_override("font_color", Color("052e16"))
|
||||
@@ -416,8 +416,8 @@ func _populate_navigation(container: VBoxContainer, include_brand: bool) -> void
|
||||
|
||||
_add_nav_button(container, "home", "Dashboard", "chart-no-axes-column-increasing", true)
|
||||
_add_nav_button(container, "question_bank", "Question Bank", "clipboard-list", true)
|
||||
_add_nav_button(container, "dynamic_questions", "Dynamic Questions", "activity", true)
|
||||
_add_nav_button(container, "ccs", "CCS Cases", "stethoscope", true)
|
||||
_add_nav_button(container, "dynamic_questions", "Dynamic Questions", "activity", true, Brand.is_uat_environment())
|
||||
_add_nav_button(container, "ccs", "CCS Cases", "stethoscope", true, Brand.is_uat_environment())
|
||||
_add_nav_button(container, "exams", "Exam Simulations", "clipboard-list", true)
|
||||
_add_nav_button(container, "flashcards", "Flashcards", "clipboard-plus", true)
|
||||
_add_nav_button(container, "bookmarks", "Bookmarks", "bookmark", true)
|
||||
@@ -433,7 +433,7 @@ func _populate_navigation(container: VBoxContainer, include_brand: bool) -> void
|
||||
_add_nav_button(container, "logout", "Log out", "log-out", true)
|
||||
|
||||
|
||||
func _add_nav_button(container: VBoxContainer, key: String, label_text: String, icon_name: String, enabled: bool) -> void:
|
||||
func _add_nav_button(container: VBoxContainer, key: String, label_text: String, icon_name: String, enabled: bool, visible_flag: bool = true) -> void:
|
||||
var button := Button.new()
|
||||
button.text = label_text
|
||||
button.name = "Nav%s" % key.to_pascal_case()
|
||||
@@ -447,6 +447,7 @@ func _add_nav_button(container: VBoxContainer, key: String, label_text: String,
|
||||
button.add_theme_font_size_override("font_size", 18)
|
||||
button.disabled = not enabled
|
||||
button.tooltip_text = "Coming Soon" if not enabled else label_text
|
||||
button.visible = visible_flag
|
||||
button.pressed.connect(_on_navigation_pressed.bind(key))
|
||||
container.add_child(button)
|
||||
if not nav_buttons.has(key):
|
||||
|
||||
Reference in New Issue
Block a user