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
Hide 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 */
/* global Flash */
import
pendingAvatarSvg
from
'
icons/_icon_dotted_circle.svg
'
;
import
LinkToMemberAvatar
from
'
~/vue_shared/components/link_to_member_avatar
'
;
import
LinkToMemberAvatar
from
'
~/vue_shared/components/link_to_member_avatar
'
;
import
eventHub
from
'
../../../event_hub
'
;
import
eventHub
from
'
../../../event_hub
'
;
...
@@ -38,7 +37,6 @@ export default {
...
@@ -38,7 +37,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
unapproving
:
false
,
unapproving
:
false
,
pendingAvatarSvg
,
};
};
},
},
components
:
{
components
:
{
...
@@ -68,23 +66,22 @@ export default {
...
@@ -68,23 +66,22 @@ export default {
template
:
`
template
:
`
<div v-if="approvedBy.length" class="approved-by-users approvals-footer clearfix mr-info-list">
<div v-if="approvedBy.length" class="approved-by-users approvals-footer clearfix mr-info-list">
<div class="legend"></div>
<div class="legend"></div>
<div>
<div
class="approvers-prefix"
>
<p
class="approvers-prefix"
>Approved by</p>
<p>Approved by</p>
<div class="approvers-list">
<div class="approvers-list">
<span v-for="approver in approvedBy">
<span v-for="approver in approvedBy">
<link-to-member-avatar
<link-to-member-avatar
:avatarSize="20"
extra-link-class="approver-avatar"
extra-link-class="approver-avatar"
:avatar-url="approver.user.avatar_url"
:display-name="approver.user.name"
:display-name="approver.user.name"
:profile-url="approver.user.web_url"
:profile-url="approver.user.web_url"
:show-tooltip="true" />
:show-tooltip="true" />
</span>
</span>
<span class="potential-approvers-list" v-for="n in approvalsLeft">
<span class="potential-approvers-list" v-for="n in approvalsLeft">
<link-to-member-avatar
<link-to-member-avatar
:avatarSize="20"
:clickable="false"
:clickable="false"
:avatar-html="pendingAvatarSvg"
:show-tooltip="false" />
:show-tooltip="false"
extra-link-class="hide-asset" />
</span>
</span>
</div>
</div>
<span class="unapprove-btn-wrap" v-if="showUnapproveButton">
<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
// Analogue of link_to_member_avatar in app/helpers/projects_helper.rb
import
pendingAvatarSvg
from
'
icons/_icon_dotted_circle.svg
'
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -52,6 +53,7 @@ export default {
...
@@ -52,6 +53,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
avatarBaseClass
:
'
avatar avatar-inline
'
,
avatarBaseClass
:
'
avatar avatar-inline
'
,
pendingAvatarSvg
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -59,7 +61,7 @@ export default {
...
@@ -59,7 +61,7 @@ export default {
return
`s
${
this
.
avatarSize
}
`
;
return
`s
${
this
.
avatarSize
}
`
;
},
},
avatarHtmlClass
()
{
avatarHtmlClass
()
{
return
`
${
this
.
avatarSizeClass
}
${
this
.
avatarBaseClass
}
`
;
return
`
${
this
.
avatarSizeClass
}
${
this
.
avatarBaseClass
}
avatar-placeholder
`
;
},
},
tooltipClass
()
{
tooltipClass
()
{
return
this
.
showTooltip
?
'
has-tooltip
'
:
''
;
return
this
.
showTooltip
?
'
has-tooltip
'
:
''
;
...
@@ -84,21 +86,23 @@ export default {
...
@@ -84,21 +86,23 @@ export default {
:class="linkClass"
:class="linkClass"
:title="displayName"
:title="displayName"
:data-container="tooltipContainerAttr">
:data-container="tooltipContainerAttr">
<img
v-if="avatarUrl"
:class="avatarClass"
:src="avatarUrl"
:width="avatarSize"
:height="avatarSize"
:alt="displayName"/>
<svg
<svg
v-
if="avatarHtml"
v-
else
v-html="
avatarHtml
"
v-html="
pendingAvatarSvg
"
:class="avatarHtmlClass"
:class="avatarHtmlClass"
:width="avatarSize"
:width="avatarSize"
:height="avatarSize"
:height="avatarSize"
:alt="displayName">
:alt="displayName">
</svg>
</svg>
<img
:class="avatarClass"
:src="avatarUrl"
:width="avatarSize"
:height="avatarSize"
:alt="displayName"/>
</a>
</a>
</div>
</div>
`
,
`
,
...
...
app/assets/stylesheets/framework/avatar.scss
View file @
4e6f1d54
...
@@ -57,6 +57,10 @@
...
@@ -57,6 +57,10 @@
border
:
none
;
border
:
none
;
}
}
&
.avatar-placeholder
{
border
:
none
;
}
&
:not
([
href
])
:hover
{
&
:not
([
href
])
:hover
{
border-color
:
rgba
(
$avatar-border
,
.2
);
border-color
:
rgba
(
$avatar-border
,
.2
);
}
}
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
4e6f1d54
...
@@ -793,32 +793,11 @@
...
@@ -793,32 +793,11 @@
top
:
10px
;
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-prefix
,
.approvers-list
{
.approvers-list
{
display
:
flex
;
align-items
:
center
;
margin-right
:
5px
;
margin-right
:
5px
;
float
:
left
;
}
.approvers-list
img
{
width
:
18px
;
height
:
18px
;
margin-top
:
3px
;
}
}
.unapprove-btn
{
.unapprove-btn
{
...
@@ -836,18 +815,8 @@
...
@@ -836,18 +815,8 @@
}
}
}
}
// styles for approver avatar checkmark
.approver-avatar
{
.approver-avatar
{
position
:
relative
;
position
:
relative
;
display
:
inline-block
;
svg
.avatar
{
position
:
absolute
;
top
:
12%
;
right
:
4%
;
height
:
45%
;
width
:
45%
;
}
}
}
}
}
...
@@ -858,8 +827,9 @@
...
@@ -858,8 +827,9 @@
}
}
.avatar
{
.avatar
{
margin-bottom
:
-2px
;
margin-bottom
:
0
;
margin-right
:
3px
;
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';
...
@@ -20,6 +20,7 @@ import linkToMemberAvatar from '~/vue_shared/components/link_to_member_avatar';
this
.
$document
=
$
(
document
);
this
.
$document
=
$
(
document
);
}
}
describe
(
'
Link To Members Components
'
,
function
()
{
describe
(
'
Link To Members Components
'
,
function
()
{
describe
(
'
Initialization
'
,
function
()
{
describe
(
'
Initialization
'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
@@ -41,19 +42,19 @@ import linkToMemberAvatar from '~/vue_shared/components/link_to_member_avatar';
...
@@ -41,19 +42,19 @@ import linkToMemberAvatar from '~/vue_shared/components/link_to_member_avatar';
expect
(
this
.
component
.
$data
).
toBeDefined
();
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
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
(
componentLink
).
not
.
toBeNull
();
expect
(
component
Img
).
not
.
toBeNull
();
expect
(
component
Placeholder
).
not
.
toBeNull
();
});
});
it
(
'
should correctly compute computed values
'
,
function
(
done
)
{
it
(
'
should correctly compute computed values
'
,
function
(
done
)
{
const
correctVals
=
{
const
correctVals
=
{
disabledClass
:
''
,
disabledClass
:
''
,
avatarSizeClass
:
'
s32
'
,
avatarSizeClass
:
'
s32
'
,
avatarHtmlClass
:
'
s32 avatar avatar-inline
'
,
avatarHtmlClass
:
'
s32 avatar avatar-inline
avatar-placeholder
'
,
avatarClass
:
'
avatar avatar-inline s32
'
,
avatarClass
:
'
avatar avatar-inline s32
'
,
tooltipClass
:
'
has-tooltip
'
,
tooltipClass
:
'
has-tooltip
'
,
linkClass
:
'
author_link 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