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
ff5fd4eb
Commit
ff5fd4eb
authored
Aug 08, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved some code over to underscorejs
parent
1de64675
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
30 deletions
+26
-30
app/assets/javascripts/boards/components/board_list.js.es6
app/assets/javascripts/boards/components/board_list.js.es6
+2
-1
app/assets/javascripts/boards/models/issue.js.es6
app/assets/javascripts/boards/models/issue.js.es6
+1
-3
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+3
-3
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+18
-21
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+2
-2
No files found.
app/assets/javascripts/boards/components/board_list.js.es6
View file @
ff5fd4eb
...
...
@@ -35,10 +35,11 @@
},
},
ready: function () {
const list = this.list;
const options = _.extend({
group: 'issues',
disabled: this.disabled,
onAdd:
function (e)
{
onAdd:
(e) =>
{
const fromListId = parseInt(e.from.getAttribute('data-board')),
toListId = parseInt(e.to.getAttribute('data-board')),
issueId = parseInt(e.item.getAttribute('data-issue'));
...
...
app/assets/javascripts/boards/models/issue.js.es6
View file @
ff5fd4eb
...
...
@@ -39,9 +39,7 @@ class Issue {
}
removeLabels (labels) {
labels.forEach((label) => {
this.removeLabel(label);
});
_.each(labels, this.removeLabel.bind(this));
}
getLists () {
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
ff5fd4eb
...
...
@@ -19,7 +19,7 @@ class List {
}
save () {
gl.boardService.createList(this.label.id)
return
gl.boardService.createList(this.label.id)
.then((resp) => {
const data = resp.json();
...
...
@@ -27,7 +27,7 @@ class List {
this.type = data.list_type;
this.position = data.position;
this.getIssues();
return
this.getIssues();
});
}
...
...
@@ -80,7 +80,7 @@ class List {
}
createIssues (data) {
data.forEach(
(issue) => {
_.each(data,
(issue) => {
this.issues.push(new Issue(issue));
});
}
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
ff5fd4eb
...
...
@@ -12,12 +12,19 @@
};
},
new: function (board, persist = true) {
const doneList = this.getDoneList(),
const doneList = this.findList('type', 'done'),
backlogList = this.findList('type', 'backlog'),
list = new List(board);
this.state.lists.push(list);
if (persist) {
list.save();
list
.save()
.then(function () {
// Remove any new issues from the backlog
// as they will be visible in the new list
_.each(list.issues, backlogList.removeIssue.bind(backlogList));
});
this.removeBlankState();
}
...
...
@@ -29,15 +36,10 @@
},
shouldAddBlankState: function () {
// Decide whether to add the blank state
let addBlankState = true;
this.state.lists.forEach(function (list) {
if (list.type !== 'backlog' && list.type !== 'done') {
addBlankState = false;
return;
}
let addBlankState = _.find(this.state.lists, function (list) {
return list.type === 'backlog' || list.type === 'done';
});
return addBlankState;
return
!
addBlankState;
},
addBlankState: function () {
const addBlankState = this.shouldAddBlankState();
...
...
@@ -65,9 +67,6 @@
welcomeIsHidden: function () {
return $.cookie('issue_board_welcome_hidden') === 'true';
},
getDoneList: function () {
return this.findList('type', 'done');
},
removeList: function (id) {
const list = this.findList('id', id);
...
...
@@ -75,7 +74,7 @@
list.destroy();
this.state.lists = _.reject(this.state.lists,
(list) =>
{
this.state.lists = _.reject(this.state.lists,
function (list)
{
return list.id === id;
});
...
...
@@ -83,7 +82,7 @@
},
moveList: function (oldIndex, newIndex) {
if (oldIndex === newIndex) return;
const listFrom = this.findList('position', oldIndex),
listTo = this.findList('position', newIndex);
...
...
@@ -101,9 +100,9 @@
moveCardToList: function (listFromId, listToId, issueId) {
const listFrom = this.findList('id', listFromId),
listTo = this.findList('id', listToId),
issueTo = listTo.findIssue(issueId)
;
let issue = listFrom.findIssue(issueId);
const
issueLists = issue.getLists(),
issueTo = listTo.findIssue(issueId)
,
issue = listFrom.findIssue(issueId),
issueLists = issue.getLists(),
listLabels = issueLists.map(function (issue) {
return issue.label;
});
...
...
@@ -114,9 +113,7 @@
}
if (listTo.type === 'done' && listFrom.type !== 'backlog') {
issueLists.forEach((list) => {
list.removeIssue(issue);
});
_.each(issueLists, list.removeIssue.bind(list));
issue.removeLabels(listLabels);
} else {
listFrom.removeIssue(issue);
...
...
app/assets/stylesheets/pages/boards.scss
View file @
ff5fd4eb
...
...
@@ -84,8 +84,8 @@
overflow-x
:
scroll
;
@media
(
min-width
:
$screen-sm-min
)
{
min-height
:
47
0
px
;
max-height
:
47
0
px
;
min-height
:
47
5
px
;
max-height
:
47
5
px
;
}
}
...
...
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