Update the Pajamas alert component with the new show_icon property
What does this MR do and why?
showIcon
was introduced into the GlAlert component (gitlab-ui!2784 (merged)). For consistency (and use in https://gitlab.com/gitlab-org/gitlab/-/issues/357375) this MR introduces the same property into the HAML version of the component.
It also updates the component so it properly applies the gl-alert-not-dimissible
class when dismissible
is false
.
Screenshots or screen recordings
Settings | Screenshot |
---|---|
With icon and dismiss | |
Without dismiss | |
Without icon | |
Without icon and dismiss |
How to set up and validate locally
The property isn't used anywhere but you can edit any known Pajamas::AlertComponent
usage locally to test if it works as expected. I made use of https://gitlab.com/gitlab-org/gitlab/blob/master/app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml#L2-2
- Add
dismissible
and/orshow_icon
properties to the component initializer - Test that the alert is rendered correctly and has the classes applied
- Check the new specs pass
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.