Move more diff viewer logic and state into DiffViewerPage.

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

Information

Review Board
release-3.0.x
44d9f9f...

Reviewers

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
revisions/interdiffs.

Tested navigating via keybindings and the file list.

Tested commenting on lines.

Tested expanding/collapsing context in a diff.

Description From Last Updated

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

daviddavid

E501 line too long (86 > 79 characters)

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. 
      
  2. Show all issues

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

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (da430fa)
Loading...