diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 12:08:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-11 12:08:10 +0000 |
commit | b86f474bf51e20d2db4cf0895d0a8e0894e31c08 (patch) | |
tree | 061d2a4c749924f5a35fe6199dd1d8982c4b0b27 /app/helpers | |
parent | 6b8040dc25fdc5fe614c3796a147517dd50bc7d8 (diff) | |
download | gitlab-ce-b86f474bf51e20d2db4cf0895d0a8e0894e31c08.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/container_expiration_policies_helper.rb | 21 | ||||
-rw-r--r-- | app/helpers/nav_helper.rb | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/helpers/container_expiration_policies_helper.rb b/app/helpers/container_expiration_policies_helper.rb new file mode 100644 index 00000000000..17791e7b0ff --- /dev/null +++ b/app/helpers/container_expiration_policies_helper.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module ContainerExpirationPoliciesHelper + def cadence_options + ContainerExpirationPolicy.cadence_options.map do |key, val| + { key: key.to_s, label: val } + end + end + + def keep_n_options + ContainerExpirationPolicy.keep_n_options.map do |key, val| + { key: key, label: val } + end + end + + def older_than_options + ContainerExpirationPolicy.older_than_options.map do |key, val| + { key: key.to_s, label: val } + end + end +end diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 2ce45cec878..6013475acb1 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -87,7 +87,7 @@ module NavHelper end if Feature.enabled?(:user_mode_in_session) - if current_user&.admin? && current_user_mode&.admin_mode? + if current_user_mode.admin_mode? links << :admin_mode end end |