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
0f6ecaa1
Commit
0f6ecaa1
authored
Jun 14, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement canAward.
parent
654355a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
app/assets/javascripts/notes/components/issue_note_awards_list.vue
...s/javascripts/notes/components/issue_note_awards_list.vue
+11
-2
No files found.
app/assets/javascripts/notes/components/issue_note_awards_list.vue
View file @
0f6ecaa1
...
@@ -16,6 +16,7 @@ export default {
...
@@ -16,6 +16,7 @@ export default {
emojiSmiling
,
emojiSmiling
,
emojiSmile
,
emojiSmile
,
emojiSmiley
,
emojiSmiley
,
canAward
:
!!
window
.
gon
.
current_user_id
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -42,6 +43,12 @@ export default {
...
@@ -42,6 +43,12 @@ export default {
getAwardHTML
(
name
)
{
getAwardHTML
(
name
)
{
return
glEmojiTag
(
name
);
return
glEmojiTag
(
name
);
},
},
getAwardClassBindings
(
awardList
)
{
return
{
active
:
this
.
amIAwarded
(
awardList
),
disabled
:
!
this
.
canAward
,
};
},
amIAwarded
(
awardList
)
{
amIAwarded
(
awardList
)
{
const
myUserId
=
window
.
gon
.
current_user_id
;
const
myUserId
=
window
.
gon
.
current_user_id
;
const
isAwarded
=
awardList
.
filter
(
award
=>
award
.
user
.
id
===
myUserId
);
const
isAwarded
=
awardList
.
filter
(
award
=>
award
.
user
.
id
===
myUserId
);
...
@@ -97,7 +104,7 @@ export default {
...
@@ -97,7 +104,7 @@ export default {
<button
<button
v-for=
"(awardList, awardName) in groupedAwards"
v-for=
"(awardList, awardName) in groupedAwards"
class=
"btn award-control has-tooltip"
class=
"btn award-control has-tooltip"
:class=
"
{ active: amIAwarded(awardList) }
"
:class=
"
getAwardClassBindings(awardList)
"
:title=
"awardTitle(awardList)"
:title=
"awardTitle(awardList)"
data-placement=
"bottom"
data-placement=
"bottom"
type=
"button"
>
type=
"button"
>
...
@@ -106,7 +113,9 @@ export default {
...
@@ -106,7 +113,9 @@ export default {
{{
awardList
.
length
}}
{{
awardList
.
length
}}
</span>
</span>
</button>
</button>
<div
class=
"award-menu-holder"
>
<div
v-if=
"canAward"
class=
"award-menu-holder"
>
<button
<button
aria-label=
"Add reaction"
aria-label=
"Add reaction"
class=
"award-control btn has-tooltip"
class=
"award-control btn has-tooltip"
...
...
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