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
Tatuya Kamada
gitlab-ce
Commits
8c92646b
Commit
8c92646b
authored
Aug 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filters backlog by search query
parent
0fa57599
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
43 deletions
+35
-43
app/assets/javascripts/boards/components/board.js.es6
app/assets/javascripts/boards/components/board.js.es6
+9
-1
app/assets/javascripts/boards/components/board_list.js.es6
app/assets/javascripts/boards/components/board_list.js.es6
+2
-28
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+20
-10
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+3
-2
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+0
-1
app/views/projects/boards/components/_card.html.haml
app/views/projects/boards/components/_card.html.haml
+1
-1
No files found.
app/assets/javascripts/boards/components/board.js.es6
View file @
8c92646b
...
@@ -3,11 +3,19 @@
...
@@ -3,11 +3,19 @@
props: {
props: {
board: Object
board: Object
},
},
data:
() =>
{
data:
function ()
{
return {
return {
filters: BoardsStore.state.filters
filters: BoardsStore.state.filters
};
};
},
},
watch: {
'query': function () {
if (this.board.canSearch()) {
const data = _.extend(this.filters, { search: this.query });
this.board.getIssues(data);
}
}
},
methods: {
methods: {
clearSearch: function () {
clearSearch: function () {
this.query = '';
this.query = '';
...
...
app/assets/javascripts/boards/components/board_list.js.es6
View file @
8c92646b
...
@@ -5,11 +5,10 @@
...
@@ -5,11 +5,10 @@
boardId: [Number, String],
boardId: [Number, String],
filters: Object,
filters: Object,
issues: Array,
issues: Array,
query: String,
loading: Boolean,
loading: Boolean,
issueLinkBase: String
issueLinkBase: String
},
},
data:
() =>
{
data:
function ()
{
return {
return {
scrollOffset: 20,
scrollOffset: 20,
loadMore: false
loadMore: false
...
@@ -26,33 +25,8 @@
...
@@ -26,33 +25,8 @@
return this.$els.list.scrollTop + this.listHeight();
return this.$els.list.scrollTop + this.listHeight();
},
},
loadFromLastId: function () {
loadFromLastId: function () {
this.loadMore = true;
setTimeout(() => {
this.loadMore = false;
}, 2000);
},
customFilter: function (issue) {
let returnIssue = issue;
if (this.filters.author && this.filters.author.id) {
if (!issue.author || issue.author.id !== this.filters.author.id) {
returnIssue = null;
}
}
if (this.filters.assignee && this.filters.assignee.id) {
if (!issue.assignee || issue.assignee.id !== this.filters.assignee.id) {
returnIssue = null;
}
}
if (this.filters.milestone && this.filters.milestone.id) {
},
if (!issue.milestone || issue.milestone.id !== this.filters.milestone.id) {
returnIssue = null;
}
}
return returnIssue;
}
},
},
ready: function () {
ready: function () {
this.sortable = Sortable.create(this.$els.list, {
this.sortable = Sortable.create(this.$els.list, {
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
8c92646b
...
@@ -11,16 +11,7 @@ class List {
...
@@ -11,16 +11,7 @@ class List {
}
}
if (this.type !== 'blank') {
if (this.type !== 'blank') {
this.loading = true;
this.getIssues();
gl.boardService.getIssuesForList(this.id)
.then((resp) => {
const data = resp.json();
this.loading = false;
data.forEach((issue) => {
this.issues.push(new Issue(issue));
});
});
}
}
}
}
...
@@ -49,6 +40,25 @@ class List {
...
@@ -49,6 +40,25 @@ class List {
return this.type === 'backlog';
return this.type === 'backlog';
}
}
getIssues (filter = {}) {
this.loading = true;
gl.boardService.getIssuesForList(this.id, filter)
.then((resp) => {
const data = resp.json();
this.loading = false;
this.issues = [];
this.createIssues(data);
});
}
createIssues (data) {
data.forEach((issue) => {
this.issues.push(new Issue(issue));
});
}
addIssue (issue, listFrom) {
addIssue (issue, listFrom) {
this.issues.push(issue);
this.issues.push(issue);
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
8c92646b
...
@@ -43,10 +43,11 @@ class BoardService {
...
@@ -43,10 +43,11 @@ class BoardService {
return this.list.delete({ id });
return this.list.delete({ id });
}
}
getIssuesForList (id) {
getIssuesForList (id, filter = {}) {
const data = _.extend({ id }, filter)
this.setCSRF();
this.setCSRF();
return this.issues.get(
{ id }
);
return this.issues.get(
data
);
}
}
moveIssue (id, from, to) {
moveIssue (id, from, to) {
...
...
app/views/projects/boards/components/_board.html.haml
View file @
8c92646b
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
":board-id"
=>
"board.id"
,
":board-id"
=>
"board.id"
,
":issues"
=>
"board.issues"
,
":issues"
=>
"board.issues"
,
":disabled"
=>
"#{current_user.nil?}"
,
":disabled"
=>
"#{current_user.nil?}"
,
":query"
=>
"query"
,
":filters"
=>
"filters"
,
":filters"
=>
"filters"
,
":loading"
=>
"board.loading"
,
":loading"
=>
"board.loading"
,
":issue-link-base"
=>
"'#{namespace_project_issues_path(@project.namespace, @project)}'"
}
":issue-link-base"
=>
"'#{namespace_project_issues_path(@project.namespace, @project)}'"
}
...
...
app/views/projects/boards/components/_card.html.haml
View file @
8c92646b
%li
.card
{
":data-issue"
=>
"issue.id"
,
"v-for"
=>
"issue in issues |
filterBy query in 'title' | filterBy customFilter
"
,
"track-by"
=>
"id"
}
%li
.card
{
":data-issue"
=>
"issue.id"
,
"v-for"
=>
"issue in issues |
orderBy 'id' -1
"
,
"track-by"
=>
"id"
}
%h4
.card-title
%h4
.card-title
%a
{
":href"
=>
"issueLinkBase + '/' + issue.id"
,
":title"
=>
"issue.title"
}
%a
{
":href"
=>
"issueLinkBase + '/' + issue.id"
,
":title"
=>
"issue.title"
}
{{ issue.title }}
{{ issue.title }}
...
...
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