Merge "Improve documentation and npm scripts for Karma tests"
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index 25d6518..3bb6564 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -7427,24 +7427,24 @@
[options="header",cols="1,^1,5"]
|============================
-|Field Name ||Description
-|`message` |optional|
+|Field Name ||Description
+|`message` |optional|
The message to be added as review comment.
-|`tag` |optional|
+|`tag` |optional|
Apply this tag to the review comment message, votes, and inline
comments. Tags may be used by CI or other automated systems to
distinguish them from human reviews. Votes/comments that contain `tag` with
'autogenerated:' prefix can be filtered out in the web UI.
-|`labels` |optional|
+|`labels` |optional|
The votes that should be added to the revision as a map that maps the
label names to the voting values.
-|`comments` |optional|
+|`comments` |optional|
The comments that should be added as a map that maps a file path to a
list of link:#comment-input[CommentInput] entities.
-|`robot_comments` |optional|
+|`robot_comments` |optional|
The robot comments that should be added as a map that maps a file path
to a list of link:#robot-comment-input[RobotCommentInput] entities.
-|`drafts` |optional|
+|`drafts` |optional|
Draft handling that defines how draft comments are handled that are
already in the database but that were not also described in this
input. +
@@ -7453,36 +7453,36 @@
Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
besides `KEEP` is allowed.
-|`notify` |optional|
+|`notify` |optional|
Notify handling that defines to whom email notifications should be sent
after the review is stored. +
Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
If not set, the default is `ALL`.
-|`notify_details` |optional|
+|`notify_details` |optional|
Additional information about whom to notify about the update as a map
of recipient type to link:#notify-info[NotifyInfo] entity.
-|`omit_duplicate_comments` |optional|
+|`omit_duplicate_comments` |optional|
If `true`, comments with the same content at the same place will be omitted.
-|`on_behalf_of` |optional|
+|`on_behalf_of` |optional|
link:rest-api-accounts.html#account-id[\{account-id\}] the review
should be posted on behalf of. To use this option the caller must
have been granted `labelAs-NAME` permission for all keys of labels.
-|`reviewers` |optional|
+|`reviewers` |optional|
A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
representing reviewers that should be added to the change.
-|`ready` |optional|
+|`ready` |optional|
If true, and if the change is work in progress, then start review.
It is an error for both `ready` and `work_in_progress` to be true.
-|`work_in_progress` |optional|
+|`work_in_progress` |optional|
If true, mark the change as work in progress. It is an error for both
`ready` and `work_in_progress` to be true.
-|`add_to_attention_set` |optional|
+|`add_to_attention_set` |optional|
list of link:#attention-set-input[AttentionSetInput] entities to add
to the link:#attention-set[attention set].
-remove_from_attention_set` |optional|
+|`remove_from_attention_set` |optional|
list of link:#attention-set-input[AttentionSetInput] entities to remove
from the link:#attention-set[attention set].
-ignore_default_attention_set_rules`|optional|
+|`ignore_default_attention_set_rules`|optional|
If set to true, ignore all default attention set rules described in the
link:#attention-set[attention set]. Updates in add_to_attention_set
and remove_from_attention_set are not ignored.
diff --git a/plugins/download-commands b/plugins/download-commands
index 47b783e..c4ef993 160000
--- a/plugins/download-commands
+++ b/plugins/download-commands
@@ -1 +1 @@
-Subproject commit 47b783ea75036664dd591d2d3f1bcd06b68cdd5e
+Subproject commit c4ef993fa5e8578641d6447c831ace13743dd5de
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js
index 3fb8442..0690a87 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js
@@ -281,7 +281,7 @@
type: Boolean,
computed: '_computeSendButtonDisabled(canBeStarted, ' +
'draftCommentThreads, draft, _reviewersMutated, _labelsChanged, ' +
- '_includeComments, disabled, _commentEditing)',
+ '_includeComments, disabled, _commentEditing, _attentionModified)',
observer: '_sendDisabledChanged',
},
draftCommentThreads: {
@@ -1028,7 +1028,8 @@
_computeSendButtonDisabled(
canBeStarted, draftCommentThreads, text, reviewersMutated,
- labelsChanged, includeComments, disabled, commentEditing) {
+ labelsChanged, includeComments, disabled, commentEditing,
+ attentionModified) {
// Polymer 2: check for undefined
if ([
canBeStarted,
@@ -1039,14 +1040,15 @@
includeComments,
disabled,
commentEditing,
+ attentionModified,
].includes(undefined)) {
return undefined;
}
-
if (commentEditing || disabled) { return true; }
if (canBeStarted === true) { return false; }
const hasDrafts = includeComments && draftCommentThreads.length;
- return !hasDrafts && !text.length && !reviewersMutated && !labelsChanged;
+ return !hasDrafts && !text.length && !reviewersMutated && !labelsChanged &&
+ !attentionModified;
}
_computePatchSetWarning(patchNum, labelsChanged) {
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.js b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.js
index 456adb5..29f1e8a 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.js
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.js
@@ -1235,7 +1235,8 @@
/* labelsChanged= */ false,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1250,7 +1251,24 @@
/* labelsChanged= */ false,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
+ ));
+ });
+
+ test('_computeSendButtonDisabled_attentionModified true', () => {
+ const fn = element._computeSendButtonDisabled.bind(element);
+ // Mock everything false
+ assert.isFalse(fn(
+ /* canBeStarted= */ false,
+ /* draftCommentThreads= */ [],
+ /* text= */ '',
+ /* reviewersMutated= */ false,
+ /* labelsChanged= */ false,
+ /* includeComments= */ false,
+ /* disabled= */ false,
+ /* commentEditing= */ false,
+ /* attentionModified= */ true
));
});
@@ -1265,7 +1283,8 @@
/* labelsChanged= */ false,
/* includeComments= */ true,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1280,7 +1299,8 @@
/* labelsChanged= */ false,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1295,7 +1315,8 @@
/* labelsChanged= */ false,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1310,7 +1331,8 @@
/* labelsChanged= */ false,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1325,7 +1347,8 @@
/* labelsChanged= */ true,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
});
@@ -1340,7 +1363,8 @@
/* labelsChanged= */ true,
/* includeComments= */ false,
/* disabled= */ true,
- /* commentEditing= */ false
+ /* commentEditing= */ false,
+ /* attentionModified= */ false
));
assert.isTrue(fn(
/* buttonLabel= */ 'Send',
@@ -1350,7 +1374,8 @@
/* labelsChanged= */ true,
/* includeComments= */ false,
/* disabled= */ false,
- /* commentEditing= */ true
+ /* commentEditing= */ true,
+ /* attentionModified= */ false
));
});
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
index ad72ee1..d3cdfbe 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
@@ -563,8 +563,9 @@
this.$.cursor.moveToNextCommentThread();
} else {
if (this.modifierPressed(e)) { return; }
+ // navigate to next file if key is not being held down
this.$.cursor.moveToNextChunk(/* opt_clipToTop = */false,
- /* opt_navigateToNextFile = */true);
+ /* opt_navigateToNextFile = */!e.detail.keyboardEvent.repeat);
}
}
diff --git a/polygerrit-ui/app/elements/diff/gr-patch-range-select/gr-patch-range-select.js b/polygerrit-ui/app/elements/diff/gr-patch-range-select/gr-patch-range-select.js
index 806e147..6a9b0bf 100644
--- a/polygerrit-ui/app/elements/diff/gr-patch-range-select/gr-patch-range-select.js
+++ b/polygerrit-ui/app/elements/diff/gr-patch-range-select/gr-patch-range-select.js
@@ -297,12 +297,19 @@
previous: detail.patchNum,
current: e.detail.value,
latest: latestPatchNum,
+ commentCount: this.changeComments.computeCommentCount(
+ {patchNum: e.detail.value}),
});
detail.patchNum = e.detail.value;
} else {
if (this.patchNumEquals(detail.basePatchNum, e.detail.value)) return;
this.reporting.reportInteraction('left-patchset-changed',
- {previous: detail.basePatchNum, current: e.detail.value});
+ {
+ previous: detail.basePatchNum,
+ current: e.detail.value,
+ commentCount: this.changeComments.computeCommentCount(
+ {patchNum: e.detail.value}),
+ });
detail.basePatchNum = e.detail.value;
}
diff --git a/resources/com/google/gerrit/server/mail/Comment.soy b/resources/com/google/gerrit/server/mail/Comment.soy
index 1eb016b..fc92b31 100644
--- a/resources/com/google/gerrit/server/mail/Comment.soy
+++ b/resources/com/google/gerrit/server/mail/Comment.soy
@@ -41,7 +41,7 @@
{for $group in $commentFiles}
// Insert a space before the newline so that Gmail does not mistakenly link
// the following line with the file link. See issue 9201.
- {$group.link}{sp}{\n}
+ {if $group.link}{$group.link}{sp}{/if}{\n}
{$group.title}:{\n}
{\n}