Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8ab3ab9e
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,体验更适合开发者的 AI 搜索 >>
提交
8ab3ab9e
编写于
7月 07, 2016
作者:
P
Paco Guzman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't render discussion notes when requesting diff tab through AJAX
上级
0de61777
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
24 deletion
+35
-24
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+32
-22
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+2
-2
未找到文件。
CHANGELOG
浏览文件 @
8ab3ab9e
...
...
@@ -45,6 +45,7 @@ v 8.10.0 (unreleased)
- RailsCache metris now includes fetch_hit/fetch_miss and read_hit/read_miss info.
- Allow [ci skip] to be in any case and allow [skip ci]. !4785 (simon_w)
- Set import_url validation to be more strict
- Don't render discussion notes when requesting diff tab through AJAX
- Add basic system information like memory and disk usage to the admin panel
- Don't garbage collect commits that have related DB records like comments
- More descriptive message for git hooks and file locks
...
...
app/controllers/projects/merge_requests_controller.rb
浏览文件 @
8ab3ab9e
...
...
@@ -53,9 +53,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def
show
@note_counts
=
Note
.
where
(
commit_id:
@merge_request
.
commits
.
map
(
&
:id
)).
group
(
:commit_id
).
count
respond_to
do
|
format
|
format
.
html
...
...
@@ -80,6 +77,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
diffs
apply_diff_view_cookie!
@merge_request_diff
=
@merge_request
.
merge_request_diff
@commit
=
@merge_request
.
diff_head_commit
@base_commit
=
@merge_request
.
diff_base_commit
||
@merge_request
.
likely_diff_base_commit
...
...
@@ -109,7 +108,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
commits
respond_to
do
|
format
|
format
.
html
{
render
'show'
}
format
.
json
{
render
json:
{
html:
view_to_html_string
(
'projects/merge_requests/show/_commits'
)
}
}
format
.
json
do
# Get commits from repository
# or from cache if already merged
@commits
=
@merge_request
.
commits
@note_counts
=
Note
.
where
(
commit_id:
@commits
.
map
(
&
:id
)).
group
(
:commit_id
).
count
render
json:
{
html:
view_to_html_string
(
'projects/merge_requests/show/_commits'
)
}
end
end
end
...
...
@@ -340,14 +347,33 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def
define_show_vars
@noteable
=
@merge_request
@commits_count
=
@merge_request
.
commits
.
count
@pipeline
=
@merge_request
.
pipeline
@statuses
=
@pipeline
.
statuses
if
@pipeline
if
@merge_request
.
locked_long_ago?
@merge_request
.
unlock_mr
@merge_request
.
close
end
if
request
.
format
==
:html
||
action_name
==
'show'
define_show_html_vars
end
end
# Discussion tab data is only required on html requests
def
define_show_html_vars
# Build a note object for comment form
@note
=
@project
.
notes
.
new
(
noteable:
@
merge_request
)
@note
=
@project
.
notes
.
new
(
noteable:
@
noteable
)
@discussions
=
@
merge_request
.
mr_and_commit_notes
.
@discussions
=
@
noteable
.
mr_and_commit_notes
.
inc_author_project_award_emoji
.
fresh
.
discussions
# This is not executed lazily
@notes
=
Banzai
::
NoteRenderer
.
render
(
@discussions
.
flatten
,
@project
,
...
...
@@ -356,22 +382,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@project_wiki
,
@ref
)
@noteable
=
@merge_request
# Get commits from repository
# or from cache if already merged
@commits
=
@merge_request
.
commits
@merge_request_diff
=
@merge_request
.
merge_request_diff
@pipeline
=
@merge_request
.
pipeline
@statuses
=
@pipeline
.
statuses
if
@pipeline
if
@merge_request
.
locked_long_ago?
@merge_request
.
unlock_mr
@merge_request
.
close
end
end
def
define_widget_vars
...
...
app/views/projects/merge_requests/_show.html.haml
浏览文件 @
8ab3ab9e
...
...
@@ -42,7 +42,7 @@
=
succeed
'.'
do
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
-
if
@commits
.
present
?
-
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
...
...
@@ -51,7 +51,7 @@
%li
.commits-tab
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
%span
.badge
=
@commits
.
size
%span
.badge
=
@commits
_count
-
if
@pipeline
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录