Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6f5f7e40
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,发现更多精彩内容 >>
提交
6f5f7e40
编写于
8月 07, 2017
作者:
S
Sean McGivern
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert ?full_data=1 -> ?view=full_data
上级
fecb1a2f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
11 deletion
+23
-11
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+1
-1
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+1
-1
app/assets/javascripts/notes/components/issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+1
-1
app/controllers/concerns/notes_actions.rb
app/controllers/concerns/notes_actions.rb
+4
-2
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+5
-3
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+1
-1
spec/helpers/notes_helper_spec.rb
spec/helpers/notes_helper_spec.rb
+8
-0
spec/javascripts/notes/mock_data.js
spec/javascripts/notes/mock_data.js
+2
-2
未找到文件。
app/assets/javascripts/notes/components/issue_comment_form.vue
浏览文件 @
6f5f7e40
...
...
@@ -105,7 +105,7 @@
endpoint
:
this
.
endpoint
,
flashContainer
:
this
.
$el
,
data
:
{
full_data
:
true
,
view
:
'
full_data
'
,
note
:
{
noteable_type
:
'
Issue
'
,
noteable_id
:
this
.
getIssueData
.
id
,
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
浏览文件 @
6f5f7e40
...
...
@@ -100,7 +100,7 @@
target_type
:
'
issue
'
,
target_id
:
this
.
discussion
.
noteable_id
,
note
:
{
note
:
noteText
},
full_data
:
true
,
view
:
'
full_data
'
,
},
};
...
...
app/assets/javascripts/notes/components/issue_note.vue
浏览文件 @
6f5f7e40
...
...
@@ -78,7 +78,7 @@
const
data
=
{
endpoint
:
this
.
note
.
path
,
note
:
{
full_data
:
true
,
view
:
'
full_data
'
,
target_type
:
'
issue
'
,
target_id
:
this
.
note
.
noteable_id
,
note
:
{
note
:
noteText
},
...
...
app/controllers/concerns/notes_actions.rb
浏览文件 @
6f5f7e40
...
...
@@ -18,7 +18,8 @@ module NotesActions
@notes
=
prepare_notes_for_rendering
(
@notes
)
notes_json
[
:notes
]
=
if
params
[
:full_data
]
case
params
[
:view
]
when
'full_data'
note_serializer
.
represent
(
@notes
)
else
@notes
.
map
{
|
note
|
note_json
(
note
)
}
...
...
@@ -87,7 +88,8 @@ module NotesActions
if
note
.
persisted?
attrs
[
:valid
]
=
true
if
params
[
:full_data
]
case
params
[
:view
]
when
'full_data'
attrs
.
merge!
(
note_serializer
.
represent
(
note
))
else
attrs
.
merge!
(
...
...
app/helpers/notes_helper.rb
浏览文件 @
6f5f7e40
...
...
@@ -93,11 +93,13 @@ module NotesHelper
end
end
def
notes_url
def
notes_url
(
extra_params
=
{})
if
@snippet
.
is_a?
(
PersonalSnippet
)
snippet_notes_path
(
@snippet
)
snippet_notes_path
(
@snippet
,
extra_params
)
else
project_noteable_notes_path
(
@project
,
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
params
=
{
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
}
project_noteable_notes_path
(
@project
,
params
.
merge
(
extra_params
))
end
end
...
...
app/views/projects/issues/_discussion.html.haml
浏览文件 @
6f5f7e40
...
...
@@ -9,7 +9,7 @@
new_session_path:
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
markdown_docs:
help_page_path
(
'user/markdown'
),
quick_actions_docs:
help_page_path
(
'user/project/quick_actions'
),
notes_path:
"#{notes_url}?full_data=1"
,
notes_path:
notes_url
(
view:
'full_data'
)
,
last_fetched_at:
Time
.
now
.
to_i
,
issue_data:
serialize_issuable
(
@issue
),
current_user_data:
UserSerializer
.
new
.
represent
(
current_user
).
to_json
}}
...
...
spec/helpers/notes_helper_spec.rb
浏览文件 @
6f5f7e40
...
...
@@ -205,6 +205,14 @@ describe NotesHelper do
expect
(
helper
.
notes_url
).
to
eq
(
"/nm/test/noteable/issue/
#{
@noteable
.
id
}
/notes"
)
end
it
'adds extra params'
do
namespace
=
create
(
:namespace
,
path:
'nm'
)
@project
=
create
(
:project
,
path:
'test'
,
namespace:
namespace
)
@noteable
=
create
(
:issue
,
project:
@project
)
expect
(
helper
.
notes_url
(
view:
'full_data'
)).
to
eq
(
"/nm/test/noteable/issue/
#{
@noteable
.
id
}
/notes?view=full_data"
)
end
end
describe
'#note_url'
do
...
...
spec/javascripts/notes/mock_data.js
浏览文件 @
6f5f7e40
...
...
@@ -3,7 +3,7 @@ export const notesDataMock = {
lastFetchedAt
:
'
1501862675
'
,
markdownDocs
:
'
/help/user/markdown
'
,
newSessionPath
:
'
/users/sign_in?redirect_to_referer=yes
'
,
notesPath
:
'
/gitlab-org/gitlab-ce/noteable/issue/98/notes?
full_data=1
'
,
notesPath
:
'
/gitlab-org/gitlab-ce/noteable/issue/98/notes?
view=full_data
'
,
quickActionsDocs
:
'
/help/user/project/quick_actions
'
,
registerPath
:
'
/users/sign_in?redirect_to_referer=yes#register-pane
'
,
};
...
...
@@ -218,4 +218,4 @@ export const discussionMock = {
path
:
'
/gitlab-org/gitlab-ce/notes/1437
'
,
}],
individual_note
:
false
,
};
\ No newline at end of file
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录