Commit 0e4ee261 authored by Robert Speicher's avatar Robert Speicher

Merge branch '6474-fix-assignees-list-showing-on-unsupported-license' into 'master'

Resolve "Assignee list UI should only appear in Premium or higher"

Closes #6474

See merge request gitlab-org/gitlab-ee!6171
parents e1792086 21d5eadf
.dropdown.prepend-left-10#js-add-list
%button.btn.btn-create.btn-inverted.d-flex.js-new-board-list{ type: "button", data: board_list_data }
%span Add list
= sprite_icon('chevron-down', size: 16, css_class: 'prepend-left-5 btn-new-board-list-chevron')
.dropdown-menu.dropdown-menu-paging.dropdown-menu-right.dropdown-menu-issues-board-new.dropdown-menu-selectable.dropdown-menu-tabs
%ul.nav.nav-tabs.dropdown-tabs-list.js-new-board-list-tabs{ role: 'tablist' }
%li.nav-item.dropdown-tab-item.js-tab-button-labels
%a.active{ href: '#', role: 'tab', data: { is_link: 'true', toggle: 'tab', action: 'tab-labels', target: '#tab-labels' } }
Label list
%li.nav-item.dropdown-tab-item.js-tab-button-labels
%a{ href: '#', role: 'tab', data: { is_link: 'true', toggle: 'tab', action: 'tab-assignees', target: '#tab-assignees' } }
Assignee list
.tab-content
#tab-labels.tab-pane.tab-pane-labels.active.js-tab-container-labels{ role: 'tabpanel' }
= render partial: "shared/issuable/label_page_default", locals: { show_title: false, show_footer: true, show_create: true, show_boards_content: true, content_title: _('Label lists show all issues with the selected label.') }
- if can?(current_user, :admin_label, board.parent)
= render partial: "shared/issuable/label_page_create", locals: { show_close: false }
#tab-assignees.tab-pane.tab-pane-assignees.js-tab-container-assignees{ role: 'tabpanel' }
= render partial: "shared/issuable/assignee_page_default"
= dropdown_loading
- if board.parent.feature_available?(:board_assignee_lists)
.dropdown.prepend-left-10#js-add-list
%button.btn.btn-create.btn-inverted.d-flex.js-new-board-list{ type: "button", data: board_list_data }
%span Add list
= sprite_icon('chevron-down', size: 16, css_class: 'prepend-left-5 btn-new-board-list-chevron')
.dropdown-menu.dropdown-menu-paging.dropdown-menu-right.dropdown-menu-issues-board-new.dropdown-menu-selectable.dropdown-menu-tabs
%ul.nav.nav-tabs.dropdown-tabs-list.js-new-board-list-tabs{ role: 'tablist' }
%li.nav-item.dropdown-tab-item.js-tab-button-labels
%a.active{ href: '#', role: 'tab', data: { is_link: 'true', toggle: 'tab', action: 'tab-labels', target: '#tab-labels' } }
Label list
%li.nav-item.dropdown-tab-item.js-tab-button-assignees
%a{ href: '#', role: 'tab', data: { is_link: 'true', toggle: 'tab', action: 'tab-assignees', target: '#tab-assignees' } }
Assignee list
.tab-content
#tab-labels.tab-pane.tab-pane-labels.active.js-tab-container-labels{ role: 'tabpanel' }
= render partial: "shared/issuable/label_page_default", locals: { show_title: false, show_footer: true, show_create: true, show_boards_content: true, content_title: _('Label lists show all issues with the selected label.') }
- if can?(current_user, :admin_label, board.parent)
= render partial: "shared/issuable/label_page_create", locals: { show_close: false }
#tab-assignees.tab-pane.tab-pane-assignees.js-tab-container-assignees{ role: 'tabpanel' }
= render partial: "shared/issuable/assignee_page_default"
= dropdown_loading
- else
= render_ce 'shared/issuable/board_create_list_dropdown', board: board
......@@ -52,6 +52,45 @@ describe 'issue boards', :js do
end
end
context 'add list dropdown' do
let(:group) { create(:group) }
let(:project) { create(:project, :public, namespace: group) }
before do
project.add_master(user)
group.add_reporter(user)
login_as(user)
end
it 'shows tabbed dropdown with labels list and assignees list' do
stub_licensed_features(board_assignee_lists: true)
visit_board_page
page.within('#js-add-list') do
page.find('.js-new-board-list').click
wait_for_requests
expect(page).to have_css('.dropdown-menu.dropdown-menu-tabs')
expect(page).to have_css('.js-tab-button-labels')
expect(page).to have_css('.js-tab-button-assignees')
end
end
it 'shows simple dropdown with only labels list' do
stub_licensed_features(board_assignee_lists: false)
visit_board_page
page.within('#js-add-list') do
page.find('.js-new-board-list').click
wait_for_requests
expect(page).to have_css('.dropdown-menu.js-tab-container-labels')
expect(page).to have_content('Create lists from labels. Issues with that label appear in that list.')
expect(page).not_to have_css('.js-tab-button-assignees')
end
end
end
def visit_board_page
visit project_boards_path(project)
wait_for_requests
......
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