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
514f22c4
Commit
514f22c4
authored
Feb 06, 2018
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Assignees vue component
parent
ba624930
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
241 additions
and
5 deletions
+241
-5
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+1
-1
app/assets/javascripts/sidebar/components/assignees/assignees.vue
...ts/javascripts/sidebar/components/assignees/assignees.vue
+231
-0
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
...scripts/sidebar/components/assignees/sidebar_assignees.js
+3
-3
changelogs/unreleased/refactor-move-assignees-vue-component.yml
...logs/unreleased/refactor-move-assignees-vue-component.yml
+5
-0
spec/javascripts/sidebar/assignees_spec.js
spec/javascripts/sidebar/assignees_spec.js
+1
-1
No files found.
app/assets/javascripts/boards/components/board_sidebar.js
View file @
514f22c4
...
...
@@ -5,7 +5,7 @@ import Flash from '../../flash';
import
Sidebar
from
'
../../right_sidebar
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
assigneeTitle
from
'
../../sidebar/components/assignees/assignee_title
'
;
import
assignees
from
'
../../sidebar/components/assignees/assignees
'
;
import
assignees
from
'
../../sidebar/components/assignees/assignees
.vue
'
;
import
DueDateSelectors
from
'
../../due_date_select
'
;
import
'
./sidebar/remove_issue
'
;
import
IssuableContext
from
'
../../issuable_context
'
;
...
...
app/assets/javascripts/sidebar/components/assignees/assignees.
js
→
app/assets/javascripts/sidebar/components/assignees/assignees.
vue
View file @
514f22c4
<
script
>
export
default
{
name
:
'
Assignees
'
,
data
()
{
return
{
defaultRenderCount
:
5
,
defaultMaxCounter
:
99
,
showLess
:
true
,
};
},
props
:
{
rootPath
:
{
type
:
String
,
...
...
@@ -21,6 +15,13 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
defaultRenderCount
:
5
,
defaultMaxCounter
:
99
,
showLess
:
true
,
};
},
computed
:
{
firstUser
()
{
return
this
.
users
[
0
];
...
...
@@ -101,124 +102,130 @@ export default {
return
index
===
0
||
firstTwo
;
},
},
template
:
`
<div>
<div
class="sidebar-collapsed-icon sidebar-collapsed-user"
:class="{ 'multiple-users': hasMoreThanOneAssignee, 'has-tooltip': hasAssignees }"
data-container="body"
data-placement="left"
:title="collapsedTooltipTitle"
};
</
script
>
<
template
>
<div>
<div
class=
"sidebar-collapsed-icon sidebar-collapsed-user"
:class=
"
{ 'multiple-users': hasMoreThanOneAssignee, 'has-tooltip': hasAssignees }"
data-container="body"
data-placement="left"
:title="collapsedTooltipTitle"
>
<i
v-if=
"hasNoUsers"
aria-label=
"No Assignee"
class=
"fa fa-user"
>
<i
v-if="hasNoUsers"
aria-label="No Assignee"
class="fa fa-user"
</i>
<button
type=
"button"
class=
"btn-link"
v-for=
"(user, index) in users"
v-if=
"shouldRenderCollapsedAssignee(index)"
:key=
"user.id"
>
<img
width=
"24"
class=
"avatar avatar-inline s24"
:alt=
"assigneeAlt(user)"
:src=
"avatarUrl(user)"
/>
<button
type="button"
class="btn-link"
v-for="(user, index) in users"
v-if="shouldRenderCollapsedAssignee(index)"
<span
class=
"author"
>
{{
user
.
name
}}
</span>
</button>
<button
v-if=
"hasMoreThanTwoAssignees"
class=
"btn-link"
type=
"button"
>
<span
class=
"avatar-counter sidebar-avatar-counter"
>
{{
sidebarAvatarCounter
}}
</span>
</button>
</div>
<div
class=
"value hide-collapsed"
>
<template
v-if=
"hasNoUsers"
>
<span
class=
"assign-yourself no-value"
>
No assignee
<template
v-if=
"editable"
>
-
<button
type=
"button"
class=
"btn-link"
@
click=
"assignSelf"
>
assign yourself
</button>
</
template
>
</span>
</template>
<
template
v-else-if=
"hasOneUser"
>
<a
class=
"author_link bold"
:href=
"assigneeUrl(firstUser)"
>
<img
width="
24
"
class="avatar avatar-inline s
24
"
:alt="assigneeAlt(
u
ser)"
:src="avatarUrl(
u
ser)"
width=
"
32
"
class=
"avatar avatar-inline s
32
"
:alt=
"assigneeAlt(
firstU
ser)"
:src=
"avatarUrl(
firstU
ser)"
/>
<span
class=
"author"
>
{{
u
ser.name }}
{{
firstU
ser
.
name
}}
</span>
</button>
<button
v-if="hasMoreThanTwoAssignees"
class="btn-link"
type="button"
>
<span
class="avatar-counter sidebar-avatar-counter"
>
{{ sidebarAvatarCounter }}
<span
class=
"username"
>
{{
assigneeUsername
(
firstUser
)
}}
</span>
</button>
</div>
<div class="value hide-collapsed">
<template v-if="hasNoUsers">
<span class="assign-yourself no-value">
No assignee
<template v-if="editable">
-
<button
type="button"
class="btn-link"
@click="assignSelf"
>
assign yourself
</button>
</template>
</span>
</template>
<template v-else-if="hasOneUser">
<a
class="author_link bold"
:href="assigneeUrl(firstUser)"
>
<img
width="32"
class="avatar avatar-inline s32"
:alt="assigneeAlt(firstUser)"
:src="avatarUrl(firstUser)"
/>
<span class="author">
{{ firstUser.name }}
</span>
<span class="username">
{{ assigneeUsername(firstUser) }}
</span>
</a>
</template>
<template v-else>
<div class="user-list">
<div
class="user-item"
v-for="(user, index) in users"
v-if="renderAssignee(index)"
>
<a
class="user-link has-tooltip"
data-placement="bottom"
:href="assigneeUrl(user)"
:data-title="user.name"
>
<img
width="32"
class="avatar avatar-inline s32"
:alt="assigneeAlt(user)"
:src="avatarUrl(user)"
/>
</a>
</div>
</div>
</a>
</
template
>
<
template
v-else
>
<div
class=
"user-list"
>
<div
v-if="renderShowMoreSection"
class="user-list-more"
class=
"user-item"
v-for=
"(user, index) in users"
v-if=
"renderAssignee(index)"
:key=
"user.id"
>
<button
type="button"
class="btn-link"
@click="toggleShowLess"
<a
class=
"user-link has-tooltip"
data-placement=
"bottom"
:href=
"assigneeUrl(user)"
:data-title=
"user.name"
>
<
template v-if="showLess">
{{ hiddenAssigneesLabel }}
</template>
<template v-else>
- show less
</template
>
</
button
>
<
img
width=
"32"
class=
"avatar avatar-inline s32"
:alt=
"assigneeAlt(user)"
:src=
"avatarUrl(user)"
/
>
</
a
>
</div>
</template>
</div>
</div>
<div
v-if=
"renderShowMoreSection"
class=
"user-list-more"
>
<button
type=
"button"
class=
"btn-link"
@
click=
"toggleShowLess"
>
<template
v-if=
"showLess"
>
{{
hiddenAssigneesLabel
}}
</
template
>
<
template
v-else
>
- show less
</
template
>
</button>
</div>
</template>
</div>
`
,
};
</div>
</template>
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
View file @
514f22c4
import
Flash
from
'
../../../flash
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
Assignees
from
'
./assignees
'
;
import
Assignees
from
'
./assignees
.vue
'
;
import
Store
from
'
../../stores/sidebar_store
'
;
import
eventHub
from
'
../../event_hub
'
;
...
...
@@ -28,8 +28,8 @@ export default {
},
},
components
:
{
'
assignee-title
'
:
AssigneeTitle
,
assignees
:
Assignees
,
AssigneeTitle
,
Assignees
,
},
methods
:
{
assignSelf
()
{
...
...
changelogs/unreleased/refactor-move-assignees-vue-component.yml
0 → 100644
View file @
514f22c4
---
title
:
Move Assignees vue component
merge_request
:
16952
author
:
George Tsiolis
type
:
performance
spec/javascripts/sidebar/assignees_spec.js
View file @
514f22c4
import
Vue
from
'
vue
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
.vue
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../helpers/user_mock_data_helper
'
;
...
...
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