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
40807a96
Commit
40807a96
authored
Jul 30, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lazy load avatars in diffs
Adds the lazy attribute to lazy load avatars in merge request diffs.
parent
020110b3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
app/assets/javascripts/diffs/components/diff_gutter_avatars.vue
...sets/javascripts/diffs/components/diff_gutter_avatars.vue
+1
-0
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+1
-0
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_link.vue
...ts/vue_shared/components/user_avatar/user_avatar_link.vue
+6
-0
spec/frontend/vue_shared/components/user_avatar/user_avatar_link_spec.js
...ue_shared/components/user_avatar/user_avatar_link_spec.js
+11
-0
No files found.
app/assets/javascripts/diffs/components/diff_gutter_avatars.vue
View file @
40807a96
...
...
@@ -75,6 +75,7 @@ export default {
:key=
"note.id"
:img-src=
"note.author.avatar_url"
:tooltip-text=
"getTooltipText(note)"
lazy
class=
"diff-comment-avatar js-diff-comment-avatar"
@
click.native=
"$emit('toggleLineDiscussions')"
/>
...
...
app/assets/javascripts/notes/components/noteable_note.vue
View file @
40807a96
...
...
@@ -392,6 +392,7 @@ export default {
:img-src=
"author.avatar_url"
:img-alt=
"author.name"
:img-size=
"40"
lazy
>
<
template
#avatar-badge
>
<slot
name=
"avatar-badge"
></slot>
...
...
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_link.vue
View file @
40807a96
...
...
@@ -30,6 +30,11 @@ export default {
GlTooltip
:
GlTooltipDirective
,
},
props
:
{
lazy
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
linkHref
:
{
type
:
String
,
required
:
false
,
...
...
@@ -91,6 +96,7 @@ export default {
:size=
"imgSize"
:tooltip-text=
"avatarTooltipText"
:tooltip-placement=
"tooltipPlacement"
:lazy=
"lazy"
>
<slot></slot>
</user-avatar-image
><span
...
...
spec/frontend/vue_shared/components/user_avatar/user_avatar_link_spec.js
View file @
40807a96
...
...
@@ -104,4 +104,15 @@ describe('User Avatar Link Component', () => {
);
});
});
describe
(
'
lazy
'
,
()
=>
{
it
(
'
passes lazy prop to avatar image
'
,
()
=>
{
createWrapper
({
username
:
''
,
lazy
:
true
,
});
expect
(
wrapper
.
find
(
UserAvatarImage
).
props
(
'
lazy
'
)).
toBe
(
true
);
});
});
});
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