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
31bc52ee
Commit
31bc52ee
authored
Apr 24, 2017
by
Clement Ho
Committed by
Jacob Schatz
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add multiple assignees to issue board card
parent
b9270cb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
34 deletions
+149
-34
app/assets/javascripts/boards/components/issue_card_inner.js
app/assets/javascripts/boards/components/issue_card_inner.js
+78
-24
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+2
-5
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+69
-5
No files found.
app/assets/javascripts/boards/components/issue_card_inner.js
View file @
31bc52ee
...
@@ -32,18 +32,36 @@ import eventHub from '../eventhub';
...
@@ -32,18 +32,36 @@ import eventHub from '../eventhub';
default
:
false
,
default
:
false
,
},
},
},
},
data
()
{
return
{
limitBeforeCounter
:
3
,
maxRender
:
4
,
maxCounter
:
99
,
};
},
computed
:
{
computed
:
{
cardUrl
()
{
numberOverLimit
()
{
return
`
${
this
.
issueLinkBase
}
/
${
this
.
issue
.
id
}
`
;
return
this
.
issue
.
assignees
.
length
-
this
.
limitBeforeCounter
;
},
},
assigneeUrl
()
{
assigneeCounterTooltip
()
{
return
`
${
this
.
rootPath
}${
this
.
issue
.
assignee
.
username
}
`
;
return
`
${
this
.
assigneeCounterLabel
}
more`
;
},
assigneeCounterLabel
()
{
if
(
this
.
numberOverLimit
>
this
.
maxCounter
)
{
return
`
${
this
.
maxCounter
}
+`
;
}
return
`+
${
this
.
numberOverLimit
}
`
;
},
},
assigneeUrlTitle
()
{
shouldRenderCounter
()
{
return
`Assigned to
${
this
.
issue
.
assignee
.
name
}
`
;
if
(
this
.
issue
.
assignees
.
length
<=
this
.
maxRender
)
{
return
false
;
}
return
this
.
issue
.
assignees
.
length
>
this
.
numberOverLimit
;
},
},
avatarUrlTitle
()
{
cardUrl
()
{
return
`
Avatar for
${
this
.
issue
.
assignee
.
name
}
`
;
return
`
${
this
.
issueLinkBase
}
/
${
this
.
issue
.
id
}
`
;
},
},
issueId
()
{
issueId
()
{
return
`#
${
this
.
issue
.
id
}
`
;
return
`#
${
this
.
issue
.
id
}
`
;
...
@@ -53,6 +71,28 @@ import eventHub from '../eventhub';
...
@@ -53,6 +71,28 @@ import eventHub from '../eventhub';
},
},
},
},
methods
:
{
methods
:
{
isIndexLessThanlimit
(
index
)
{
return
index
<
this
.
limitBeforeCounter
;
},
shouldRenderAssignee
(
index
)
{
// Eg. maxRender is 4,
// Render up to all 4 assignees if there are only 4 assigness
// Otherwise render up to the limitBeforeCounter
if
(
this
.
issue
.
assignees
.
length
<=
this
.
maxRender
)
{
return
index
<
this
.
maxRender
;
}
return
index
<
this
.
limitBeforeCounter
;
},
assigneeUrl
(
assignee
)
{
return
`
${
this
.
rootPath
}${
assignee
.
username
}
`
;
},
assigneeUrlTitle
(
assignee
)
{
return
`Assigned to
${
assignee
.
name
}
`
;
},
avatarUrlTitle
(
assignee
)
{
return
`Avatar for
${
assignee
.
name
}
`
;
},
showLabel
(
label
)
{
showLabel
(
label
)
{
if
(
!
this
.
list
)
return
true
;
if
(
!
this
.
list
)
return
true
;
...
@@ -106,23 +146,37 @@ import eventHub from '../eventhub';
...
@@ -106,23 +146,37 @@ import eventHub from '../eventhub';
{{ issueId }}
{{ issueId }}
</span>
</span>
</h4>
</h4>
<a
<div class="card-assignee">
class="card-assignee has-tooltip js-no-trigger"
<a
:href="assigneeUrl"
class="has-tooltip js-no-trigger"
:title="assigneeUrlTitle"
:href="assigneeUrl(assignee)"
v-if="issue.assignee"
:title="assigneeUrlTitle(assignee)"
data-container="body"
v-for="(assignee, index) in issue.assignees"
>
v-if="shouldRenderAssignee(index)"
<img
data-container="body"
class="avatar avatar-inline s20"
data-placement="bottom"
:src="issue.assignee.avatar"
>
width="20"
<img
height="20"
class="avatar avatar-inline s20"
:alt="avatarUrlTitle"
:src="assignee.avatar"
/>
width="20"
</a>
height="20"
:alt="avatarUrlTitle(assignee)"
/>
</a>
<span
class="avatar-counter has-tooltip"
:title="assigneeCounterTooltip"
v-if="shouldRenderCounter"
>
{{ assigneeCounterLabel }}
</span>
</div>
</div>
</div>
<div class="card-footer" v-if="showLabelFooter">
<div
class="card-footer"
v-if="showLabelFooter"
>
<button
<button
class="label color-label has-tooltip"
class="label color-label has-tooltip"
v-for="label in issue.labels"
v-for="label in issue.labels"
...
...
app/assets/javascripts/boards/models/issue.js
View file @
31bc52ee
...
@@ -15,14 +15,9 @@ class ListIssue {
...
@@ -15,14 +15,9 @@ class ListIssue {
this
.
subscribed
=
obj
.
subscribed
;
this
.
subscribed
=
obj
.
subscribed
;
this
.
labels
=
[];
this
.
labels
=
[];
this
.
selected
=
false
;
this
.
selected
=
false
;
this
.
assignee
=
false
;
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
milestone_id
=
obj
.
milestone_id
;
this
.
milestone_id
=
obj
.
milestone_id
;
if
(
obj
.
assignee
)
{
this
.
assignee
=
new
ListUser
(
obj
.
assignee
);
}
if
(
obj
.
milestone
)
{
if
(
obj
.
milestone
)
{
this
.
milestone
=
new
ListMilestone
(
obj
.
milestone
);
this
.
milestone
=
new
ListMilestone
(
obj
.
milestone
);
}
}
...
@@ -30,6 +25,8 @@ class ListIssue {
...
@@ -30,6 +25,8 @@ class ListIssue {
obj
.
labels
.
forEach
((
label
)
=>
{
obj
.
labels
.
forEach
((
label
)
=>
{
this
.
labels
.
push
(
new
ListLabel
(
label
));
this
.
labels
.
push
(
new
ListLabel
(
label
));
});
});
this
.
assignees
=
obj
.
assignees
.
map
(
a
=>
new
ListUser
(
a
));
}
}
addLabel
(
label
)
{
addLabel
(
label
)
{
...
...
app/assets/stylesheets/pages/boards.scss
View file @
31bc52ee
...
@@ -236,8 +236,13 @@
...
@@ -236,8 +236,13 @@
margin-bottom
:
5px
;
margin-bottom
:
5px
;
}
}
&
.is-active
{
&
.is-active
,
&
.is-active
.card-assignee
:hover
a
{
background-color
:
$row-hover
;
background-color
:
$row-hover
;
&
:first-child:not
(
:only-child
)
{
box-shadow
:
-10px
0
10px
1px
$row-hover
;
}
}
}
.label
{
.label
{
...
@@ -253,7 +258,7 @@
...
@@ -253,7 +258,7 @@
}
}
.card-title
{
.card-title
{
margin
:
0
;
margin
:
0
30px
0
0
;
font-size
:
1em
;
font-size
:
1em
;
line-height
:
inherit
;
line-height
:
inherit
;
...
@@ -269,10 +274,69 @@
...
@@ -269,10 +274,69 @@
min-height
:
20px
;
min-height
:
20px
;
.card-assignee
{
.card-assignee
{
margin-left
:
auto
;
display
:
flex
;
margin-right
:
5px
;
justify-content
:
flex-end
;
padding-left
:
10px
;
position
:
absolute
;
right
:
15px
;
height
:
20px
;
height
:
20px
;
width
:
20px
;
.avatar-counter
{
display
:
none
;
vertical-align
:
middle
;
min-width
:
20px
;
line-height
:
19px
;
height
:
20px
;
padding-left
:
2px
;
padding-right
:
2px
;
border-radius
:
2em
;
}
img
{
vertical-align
:
top
;
}
a
{
position
:
relative
;
margin-left
:
-15px
;
}
a
:nth-child
(
1
)
{
z-index
:
3
;
}
a
:nth-child
(
2
)
{
z-index
:
2
;
}
a
:nth-child
(
3
)
{
z-index
:
1
;
}
a
:nth-child
(
4
)
{
display
:
none
;
}
&
:hover
{
.avatar-counter
{
display
:
inline-block
;
}
a
{
position
:
static
;
background-color
:
$white-light
;
transition
:
background-color
0s
;
margin-left
:
auto
;
&
:nth-child
(
4
)
{
display
:
block
;
}
&
:first-child:not
(
:only-child
)
{
box-shadow
:
-10px
0
10px
1px
$white-light
;
}
}
}
}
}
.avatar
{
.avatar
{
...
...
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