Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a55c1232
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a55c1232
编写于
7月 05, 2016
作者:
P
Phil Hughes
提交者:
Douwe Maan
7月 24, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve all endpoint
上级
50e0728c
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
15 deletion
+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
未找到文件。
app/assets/javascripts/line_comments/components/resolve_all.js.coffee
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
a55c1232
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录