Commit e5eebeb8 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch 'reposition-multiple-issue-boards-selector' into 'master'

Repositioned multiple issue boards selector

Closes #1156

See merge request !1020
parents 89dde32a 96a6ed57
...@@ -35,7 +35,6 @@ $(() => { ...@@ -35,7 +35,6 @@ $(() => {
el: $boardApp, el: $boardApp,
components: { components: {
'board': gl.issueBoards.Board, 'board': gl.issueBoards.Board,
'boards-selector': gl.issueBoards.BoardsSelector,
'board-sidebar': gl.issueBoards.BoardSidebar, 'board-sidebar': gl.issueBoards.BoardSidebar,
'board-add-issues-modal': gl.issueBoards.IssuesModal, 'board-add-issues-modal': gl.issueBoards.IssuesModal,
}, },
...@@ -110,4 +109,11 @@ $(() => { ...@@ -110,4 +109,11 @@ $(() => {
</button> </button>
`, `,
}); });
gl.IssueboardsSwitcher = new Vue({
el: '#js-multiple-boards-switcher',
components: {
'boards-selector': gl.issueBoards.BoardsSelector,
}
});
}); });
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
Store.state.reload = true; Store.state.reload = true;
}); });
}, },
cancel() {
Store.state.currentPage = '';
},
}, },
}); });
})(); })();
...@@ -64,6 +64,7 @@ require('./board_new_form'); ...@@ -64,6 +64,7 @@ require('./board_new_form');
}, },
methods: { methods: {
showPage(page) { showPage(page) {
this.state.reload = false;
this.state.currentPage = page; this.state.currentPage = page;
}, },
toggleDropdown() { toggleDropdown() {
......
...@@ -49,6 +49,15 @@ ...@@ -49,6 +49,15 @@
.page-with-sidebar { .page-with-sidebar {
padding-bottom: 0; padding-bottom: 0;
} }
.issues-details-filters {
display: -webkit-flex;
display: flex;
}
.filter-form {
width: 100%;
}
} }
.boards-app { .boards-app {
...@@ -63,6 +72,7 @@ ...@@ -63,6 +72,7 @@
.boards-list { .boards-list {
height: calc(100vh - 152px); height: calc(100vh - 152px);
width: 100%; width: 100%;
padding-top: 25px;
padding-bottom: 25px; padding-bottom: 25px;
padding-right: ($gl-padding / 2); padding-right: ($gl-padding / 2);
padding-left: ($gl-padding / 2); padding-left: ($gl-padding / 2);
...@@ -70,8 +80,8 @@ ...@@ -70,8 +80,8 @@
white-space: nowrap; white-space: nowrap;
@media (min-width: $screen-sm-min) { @media (min-width: $screen-sm-min) {
height: 409px; // Needed for PhantomJS height: 475px; // Needed for PhantomJS
height: calc(100vh - 290px); height: calc(100vh - 220px);
min-height: 409px; min-height: 409px;
transition: width .2s; transition: width .2s;
...@@ -304,21 +314,6 @@ ...@@ -304,21 +314,6 @@
} }
} }
.boards-switcher {
padding: 0;
border: 0;
outline: 0;
background: none;
font-size: 19px;
font-weight: 600;
> .fa {
position: relative;
top: 2px;
margin-left: 5px;
}
}
.board-selector-page-two { .board-selector-page-two {
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
...@@ -530,6 +525,13 @@ ...@@ -530,6 +525,13 @@
font-size: 9px; font-size: 9px;
line-height: 15px; line-height: 15px;
border-radius: 50%; border-radius: 50%;
}
.boards-switcher {
padding-right: 10px;
margin-right: 10px;
border-right: 1px solid $white-dark;
} }
.modal-filters { .modal-filters {
......
...@@ -13,10 +13,9 @@ ...@@ -13,10 +13,9 @@
= render "projects/issues/head" = render "projects/issues/head"
= render 'shared/issuable/filter', type: :boards = render 'shared/issuable/filter', type: :boards, board: board
#board-app.boards-app{ "v-cloak" => true, data: board_data } #board-app.boards-app{ "v-cloak" => true, data: board_data }
= render "title", board: board
.boards-list{ ":class" => "{ 'is-compact': detailIssueVisible }" } .boards-list{ ":class" => "{ 'is-compact': detailIssueVisible }" }
.boards-app-loading.text-center{ "v-if" => "loading" } .boards-app-loading.text-center{ "v-if" => "loading" }
= icon("spinner spin") = icon("spinner spin")
......
%boards-selector{ "inline-template" => true, %boards-selector{ "inline-template" => true,
":current-board" => board.to_json } ":current-board" => board.to_json }
.boards-title-holder.dropdown .dropdown
%button.boards-switcher{ "@click" => "loadBoards", %button.dropdown-menu-toggle{ "@click" => "loadBoards",
data: { toggle: "dropdown" } } data: { toggle: "dropdown" } }
{{ board.name }} {{ board.name }}
= icon("caret-down") = icon("chevron-down")
.dropdown-menu{ ":class" => "{ 'is-loading': loading }" } .dropdown-menu{ ":class" => "{ 'is-loading': loading }" }
.dropdown-title .dropdown-title
%button.dropdown-title-button.dropdown-menu-back{ type: "button", %button.dropdown-title-button.dropdown-menu-back{ type: "button",
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
method: :delete do method: :delete do
Delete Delete
%button.btn.btn-default.pull-right{ type: "button", %button.btn.btn-default.pull-right{ type: "button",
"@click.stop.prevent" => "currentPage = ''" } "@click.stop.prevent" => "showPage('')" }
Cancel Cancel
- if can?(current_user, :admin_board, @project) - if can?(current_user, :admin_board, @project)
.dropdown-footer{ "v-if" => "currentPage === ''" } .dropdown-footer{ "v-if" => "currentPage === ''" }
......
...@@ -11,5 +11,5 @@ ...@@ -11,5 +11,5 @@
"ref" => "'submit-btn'" } "ref" => "'submit-btn'" }
{{ buttonText }} {{ buttonText }}
%button.btn.btn-default.pull-right{ type: "button", %button.btn.btn-default.pull-right{ type: "button",
"@click.stop.prevent" => "currentPage = ''" } "@click.stop.prevent" => "cancel" }
Cancel Cancel
- finder = controller.controller_name == 'issues' || controller.controller_name == 'boards' ? issues_finder : merge_requests_finder - finder = controller.controller_name == 'issues' || controller.controller_name == 'boards' ? issues_finder : merge_requests_finder
- boards_page = controller.controller_name == 'boards' - boards_page = controller.controller_name == 'boards'
- board = local_assigns.fetch(:board, nil)
.issues-filters .issues-filters
.issues-details-filters.row-content-block.second-block .issues-details-filters.row-content-block.second-block
- if boards_page && board
#js-multiple-boards-switcher.filter-item.inline.boards-switcher{ "v-cloak" => true }
= render "projects/boards/switcher", board: board
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
- if params[:search].present? - if params[:search].present?
= hidden_field_tag :search, params[:search] = hidden_field_tag :search, params[:search]
......
---
title: Repositioned multiple issue boards selector
merge_request:
author:
...@@ -29,7 +29,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -29,7 +29,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'shows a list of boards' do it 'shows a list of boards' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content(board.name) expect(page).to have_content(board.name)
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
end end
...@@ -38,7 +38,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -38,7 +38,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'switches current board' do it 'switches current board' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link board2.name click_link board2.name
end end
...@@ -52,7 +52,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -52,7 +52,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'creates new board' do it 'creates new board' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link 'Edit board name' click_link 'Edit board name'
fill_in 'board-new-name', with: 'Testing' fill_in 'board-new-name', with: 'Testing'
...@@ -62,7 +62,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -62,7 +62,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
wait_for_vue_resource wait_for_vue_resource
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content('Testing') expect(page).to have_content('Testing')
end end
end end
...@@ -70,7 +70,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -70,7 +70,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'edits board name' do it 'edits board name' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link 'Edit board name' click_link 'Edit board name'
fill_in 'board-new-name', with: 'Testing' fill_in 'board-new-name', with: 'Testing'
...@@ -80,7 +80,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -80,7 +80,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
wait_for_vue_resource wait_for_vue_resource
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content('Testing') expect(page).to have_content('Testing')
end end
end end
...@@ -90,7 +90,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -90,7 +90,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
wait_for_vue_resource wait_for_vue_resource
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link 'Delete board' click_link 'Delete board'
page.within('.dropdown-title') do page.within('.dropdown-title') do
...@@ -102,7 +102,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -102,7 +102,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button board2.name click_button board2.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
expect(page).not_to have_content(board.name) expect(page).not_to have_content(board.name)
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
end end
...@@ -111,7 +111,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -111,7 +111,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'adds a list to the none default board' do it 'adds a list to the none default board' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link board2.name click_link board2.name
end end
...@@ -135,7 +135,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -135,7 +135,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button board2.name click_button board2.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
click_link board.name click_link board.name
end end
...@@ -154,7 +154,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -154,7 +154,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'does not show action links' do it 'does not show action links' do
click_button board.name click_button board.name
page.within('.boards-title-holder .dropdown-menu') do page.within('.dropdown-menu') do
expect(page).not_to have_content('Create new board') expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Edit board name') expect(page).not_to have_content('Edit board name')
expect(page).not_to have_content('Delete board') expect(page).not_to have_content('Delete board')
......
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