Module: Users::CalloutsHelper
- Defined in:
- app/helpers/users/callouts_helper.rb
Constant Summary collapse
- GKE_CLUSTER_INTEGRATION =
'gke_cluster_integration'
- GCP_SIGNUP_OFFER =
'gcp_signup_offer'
- SUGGEST_POPOVER_DISMISSED =
'suggest_popover_dismissed'
- TABS_POSITION_HIGHLIGHT =
'tabs_position_highlight'
- FEATURE_FLAGS_NEW_VERSION =
'feature_flags_new_version'
- REGISTRATION_ENABLED_CALLOUT =
'registration_enabled_callout'
- UNFINISHED_TAG_CLEANUP_CALLOUT =
'unfinished_tag_cleanup_callout'
- SECURITY_NEWSLETTER_CALLOUT =
'security_newsletter_callout'
- MERGE_REQUEST_SETTINGS_MOVED_CALLOUT =
'merge_request_settings_moved_callout'
- PAGES_MOVED_CALLOUT =
'pages_moved_callout'
- 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'
Instance Method Summary collapse
- #dismiss_two_factor_auth_recovery_settings_check ⇒ Object
- #gitlab_com_user_created_after_new_nav_rollout? ⇒ Boolean
- #render_dashboard_ultimate_trial(user) ⇒ Object
- #render_two_factor_auth_recovery_settings_check ⇒ Object
- #show_branch_rules_info? ⇒ Boolean
- #show_feature_flags_new_version? ⇒ Boolean
- #show_gcp_signup_offer? ⇒ Boolean
- #show_gke_cluster_integration_callout?(project) ⇒ Boolean
- #show_merge_request_settings_callout?(project) ⇒ Boolean
- #show_new_navigation_callout? ⇒ Boolean
- #show_pages_menu_callout? ⇒ Boolean
- #show_registration_enabled_user_callout? ⇒ Boolean
- #show_security_newsletter_user_callout? ⇒ Boolean
- #show_suggest_popover? ⇒ Boolean
- #show_unfinished_tag_cleanup_callout? ⇒ Boolean
- #web_hook_disabled_dismissed?(object) ⇒ Boolean
Instance Method Details
#dismiss_two_factor_auth_recovery_settings_check ⇒ Object
56 57 |
# File 'app/helpers/users/callouts_helper.rb', line 56 def dismiss_two_factor_auth_recovery_settings_check end |
#gitlab_com_user_created_after_new_nav_rollout? ⇒ Boolean
90 91 92 93 94 |
# File 'app/helpers/users/callouts_helper.rb', line 90 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) end |
#render_dashboard_ultimate_trial(user) ⇒ Object
30 31 |
# File 'app/helpers/users/callouts_helper.rb', line 30 def render_dashboard_ultimate_trial(user) end |
#render_two_factor_auth_recovery_settings_check ⇒ Object
33 34 |
# File 'app/helpers/users/callouts_helper.rb', line 33 def render_two_factor_auth_recovery_settings_check end |
#show_branch_rules_info? ⇒ Boolean
78 79 80 |
# File 'app/helpers/users/callouts_helper.rb', line 78 def show_branch_rules_info? !user_dismissed?(BRANCH_RULES_INFO_CALLOUT) end |
#show_feature_flags_new_version? ⇒ Boolean
40 41 42 |
# File 'app/helpers/users/callouts_helper.rb', line 40 def show_feature_flags_new_version? !user_dismissed?(FEATURE_FLAGS_NEW_VERSION) end |
#show_gcp_signup_offer? ⇒ Boolean
26 27 28 |
# File 'app/helpers/users/callouts_helper.rb', line 26 def show_gcp_signup_offer? !user_dismissed?(GCP_SIGNUP_OFFER) end |
#show_gke_cluster_integration_callout?(project) ⇒ Boolean
20 21 22 23 24 |
# File 'app/helpers/users/callouts_helper.rb', line 20 def show_gke_cluster_integration_callout?(project) active_nav_link?(controller: ) && can?(current_user, :create_cluster, project) && !user_dismissed?(GKE_CLUSTER_INTEGRATION) end |
#show_merge_request_settings_callout?(project) ⇒ Boolean
70 71 72 |
# File 'app/helpers/users/callouts_helper.rb', line 70 def show_merge_request_settings_callout?(project) !user_dismissed?(MERGE_REQUEST_SETTINGS_MOVED_CALLOUT) && project.merge_requests_enabled? end |
#show_new_navigation_callout? ⇒ Boolean
82 83 84 85 86 87 88 |
# File 'app/helpers/users/callouts_helper.rb', line 82 def && !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 |
#show_pages_menu_callout? ⇒ Boolean
74 75 76 |
# File 'app/helpers/users/callouts_helper.rb', line 74 def !user_dismissed?(PAGES_MOVED_CALLOUT) end |
#show_registration_enabled_user_callout? ⇒ Boolean
48 49 50 51 52 53 54 |
# File 'app/helpers/users/callouts_helper.rb', line 48 def show_registration_enabled_user_callout? !Gitlab.com? && current_user&.can_admin_all_resources? && signup_enabled? && !user_dismissed?(REGISTRATION_ENABLED_CALLOUT) && REGISTRATION_ENABLED_CALLOUT_ALLOWED_CONTROLLER_PATHS.any? { |path| controller.controller_path.match?(path) } end |
#show_security_newsletter_user_callout? ⇒ Boolean
59 60 61 62 |
# File 'app/helpers/users/callouts_helper.rb', line 59 def current_user&.can_admin_all_resources? && !user_dismissed?(SECURITY_NEWSLETTER_CALLOUT) end |
#show_suggest_popover? ⇒ Boolean
36 37 38 |
# File 'app/helpers/users/callouts_helper.rb', line 36 def show_suggest_popover? !user_dismissed?(SUGGEST_POPOVER_DISMISSED) end |
#show_unfinished_tag_cleanup_callout? ⇒ Boolean
44 45 46 |
# File 'app/helpers/users/callouts_helper.rb', line 44 def show_unfinished_tag_cleanup_callout? !user_dismissed?(UNFINISHED_TAG_CLEANUP_CALLOUT) end |
#web_hook_disabled_dismissed?(object) ⇒ Boolean
64 65 66 67 68 |
# File 'app/helpers/users/callouts_helper.rb', line 64 def web_hook_disabled_dismissed?(object) return false unless object.is_a?(::WebHooks::HasWebHooks) user_dismissed?(WEB_HOOK_DISABLED, object.last_webhook_failure, object: object) end |