In merge changes, comments on a specific parent should not appear in the
non-specific auto-merge base patch. The CommentInfo field that indicates
this was formerly not taken into consideration.
Change-Id: I42b2afe013c0fc3a04dd1583d7677c6825e2c8af
This function also re-initializes a ChangeComment object, but uses the
old values for comments and robot comments, and only makes a request for
new drafts.
It's response is identical to loadAll for the purposes of elements using
these functions, but will reduce unneeded API calls.
Change-Id: I3c0872b86a0e24c9c378acf3311fe8cc3e078eda
Previously, nested components (that are never standalone) were making
their own requests for comments, creating unecessary duplicate API
requests.
Some requests were made to the rest API directly (for example,
gr-change-view requested comments this way), and some were through the
gr-comment-api, which also helped handle comment manipulation and
reorganization.
Instead of ad-hoc comment requesting, move all comment requests to the
top level (standalone) component, and use an object prototype to
generate _changeComments as a property on gr-comment-api. This is an
immutable object that can be passed to the inner components
(file list, etc), and includes the methods needed to manipulate
comments into the forms
necessary.
When a child component needs to trigger a refresh of the comments, fire
an event that the parent event handles (see gr-file-list l.867).
Bug: Issue 6953
Change-Id: Ic4b6cf16520baae65d8cf956c311a60f2a70a2e1
Because requests for a user's draft diff comments is always nested
within a check for whether a user is logged in, these can be combined
into the same REST API interface call. The updated call is given a JSDoc
to describe the additional functionality and call sites are simplified.
Change-Id: Idc0cc6298c7287579ba76e7cc35701e62142bca3
Formerly, gr-diff would make its own REST calls for diff comments in the
patch range and path being viewed. However, these calls by the diff view
were redundant to the more general comment requests made by either
gr-diff-view (which requests all comments to support skipping to the
next file with comments) or gr-change-view (which requests comments
individually for each inline diff).
With this change, the diff component no longer loads comments for
itself, but is rather provided the comments from its host view via a
public property. In this way the host view can load the more-general
comment data, and filter it down for the diff view's params.
Introduces the gr-comment-api component to simplify loading and
filtering diff comments for use by diff views. By using this new
component:
* The diff view makes only one request for comments (including drafts
and robot comments) to support skipping to the next comment and
displaying comments in the diff view.
* The change view makes only one request for comments for all inline
diffs.
Bug: Issue 5299
Change-Id: Ia14a01619f1f9881aa0d253fd3f49af9a17f3dce