Allow suggestions that are already on some changes Previously, suggestions were only allowed in the "add reviewer/CC" bulk action if they were suggested for all changes in the action. However if a reviewer is already assigned to a change they would not appear as a suggestion. This change allows a suggestion if, for every change, it is either a suggestion or an existing reviewer. Because of this new requirement, the full ChangeInfo is pulled into the suggestions provider instead of just the number because the suggestions provider now needs to inspect the reviewer lists of the changes. This also meant the intersection util should no longer be used here. Early versions of the change attempted to abstract part of the util out to the caller, but it had a sneaky bug and diluted the utility function. The reduce+filter combo is pretty much the same except the reviewers/CCs are added into the filter as well. The reviewer+suggestions arrays cannot be simply intersected themselves because it is important that the output suggestions are actually suggested for at least one change, and not just reviewer/CCs on every change. Release-Notes: skip Google-Bug-Id: b/236099406 Change-Id: I7a75b5926aea79c6863b0640ce668e1cd381df6e
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts index 083758d..f6ff2a8 100644 --- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts +++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
@@ -2080,7 +2080,7 @@ ReviewerState.REVIEWER, this.serverConfig, this.isLoggedIn, - change._number + change ); return provider; } @@ -2092,7 +2092,7 @@ ReviewerState.CC, this.serverConfig, this.isLoggedIn, - change._number + change ); return provider; }