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:
hz
2026-07-24 23:12:47 -05:00
parent 118c215608
commit 6df0a88fd4
4 changed files with 27 additions and 20 deletions
+5 -4
View File
@@ -244,10 +244,11 @@ func _render_review(data: Dictionary) -> void:
missed_action.disabled = missed_count <= 0 or pending_review_launch missed_action.disabled = missed_count <= 0 or pending_review_launch
missed_action.pressed.connect(_start_review_queue) missed_action.pressed.connect(_start_review_queue)
review_list.add_child(missed_action) review_list.add_child(missed_action)
var dynamic_due := int(data.get("dynamicReviewsDue", 0)) if Brand.is_uat_environment():
review_list.add_child(_review_action( var dynamic_due := int(data.get("dynamicReviewsDue", 0))
"%d dynamic concepts due" % dynamic_due if dynamic_due > 0 else "Dynamic concepts up to date", review_list.add_child(_review_action(
"activity", Brand.PURPLE if dynamic_due > 0 else Brand.ROYAL_BLUE, "dynamic_questions")) "%d dynamic concepts due" % dynamic_due if dynamic_due > 0 else "Dynamic concepts up to date",
"activity", Brand.PURPLE if dynamic_due > 0 else Brand.ROYAL_BLUE, "dynamic_questions"))
var flashcards_due := int(data.get("flashcardsDue", 0)) var flashcards_due := int(data.get("flashcardsDue", 0))
review_list.add_child(_review_action( review_list.add_child(_review_action(
"%d flashcards due" % flashcards_due if flashcards_due > 0 else "Flashcards up to date", "%d flashcards due" % flashcards_due if flashcards_due > 0 else "Flashcards up to date",
+5 -4
View File
@@ -154,7 +154,7 @@ func _build_ui() -> void:
environment_badge = Label.new() environment_badge = Label.new()
environment_badge.text = "UAT" environment_badge.text = "UAT"
environment_badge.tooltip_text = "User acceptance testing environment" 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_override("font", Brand.font)
environment_badge.add_theme_font_size_override("font_size", 13) environment_badge.add_theme_font_size_override("font_size", 13)
environment_badge.add_theme_color_override("font_color", Color("052e16")) 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, "home", "Dashboard", "chart-no-axes-column-increasing", true)
_add_nav_button(container, "question_bank", "Question Bank", "clipboard-list", 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, "dynamic_questions", "Dynamic Questions", "activity", true, Brand.is_uat_environment())
_add_nav_button(container, "ccs", "CCS Cases", "stethoscope", true) _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, "exams", "Exam Simulations", "clipboard-list", true)
_add_nav_button(container, "flashcards", "Flashcards", "clipboard-plus", true) _add_nav_button(container, "flashcards", "Flashcards", "clipboard-plus", true)
_add_nav_button(container, "bookmarks", "Bookmarks", "bookmark", 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) _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() var button := Button.new()
button.text = label_text button.text = label_text
button.name = "Nav%s" % key.to_pascal_case() 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.add_theme_font_size_override("font_size", 18)
button.disabled = not enabled button.disabled = not enabled
button.tooltip_text = "Coming Soon" if not enabled else label_text button.tooltip_text = "Coming Soon" if not enabled else label_text
button.visible = visible_flag
button.pressed.connect(_on_navigation_pressed.bind(key)) button.pressed.connect(_on_navigation_pressed.bind(key))
container.add_child(button) container.add_child(button)
if not nav_buttons.has(key): if not nav_buttons.has(key):
+4
View File
@@ -26,6 +26,10 @@ static func ranaze_mark_texture() -> Texture2D:
return preload("res://assets/branding/ranaze-mark.png") return preload("res://assets/branding/ranaze-mark.png")
static func is_uat_environment() -> bool:
return str(ProjectSettings.get_setting("step3/deployment_environment", "development")) == "uat"
static func text_color(dark: bool) -> Color: static func text_color(dark: bool) -> Color:
return DARK_TEXT if dark else LIGHT_TEXT return DARK_TEXT if dark else LIGHT_TEXT
+13 -12
View File
@@ -187,18 +187,19 @@ func _build_mode_view() -> void:
retry_button = question_card.retry retry_button = question_card.retry
retry_button.pressed.connect(_retry_question_bank) retry_button.pressed.connect(_retry_question_bank)
var ccs_card := _add_mode_card( if Brand.is_uat_environment():
"CCS Cases", var ccs_card := _add_mode_card(
"Interactive case simulations", "CCS Cases",
"Available", "Interactive case simulations",
"Available", "Available",
"Practice real-world clinical scenarios and\nimprove your management skills.", "Available",
"stethoscope", "Practice real-world clinical scenarios and\nimprove your management skills.",
true, "stethoscope",
Brand.TEAL) true,
ccs_button = ccs_card.action Brand.TEAL)
ccs_status_label = ccs_card.status ccs_button = ccs_card.action
ccs_button.pressed.connect(_select_ccs) ccs_status_label = ccs_card.status
ccs_button.pressed.connect(_select_ccs)
func _build_question_bank_launch_view() -> void: func _build_question_bank_launch_view() -> void: