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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
e3bddb62
Commit
e3bddb62
authored
Nov 29, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace existing uses of timeline-entry with timeline entry component
parent
99862050
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
371 additions
and
372 deletions
+371
-372
app/assets/javascripts/notes/components/comment_form.vue
app/assets/javascripts/notes/components/comment_form.vue
+121
-121
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+133
-137
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+49
-49
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
...ascripts/vue_shared/components/notes/placeholder_note.vue
+22
-22
app/assets/javascripts/vue_shared/components/notes/placeholder_system_note.vue
...s/vue_shared/components/notes/placeholder_system_note.vue
+9
-6
app/assets/javascripts/vue_shared/components/notes/skeleton_note.vue
...javascripts/vue_shared/components/notes/skeleton_note.vue
+8
-8
app/assets/javascripts/vue_shared/components/notes/system_note.vue
...s/javascripts/vue_shared/components/notes/system_note.vue
+25
-25
app/assets/javascripts/vue_shared/components/notes/timeline_entry_item.vue
...ripts/vue_shared/components/notes/timeline_entry_item.vue
+1
-1
spec/javascripts/vue_shared/components/notes/timeline_entry_item_spec.js
...s/vue_shared/components/notes/timeline_entry_item_spec.js
+3
-3
No files found.
app/assets/javascripts/notes/components/comment_form.vue
View file @
e3bddb62
This diff is collapsed.
Click to expand it.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
e3bddb62
This diff is collapsed.
Click to expand it.
app/assets/javascripts/notes/components/noteable_note.vue
View file @
e3bddb62
...
...
@@ -2,6 +2,7 @@
import
$
from
'
jquery
'
;
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
escape
}
from
'
underscore
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
import
Flash
from
'
../../flash
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
noteHeader
from
'
./note_header.vue
'
;
...
...
@@ -18,6 +19,7 @@ export default {
noteHeader
,
noteActions
,
noteBody
,
TimelineEntryItem
,
},
mixins
:
[
noteable
,
resolvable
],
props
:
{
...
...
@@ -169,62 +171,60 @@ export default {
</
script
>
<
template
>
<
li
<
timeline-entry-item
:id=
"noteAnchorId"
:class=
"classNameBindings"
:data-award-url=
"note.toggle_award_path"
:data-note-id=
"note.id"
class=
"note
timeline-entry
note-wrapper"
class=
"note note-wrapper"
>
<div
class=
"timeline-entry-inner"
>
<div
v-once
class=
"timeline-icon"
>
<user-avatar-link
:link-href=
"author.path"
:img-src=
"author.avatar_url"
:img-alt=
"author.name"
:img-size=
"40"
>
<slot
slot=
"avatar-badge"
name=
"avatar-badge"
>
</slot>
</user-avatar-link>
</div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<note-header
v-once
:author=
"author"
:created-at=
"note.created_at"
:note-id=
"note.id"
action-text=
"commented"
/>
<note-actions
:author-id=
"author.id"
:note-id=
"note.id"
:note-url=
"note.noteable_note_url"
:access-level=
"note.human_access"
:can-edit=
"note.current_user.can_edit"
:can-award-emoji=
"note.current_user.can_award_emoji"
:can-delete=
"note.current_user.can_edit"
:can-report-as-abuse=
"canReportAsAbuse"
:can-resolve=
"note.current_user.can_resolve"
:report-abuse-path=
"note.report_abuse_path"
:resolvable=
"note.resolvable"
:is-resolved=
"note.resolved"
:is-resolving=
"isResolving"
:resolved-by=
"note.resolved_by"
@
handleEdit=
"editHandler"
@
handleDelete=
"deleteHandler"
@
handleResolve=
"resolveHandler"
/>
</div>
<note-body
ref=
"noteBody"
:note=
"note"
<div
v-once
class=
"timeline-icon"
>
<user-avatar-link
:link-href=
"author.path"
:img-src=
"author.avatar_url"
:img-alt=
"author.name"
:img-size=
"40"
>
<slot
slot=
"avatar-badge"
name=
"avatar-badge"
>
</slot>
</user-avatar-link>
</div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<note-header
v-once
:author=
"author"
:created-at=
"note.created_at"
:note-id=
"note.id"
action-text=
"commented"
/>
<note-actions
:author-id=
"author.id"
:note-id=
"note.id"
:note-url=
"note.noteable_note_url"
:access-level=
"note.human_access"
:can-edit=
"note.current_user.can_edit"
:is-editing=
"isEditing"
@
handleFormUpdate=
"formUpdateHandler"
@
cancelForm=
"formCancelHandler"
:can-award-emoji=
"note.current_user.can_award_emoji"
:can-delete=
"note.current_user.can_edit"
:can-report-as-abuse=
"canReportAsAbuse"
:can-resolve=
"note.current_user.can_resolve"
:report-abuse-path=
"note.report_abuse_path"
:resolvable=
"note.resolvable"
:is-resolved=
"note.resolved"
:is-resolving=
"isResolving"
:resolved-by=
"note.resolved_by"
@
handleEdit=
"editHandler"
@
handleDelete=
"deleteHandler"
@
handleResolve=
"resolveHandler"
/>
</div>
<note-body
ref=
"noteBody"
:note=
"note"
:can-edit=
"note.current_user.can_edit"
:is-editing=
"isEditing"
@
handleFormUpdate=
"formUpdateHandler"
@
cancelForm=
"formCancelHandler"
/>
</div>
</
li
>
</
timeline-entry-item
>
</
template
>
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
View file @
e3bddb62
...
...
@@ -17,12 +17,14 @@
* />
*/
import
{
mapGetters
}
from
'
vuex
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
import
userAvatarLink
from
'
../user_avatar/user_avatar_link.vue
'
;
export
default
{
name
:
'
PlaceholderNote
'
,
components
:
{
userAvatarLink
,
TimelineEntryItem
,
},
props
:
{
note
:
{
...
...
@@ -37,30 +39,28 @@ export default {
</
script
>
<
template
>
<li
class=
"note being-posted fade-in-half timeline-entry"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
:link-href=
"getUserData.path"
:img-src=
"getUserData.avatar_url"
:img-size=
"40"
/>
</div>
<div
:class=
"
{ discussion: !note.individual_note }" class="timeline-content">
<div
class=
"note-header"
>
<div
class=
"note-header-info"
>
<a
:href=
"getUserData.path"
>
<span
class=
"d-none d-sm-inline-block"
>
{{
getUserData
.
name
}}
</span>
<span
class=
"note-headline-light"
>
@
{{
getUserData
.
username
}}
</span>
</a>
</div>
<timeline-entry-item
class=
"note being-posted fade-in-half"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
:link-href=
"getUserData.path"
:img-src=
"getUserData.avatar_url"
:img-size=
"40"
/>
</div>
<div
:class=
"
{ discussion: !note.individual_note }" class="timeline-content">
<div
class=
"note-header"
>
<div
class=
"note-header-info"
>
<a
:href=
"getUserData.path"
>
<span
class=
"d-none d-sm-inline-block"
>
{{
getUserData
.
name
}}
</span>
<span
class=
"note-headline-light"
>
@
{{
getUserData
.
username
}}
</span>
</a>
</div>
<div
class=
"note-body"
>
<div
class=
"note-text
"
>
<p>
{{
note
.
body
}}
</p
>
<
/div
>
</div
>
<div
class=
"note-body
"
>
<div
class=
"note-text"
>
<
p>
{{
note
.
body
}}
</p
>
</div>
</div>
</div>
</
li
>
</
timeline-entry-item
>
</
template
>
app/assets/javascripts/vue_shared/components/notes/placeholder_system_note.vue
View file @
e3bddb62
<
script
>
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
/**
* Common component to render a placeholder system note.
*
...
...
@@ -9,6 +11,9 @@
*/
export
default
{
name
:
'
PlaceholderSystemNote
'
,
components
:
{
TimelineEntryItem
,
},
props
:
{
note
:
{
type
:
Object
,
...
...
@@ -19,11 +24,9 @@ export default {
</
script
>
<
template
>
<li
class=
"note system-note timeline-entry being-posted fade-in-half"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-content"
>
<em>
{{
note
.
body
}}
</em>
</div>
<timeline-entry-item
class=
"note system-note being-posted fade-in-half"
>
<div
class=
"timeline-content"
>
<em>
{{
note
.
body
}}
</em>
</div>
</
li
>
</
timeline-entry-item
>
</
template
>
app/assets/javascripts/vue_shared/components/notes/skeleton_note.vue
View file @
e3bddb62
<
script
>
import
{
GlSkeletonLoading
}
from
'
@gitlab/ui
'
;
import
TimelineEntryItem
from
'
~/vue_shared/components/notes/timeline_entry_item.vue
'
;
export
default
{
name
:
'
SkeletonNote
'
,
components
:
{
GlSkeletonLoading
,
TimelineEntryItem
,
},
};
</
script
>
<
template
>
<li
class=
"timeline-entry note note-wrapper"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
></div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
></div>
<div
class=
"note-body"
><gl-skeleton-loading
/></div>
</div>
<timeline-entry-item
class=
"note note-wrapper"
>
<div
class=
"timeline-icon"
></div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
></div>
<div
class=
"note-body"
><gl-skeleton-loading
/></div>
</div>
</
li
>
</
timeline-entry-item
>
</
template
>
app/assets/javascripts/vue_shared/components/notes/system_note.vue
View file @
e3bddb62
...
...
@@ -20,6 +20,7 @@ import $ from 'jquery';
import
{
mapGetters
}
from
'
vuex
'
;
import
noteHeader
from
'
~/notes/components/note_header.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
TimelineEntryItem
from
'
./timeline_entry_item.vue
'
;
import
{
spriteIcon
}
from
'
../../../lib/utils/common_utils
'
;
const
MAX_VISIBLE_COMMIT_LIST_COUNT
=
3
;
...
...
@@ -29,6 +30,7 @@ export default {
components
:
{
Icon
,
noteHeader
,
TimelineEntryItem
,
},
props
:
{
note
:
{
...
...
@@ -73,36 +75,34 @@ export default {
</
script
>
<
template
>
<
li
<
timeline-entry-item
:id=
"noteAnchorId"
:class=
"
{ target: isTargetNote }"
class="note system-note
timeline-entry
note-wrapper"
class="note system-note note-wrapper"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
v-html=
"iconHtml"
></div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<note-header
:author=
"note.author"
:created-at=
"note.created_at"
:note-id=
"note.id"
>
<span
v-html=
"actionTextHtml"
></span>
</note-header>
</div>
<div
class=
"note-body"
>
<div
:class=
"
{
'system-note-commit-list': hasMoreCommits,
'hide-shade': expanded,
}"
class="note-text"
v-html="note.note_html"
>
</div>
<div
v-if=
"hasMoreCommits"
class=
"flex-list"
>
<div
class=
"system-note-commit-list-toggler flex-row"
@
click=
"expanded = !expanded;"
>
<icon
:name=
"toggleIcon"
:size=
"8"
class=
"append-right-5"
/>
<span>
Toggle commit list
</span>
</div>
<div
class=
"timeline-icon"
v-html=
"iconHtml"
></div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<note-header
:author=
"note.author"
:created-at=
"note.created_at"
:note-id=
"note.id"
>
<span
v-html=
"actionTextHtml"
></span>
</note-header>
</div>
<div
class=
"note-body"
>
<div
:class=
"
{
'system-note-commit-list': hasMoreCommits,
'hide-shade': expanded,
}"
class="note-text"
v-html="note.note_html"
>
</div>
<div
v-if=
"hasMoreCommits"
class=
"flex-list"
>
<div
class=
"system-note-commit-list-toggler flex-row"
@
click=
"expanded = !expanded;"
>
<icon
:name=
"toggleIcon"
:size=
"8"
class=
"append-right-5"
/>
<span>
Toggle commit list
</span>
</div>
</div>
</div>
</div>
</
li
>
</
timeline-entry-item
>
</
template
>
app/assets/javascripts/vue_shared/components/notes/timeline_entry_item.vue
View file @
e3bddb62
<
script
>
export
default
{
name
:
'
TimelineEntry
'
,
name
:
'
TimelineEntry
Item
'
,
};
</
script
>
...
...
spec/javascripts/vue_shared/components/notes/timeline_entry_item_spec.js
View file @
e3bddb62
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
TimelineEntry
from
'
~/vue_shared/components/notes/timeline_entry
.vue
'
;
import
TimelineEntry
Item
from
'
~/vue_shared/components/notes/timeline_entry_item
.vue
'
;
describe
(
TimelineEntry
.
name
,
()
=>
{
describe
(
TimelineEntry
Item
.
name
,
()
=>
{
let
wrapper
;
const
factory
=
(
options
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
shallowMount
(
TimelineEntry
,
{
wrapper
=
shallowMount
(
TimelineEntry
Item
,
{
localVue
,
...
options
,
});
...
...
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