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
63307ade
Commit
63307ade
authored
Dec 21, 2018
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split bio into individual line in extended user tooltips
- Remove leading 'at' in organzation info - Update karma tests
parent
347d1633
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
27 deletions
+16
-27
app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue
...ripts/vue_shared/components/user_popover/user_popover.vue
+2
-19
changelogs/unreleased/55293-split-bio-into-individual-line-in-extended-user-tooltips.yml
...it-bio-into-individual-line-in-extended-user-tooltips.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/javascripts/vue_shared/components/user_popover/user_popover_spec.js
...s/vue_shared/components/user_popover/user_popover_spec.js
+9
-5
No files found.
app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue
View file @
63307ade
<
script
>
import
{
GlPopover
,
GlSkeletonLoading
}
from
'
@gitlab/ui
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
UserAvatarImage
from
'
../user_avatar/user_avatar_image.vue
'
;
import
{
glEmojiTag
}
from
'
../../../emoji
'
;
...
...
@@ -28,23 +27,6 @@ export default {
},
},
computed
:
{
jobLine
()
{
if
(
this
.
user
.
bio
&&
this
.
user
.
organization
)
{
return
sprintf
(
__
(
'
%{bio} at %{organization}
'
),
{
bio
:
this
.
user
.
bio
,
organization
:
this
.
user
.
organization
,
},
false
,
);
}
else
if
(
this
.
user
.
bio
)
{
return
this
.
user
.
bio
;
}
else
if
(
this
.
user
.
organization
)
{
return
this
.
user
.
organization
;
}
return
null
;
},
statusHtml
()
{
if
(
this
.
user
.
status
.
emoji
&&
this
.
user
.
status
.
message
)
{
return
`
${
glEmojiTag
(
this
.
user
.
status
.
emoji
)}
${
this
.
user
.
status
.
message
}
`
;
...
...
@@ -86,7 +68,8 @@ export default {
<gl-skeleton-loading
v-else
:lines=
"1"
class=
"animation-container-small mb-1"
/>
</div>
<div
class=
"text-secondary"
>
{{
jobLine
}}
<div
v-if=
"user.bio"
class=
"js-bio"
>
{{
user
.
bio
}}
</div>
<div
v-if=
"user.organization"
class=
"js-organization"
>
{{
user
.
organization
}}
</div>
<gl-skeleton-loading
v-if=
"jobInfoIsLoading"
:lines=
"1"
...
...
changelogs/unreleased/55293-split-bio-into-individual-line-in-extended-user-tooltips.yml
0 → 100644
View file @
63307ade
---
title
:
Split bio into individual line in extended user tooltips
merge_request
:
23940
author
:
type
:
other
locale/gitlab.pot
View file @
63307ade
...
...
@@ -97,9 +97,6 @@ msgstr[1] ""
msgid "%{actionText} & %{openOrClose} %{noteable}"
msgstr ""
msgid "%{bio} at %{organization}"
msgstr ""
msgid "%{commit_author_link} authored %{commit_timeago}"
msgstr ""
...
...
spec/javascripts/vue_shared/components/user_popover/user_popover_spec.js
View file @
63307ade
...
...
@@ -89,7 +89,7 @@ describe('User Popover Component', () => {
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
GitLab
'
);
});
it
(
'
should
have full job line when we have bio and organization
'
,
()
=>
{
it
(
'
should
display bio and organization in separate lines
'
,
()
=>
{
const
testProps
=
Object
.
assign
({},
DEFAULT_PROPS
);
testProps
.
user
.
bio
=
'
Engineer
'
;
testProps
.
user
.
organization
=
'
GitLab
'
;
...
...
@@ -99,20 +99,24 @@ describe('User Popover Component', () => {
target
:
document
.
querySelector
(
'
.js-user-link
'
),
});
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Engineer at GitLab
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-bio
'
).
textContent
).
toContain
(
'
Engineer
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-organization
'
).
textContent
).
toContain
(
'
GitLab
'
);
});
it
(
'
should not encode special characters
when we have
bio and organization
'
,
()
=>
{
it
(
'
should not encode special characters
in
bio and organization
'
,
()
=>
{
const
testProps
=
Object
.
assign
({},
DEFAULT_PROPS
);
testProps
.
user
.
bio
=
'
Manager & Team Lead
'
;
testProps
.
user
.
organization
=
'
GitLab
'
;
testProps
.
user
.
organization
=
'
Me & my <funky> Company
'
;
vm
=
mountComponent
(
UserPopover
,
{
...
DEFAULT_PROPS
,
target
:
document
.
querySelector
(
'
.js-user-link
'
),
});
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Manager & Team Lead at GitLab
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-bio
'
).
textContent
).
toContain
(
'
Manager & Team Lead
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-organization
'
).
textContent
).
toContain
(
'
Me & my <funky> Company
'
,
);
});
});
...
...
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