diff --git a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.html b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.html index 7a6aa7f1e6..0afd214640 100644 --- a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.html +++ b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.html @@ -78,13 +78,15 @@ limitations under the License. on-click="_handleCloseTap">Close + id="filterInput" + placeholder="Filter" + bind-value="{{_filterText}}" + > + is="iron-input" + placeholder="Filter" + bind-value="{{_filterText}}" + />
Loading...
diff --git a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.js b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.js index 4b8ce2256f..9d9f654ca8 100644 --- a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.js +++ b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog.js @@ -65,7 +65,9 @@ }, _computeGroups(includedIn, filterText) { - if (!includedIn) { return []; } + if (!includedIn || filterText === undefined) { + return []; + } const filter = item => !filterText.length || item.toLowerCase().indexOf(filterText.toLowerCase()) !== -1; @@ -94,11 +96,5 @@ _computeLoadingClass(loaded) { return loaded ? 'loading loaded' : 'loading'; }, - - _onFilterChanged() { - this.debounce('filter-change', () => { - this._filterText = this.$.filterInput.bindValue; - }, 100); - }, }); })(); diff --git a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog_test.html b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog_test.html index 68c77e63ad..ad2ad5a171 100644 --- a/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog_test.html +++ b/polygerrit-ui/app/elements/change/gr-included-in-dialog/gr-included-in-dialog_test.html @@ -82,5 +82,20 @@ limitations under the License. {title: 'Tags', items: ['v2.0', 'v2.1']}, ]); }); + + test('_computeGroups with .bindValue', done => { + element.$.filterInput.bindValue = 'stable-3.2'; + const includedIn = {branches: [], tags: []}; + includedIn.branches.push('master', 'stable-3.2'); + + setTimeout(() => { + const filterText = element._filterText; + assert.deepEqual(element._computeGroups(includedIn, filterText), [ + {title: 'Branches', items: ['stable-3.2']}, + ]); + + done(); + }); + }); });