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
Léo-Paul Géneau
gitlab-ce
Commits
77a074a7
Commit
77a074a7
authored
Aug 17, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code improvements
parent
94f5d8a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
41 deletions
+24
-41
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+5
-11
app/assets/javascripts/boards/models/issue.js.es6
app/assets/javascripts/boards/models/issue.js.es6
+3
-1
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+16
-29
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
77a074a7
...
...
@@ -31,29 +31,23 @@ $(() => {
disabled: $boardApp.dataset.disabled === 'true',
issueLinkBase: $boardApp.dataset.issueLinkBase
},
init () {
gl.issueBoards.BoardsStore.create();
},
init: Store.create.bind(Store),
created () {
this.loading = true;
gl.boardService = new BoardService(this.endpoint);
},
ready () {
Store.disabled = this.disabled;
gl.boardService.all()
.then((resp) => {
const boards = resp.json();
for (let i = 0, boardsLength = boards.length; i < boardsLength; i++) {
const board = boards[i],
list = Store.addList(board);
.then((resp) => {
resp.json().forEach((board) => {
const list = Store.addList(board);
if (list.type === 'done') {
list.position = Infinity;
} else if (list.type === 'backlog') {
list.position = -1;
}
}
}
);
Store.addBlankState();
this.loading = false;
...
...
app/assets/javascripts/boards/models/issue.js.es6
View file @
77a074a7
...
...
@@ -29,7 +29,9 @@ class ListIssue {
}
removeLabel (removeLabel) {
this.labels = this.labels.filter( label => removeLabel.title !== label.title );
if (removeLabel) {
this.labels = this.labels.filter( label => removeLabel.title !== label.title );
}
}
removeLabels (labels) {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
77a074a7
...
...
@@ -33,10 +33,7 @@
.then(() => {
// Remove any new issues from the backlog
// as they will be visible in the new list
for (let i = 0, issuesLength = list.issues.length; i < issuesLength; i++) {
const issue = list.issues[i];
backlogList.removeIssue(issue);
}
list.issues.forEach(backlogList.removeIssue.bind(backlogList));
});
this.removeBlankState();
},
...
...
@@ -45,21 +42,17 @@
},
shouldAddBlankState () {
// Decide whether to add the blank state
return !(this.state.lists.filter((list) => {
return list.type !== 'backlog' && list.type !== 'done';
})[0]);
return !(this.state.lists.filter( list => list.type !== 'backlog' && list.type !== 'done' )[0]);
},
addBlankState () {
if (this.welcomeIsHidden() || this.disabled) return;
if (
!this.shouldAddBlankState() ||
this.welcomeIsHidden() || this.disabled) return;
if (this.shouldAddBlankState()) {
this.addList({
id: 'blank',
list_type: 'blank',
title: 'Welcome to your Issue Board!',
position: 0
});
}
this.addList({
id: 'blank',
list_type: 'blank',
title: 'Welcome to your Issue Board!',
position: 0
});
},
removeBlankState () {
this.removeList('blank');
...
...
@@ -76,25 +69,20 @@
if (!list) return;
this.state.lists = this.state.lists.filter((list) => {
return list.id !== id;
});
this.state.lists = this.state.lists.filter( list => list.id !== id );
},
moveList (listFrom, orderLists) {
for (let i = 0, orderLength = orderLists.length; i < orderLength; i++) {
const id = parseInt(orderLists[i]),
list = this.findList('id', id);
orderLists.forEach((id, i) => {
const list = this.findList('id', id);
list.position = i;
}
}
);
listFrom.update();
},
moveIssueToList (listFrom, listTo, issue) {
const issueTo = listTo.findIssue(issue.id),
issueLists = issue.getLists(),
listLabels = issueLists.map((listIssue) => {
return listIssue.label;
});
listLabels = issueLists.map( listIssue => listIssue.label );
// Add to new lists issues if it doesn't already exist
if (!issueTo) {
...
...
@@ -102,10 +90,9 @@
}
if (listTo.type === 'done' && listFrom.type !== 'backlog') {
for (let i = 0, listsLength = issueLists.length; i < listsLength; i++) {
const list = issueLists[i];
issueLists.forEach((list) => {
list.removeIssue(issue);
}
}
)
issue.removeLabels(listLabels);
} else {
listFrom.removeIssue(issue);
...
...
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