Update main JavaScript file to only apply right sidebar CSS class when an aside is present
What does this MR do?
This MR is for issue #202109 (closed)
The root of this issue can be found in the main.js
file where on document load, if the page is at a mobile view port i.e. sm
or xs
, a class called right-sidebar-x
is applied which creates extra padding on the right of the screen.
The issue stems from the fact this class is applied to every page regardless of if a right sidebar actually exists or not.
In this MR we create the tiniest MVC possible to ensure this class is only applied when a aside.right-sidebar
is actually present on page load.
Screenshots
Before | After |
---|---|
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
This is a sweeping change!
I have manually tested this change on as many screens as possible across all different view port sizes and browsers but I need to highlight two issues:
- This is a sweeping change across many parts of the application as its was fundamental break.
- I am unsure how to approach this from a testing perspective as I could not find any related tests to
main.js
and could use some advice on this!
-
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
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team