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
Boxiang Sun
gitlab-ce
Commits
034f1f07
Commit
034f1f07
authored
Aug 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly filters by labels
parent
69458c0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
+27
-11
app/assets/javascripts/boards/models/issue.js.es6
app/assets/javascripts/boards/models/issue.js.es6
+6
-0
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+9
-9
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+5
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+7
-1
No files found.
app/assets/javascripts/boards/models/issue.js.es6
View file @
034f1f07
...
@@ -38,6 +38,12 @@ class Issue {
...
@@ -38,6 +38,12 @@ class Issue {
}
}
}
}
removeLabels (labels) {
labels.forEach((label) => {
this.removeLabel(label);
});
}
getLists () {
getLists () {
return _.filter(BoardsStore.state.lists, (list) => {
return _.filter(BoardsStore.state.lists, (list) => {
return list.findIssue(this.id);
return list.findIssue(this.id);
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
034f1f07
...
@@ -54,7 +54,13 @@ class List {
...
@@ -54,7 +54,13 @@ class List {
}
}
getIssues (emptyIssues = true) {
getIssues (emptyIssues = true) {
const data = _.extend({ page: this.page }, this.filters);
let data = _.extend({ page: this.page }, this.filters);
if (this.label) {
data.label_name = _.reject(data.label_name, (label) => {
return label === this.label.title;
});
}
if (emptyIssues) {
if (emptyIssues) {
this.loading = true;
this.loading = true;
...
@@ -93,18 +99,12 @@ class List {
...
@@ -93,18 +99,12 @@ class List {
});
});
}
}
removeIssue (removeIssue
, listLabels
) {
removeIssue (removeIssue) {
this.issues = _.reject(this.issues, (issue) => {
this.issues = _.reject(this.issues, (issue) => {
const matchesRemove = removeIssue.id === issue.id;
const matchesRemove = removeIssue.id === issue.id;
if (matchesRemove) {
if (matchesRemove) {
if (typeof listLabels !== 'undefined') {
issue.removeLabel(this.label);
listLabels.forEach((listLabel) => {
issue.removeLabel(listLabel);
});
} else {
issue.removeLabel(this.label);
}
}
}
return matchesRemove;
return matchesRemove;
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
034f1f07
...
@@ -98,7 +98,10 @@
...
@@ -98,7 +98,10 @@
listTo = this.findList('id', listToId),
listTo = this.findList('id', listToId),
issueTo = listTo.findIssue(issueId);
issueTo = listTo.findIssue(issueId);
let issue = listFrom.findIssue(issueId);
let issue = listFrom.findIssue(issueId);
const issueLists = issue.getLists();
const issueLists = issue.getLists(),
issueLabels = issueLists.map(function (issue) {
return issue.label;
});
listFrom.removeIssue(issue);
listFrom.removeIssue(issue);
// Add to new lists issues if it doesn't already exist
// Add to new lists issues if it doesn't already exist
...
@@ -112,6 +115,7 @@
...
@@ -112,6 +115,7 @@
issueLists.forEach((list) => {
issueLists.forEach((list) => {
list.removeIssue(issue);
list.removeIssue(issue);
});
});
issue.removeLabels(issueLabels);
}
}
},
},
findList: function (key, val) {
findList: function (key, val) {
...
...
app/assets/javascripts/labels_select.js
View file @
034f1f07
...
@@ -304,7 +304,13 @@
...
@@ -304,7 +304,13 @@
isIssueIndex
=
page
===
'
projects:issues:index
'
;
isIssueIndex
=
page
===
'
projects:issues:index
'
;
isMRIndex
=
page
===
'
projects:merge_requests:index
'
;
isMRIndex
=
page
===
'
projects:merge_requests:index
'
;
if
(
page
===
'
projects:boards:show
'
)
{
if
(
page
===
'
projects:boards:show
'
)
{
BoardsStore
.
state
.
filters
[
'
label_name
'
].
push
(
label
.
title
);
if
(
label
.
title
)
{
BoardsStore
.
state
.
filters
[
'
label_name
'
].
push
(
label
.
title
);
}
else
{
var
labelIndex
=
BoardsStore
.
state
.
filters
[
'
label_name
'
].
indexOf
(
label
.
text
());
BoardsStore
.
state
.
filters
[
'
label_name
'
].
splice
(
labelIndex
,
1
);
}
BoardsStore
.
updateFiltersUrl
();
BoardsStore
.
updateFiltersUrl
();
e
.
preventDefault
();
e
.
preventDefault
();
return
;
return
;
...
...
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