Commit 4eb6b7c1 authored by Phil Hughes's avatar Phil Hughes

Merge branch...

Merge branch '34097-issue-board-remove-from-board-button-when-viewing-an-issue-gives-js-error-and-fails' into 'master'

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

Closes #34097

See merge request !12430
parents b071317c a080aa13
...@@ -34,7 +34,10 @@ gl.issueBoards.BoardSidebar = Vue.extend({ ...@@ -34,7 +34,10 @@ gl.issueBoards.BoardSidebar = Vue.extend({
}, },
milestoneTitle() { milestoneTitle() {
return this.issue.milestone ? this.issue.milestone.title : 'No Milestone'; return this.issue.milestone ? this.issue.milestone.title : 'No Milestone';
} },
canRemove() {
return !this.list.preset;
},
}, },
watch: { watch: {
detail: { detail: {
......
...@@ -46,8 +46,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -46,8 +46,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
}, },
template: ` template: `
<div <div
class="block list" class="block list">
v-if="list.type !== 'closed'">
<button <button
class="btn btn-default btn-block" class="btn btn-default btn-block"
type="button" type="button"
......
...@@ -23,4 +23,5 @@ ...@@ -23,4 +23,5 @@
= render "projects/boards/components/sidebar/labels" = render "projects/boards/components/sidebar/labels"
= render "projects/boards/components/sidebar/notifications" = render "projects/boards/components/sidebar/notifications"
%remove-btn{ ":issue" => "issue", %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 ...@@ -79,6 +79,22 @@ describe 'Issue Boards', feature: true, js: true do
end end
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 context 'assignee' do
it 'updates the issues assignee' do it 'updates the issues assignee' do
click_card(card) 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