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
a55c1232
Commit
a55c1232
authored
Jul 05, 2016
by
Phil Hughes
Committed by
Douwe Maan
Jul 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve all endpoint
parent
50e0728c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
15 deletions
+19
-15
app/assets/javascripts/line_comments/components/resolve_all.js.coffee
...avascripts/line_comments/components/resolve_all.js.coffee
+4
-3
app/assets/javascripts/line_comments/services/resolve.js.coffee
...sets/javascripts/line_comments/services/resolve.js.coffee
+4
-9
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+5
-0
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+2
-2
config/routes.rb
config/routes.rb
+4
-0
vendor/assets/javascripts/vue.js
vendor/assets/javascripts/vue.js
+0
-1
No files found.
app/assets/javascripts/line_comments/components/resolve_all.js.coffee
View file @
a55c1232
...
...
@@ -2,6 +2,8 @@
data
:
->
comments
:
CommentsStore
.
state
loading
:
false
props
:
endpoint
:
String
computed
:
resolved
:
->
resolvedCount
=
0
...
...
@@ -19,9 +21,8 @@
ids
=
CommentsStore
.
getAllForState
(
this
.
allResolved
)
this
.
$set
(
'loading'
,
true
)
promise
=
if
this
.
allResolved
then
ResolveService
.
resolveAll
(
ids
)
else
ResolveService
.
resolveAll
(
ids
)
promise
ResolveService
.
resolveAll
(
this
.
endpoint
,
ids
,
!
this
.
allResolved
)
.
done
=>
CommentsStore
.
updateAll
(
!
this
.
allResolved
)
.
always
=>
...
...
app/assets/javascripts/line_comments/services/resolve.js.coffee
View file @
a55c1232
...
...
@@ -5,15 +5,10 @@
resolved
:
resolve
type
:
'post'
url
:
endpoint
resolveAll
:
(
ids
)
->
resolveAll
:
(
endpoint
,
ids
,
resolve
)
->
$
.
ajax
data
:
id
:
ids
type
:
'get'
url
:
'/'
unResolveAll
:
(
ids
)
->
$
.
ajax
data
:
id
:
ids
type
:
'get'
url
:
'/'
resolve
:
resolve
type
:
'post'
url
:
endpoint
app/controllers/projects/notes_controller.rb
View file @
a55c1232
...
...
@@ -71,6 +71,11 @@ class Projects::NotesController < Projects::ApplicationController
render
nothing:
true
,
status:
200
end
def
resolve_all
sleep
2
render
nothing:
true
,
status:
200
end
private
def
note
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
a55c1232
...
...
@@ -46,7 +46,7 @@
-
if
current_user
#resolve-all-app
{
"v-cloak"
=>
true
}
%resolve-all
{
"inline-template"
=>
true
}
%resolve-all
{
"
:endpoint"
=>
"'#{resolve_all_namespace_project_notes_path(@project.namespace, @project)}'"
,
"
inline-template"
=>
true
}
.line-resolve-all
{
"v-show"
=>
"commentsCount > 0"
}
%button
.btn.btn-gray
{
type:
"button"
,
"aria-label"
=>
"Resolve all"
,
"@click"
=>
"updateAll"
,
":disabled"
=>
"loading"
}
=
icon
(
"spinner spin"
,
"v-show"
=>
"loading"
)
...
...
@@ -54,7 +54,7 @@
%span
.line-resolve-text
{{ resolved }}/{{ commentsCount }} comments resolved
-
if
@commits
.
nonzero?
-
if
@commits
_count
.
nonzero?
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
%li
.notes-tab
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
...
...
config/routes.rb
View file @
a55c1232
...
...
@@ -825,6 +825,10 @@ Rails.application.routes.draw do
resources
:group_links
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
do
collection
do
post
:resolve_all
end
member
do
post
:toggle_award_emoji
delete
:delete_attachment
...
...
vendor/assets/javascripts/vue.js
View file @
a55c1232
This diff is collapsed.
Click to expand it.
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