Move more diff viewer logic and state into DiffViewerPage.

Review Request #9166 — Created Aug. 31, 2017 and submitted

Christian Hammond
Review Board

RB.DiffViewerPageView has been responsible for a lot of state and
logic around loading in diffs from the server. This change moves some of
that down to the RB.DiffViewerPage model. The model now handles
creating/storing all RB.DiffReviewables and emitting events that the
view can use to know when to queue up the loading of diffs or when to
reset elements for a new set.

By moving state to the model, it'll be easier for the new review UI work
and the diff bookmarks features to better track and respond to updates
made on the page.

All unit tests pass.

Tested viewing several diffs, changing pages, and viewing different

Tested navigating via keybindings and the file list.

Tested commenting on lines.

Tested expanding/collapsing context in a diff.

  • 0
  • 0
  • 1
  • 1
  • 2
Description From Last Updated
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.


Christian Hammond
David Trowbridge
  2. This can be const. The array is still mutable, but we wouldn't be able to reassign the queryArgs name.

Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (da430fa)