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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
cdb305ce
Commit
cdb305ce
authored
Sep 05, 2017
by
Phil Hughes
Committed by
Filipa Lacerda
Sep 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix diff comment button not showing after deleting a comment
parent
dd157e45
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
6 deletions
+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
No files found.
app/assets/javascripts/diff_notes/components/diff_note_avatars.js
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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"]'
))
...
...
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