Skip to content

Adds an alert handler for bootstrap migration

Sam Beckham requested to merge alert-handler into master

What does this MR do?

As part of the HAML bootrap migration process, there are a couple things that we need to port over to our own codebase temporarily. This is one of those things.

Bootstrap js uses the bootstrap class names to dismiss alerts and we're in the process of removing those class names in favour of Gitlab UI equivalents. Doing so would break the dismissal action on every alert.

This MR introduces a really simple bit of JS that brings the dismissal functionality back to the alerts that are using the newer classes.

Note: This only affects the alerts that are written in HTML/HAML and are using the GitLab UI class names. This does not affect the older bootstrap alerts, nor does it affect any alerts using the actual GitLab UI component in vue.

Note2: Because of the way this is written, it only attaches the event listeners on the initial page load. If any alerts are added programatically, these listeners won't be added. This is by design and prevents this script from interfering with the vue components.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Sam Beckham

Merge request reports