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
4e6f1d54
Commit
4e6f1d54
authored
May 31, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MR approval placeholders same size as images
parent
36b3e067
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
56 deletions
+32
-56
app/assets/javascripts/vue_merge_request_widget/ee/components/approvals/approvals_footer.js
...equest_widget/ee/components/approvals/approvals_footer.js
+5
-8
app/assets/javascripts/vue_shared/components/link_to_member_avatar.js
...avascripts/vue_shared/components/link_to_member_avatar.js
+13
-9
app/assets/stylesheets/framework/avatar.scss
app/assets/stylesheets/framework/avatar.scss
+4
-0
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+5
-35
spec/javascripts/vue_shared/components/link_to_member_avatar_spec.js
...ripts/vue_shared/components/link_to_member_avatar_spec.js
+5
-4
No files found.
app/assets/javascripts/vue_merge_request_widget/ee/components/approvals/approvals_footer.js
View file @
4e6f1d54
/* global Flash */
import
pendingAvatarSvg
from
'
icons/_icon_dotted_circle.svg
'
;
import
LinkToMemberAvatar
from
'
~/vue_shared/components/link_to_member_avatar
'
;
import
eventHub
from
'
../../../event_hub
'
;
...
...
@@ -38,7 +37,6 @@ export default {
data
()
{
return
{
unapproving
:
false
,
pendingAvatarSvg
,
};
},
components
:
{
...
...
@@ -68,23 +66,22 @@ export default {
template
:
`
<div v-if="approvedBy.length" class="approved-by-users approvals-footer clearfix mr-info-list">
<div class="legend"></div>
<div>
<p
class="approvers-prefix"
>Approved by</p>
<div
class="approvers-prefix"
>
<p>Approved by</p>
<div class="approvers-list">
<span v-for="approver in approvedBy">
<link-to-member-avatar
:avatarSize="20"
extra-link-class="approver-avatar"
:avatar-url="approver.user.avatar_url"
:display-name="approver.user.name"
:profile-url="approver.user.web_url"
:show-tooltip="true" />
</span>
<span class="potential-approvers-list" v-for="n in approvalsLeft">
<link-to-member-avatar
:avatarSize="20"
:clickable="false"
:avatar-html="pendingAvatarSvg"
:show-tooltip="false"
extra-link-class="hide-asset" />
:show-tooltip="false" />
</span>
</div>
<span class="unapprove-btn-wrap" v-if="showUnapproveButton">
...
...
app/assets/javascripts/vue_shared/components/link_to_member_avatar.js
View file @
4e6f1d54
// Analogue of link_to_member_avatar in app/helpers/projects_helper.rb
import
pendingAvatarSvg
from
'
icons/_icon_dotted_circle.svg
'
;
export
default
{
props
:
{
...
...
@@ -52,6 +53,7 @@ export default {
data
()
{
return
{
avatarBaseClass
:
'
avatar avatar-inline
'
,
pendingAvatarSvg
,
};
},
computed
:
{
...
...
@@ -59,7 +61,7 @@ export default {
return
`s
${
this
.
avatarSize
}
`
;
},
avatarHtmlClass
()
{
return
`
${
this
.
avatarSizeClass
}
${
this
.
avatarBaseClass
}
`
;
return
`
${
this
.
avatarSizeClass
}
${
this
.
avatarBaseClass
}
avatar-placeholder
`
;
},
tooltipClass
()
{
return
this
.
showTooltip
?
'
has-tooltip
'
:
''
;
...
...
@@ -84,21 +86,23 @@ export default {
:class="linkClass"
:title="displayName"
:data-container="tooltipContainerAttr">
<img
v-if="avatarUrl"
:class="avatarClass"
:src="avatarUrl"
:width="avatarSize"
:height="avatarSize"
:alt="displayName"/>
<svg
v-
if="avatarHtml"
v-html="
avatarHtml
"
v-
else
v-html="
pendingAvatarSvg
"
:class="avatarHtmlClass"
:width="avatarSize"
:height="avatarSize"
:alt="displayName">
</svg>
<img
:class="avatarClass"
:src="avatarUrl"
:width="avatarSize"
:height="avatarSize"
:alt="displayName"/>
</a>
</div>
`
,
...
...
app/assets/stylesheets/framework/avatar.scss
View file @
4e6f1d54
...
...
@@ -57,6 +57,10 @@
border
:
none
;
}
&
.avatar-placeholder
{
border
:
none
;
}
&
:not
([
href
])
:hover
{
border-color
:
rgba
(
$avatar-border
,
.2
);
}
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
4e6f1d54
...
...
@@ -793,32 +793,11 @@
top
:
10px
;
}
// vertically centers all children
>
span
{
align-self
:
center
;
}
.hide-asset
{
img
{
display
:
none
;
}
svg
{
margin-bottom
:
-7px
;
// makes up for border removed
border
:
none
;
}
}
.approvers-prefix
,
.approvers-list
{
display
:
flex
;
align-items
:
center
;
margin-right
:
5px
;
float
:
left
;
}
.approvers-list
img
{
width
:
18px
;
height
:
18px
;
margin-top
:
3px
;
}
.unapprove-btn
{
...
...
@@ -836,18 +815,8 @@
}
}
// styles for approver avatar checkmark
.approver-avatar
{
position
:
relative
;
display
:
inline-block
;
svg
.avatar
{
position
:
absolute
;
top
:
12%
;
right
:
4%
;
height
:
45%
;
width
:
45%
;
}
}
}
...
...
@@ -858,8 +827,9 @@
}
.avatar
{
margin-bottom
:
-2px
;
margin-right
:
3px
;
margin-bottom
:
0
;
margin-left
:
7px
;
display
:
block
;
}
}
...
...
spec/javascripts/vue_shared/components/link_to_member_avatar_spec.js
View file @
4e6f1d54
...
...
@@ -20,6 +20,7 @@ import linkToMemberAvatar from '~/vue_shared/components/link_to_member_avatar';
this
.
$document
=
$
(
document
);
}
describe
(
'
Link To Members Components
'
,
function
()
{
describe
(
'
Initialization
'
,
function
()
{
beforeEach
(
function
()
{
...
...
@@ -41,19 +42,19 @@ import linkToMemberAvatar from '~/vue_shared/components/link_to_member_avatar';
expect
(
this
.
component
.
$data
).
toBeDefined
();
});
it
(
'
should have <a> and <
im
g> children
'
,
function
()
{
it
(
'
should have <a> and <
sv
g> children
'
,
function
()
{
const
componentLink
=
this
.
component
.
$el
.
querySelector
(
'
a
'
);
const
component
Img
=
componentLink
.
querySelector
(
'
im
g
'
);
const
component
Placeholder
=
componentLink
.
querySelector
(
'
sv
g
'
);
expect
(
componentLink
).
not
.
toBeNull
();
expect
(
component
Img
).
not
.
toBeNull
();
expect
(
component
Placeholder
).
not
.
toBeNull
();
});
it
(
'
should correctly compute computed values
'
,
function
(
done
)
{
const
correctVals
=
{
disabledClass
:
''
,
avatarSizeClass
:
'
s32
'
,
avatarHtmlClass
:
'
s32 avatar avatar-inline
'
,
avatarHtmlClass
:
'
s32 avatar avatar-inline
avatar-placeholder
'
,
avatarClass
:
'
avatar avatar-inline s32
'
,
tooltipClass
:
'
has-tooltip
'
,
linkClass
:
'
author_link has-tooltip
'
,
...
...
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