Skip to content

Resolve "Switching branches in repo tree view navigates backwards"

What does this MR do?

Fixes bug where selecting a different branch always loads the root directory of that branch instead of the currently viewed directory.

What was going on?

The dropdown list of branches is only built on the initial page load. Since changing directories does not reload the page, the links are never updated.

How did you fix this?

I am interrupting the click event and updating the path URL parameter with the current directory path, then opening that link.

NOTE

I consider this a temporary solution. Ideally, the links would be updated when the directory changes and this javascript would not be necessary however since this is already a "deprecated" dropdown list I think we are better off with this small change vs the larger correct fix which would be to finish converting this page to Vue.

Where my tests at???

Great question! This file has no exitsting tests 😬 I suppose we could write some now but considering that

  1. This code is already marked deprecated
  2. This sections is already marked to be re-written in Vue

I have opted to not add tests.

Screenshots (strongly suggested)

Before

Screen_Recording_2020-10-29_at_12.15.52_PM

After

Screen_Recording_2020-10-29_at_12.14.14_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #231777 (closed)

Edited by Justin Boyson

Merge request reports

Loading