Commit 75c0e83b authored by Mike Greiling's avatar Mike Greiling

Merge branch...

Merge branch '197497-when-user-clicks-on-exit-while-editing-work-in-progress-limits-user-gets-error' into 'master'

Fix error on close of board sidebar when editing

Closes #197497

See merge request gitlab-org/gitlab!23532
parents 2ceaff37 603c008d
......@@ -111,13 +111,12 @@ export default {
offFocus() {
if (this.currentWipLimit !== this.activeList.maxIssueCount) {
this.updating = true;
// NOTE: Need a ref to activeListId in case the user closes the drawer.
const id = this.activeListId;
this.updateListWipLimit({ maxIssueCount: this.currentWipLimit, id: this.activeListId })
this.updateListWipLimit({ maxIssueCount: this.currentWipLimit, id })
.then(({ config }) => {
boardsStoreEE.setMaxIssueCountOnList(
this.activeListId,
JSON.parse(config.data).list.max_issue_count,
);
boardsStoreEE.setMaxIssueCountOnList(id, JSON.parse(config.data).list.max_issue_count);
this.resetStateAfterUpdate();
})
.catch(() => {
......
---
title: Allow user to close sidebar while editing boardlist and save wip limit
merge_request:
author:
type: fixed
......@@ -225,6 +225,30 @@ describe 'issue boards', :js do
end
end
context 'when the user is editing a wip limit and clicks close' do
it 'updates the max issue count wip limit' do
max_issue_count = 3
page.within(find('.js-board-settings-sidebar')) do
click_button("Edit")
find('input').set(max_issue_count)
end
# Off click
# Danger: coupling to gitlab-ui class name for close.
# Change when https://gitlab.com/gitlab-org/gitlab-ui/issues/578 is resolved
find('.gl-drawer-close-button').click
wait_for_requests
page.within(find(".board:nth-child(2)")) do
click_button('List Settings')
end
expect(page.find('.js-wip-limit')).to have_text(max_issue_count)
end
end
context "when user off clicks" do
it 'updates the max issue count wip limit' do
max_issue_count = 2
......
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