summaryrefslogtreecommitdiff
path: root/app/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-30 03:09:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-30 03:09:54 +0000
commitc74f7b6ff54ab900d2585ff216cce78d619b183c (patch)
treed2841380127d6b3e2526b3cc47562c3cca4bc49a /app/components
parentd210b1bee140e0f2c1f09635dd14a872e07a3100 (diff)
downloadgitlab-ce-c74f7b6ff54ab900d2585ff216cce78d619b183c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/components')
-rw-r--r--app/components/pajamas/alert_component.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/components/pajamas/alert_component.rb b/app/components/pajamas/alert_component.rb
index cfab34f537e..4475f4cde6e 100644
--- a/app/components/pajamas/alert_component.rb
+++ b/app/components/pajamas/alert_component.rb
@@ -12,8 +12,8 @@ module Pajamas
def initialize(
title: nil, variant: :info, dismissible: true, show_icon: true,
alert_options: {}, close_button_options: {})
- @title = title
- @variant = variant
+ @title = title.presence
+ @variant = filter_attribute(variant&.to_sym, VARIANT_ICONS.keys, default: :info)
@dismissible = dismissible
@show_icon = show_icon
@alert_options = alert_options
@@ -35,7 +35,7 @@ module Pajamas
renders_one :body
renders_one :actions
- ICONS = {
+ VARIANT_ICONS = {
info: 'information-o',
warning: 'warning',
success: 'check-circle',
@@ -44,7 +44,7 @@ module Pajamas
}.freeze
def icon
- ICONS[@variant]
+ VARIANT_ICONS[@variant]
end
def icon_classes