diff --git a/polygerrit-ui/app/elements/gr-change-list-item.html b/polygerrit-ui/app/elements/gr-change-list-item.html index 374333744b..87d7fc6692 100644 --- a/polygerrit-ui/app/elements/gr-change-list-item.html +++ b/polygerrit-ui/app/elements/gr-change-list-item.html @@ -76,7 +76,7 @@ limitations under the License. - [[change.subject]] + [[change.subject]] [[_computeChangeStatusString(change)]] @@ -118,11 +118,15 @@ limitations under the License. reflectToAttribute: true, }, change: Object, + changeURL: { + type: String, + computed: '_computeChangeURL(change._number)', + } }, - changeURL: function() { - if (!this.change) { return ''; } - return '/c/' + this.change._number + '/'; + _computeChangeURL: function(changeNum) { + if (!changeNum) { return ''; } + return '/c/' + changeNum + '/'; }, _computeChangeStatusString: function(change) { diff --git a/polygerrit-ui/app/elements/gr-change-list.html b/polygerrit-ui/app/elements/gr-change-list.html index f3f3ca202c..c2418be7ad 100644 --- a/polygerrit-ui/app/elements/gr-change-list.html +++ b/polygerrit-ui/app/elements/gr-change-list.html @@ -111,7 +111,7 @@ limitations under the License. _changeURLForIndex: function(index) { var changeEls = this._getNonHeaderListItems(); if (index < changeEls.length && changeEls[index]) { - return changeEls[index].changeURL(); + return changeEls[index].changeURL; } return ''; }, diff --git a/polygerrit-ui/app/test/gr-change-list-item-test.html b/polygerrit-ui/app/test/gr-change-list-item-test.html index d9cf2b640f..1d3c9e32ca 100644 --- a/polygerrit-ui/app/test/gr-change-list-item-test.html +++ b/polygerrit-ui/app/test/gr-change-list-item-test.html @@ -82,7 +82,9 @@ limitations under the License. '/q/status:open+project:combustible-stuff+branch:lemons'); element.change = { _number: 42 }; - assert.equal(element.changeURL(), '/c/42/'); + assert.equal(element.changeURL, '/c/42/'); + element.change = { _number: 43 }; + assert.equal(element.changeURL, '/c/43/'); }); });