Commit a080aa13 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett Committed by Phil Hughes

Resolve "Issue Board -> "Remove from board" button when viewing an issue gives js error and fails"

parent b071317c
......@@ -34,7 +34,10 @@ gl.issueBoards.BoardSidebar = Vue.extend({
},
milestoneTitle() {
return this.issue.milestone ? this.issue.milestone.title : 'No Milestone';
}
},
canRemove() {
return !this.list.preset;
},
},
watch: {
detail: {
......
......@@ -46,8 +46,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
},
template: `
<div
class="block list"
v-if="list.type !== 'closed'">
class="block list">
<button
class="btn btn-default btn-block"
type="button"
......
......@@ -23,4 +23,5 @@
= render "projects/boards/components/sidebar/labels"
= render "projects/boards/components/sidebar/notifications"
%remove-btn{ ":issue" => "issue",
":list" => "list" }
":list" => "list",
"v-if" => "canRemove" }
---
title: Remove "Remove from board" button from backlog and closed list
merge_request: 12430
author:
......@@ -79,6 +79,22 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it 'does not show remove button for backlog or closed issues' do
create(:issue, project: project)
create(:issue, :closed, project: project)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
click_card(find('.board:nth-child(1)').first('.card'))
expect(find('.issue-boards-sidebar')).not_to have_button 'Remove from board'
click_card(find('.board:nth-child(3)').first('.card'))
expect(find('.issue-boards-sidebar')).not_to have_button 'Remove from board'
end
context 'assignee' do
it 'updates the issues assignee' do
click_card(card)
......
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