Adds an alert handler for bootstrap migration
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
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines - [-] Style guides
- [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done