Expands the alert dismisser to dismiss banners
What does this MR do?
This MR expands on the work done in !41323 (merged) and allows banners to be dismissed too. It also re-writes the function so it's easier to add other dismissibles going forward should the need arise.
The reason for this is that some parts of the codebase use the bootstrap js for dismissing alerts to dismiss other things too. One of those things was banners. In a continuation of the effort to remove bootstrap from the codebase, this bridges the gap needed until we have a more solid solution for migrating to GitLab UI more effectively for HAML components.
Note: This uses [aria-label="Dismiss"]
to select the dismiss button. I was initially skeptical about using this as a class is usually a better selector. However, after thinking about this further, it also enforces that we correctly add aria labels so maybe it's a good thing.
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