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
283772d0
Commit
283772d0
authored
Sep 21, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve responsiveness of notes header content
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/214732
parent
8a2e578e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
10 deletions
+120
-10
app/assets/javascripts/notes/components/discussion_notes.vue
app/assets/javascripts/notes/components/discussion_notes.vue
+7
-0
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+6
-0
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+14
-1
app/assets/javascripts/notes/components/notes_app.vue
app/assets/javascripts/notes/components/notes_app.vue
+1
-0
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
...ascripts/vue_shared/components/notes/placeholder_note.vue
+12
-1
app/assets/stylesheets/framework/diffs.scss
app/assets/stylesheets/framework/diffs.scss
+22
-1
app/assets/stylesheets/pages/notes.scss
app/assets/stylesheets/pages/notes.scss
+37
-7
spec/frontend/notes/components/noteable_note_spec.js
spec/frontend/notes/components/noteable_note_spec.js
+21
-0
No files found.
app/assets/javascripts/notes/components/discussion_notes.vue
View file @
283772d0
...
...
@@ -47,6 +47,11 @@ export default {
required
:
false
,
default
:
''
,
},
isOverviewTab
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
...
mapGetters
([
'
userCanReply
'
]),
...
...
@@ -127,6 +132,7 @@ export default {
:show-reply-button=
"userCanReply"
:discussion-root=
"true"
:discussion-resolve-path=
"discussion.resolve_path"
:is-overview-tab=
"isOverviewTab"
@
handleDeleteNote=
"$emit('deleteNote')"
@
startReplying=
"$emit('startReplying')"
>
...
...
@@ -176,6 +182,7 @@ export default {
:line=
"diffLine"
:discussion-root=
"index === 0"
:discussion-resolve-path=
"discussion.resolve_path"
:is-overview-tab=
"isOverviewTab"
@
handleDeleteNote=
"$emit('deleteNote')"
>
<template
#avatar-badge
>
...
...
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
283772d0
...
...
@@ -66,6 +66,11 @@ export default {
required
:
false
,
default
:
''
,
},
isOverviewTab
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
data
()
{
return
{
...
...
@@ -263,6 +268,7 @@ export default {
:is-expanded=
"isExpanded"
:line=
"line"
:should-group-replies=
"shouldGroupReplies"
:is-overview-tab=
"isOverviewTab"
@
startReplying=
"showReplyForm"
@
deleteNote=
"deleteNoteHandler"
>
...
...
app/assets/javascripts/notes/components/noteable_note.vue
View file @
283772d0
...
...
@@ -84,6 +84,11 @@ export default {
required
:
false
,
default
:
''
,
},
isOverviewTab
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
data
()
{
return
{
...
...
@@ -186,6 +191,14 @@ export default {
return
fileResolvedFromAvailableSource
||
null
;
},
avatarSize
()
{
// Use a different size if shown on a Merge Request Diff
if
(
this
.
line
&&
!
this
.
isOverviewTab
)
{
return
24
;
}
return
40
;
},
},
created
()
{
const
line
=
this
.
note
.
position
?.
line_range
?.
start
||
this
.
line
;
...
...
@@ -391,7 +404,7 @@ export default {
:link-href=
"author.path"
:img-src=
"author.avatar_url"
:img-alt=
"author.name"
:img-size=
"
40
"
:img-size=
"
avatarSize
"
lazy
>
<
template
#avatar-badge
>
...
...
app/assets/javascripts/notes/components/notes_app.vue
View file @
283772d0
...
...
@@ -317,6 +317,7 @@ export default {
:key=
"discussion.id"
:discussion=
"discussion"
:render-diff-file=
"true"
is-overview-tab
:help-page-path=
"helpPagePath"
/>
</template>
...
...
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
View file @
283772d0
...
...
@@ -34,12 +34,23 @@ export default {
type
:
Object
,
required
:
true
,
},
line
:
{
type
:
Object
,
required
:
false
,
default
:
null
,
},
},
computed
:
{
...
mapGetters
([
'
getUserData
'
]),
renderedNote
()
{
return
renderMarkdown
(
this
.
note
.
body
);
},
avatarSize
()
{
if
(
this
.
line
)
{
return
16
;
}
return
40
;
},
},
};
</
script
>
...
...
@@ -50,7 +61,7 @@ export default {
<user-avatar-link
:link-href=
"getUserData.path"
:img-src=
"getUserData.avatar_url"
:img-size=
"
40
"
:img-size=
"
avatarSize
"
/>
</div>
<div
ref=
"note"
:class=
"
{ discussion: !note.individual_note }" class="timeline-content">
...
...
app/assets/stylesheets/framework/diffs.scss
View file @
283772d0
...
...
@@ -1034,6 +1034,27 @@ table.code {
}
}
// Notes tweaks for the Changes tab ONLY
.diff-tr
{
.timeline-discussion-body
{
clear
:
left
;
.note-body
{
margin-top
:
0
!
important
;
}
}
.timeline-entry
img
.avatar
{
margin-top
:
-2px
;
margin-right
:
$gl-padding-8
;
}
// tiny adjustment to vertical align with the note header text
.discussion-collapsible
.timeline-icon
{
padding-top
:
2px
;
}
}
.files
:not
([
data-can-create-note
])
.frame
{
cursor
:
auto
;
}
...
...
@@ -1152,7 +1173,7 @@ table.code {
}
.discussion-collapsible
{
margin
:
0
$gl-padding
$gl-padding
71px
;
margin
:
0
$gl-padding
$gl-padding
;
.notes
{
border-radius
:
$border-radius-default
;
...
...
app/assets/stylesheets/pages/notes.scss
View file @
283772d0
...
...
@@ -125,18 +125,17 @@ $system-note-svg-size: 16px;
}
}
.timeline-discussion-body
{
margin-top
:
-
$gl-padding-8
;
}
.discussion
{
display
:
block
;
position
:
relative
;
.timeline-discussion-body
{
margin-top
:
-
$gl-padding-8
;
overflow-x
:
auto
;
overflow-y
:
hidden
;
.note-body
{
margin-top
:
$gl-padding-8
;
}
}
.diff-content
{
...
...
@@ -586,17 +585,47 @@ $system-note-svg-size: 16px;
.note-header
{
display
:
flex
;
justify-content
:
space-between
;
flex-wrap
:
wrap
;
>
.note-header-info
,
>
.note-actions
{
flex-grow
:
1
;
flex-shrink
:
1
;
}
}
.note
{
@include
notes-media
(
'max'
,
map-get
(
$grid-breakpoints
,
sm
)
-
1
)
{
.note-header
{
.note-actions
{
flex-wrap
:
wrap
;
margin-bottom
:
$gl-padding-12
;
>
:first-child
{
margin-left
:
0
;
}
}
}
.note-header-author-name
{
display
:
block
;
}
}
}
.note-header-info
{
min-width
:
0
;
padding-bottom
:
$gl-padding-8
;
&
.discussion
{
padding-bottom
:
0
;
}
}
.note-header-info
,
.note-actions
{
padding-bottom
:
$gl-padding-8
;
}
.system-note
.note-header-info
{
padding-bottom
:
0
;
}
...
...
@@ -667,7 +696,8 @@ $system-note-svg-size: 16px;
.note-actions
{
align-self
:
flex-start
;
flex-shrink
:
0
;
justify-content
:
flex-end
;
flex-shrink
:
1
;
display
:
inline-flex
;
align-items
:
center
;
margin-left
:
10px
;
...
...
spec/frontend/notes/components/noteable_note_spec.js
View file @
283772d0
...
...
@@ -189,6 +189,27 @@ describe('issue_note', () => {
createWrapper
();
});
describe
(
'
avatar sizes in diffs
'
,
()
=>
{
const
line
=
{
line_code
:
'
abc_1_1
'
,
type
:
null
,
old_line
:
'
1
'
,
new_line
:
'
1
'
,
};
it
(
'
should render 24px avatars
'
,
async
()
=>
{
wrapper
.
setProps
({
note
:
{
...
note
},
discussionRoot
:
true
,
line
,
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
findComponent
(
UserAvatarLink
).
props
(
'
imgSize
'
)).
toBe
(
24
);
});
});
it
(
'
should render user information
'
,
()
=>
{
const
{
author
}
=
note
;
const
avatar
=
wrapper
.
findComponent
(
UserAvatarLink
);
...
...
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