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
- This code is already marked deprecated
- 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
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] 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
Related to #231777 (closed)