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.

Relates to #474105 (closed)

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 3e81b157596c..12d081166045 100644
--- a/app/views/shared/_token_expiration_banner.html.haml
+++ b/app/views/shared/_token_expiration_banner.html.haml
@@ -1,7 +1,6 @@
 - id = 'token_expiration'
 - cookie_key = 'hide_token_expiration_banner'
 
-- return unless show_token_expiration_banner?
 - return unless cookies[cookie_key].blank?
 
 - link = link_to('', help_page_path('security/token_overview',  anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer')
Edited by Adil Farrukh

Merge request reports

Loading