Fix switching of view modes in text-type file attachment diffs.

Review Request #12430 — Created July 1, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

The view mode selector ("rendered" vs "source") wasn't working when
viewing a diff of a text-based file attachment. We initially noticed
this with the Markdown review UI, but it affects all text-based
reviewables that support render modes. The issue here is that we were
passing in a root to Backbone.history that wasn't properly including
the diff file attachment ID. Because the root didn't match, the route
would never get triggered when the URL changed after the anchor was
clicked.

Viewed a markdown file attachment in both single-revision and diff
views. Verified that switching between "rendered" and "source" worked
properly for both.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix switching of view modes in text-type file attachment diffs.
The view mode selector ("rendered" vs "source") wasn't working when viewing a diff of a text-based file attachment. We initially noticed this with the Markdown review UI, but it affects all text-based reviewables that support render modes. The issue here is that we were passing in a `root` to `Backbone.history` that wasn't properly including the diff file attachment ID. Because the root didn't match, the route would never get triggered when the URL changed after the anchor was clicked. Testing Done: Viewed a markdown file attachment in both single-revision and diff views. Verified that switching between "rendered" and "source" worked properly for both.
73bc03caaf01feca405ea31a14c07c813ef2d1b3 David Trowbridge
reviewboard/static/rb/js/views/textBasedReviewableView.es6.js
Loading...