From b461ea9d58ebe4aae21d123c7d00ebe12f665d99 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Wed, 14 Sep 2016 14:42:07 -0400 Subject: [PATCH] Only show related changes from latest patch set This is to keep with the UI model that only the file list area should change according to which patch set is selected. Additionally fixed an issue where a thenable function was being passed to then(), which accepts a success and failure function and not a Promise. Bug: Issue 4477 Change-Id: Id83db0ad77c4ec6ba2840fa27d13291f2c927797 --- .../change/gr-change-view/gr-change-view.html | 2 +- .../gr-related-changes-list.html | 106 +++++++++--------- .../gr-related-changes-list.js | 6 +- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html index 54f07a0db3..37c9f62740 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html @@ -256,7 +256,7 @@ limitations under the License.
+ patch-num="[[_computeLatestPatchNum(_allPatchSets)]]">
diff --git a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.html b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.html index 5d2d20d51d..adde31e041 100644 --- a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.html +++ b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.html @@ -74,59 +74,61 @@ limitations under the License. }
Loading...
- + + + + diff --git a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js index f4ee53a56c..cac45c6d99 100644 --- a/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js +++ b/polygerrit-ui/app/elements/change/gr-related-changes-list/gr-related-changes-list.js @@ -68,7 +68,7 @@ }.bind(this)), ]; - return this._getServerConfig().then(function(config) { + promises.push(this._getServerConfig().then(function(config) { if (this.change.topic && !config.change.submit_whole_topic) { return this._getChangesWithSameTopic().then(function(response) { this._sameTopic = response; @@ -77,7 +77,9 @@ this._sameTopic = []; } return this._sameTopic; - }.bind(this)).then(Promise.all(promises)).then(function() { + }.bind(this))); + + return Promise.all(promises).then(function() { this._loading = false; }.bind(this)); },