diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-29 00:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-29 00:09:36 +0300 |
commit | e5940143fe1fdb95ed7c3dc6f0a4efdfaaf876c0 (patch) | |
tree | 006afb964e1f39ccc5429d8cc91793f6cab4ddf4 /app/helpers/version_check_helper.rb | |
parent | 953180403c1798ba42d396742e0691d5772da3a5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/version_check_helper.rb')
-rw-r--r-- | app/helpers/version_check_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index 7179607ca7c..0bb92dfd118 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -3,6 +3,8 @@ module VersionCheckHelper include Gitlab::Utils::StrongMemoize + SECURITY_ALERT_SEVERITY = 'danger' + def show_version_check? return false unless Gitlab::CurrentSettings.version_check_enabled return false if User.single_user&.requires_usage_stats_consent? @@ -15,6 +17,12 @@ module VersionCheckHelper end strong_memoize_attr :gitlab_version_check + def show_security_patch_upgrade_alert? + return false unless show_version_check? && gitlab_version_check + + gitlab_version_check['severity'] === SECURITY_ALERT_SEVERITY + end + def link_to_version if Gitlab.pre_release? commit_link = link_to(Gitlab.revision, source_host_url + namespace_project_commits_path(source_code_group, source_code_project, Gitlab.revision)) |