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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
87cab11c
Commit
87cab11c
authored
Aug 01, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test added a mock list
parent
99915931
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
...ts/javascripts/boards/components/new_list_dropdown.js.es6
+11
-0
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+15
-1
No files found.
app/assets/javascripts/boards/components/new_list_dropdown.js.es6
View file @
87cab11c
...
...
@@ -26,6 +26,17 @@ $(() => {
selectable: true,
clicked: (label, $el, e) => {
e.preventDefault();
BoardsStore.new({
id: BoardsStore.state.lists.length - 1,
title: label.title,
index: BoardsStore.state.lists.length - 1,
label: {
title: label.title,
backgroundColor: label.color,
color: '#fff'
},
issues: []
});
}
});
});
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
87cab11c
...
...
@@ -10,13 +10,27 @@
}
},
new: function (board) {
// Move the done list index
const doneList = this.getDoneList();
if (doneList) {
doneList.index = board.index + 1;
}
const list = new List(board);
this.state.lists.push(list);
},
getDoneList: function () {
return _.find(this.state.lists, (list) => {
return list.id === 'done';
});
},
removeList: function (id) {
this.state.lists = _.reject(this.state.lists, (list) => {
return list.id === id;
});
this.getDoneList().index = this.state.lists.length - 1;
},
moveList: function (oldIndex, newIndex) {
const listFrom = _.find(this.state.lists, (list) => {
...
...
@@ -48,7 +62,7 @@
const issueLists = this.getListsForIssue(issue);
listFrom.removeIssue(issue);
// Add to new
board
s issues if it doesn't already exist
// Add to new
list
s issues if it doesn't already exist
if (issueTo) {
issue = issueTo;
issue.removeLabel(listFrom.label);
...
...
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