diff --git a/polygerrit-ui/app/elements/gr-app.html b/polygerrit-ui/app/elements/gr-app.html
index e7e9e581d6..88909838da 100644
--- a/polygerrit-ui/app/elements/gr-app.html
+++ b/polygerrit-ui/app/elements/gr-app.html
@@ -126,6 +126,7 @@ limitations under the License.
diff --git a/polygerrit-ui/app/elements/gr-change-list-item.html b/polygerrit-ui/app/elements/gr-change-list-item.html
index 797772769e..1e57e09fc4 100644
--- a/polygerrit-ui/app/elements/gr-change-list-item.html
+++ b/polygerrit-ui/app/elements/gr-change-list-item.html
@@ -31,7 +31,7 @@ limitations under the License.
:host([selected]) {
background-color: #ebf5fb;
}
- :host([unreviewed]) {
+ :host([needs-review]) {
font-weight: bold;
}
.cell {
@@ -98,7 +98,7 @@ limitations under the License.
value: false,
reflectToAttribute: true,
},
- unreviewed: {
+ needsReview: {
type: Boolean,
value: false,
reflectToAttribute: true,
diff --git a/polygerrit-ui/app/elements/gr-change-list.html b/polygerrit-ui/app/elements/gr-change-list.html
index c11800e3fe..1a0341a768 100644
--- a/polygerrit-ui/app/elements/gr-change-list.html
+++ b/polygerrit-ui/app/elements/gr-change-list.html
@@ -55,7 +55,7 @@ limitations under the License.
@@ -75,6 +75,14 @@ limitations under the License.
},
properties: {
+ /**
+ * The logged-in user's account, or an empty object if no user is logged
+ * in.
+ */
+ account: {
+ type: Object,
+ value: function() { return {}; },
+ },
/**
* An array of ChangeInfo objects to render.
* https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-info
@@ -162,9 +170,10 @@ limitations under the License.
return idx == selectedIndex;
},
- _computeItemUnreviewed: function(change, showReviewedState) {
+ _computeItemNeedsReview: function(account, change, showReviewedState) {
return showReviewedState && !change.reviewed &&
- change.status != this.ChangeStatus.MERGED;
+ change.status != this.ChangeStatus.MERGED &&
+ account._account_id != change.owner._account_id;
},
_handleKey: function(e) {
diff --git a/polygerrit-ui/app/elements/gr-dashboard-view.html b/polygerrit-ui/app/elements/gr-dashboard-view.html
index 324b07d5eb..cdd4b1a54f 100644
--- a/polygerrit-ui/app/elements/gr-dashboard-view.html
+++ b/polygerrit-ui/app/elements/gr-dashboard-view.html
@@ -54,6 +54,7 @@ limitations under the License.
@@ -73,6 +74,10 @@ limitations under the License.
*/
properties: {
+ account: {
+ type: Object,
+ value: function() { return {}; },
+ },
viewState: Object,
_results: Array,
diff --git a/polygerrit-ui/app/test/gr-change-list-test.html b/polygerrit-ui/app/test/gr-change-list-test.html
index 306840fe58..edd2ab83bf 100644
--- a/polygerrit-ui/app/test/gr-change-list-test.html
+++ b/polygerrit-ui/app/test/gr-change-list-test.html
@@ -105,35 +105,52 @@ limitations under the License.
}, 1);
});
- test('unreviewed changes', function() {
+ test('changes needing review', function() {
element.changes = [
{
_number: 0,
reviewed: true,
+ owner: { _account_id: 0 },
},
{
_number: 1,
+ owner: { _account_id: 0 },
},
{
_number: 2,
status: 'MERGED',
+ owner: { _account_id: 0 },
},
+ {
+ _number: 3,
+ owner: { _account_id: 42 },
+ }
];
flushAsynchronousOperations();
var elementItems = Polymer.dom(element.root).querySelectorAll(
'gr-change-list-item');
- assert.equal(elementItems.length, 3);
+ assert.equal(elementItems.length, 4);
for (var i = 0; i < elementItems.length; i++) {
- assert.isFalse(elementItems[i].hasAttribute('unreviewed'));
+ assert.isFalse(elementItems[i].hasAttribute('needs-review'));
}
element.showReviewedState = true;
var elementItems = Polymer.dom(element.root).querySelectorAll(
'gr-change-list-item');
- assert.equal(elementItems.length, 3);
- assert.isFalse(elementItems[0].hasAttribute('unreviewed'));
- assert.isTrue(elementItems[1].hasAttribute('unreviewed'));
- assert.isFalse(elementItems[2].hasAttribute('unreviewed'));
+ assert.equal(elementItems.length, 4);
+ assert.isFalse(elementItems[0].hasAttribute('needs-review'));
+ assert.isTrue(elementItems[1].hasAttribute('needs-review'));
+ assert.isFalse(elementItems[2].hasAttribute('needs-review'));
+ assert.isTrue(elementItems[3].hasAttribute('needs-review'));
+
+ element.account = { _account_id: 42 };
+ var elementItems = Polymer.dom(element.root).querySelectorAll(
+ 'gr-change-list-item');
+ assert.equal(elementItems.length, 4);
+ assert.isFalse(elementItems[0].hasAttribute('needs-review'));
+ assert.isTrue(elementItems[1].hasAttribute('needs-review'));
+ assert.isFalse(elementItems[2].hasAttribute('needs-review'));
+ assert.isFalse(elementItems[3].hasAttribute('needs-review'));
});
test('no changes', function() {