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
0
Merge Requests
0
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
Boxiang Sun
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';
...
@@ -5,7 +5,7 @@ import Flash from '../../flash';
import
Sidebar
from
'
../../right_sidebar
'
;
import
Sidebar
from
'
../../right_sidebar
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
assigneeTitle
from
'
../../sidebar/components/assignees/assignee_title
'
;
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
DueDateSelectors
from
'
../../due_date_select
'
;
import
'
./sidebar/remove_issue
'
;
import
'
./sidebar/remove_issue
'
;
import
IssuableContext
from
'
../../issuable_context
'
;
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
{
export
default
{
name
:
'
Assignees
'
,
name
:
'
Assignees
'
,
data
()
{
return
{
defaultRenderCount
:
5
,
defaultMaxCounter
:
99
,
showLess
:
true
,
};
},
props
:
{
props
:
{
rootPath
:
{
rootPath
:
{
type
:
String
,
type
:
String
,
...
@@ -21,6 +15,13 @@ export default {
...
@@ -21,6 +15,13 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
data
()
{
return
{
defaultRenderCount
:
5
,
defaultMaxCounter
:
99
,
showLess
:
true
,
};
},
computed
:
{
computed
:
{
firstUser
()
{
firstUser
()
{
return
this
.
users
[
0
];
return
this
.
users
[
0
];
...
@@ -101,124 +102,130 @@ export default {
...
@@ -101,124 +102,130 @@ export default {
return
index
===
0
||
firstTwo
;
return
index
===
0
||
firstTwo
;
},
},
},
},
template
:
`
};
<div>
</
script
>
<div
class="sidebar-collapsed-icon sidebar-collapsed-user"
<
template
>
:class="{ 'multiple-users': hasMoreThanOneAssignee, 'has-tooltip': hasAssignees }"
<div>
data-container="body"
<div
data-placement="left"
class=
"sidebar-collapsed-icon sidebar-collapsed-user"
:title="collapsedTooltipTitle"
: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
</i>
v-if="hasNoUsers"
<button
aria-label="No Assignee"
type=
"button"
class="fa fa-user"
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
<span
class=
"author"
>
type="button"
{{
user
.
name
}}
class="btn-link"
</span>
v-for="(user, index) in users"
</button>
v-if="shouldRenderCollapsedAssignee(index)"
<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
<img
width="
24
"
width=
"
32
"
class="avatar avatar-inline s
24
"
class=
"avatar avatar-inline s
32
"
:alt="assigneeAlt(
u
ser)"
:alt=
"assigneeAlt(
firstU
ser)"
:src="avatarUrl(
u
ser)"
:src=
"avatarUrl(
firstU
ser)"
/>
/>
<span
class=
"author"
>
<span
class=
"author"
>
{{
u
ser.name }}
{{
firstU
ser
.
name
}}
</span>
</span>
</button>
<span
class=
"username"
>
<button
{{
assigneeUsername
(
firstUser
)
}}
v-if="hasMoreThanTwoAssignees"
class="btn-link"
type="button"
>
<span
class="avatar-counter sidebar-avatar-counter"
>
{{ sidebarAvatarCounter }}
</span>
</span>
</button>
</a>
</div>
</
template
>
<div class="value hide-collapsed">
<
template
v-else
>
<template v-if="hasNoUsers">
<div
class=
"user-list"
>
<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>
<div
<div
v-if="renderShowMoreSection"
class=
"user-item"
class="user-list-more"
v-for=
"(user, index) in users"
v-if=
"renderAssignee(index)"
:key=
"user.id"
>
>
<button
<a
type="button"
class=
"user-link has-tooltip"
class="btn-link"
data-placement=
"bottom"
@click="toggleShowLess"
:href=
"assigneeUrl(user)"
:data-title=
"user.name"
>
>
<
template v-if="showLess">
<
img
{{ hiddenAssigneesLabel }}
width=
"32"
</template>
class=
"avatar avatar-inline s32"
<template v-else>
:alt=
"assigneeAlt(user)"
- show less
:src=
"avatarUrl(user)"
</template
>
/
>
</
button
>
</
a
>
</div>
</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>
`
,
</div>
};
</template>
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
View file @
514f22c4
import
Flash
from
'
../../../flash
'
;
import
Flash
from
'
../../../flash
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
Assignees
from
'
./assignees
'
;
import
Assignees
from
'
./assignees
.vue
'
;
import
Store
from
'
../../stores/sidebar_store
'
;
import
Store
from
'
../../stores/sidebar_store
'
;
import
eventHub
from
'
../../event_hub
'
;
import
eventHub
from
'
../../event_hub
'
;
...
@@ -28,8 +28,8 @@ export default {
...
@@ -28,8 +28,8 @@ export default {
},
},
},
},
components
:
{
components
:
{
'
assignee-title
'
:
AssigneeTitle
,
AssigneeTitle
,
assignees
:
Assignees
,
Assignees
,
},
},
methods
:
{
methods
:
{
assignSelf
()
{
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
Vue
from
'
vue
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
.vue
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../helpers/user_mock_data_helper
'
;
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