Skip to content

Improve specificity selector

What does this MR do and why?

Sometime developers assume that an element is unique in a page, for example a close button. In this MR, we make several buttons and actions more specific by wrapping the selector in a within block.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No changes

How to set up and validate locally

The tests should all pass.

If added an extra button to the page it should continue to pass:

diff --git a/app/views/shared/_token_expiration_banner.html.haml b/app/views/shared/_token_expiration_banner.html.haml
index 5c41dfd31c50..afdef9b9bf23 100644
--- a/app/views/shared/_token_expiration_banner.html.haml
+++ b/app/views/shared/_token_expiration_banner.html.haml
@@ -1,7 +1,7 @@
 - id = 'token_expiration'
 - cookie_key = 'hide_token_expiration_banner'
 
-- return unless Gitlab.version_info >= Gitlab::VersionInfo.new(16, 0) && Gitlab.version_info <= Gitlab::VersionInfo.new(17, 0)
+- return unless Gitlab.version_info >= Gitlab::VersionInfo.new(16, 0) && Gitlab.version_info <= Gitlab::VersionInfo.new(18, 0)
 - return unless cookies[cookie_key].blank?
 
 - link = link_to('', help_page_path('security/token_overview',  anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer')
Edited by Eduardo Sanz García

Merge request reports