Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
cdb305ce
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 搜索 >>
提交
cdb305ce
编写于
9月 05, 2017
作者:
P
Phil Hughes
提交者:
Filipa Lacerda
9月 05, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix diff comment button not showing after deleting a comment
上级
dd157e45
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
6 deletion
+29
-6
app/assets/javascripts/diff_notes/components/diff_note_avatars.js
...ts/javascripts/diff_notes/components/diff_note_avatars.js
+7
-1
app/assets/javascripts/diff_notes/diff_notes_bundle.js
app/assets/javascripts/diff_notes/diff_notes_bundle.js
+4
-0
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+3
-5
changelogs/unreleased/dont-remove-add-diff-btn-on-post.yml
changelogs/unreleased/dont-remove-add-diff-btn-on-post.yml
+5
-0
spec/features/merge_requests/user_posts_diff_notes_spec.rb
spec/features/merge_requests/user_posts_diff_notes_spec.rb
+10
-0
未找到文件。
app/assets/javascripts/diff_notes/components/diff_note_avatars.js
浏览文件 @
cdb305ce
...
...
@@ -21,11 +21,13 @@ const DiffNoteAvatars = Vue.extend({
},
template
:
`
<div class="diff-comment-avatar-holders"
:class="discussionClassName"
v-show="notesCount !== 0">
<div v-if="!isVisible">
<!-- FIXME: Pass an alt attribute here for accessibility -->
<user-avatar-image
v-for="note in notesSubset"
:key="note.id"
class="diff-comment-avatar js-diff-comment-avatar"
@click.native="clickedAvatar($event)"
:img-src="note.authorAvatar"
...
...
@@ -68,7 +70,8 @@ const DiffNoteAvatars = Vue.extend({
});
});
},
destroyed
()
{
beforeDestroy
()
{
this
.
addNoCommentClass
();
$
(
document
).
off
(
'
toggle.comments
'
);
},
watch
:
{
...
...
@@ -85,6 +88,9 @@ const DiffNoteAvatars = Vue.extend({
},
},
computed
:
{
discussionClassName
()
{
return
`js-diff-avatars-
${
this
.
discussionId
}
`
;
},
notesSubset
()
{
let
notes
=
[];
...
...
app/assets/javascripts/diff_notes/diff_notes_bundle.js
浏览文件 @
cdb305ce
...
...
@@ -32,6 +32,10 @@ $(() => {
const
tmpApp
=
new
tmp
().
$mount
();
$
(
this
).
replaceWith
(
tmpApp
.
$el
);
$
(
tmpApp
.
$el
).
one
(
'
remove.vue
'
,
()
=>
{
tmpApp
.
$destroy
();
tmpApp
.
$el
.
remove
();
});
});
const
$components
=
$
(
COMPONENT_SELECTOR
).
filter
(
function
()
{
...
...
app/assets/javascripts/notes.js
浏览文件 @
cdb305ce
...
...
@@ -464,7 +464,6 @@ export default class Notes {
}
renderDiscussionAvatar
(
diffAvatarContainer
,
noteEntity
)
{
var
commentButton
=
diffAvatarContainer
.
find
(
'
.js-add-diff-note-button
'
);
var
avatarHolder
=
diffAvatarContainer
.
find
(
'
.diff-comment-avatar-holders
'
);
if
(
!
avatarHolder
.
length
)
{
...
...
@@ -475,10 +474,6 @@ export default class Notes {
gl
.
diffNotesCompileComponents
();
}
if
(
commentButton
.
length
)
{
commentButton
.
remove
();
}
}
/**
...
...
@@ -767,6 +762,7 @@ export default class Notes {
var
$note
,
$notes
;
$note
=
$
(
el
);
$notes
=
$note
.
closest
(
'
.discussion-notes
'
);
const
discussionId
=
$
(
'
.notes
'
,
$notes
).
data
(
'
discussion-id
'
);
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
if
(
gl
.
diffNoteApps
[
noteElId
])
{
...
...
@@ -783,6 +779,8 @@ export default class Notes {
// "Discussions" tab
$notes
.
closest
(
'
.timeline-entry
'
).
remove
();
$
(
`.js-diff-avatars-
${
discussionId
}
`
).
trigger
(
'
remove.vue
'
);
// The notes tr can contain multiple lists of notes, like on the parallel diff
if
(
notesTr
.
find
(
'
.discussion-notes
'
).
length
>
1
)
{
$notes
.
remove
();
...
...
changelogs/unreleased/dont-remove-add-diff-btn-on-post.yml
0 → 100644
浏览文件 @
cdb305ce
---
title
:
Fixed add diff note button not showing after deleting a comment
merge_request
:
author
:
type
:
fixed
spec/features/merge_requests/user_posts_diff_notes_spec.rb
浏览文件 @
cdb305ce
...
...
@@ -97,6 +97,16 @@ feature 'Merge requests > User posts diff notes', :js do
visit
diffs_project_merge_request_path
(
project
,
merge_request
,
view:
'inline'
)
end
context
'after deleteing a note'
do
it
'allows commenting'
do
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"]'
))
first
(
'.js-note-delete'
,
visible:
false
).
trigger
(
'click'
)
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"]'
))
end
end
context
'with a new line'
do
it
'allows commenting'
do
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"]'
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录