Update permalink/blame buttons with line number fragment hash
What does this MR do?
Updates permalink and blame buttons href to include the line number fragment hash.
Previous MR to add y
keyboard shortcut that maintained line number fragment hash, https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8799
Are there points in the code the reviewer needs to double check?
- Are we ok with the
app/assets/javascripts/extensions/history.js
that fires off an event wheneverhistory.pushState
is called?- When clicking a line number, it changes the URL to
#LX
withhistory.pushState
which doesn't have a way to listen to natively - Clicking a line number is
preventDefault
'ed andstopPropagation
'ed so we can't hook on that and adding it directly inline_highter.js
doesn't seem right.
- When clicking a line number, it changes the URL to
Why was this MR needed?
Previously when you clicked a line number and had the #LX
fragment hash and then click the Permalink
or Blame
button, it would get rid of the hash.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1381
EE MR:What are the relevant issue numbers?
Closes #19742 (closed)