Commit d459f0ce authored by Simon Knox's avatar Simon Knox

Merge branch...

Merge branch '329627-cannot-create-new-issue-after-creating-new-list-without-page-refresh' into 'master'

Boards - Fix adding issue right after creating list

See merge request gitlab-org/gitlab!63497
parents d4eaa4a8 628ab9f7
......@@ -111,10 +111,17 @@ export default {
this.showCount = this.scrollHeight() > Math.ceil(this.listHeight());
});
},
},
created() {
eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
eventHub.$on(`scroll-board-list-${this.list.id}`, this.scrollToTop);
'list.id': {
handler(id, oldVal) {
if (id) {
eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
eventHub.$on(`scroll-board-list-${this.list.id}`, this.scrollToTop);
eventHub.$off(`toggle-issue-form-${oldVal}`, this.toggleForm);
eventHub.$off(`scroll-board-list-${oldVal}`, this.scrollToTop);
}
},
immediate: true,
},
},
beforeDestroy() {
eventHub.$off(`toggle-issue-form-${this.list.id}`, this.toggleForm);
......
......@@ -91,6 +91,13 @@ export default {
}
});
},
'list.id': {
handler(id) {
if (id) {
eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
}
},
},
},
created() {
eventHub.$on(`toggle-issue-form-${this.list.id}`, this.toggleForm);
......
......@@ -120,6 +120,32 @@ RSpec.describe 'Issue Boards new issue', :js do
expect(page).to have_content 'Label 1'
end
end
it 'allows creating an issue in newly created list' do
click_button 'Create list'
wait_for_all_requests
click_button 'Select a label'
find('label', text: label.title).click
click_button 'Add to board'
wait_for_all_requests
page.within('.board:nth-child(2)') do
click_button('New issue')
page.within(first('.board-new-issue-form')) do
find('.form-control').set('new issue')
click_button 'Create issue'
end
wait_for_all_requests
page.within('.board-card') do
expect(page).to have_content 'new issue'
end
end
end
end
context 'unauthorized user' do
......
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