Commit 161d77e0 authored by Phil Hughes's avatar Phil Hughes

Open new board after creating it

After creating a new board, it correctly opens it instead of just reloading the list & therefore requiring the user to click on the board link to view it.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/29611
parent 7e7eec0e
......@@ -78,6 +78,7 @@ $(() => {
}
gl.boardService = new BoardService(this.endpoint, this.bulkUpdatePath, this.boardId);
Store.rootPath = this.endpoint;
this.filterManager = new FilteredSearchBoards(Store.filter, true, [(this.milestoneTitle ? 'milestone' : null)]);
......
......@@ -81,7 +81,7 @@ const extraMilestones = require('../mixins/extra_milestones');
},
submit() {
gl.boardService.createBoard(this.board)
.then(() => {
.then((resp) => {
if (this.currentBoard && this.currentPage !== 'new') {
this.currentBoard.name = this.board.name;
......@@ -89,14 +89,17 @@ const extraMilestones = require('../mixins/extra_milestones');
// We reload the page to make sure the store & state of the app are correct
this.refreshPage();
}
}
// Enable the button thanks to our jQuery disabling it
$(this.$refs.submitBtn).enable();
// Enable the button thanks to our jQuery disabling it
$(this.$refs.submitBtn).enable();
// Reset the selectors current page
Store.state.currentPage = '';
Store.state.reload = true;
// Reset the selectors current page
Store.state.currentPage = '';
Store.state.reload = true;
} else if (this.currentPage === 'new') {
const data = resp.json();
gl.utils.visitUrl(`${Store.rootPath}/${data.id}`);
}
});
},
cancel() {
......
......@@ -24,9 +24,8 @@ describe 'Board with milestone', :feature, :js do
it 'creates board with milestone' do
create_board_with_milestone
click_link 'test'
expect(find('.tokens-container')).to have_content(milestone.title)
wait_for_vue_resource
expect(all('.board')[1]).to have_selector('.card', count: 1)
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