Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
954deefa
Commit
954deefa
authored
Jan 30, 2017
by
Phil Hughes
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added remove button
parent
ffeb3200
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
2 deletions
+77
-2
app/assets/javascripts/boards/components/board_card.js.es6
app/assets/javascripts/boards/components/board_card.js.es6
+1
-0
app/assets/javascripts/boards/components/board_sidebar.js.es6
...assets/javascripts/boards/components/board_sidebar.js.es6
+8
-2
app/assets/javascripts/boards/components/sidebar/remove_issue.js.es6
...javascripts/boards/components/sidebar/remove_issue.js.es6
+34
-0
app/views/projects/boards/components/_sidebar.html.haml
app/views/projects/boards/components/_sidebar.html.haml
+2
-0
spec/features/boards/sidebar_spec.rb
spec/features/boards/sidebar_spec.rb
+32
-0
No files found.
app/assets/javascripts/boards/components/board_card.js.es6
View file @
954deefa
...
...
@@ -50,6 +50,7 @@
Store.detail.issue = {};
} else {
Store.detail.issue = this.issue;
Store.detail.list = this.list;
}
}
}
...
...
app/assets/javascripts/boards/components/board_sidebar.js.es6
View file @
954deefa
...
...
@@ -4,6 +4,7 @@
/* global MilestoneSelect */
/* global LabelsSelect */
/* global Sidebar */
//= require ./sidebar/remove_issue
(() => {
const Store = gl.issueBoards.BoardsStore;
...
...
@@ -18,7 +19,8 @@
data() {
return {
detail: Store.detail,
issue: {}
issue: {},
list: {},
};
},
computed: {
...
...
@@ -36,6 +38,7 @@
}
this.issue = this.detail.issue;
this.list = this.detail.list;
},
deep: true
},
...
...
@@ -60,6 +63,9 @@
new LabelsSelect();
new Sidebar();
gl.Subscription.bindAll('.subscription');
}
},
components: {
'remove-btn': gl.issueBoards.RemoveIssueBtn,
},
});
})();
app/assets/javascripts/boards/components/sidebar/remove_issue.js.es6
0 → 100644
View file @
954deefa
/* global Vue */
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.RemoveIssueBtn = Vue.extend({
props: [
'issue', 'list',
],
methods: {
removeIssue() {
const doneList = Store.findList('type', 'done', false);
Store.moveIssueToList(this.list, doneList, this.issue, 0);
Store.detail.issue = {};
},
},
template: `
<div
class="block list"
v-if="list.type !== 'done'">
<button
class="btn btn-default btn-block"
type="button"
@click="removeIssue">
Remove from board
</button>
</div>
`,
});
})();
app/views/projects/boards/components/_sidebar.html.haml
View file @
954deefa
...
...
@@ -22,3 +22,5 @@
=
render
"projects/boards/components/sidebar/due_date"
=
render
"projects/boards/components/sidebar/labels"
=
render
"projects/boards/components/sidebar/notifications"
%remove-btn
{
":issue"
=>
"issue"
,
":list"
=>
"list"
}
spec/features/boards/sidebar_spec.rb
View file @
954deefa
...
...
@@ -70,6 +70,38 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it
'removes card from board when clicking remove button'
do
page
.
within
(
first
(
'.board'
))
do
first
(
'.card'
).
click
end
page
.
within
(
'.issue-boards-sidebar'
)
do
click_button
'Remove from board'
end
page
.
within
(
first
(
'.board'
))
do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
it
'does not show remove issue button when issue is closed'
do
page
.
within
(
first
(
'.board'
))
do
first
(
'.card'
).
click
end
page
.
within
(
'.issue-boards-sidebar'
)
do
click_button
'Remove from board'
end
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
first
(
'.card'
).
click
end
page
.
within
(
'.issue-boards-sidebar'
)
do
expect
(
page
).
not_to
have_button
'Remove from board'
end
end
context
'assignee'
do
it
'updates the issues assignee'
do
page
.
within
(
first
(
'.board'
))
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment