BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
56af0631
Commit
56af0631
authored
Feb 28, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refactor/move-assignees-vue-component' into 'master'
Move (Multiple) Assignees vue component See merge request gitlab-org/gitlab-ce!16952
parents
fcf34e28
514f22c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
120 deletions
+132
-120
board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+1
-1
assignees.vue
...ts/javascripts/sidebar/components/assignees/assignees.vue
+122
-115
sidebar_assignees.js
...scripts/sidebar/components/assignees/sidebar_assignees.js
+3
-3
refactor-move-assignees-vue-component.yml
...logs/unreleased/refactor-move-assignees-vue-component.yml
+5
-0
assignees_spec.js
spec/javascripts/sidebar/assignees_spec.js
+1
-1
No files found.
app/assets/javascripts/boards/components/board_sidebar.js
View file @
56af0631
...
...
@@ -6,7 +6,7 @@ import { __ } from '../../locale';
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 @
56af0631
<
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 @
56af0631
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 @
56af0631
---
title
:
Move Assignees vue component
merge_request
:
16952
author
:
George Tsiolis
type
:
performance
spec/javascripts/sidebar/assignees_spec.js
View file @
56af0631
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