diff options
author | Chantal Rollison <crollison@gitlab.com> | 2018-08-24 10:13:41 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-24 10:13:41 +0000 |
commit | 009c4f7fb892e8af09cc2489f015ea6c62411df6 (patch) | |
tree | 5cce8b07846ed39aa8bd00bd149a7999d0d7b85a /app/assets/javascripts/notes/components/note_awards_list.vue | |
parent | f4d18201d2fd46f75612485f97dde157e8aca71e (diff) | |
download | gitlab-ce-009c4f7fb892e8af09cc2489f015ea6c62411df6.tar.gz |
Allows author to vote on their own issue
Diffstat (limited to 'app/assets/javascripts/notes/components/note_awards_list.vue')
-rw-r--r-- | app/assets/javascripts/notes/components/note_awards_list.vue | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/app/assets/javascripts/notes/components/note_awards_list.vue b/app/assets/javascripts/notes/components/note_awards_list.vue index 225d9f18612..e111d3b9ac2 100644 --- a/app/assets/javascripts/notes/components/note_awards_list.vue +++ b/app/assets/javascripts/notes/components/note_awards_list.vue @@ -82,29 +82,17 @@ export default { getAwardHTML(name) { return glEmojiTag(name); }, - getAwardClassBindings(awardList, awardName) { + getAwardClassBindings(awardList) { return { active: this.hasReactionByCurrentUser(awardList), - disabled: !this.canInteractWithEmoji(awardList, awardName), + disabled: !this.canInteractWithEmoji(), }; }, - canInteractWithEmoji(awardList, awardName) { - let isAllowed = true; - const restrictedEmojis = ['thumbsup', 'thumbsdown']; - - // Users can not add :+1: and :-1: to their own notes - if ( - this.getUserData.id === this.noteAuthorId && - restrictedEmojis.indexOf(awardName) > -1 - ) { - isAllowed = false; - } - - return this.getUserData.id && isAllowed; + canInteractWithEmoji() { + return this.getUserData.id; }, hasReactionByCurrentUser(awardList) { - return awardList.filter(award => award.user.id === this.getUserData.id) - .length; + return awardList.filter(award => award.user.id === this.getUserData.id).length; }, awardTitle(awardsList) { const hasReactionByCurrentUser = this.hasReactionByCurrentUser( @@ -197,7 +185,7 @@ export default { v-tooltip v-for="(awardList, awardName, index) in groupedAwards" :key="index" - :class="getAwardClassBindings(awardList, awardName)" + :class="getAwardClassBindings(awardList)" :title="awardTitle(awardList)" class="btn award-control" data-boundary="viewport" |