From 014bef80bc6cded43ae695ba54376a532d9809e5 Mon Sep 17 00:00:00 2001 From: Bryce Johnson <bryce@gitlab.com> Date: Tue, 27 Sep 2016 13:20:27 +0200 Subject: [PATCH] Fix up for issues bulk assignment test. --- .../javascripts/issues-bulk-assignment.js.es6 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/issues-bulk-assignment.js.es6 b/app/assets/javascripts/issues-bulk-assignment.js.es6 index 012002a293a..0808f538f01 100644 --- a/app/assets/javascripts/issues-bulk-assignment.js.es6 +++ b/app/assets/javascripts/issues-bulk-assignment.js.es6 @@ -69,15 +69,17 @@ getUnmarkedIndeterminedLabels() { const result = []; - const elements = this.getElement('.labels-filter .is-indeterminate'); - const labelsToKeep = elements.map((el) => labelsToKeep.push($(el).data('labelId'))); - const selectedLabels = this.getLabelsFromSelection() - .forEach(() => { - const id = selectedLabels[j]; - if (labelsToKeep.indexOf(id) === -1) { - result.push(id); - } - }); + const labelsToKeep = []; + + this.getElement('.labels-filter .is-indeterminate') + .each((i, el) => labelsToKeep.push($(el).data('labelId'))); + + this.getLabelsFromSelection().forEach((id) => { + if (labelsToKeep.indexOf(id) === -1) { + result.push(id); + } + }); + return result; } -- GitLab