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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 21:07:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 21:07:40 +0300
commitd5e16807136445884fd7cc5f71f9f039f823b5d8 (patch)
treea3e60aa59ac9a83966c7ecda6d8bb9a89adc1fbc /app/helpers/icons_helper.rb
parent016af097cb1fa872fdc28a786d16315e55cd2701 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r--app/helpers/icons_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index b79766e3a65..cacb4113cb2 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -42,7 +42,7 @@ module IconsHelper
end
def sprite_icon(icon_name, size: nil, css_class: nil)
- unless known_sprites.include?(icon_name)
+ if known_sprites&.exclude?(icon_name)
exception = ArgumentError.new("#{icon_name} is not a known icon in @gitlab-org/gitlab-svg")
Gitlab::Sentry.track_and_raise_for_dev_exception(exception)
end
@@ -156,6 +156,8 @@ module IconsHelper
private
def known_sprites
+ return if Rails.env.production?
+
@known_sprites ||= JSON.parse(File.read(Rails.root.join('node_modules/@gitlab/svgs/dist/icons.json')))['icons']
end
end