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
e3b96ad7
Commit
e3b96ad7
authored
Oct 03, 2018
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix placeholder note rendering
parent
70f4a26b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+2
-1
changelogs/unreleased/_acet-fix-placeholder-note.yml
changelogs/unreleased/_acet-fix-placeholder-note.yml
+5
-0
spec/javascripts/notes/components/noteable_discussion_spec.js
.../javascripts/notes/components/noteable_discussion_spec.js
+25
-0
No files found.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
e3b96ad7
...
...
@@ -191,6 +191,7 @@ export default {
if
(
note
.
placeholderType
===
SYSTEM_NOTE
)
{
return
placeholderSystemNote
;
}
return
placeholderNote
;
}
...
...
@@ -201,7 +202,7 @@ export default {
return
noteableNote
;
},
componentData
(
note
)
{
return
note
.
isPlaceholderNote
?
this
.
discussion
.
notes
[
0
]
:
note
;
return
note
.
isPlaceholderNote
?
note
.
notes
[
0
]
:
note
;
},
toggleDiscussionHandler
()
{
this
.
toggleDiscussion
({
discussionId
:
this
.
discussion
.
id
});
...
...
changelogs/unreleased/_acet-fix-placeholder-note.yml
0 → 100644
View file @
e3b96ad7
---
title
:
Fix rendering placeholder notes
merge_request
:
22078
author
:
type
:
fixed
spec/javascripts/notes/components/noteable_discussion_spec.js
View file @
e3b96ad7
...
...
@@ -133,4 +133,29 @@ describe('noteable_discussion component', () => {
});
});
});
describe
(
'
componentData
'
,
()
=>
{
it
(
'
should return first note object for placeholder note
'
,
()
=>
{
const
data
=
{
isPlaceholderNote
:
true
,
notes
:
[
{
body
:
'
hello world!
'
},
],
};
const
note
=
vm
.
componentData
(
data
);
expect
(
note
).
toEqual
(
data
.
notes
[
0
]);
});
it
(
'
should return given note for nonplaceholder notes
'
,
()
=>
{
const
data
=
{
notes
:
[
{
id
:
12
},
],
};
const
note
=
vm
.
componentData
(
data
);
expect
(
note
).
toEqual
(
data
);
});
});
});
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