Commit 3b02f8dc authored by Bob Van Landuyt's avatar Bob Van Landuyt

Hide editing/creating milestones from the board UI

parent 2ec00d8c
......@@ -49,6 +49,7 @@
%li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" }
Edit board name
- if @project.feature_available?(:issue_board_milestone, current_user)
%li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('milestone')" }
Edit board milestone
......
......@@ -10,6 +10,7 @@
%input.form-control{ type: "text",
id: "board-new-name",
"v-model" => "board.name" }
- if @project.feature_available?(:issue_board_milestone, current_user)
.dropdown.board-inner-milestone-dropdown{ ":class" => "{ open: milestoneDropdownOpen }",
"v-if" => "currentPage === 'new'" }
%label.label-light{ for: "board-milestone" }
......
......@@ -10,7 +10,12 @@ describe 'Board with milestone', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
login_as(user)
end
context 'with the feature enabled' do
before do
stub_licensed_features(issue_board_milestone: true)
end
context 'new board' do
......@@ -162,6 +167,38 @@ describe 'Board with milestone', :feature, :js do
expect(page).to have_content(milestone.title)
end
end
end
context 'with the feature disabled' do
before do
stub_licensed_features(issue_board_milestone: false)
visit namespace_project_boards_path(project.namespace, project)
end
it "doesn't show the input when creating a board" do
page.within '#js-multiple-boards-switcher' do
find('.dropdown-menu-toggle').click
click_link 'Create new board'
# To make sure the form is shown
expect(page).to have_selector('#board-new-name')
expect(page).not_to have_button('Milestone')
end
end
it "doesn't show the option to edit the milestone" do
page.within '#js-multiple-boards-switcher' do
find('.dropdown-menu-toggle').click
# To make sure the dropdown is open
expect(page).to have_link('Edit board name')
expect(page).not_to have_link('Edit board milestone')
end
end
end
def create_board_with_milestone
page.within '#js-multiple-boards-switcher' 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