Skip to content

Update main JavaScript file to only apply right sidebar CSS class when an aside is present

David O'Regan requested to merge oregand/gitlab:202109 into master

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
Screenshot_2020-02-13_16-34-18 Screenshot_2020-02-13_16-39-03
Screenshot_2020-02-13_16-34-52 Screenshot_2020-02-13_16-39-44
Screenshot_2020-02-04_17-07-40 Screenshot_2020-02-13_16-38-20

Does this MR meet the acceptance criteria?

Conformity

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:

  1. This is a sweeping change across many parts of the application as its was fundamental break.
  2. 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!

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

Merge request reports