diff --git a/polygerrit-ui/app/elements/gr-diff-view.html b/polygerrit-ui/app/elements/gr-diff-view.html index 4945a67956..9829aeba7e 100644 --- a/polygerrit-ui/app/elements/gr-diff-view.html +++ b/polygerrit-ui/app/elements/gr-diff-view.html @@ -55,6 +55,7 @@ limitations under the License. change-num="[[_changeNum]]" patch-range="[[_patchRange]]" path="[[_path]]" + available-patches="[[_computeAvailablePatches(_change.revisions)]]" on-render="_handleDiffRender"> @@ -156,6 +157,14 @@ limitations under the License. } }, + _computeAvailablePatches: function(revisions) { + var patchNums = []; + for (var rev in revisions) { + patchNums.push(revisions[rev]._number); + } + return patchNums.sort(function(a, b) { return a - b; }); + }, + _computeChangePath: function(changeNum) { return '/c/' + changeNum; }, diff --git a/polygerrit-ui/app/elements/gr-diff.html b/polygerrit-ui/app/elements/gr-diff.html index 23d14b5a81..ebc67b991f 100644 --- a/polygerrit-ui/app/elements/gr-diff.html +++ b/polygerrit-ui/app/elements/gr-diff.html @@ -17,12 +17,16 @@ limitations under the License. + + + diff --git a/polygerrit-ui/app/test/gr-patch-range-select-test.html b/polygerrit-ui/app/test/gr-patch-range-select-test.html new file mode 100644 index 0000000000..c2b19e7542 --- /dev/null +++ b/polygerrit-ui/app/test/gr-patch-range-select-test.html @@ -0,0 +1,93 @@ + + + + +gr-patch-range-select + + + + + + + + + + + + + diff --git a/polygerrit-ui/app/test/index.html b/polygerrit-ui/app/test/index.html index 231f960006..1ba06b00d9 100644 --- a/polygerrit-ui/app/test/index.html +++ b/polygerrit-ui/app/test/index.html @@ -34,6 +34,7 @@ limitations under the License. 'gr-diff-test.html', 'gr-diff-view-test.html', 'gr-file-list-test.html', + 'gr-patch-range-select-test.html', 'gr-reply-dropdown-test.html', 'gr-search-bar-test.html', ].forEach(function(file) {