Commit 1e801655 authored by Rajat Jain's avatar Rajat Jain

Allow different in bulk editing issues

Previously, choosing labels and then clicking on the issue, would cause
the label to reset. Now, we'll make sure to keep the state persistent
even when the issues are selected.
parent a3e1d9d5
...@@ -99,8 +99,11 @@ export default { ...@@ -99,8 +99,11 @@ export default {
setOriginalDropdownData() { setOriginalDropdownData() {
const $labelSelect = $('.bulk-update .js-label-select'); const $labelSelect = $('.bulk-update .js-label-select');
const dirtyLabelIds = $labelSelect.data('marked') || [];
const chosenLabelIds = [...this.getOriginalMarkedIds(), ...dirtyLabelIds];
$labelSelect.data('common', this.getOriginalCommonIds()); $labelSelect.data('common', this.getOriginalCommonIds());
$labelSelect.data('marked', this.getOriginalMarkedIds()); $labelSelect.data('marked', chosenLabelIds);
$labelSelect.data('indeterminate', this.getOriginalIndeterminateIds()); $labelSelect.data('indeterminate', this.getOriginalIndeterminateIds());
}, },
......
---
title: Allow different in bulk editing issues
merge_request: 32734
author:
type: fixed
...@@ -302,7 +302,23 @@ describe 'Issues > Labels bulk assignment' do ...@@ -302,7 +302,23 @@ describe 'Issues > Labels bulk assignment' do
sleep 1 # needed sleep 1 # needed
expect(find("#issue_#{issue1.id}")).to have_content 'bug' expect(find("#issue_#{issue1.id}")).to have_content 'bug'
expect(find("#issue_#{issue1.id}")).not_to have_content 'feature' expect(find("#issue_#{issue1.id}")).to have_content 'feature'
end
end
context 'mark previously toggled label' do
before do
enable_bulk_update
end
it do
open_labels_dropdown ['feature']
check_issue issue1
update_issues
expect(find("#issue_#{issue1.id}")).to have_content 'feature'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment