Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/users/callouts_helper.rb')
-rw-r--r--app/helpers/users/callouts_helper.rb24
1 files changed, 7 insertions, 17 deletions
diff --git a/app/helpers/users/callouts_helper.rb b/app/helpers/users/callouts_helper.rb
index 1b5d0b276a3..6f1d4db4349 100644
--- a/app/helpers/users/callouts_helper.rb
+++ b/app/helpers/users/callouts_helper.rb
@@ -15,7 +15,7 @@ module Users
REGISTRATION_ENABLED_CALLOUT_ALLOWED_CONTROLLER_PATHS = [/^root/, /^dashboard\S*/, /^admin\S*/].freeze
WEB_HOOK_DISABLED = 'web_hook_disabled'
BRANCH_RULES_INFO_CALLOUT = 'branch_rules_info_callout'
- NEW_NAVIGATION_CALLOUT = 'new_navigation_callout'
+ NEW_NAV_FOR_EVERYONE_CALLOUT = 'new_nav_for_everyone_callout'
def show_gke_cluster_integration_callout?(project)
active_nav_link?(controller: sidebar_operations_paths) &&
@@ -71,26 +71,16 @@ module Users
!user_dismissed?(MERGE_REQUEST_SETTINGS_MOVED_CALLOUT) && project.merge_requests_enabled?
end
- def show_pages_menu_callout?
- !user_dismissed?(PAGES_MOVED_CALLOUT)
- end
-
def show_branch_rules_info?
!user_dismissed?(BRANCH_RULES_INFO_CALLOUT)
end
- def show_new_navigation_callout?
- show_super_sidebar? &&
- !user_dismissed?(NEW_NAVIGATION_CALLOUT) &&
- # GitLab.com users created after the feature flag's full rollout (June 2nd 2023) don't need to see the callout.
- # Remove the gitlab_com_user_created_after_new_nav_rollout? method when the callout isn't needed anymore.
- !gitlab_com_user_created_after_new_nav_rollout?
- end
-
- def gitlab_com_user_created_after_new_nav_rollout?
- return true unless current_user
-
- Gitlab.com? && current_user.created_at >= Date.new(2023, 6, 2)
+ def show_new_nav_for_everyone_callout?
+ # The use_new_navigation user preference was controlled by the now removed "New navigation" toggle in the UI.
+ # We want to show this banner only to signed-in users who chose to disable the new nav (`false`).
+ # We don't want to show it for users who never touched the toggle and already had the new nav by default (`nil`)
+ user_had_new_nav_off = current_user && current_user.use_new_navigation == false
+ user_had_new_nav_off && !user_dismissed?(NEW_NAV_FOR_EVERYONE_CALLOUT)
end
private