Commit 863f77b6 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Ruben Davila

Merge branch 'fix-issuable-filter' into 'master'

Hide "Create new list button" on Issues and MRs pages

![1](/uploads/d8b08cb62cfc9e9d29e3e64b2ed0a8af/1.png)

/cc @jschatz1 

See merge request !5852
parent 6505a994
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
= render "shared/issuable/label_dropdown" = render "shared/issuable/label_dropdown"
.pull-right .pull-right
- if controller.controller_name != 'boards' - if controller.controller_name == 'boards' && can?(current_user, :admin_list, @project)
= render 'shared/sort_dropdown'
- if can?(current_user, :admin_list, @project)
.dropdown .dropdown
%button.btn.btn-create.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, project_id: @project.try(:id) } } %button.btn.btn-create.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, project_id: @project.try(:id) } }
Create new list Create new list
...@@ -38,6 +36,8 @@ ...@@ -38,6 +36,8 @@
- if can?(current_user, :admin_label, @project) - if can?(current_user, :admin_label, @project)
= render partial: "shared/issuable/label_page_create" = render partial: "shared/issuable/label_page_create"
= dropdown_loading = dropdown_loading
- else
= render 'shared/sort_dropdown'
- if controller.controller_name == 'issues' - if controller.controller_name == 'issues'
.issues_bulk_update.hide .issues_bulk_update.hide
......
require 'spec_helper'
feature 'Issues List' do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
background do
project.team << [user, :developer]
login_as(user)
end
scenario 'user does not see create new list button' do
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
expect(page).not_to have_selector('.js-new-board-list')
end
end
require 'spec_helper'
feature 'Merge Requests List' do
let(:user) { create(:user) }
let(:project) { create(:project) }
background do
project.team << [user, :developer]
login_as(user)
end
scenario 'user does not see create new list button' do
create(:merge_request, source_project: project)
visit namespace_project_merge_requests_path(project.namespace, project)
expect(page).not_to have_selector('.js-new-board-list')
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