Skip to content

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 image
Without dismiss image
Without icon image
Without icon and dismiss image

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

  1. Add dismissible and/or show_icon properties to the component initializer
  2. Test that the alert is rendered correctly and has the classes applied
  3. 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.

Edited by Robert Hunt

Merge request reports

Loading