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
3aabf0c6
Commit
3aabf0c6
authored
Jan 26, 2017
by
Phil Hughes
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used issue bulk update instead of different endpoint
parent
54461ce2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
21 deletions
+16
-21
app/assets/javascripts/boards/components/modal/footer.js.es6
app/assets/javascripts/boards/components/modal/footer.js.es6
+10
-2
app/assets/javascripts/boards/components/modal/index.js.es6
app/assets/javascripts/boards/components/modal/index.js.es6
+2
-2
app/assets/javascripts/boards/models/issue.js.es6
app/assets/javascripts/boards/models/issue.js.es6
+1
-0
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+0
-10
app/controllers/projects/boards/lists_controller.rb
app/controllers/projects/boards/lists_controller.rb
+0
-4
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+1
-1
app/views/projects/boards/_show.html.haml
app/views/projects/boards/_show.html.haml
+2
-1
config/routes/project.rb
config/routes/project.rb
+0
-1
No files found.
app/assets/javascripts/boards/components/modal/footer.js.es6
View file @
3aabf0c6
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalFooter = Vue.extend({
gl.issueBoards.ModalFooter = Vue.extend({
props: [
'bulkUpdatePath',
],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -23,10 +26,15 @@
...
@@ -23,10 +26,15 @@
},
},
addIssues() {
addIssues() {
const list = this.selectedList;
const list = this.selectedList;
const issueIds = this.selectedIssues.map(issue => issue.id);
const issueIds = this.selectedIssues.map(issue => issue.
_
id);
// Post the data to the backend
// Post the data to the backend
gl.boardService.addMultipleIssues(list, issueIds);
this.$http.post(this.bulkUpdatePath, {
update: {
issuable_ids: issueIds.join(','),
add_label_ids: [list.label.id],
},
});
// Add the issues on the frontend
// Add the issues on the frontend
this.selectedIssues.forEach((issue) => {
this.selectedIssues.forEach((issue) => {
...
...
app/assets/javascripts/boards/components/modal/index.js.es6
View file @
3aabf0c6
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
gl.issueBoards.IssuesModal = Vue.extend({
gl.issueBoards.IssuesModal = Vue.extend({
props: [
props: [
'blankStateImage', 'newIssuePath',
'blankStateImage', 'newIssuePath',
'bulkUpdatePath',
],
],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
</section>
</section>
<modal-footer></modal-footer>
<modal-footer
:bulk-update-path="bulkUpdatePath"
></modal-footer>
</div>
</div>
</div>
</div>
`,
`,
...
...
app/assets/javascripts/boards/models/issue.js.es6
View file @
3aabf0c6
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
class ListIssue {
class ListIssue {
constructor (obj) {
constructor (obj) {
this._id = obj.id;
this.id = obj.iid;
this.id = obj.iid;
this.title = obj.title;
this.title = obj.title;
this.confidential = obj.confidential;
this.confidential = obj.confidential;
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
3aabf0c6
...
@@ -14,10 +14,6 @@ class BoardService {
...
@@ -14,10 +14,6 @@ class BoardService {
method: 'POST',
method: 'POST',
url: `${root}/${boardId}/lists/generate.json`
url: `${root}/${boardId}/lists/generate.json`
},
},
multiple: {
method: 'POST',
url: `${root}/${boardId}/lists{/id}/multiple`
},
});
});
this.issue = Vue.resource(`${root}/${boardId}/issues{/id}`, {});
this.issue = Vue.resource(`${root}/${boardId}/issues{/id}`, {});
this.issues = Vue.resource(`${root}/${boardId}/lists{/id}/issues`, {});
this.issues = Vue.resource(`${root}/${boardId}/lists{/id}/issues`, {});
...
@@ -79,12 +75,6 @@ class BoardService {
...
@@ -79,12 +75,6 @@ class BoardService {
getBacklog(data) {
getBacklog(data) {
return this.boards.backlog(data);
return this.boards.backlog(data);
}
}
addMultipleIssues(list, issue_ids) {
return this.lists.multiple(list.id, {
issue_ids,
});
}
}
}
window.BoardService = BoardService;
window.BoardService = BoardService;
app/controllers/projects/boards/lists_controller.rb
View file @
3aabf0c6
...
@@ -50,10 +50,6 @@ module Projects
...
@@ -50,10 +50,6 @@ module Projects
end
end
end
end
def
multiple
head
:ok
end
private
private
def
authorize_admin_list!
def
authorize_admin_list!
...
...
app/controllers/projects/boards_controller.rb
View file @
3aabf0c6
...
@@ -37,7 +37,7 @@ class Projects::BoardsController < Projects::ApplicationController
...
@@ -37,7 +37,7 @@ class Projects::BoardsController < Projects::ApplicationController
render
json:
@issues
.
as_json
(
render
json:
@issues
.
as_json
(
labels:
true
,
labels:
true
,
only:
[
:iid
,
:title
,
:confidential
,
:due_date
],
only:
[
:i
d
,
:i
id
,
:title
,
:confidential
,
:due_date
],
include:
{
include:
{
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
milestone:
{
only:
[
:id
,
:title
]
}
milestone:
{
only:
[
:id
,
:title
]
}
...
...
app/views/projects/boards/_show.html.haml
View file @
3aabf0c6
...
@@ -27,4 +27,5 @@
...
@@ -27,4 +27,5 @@
":key"
=>
"_uid"
}
":key"
=>
"_uid"
}
=
render
"projects/boards/components/sidebar"
=
render
"projects/boards/components/sidebar"
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
"new-issue-path"
=>
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
)
}
"new-issue-path"
=>
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
),
"bulk-update-path"
=>
bulk_update_namespace_project_issues_path
(
@project
.
namespace
,
@project
)
}
config/routes/project.rb
View file @
3aabf0c6
...
@@ -274,7 +274,6 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -274,7 +274,6 @@ constraints(ProjectUrlConstrainer.new) do
resources
:lists
,
only:
[
:index
,
:create
,
:update
,
:destroy
]
do
resources
:lists
,
only:
[
:index
,
:create
,
:update
,
:destroy
]
do
collection
do
collection
do
post
:generate
post
:generate
post
:multiple
end
end
resources
:issues
,
only:
[
:index
,
:create
]
resources
:issues
,
only:
[
:index
,
:create
]
...
...
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