diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-08-18 19:32:39 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-08-18 19:32:39 +0300 |
commit | 7e82e45d874170fe894f4caf3fba83b75ca16986 (patch) | |
tree | 328d6e3a084a58b6801dec4c914de98e1d536db3 /app/assets/javascripts/notes | |
parent | 99be7d6e2512724be5bfd8756e148c571d4fff07 (diff) |
IssueNotesRefactor: Prevent anon user to try to add award.
Diffstat (limited to 'app/assets/javascripts/notes')
4 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes/components/issue_discussion.vue b/app/assets/javascripts/notes/components/issue_discussion.vue index 1a8d3b98309..bbf9e0db45c 100644 --- a/app/assets/javascripts/notes/components/issue_discussion.vue +++ b/app/assets/javascripts/notes/components/issue_discussion.vue @@ -72,7 +72,7 @@ } return null; - } + }, }, methods: { ...mapActions([ diff --git a/app/assets/javascripts/notes/components/issue_note_actions.vue b/app/assets/javascripts/notes/components/issue_note_actions.vue index 5476ce19836..4b3dc1ad124 100644 --- a/app/assets/javascripts/notes/components/issue_note_actions.vue +++ b/app/assets/javascripts/notes/components/issue_note_actions.vue @@ -3,10 +3,10 @@ import emojiSmiling from 'icons/_emoji_slightly_smiling_face.svg'; import emojiSmile from 'icons/_emoji_smile.svg'; import emojiSmiley from 'icons/_emoji_smiley.svg'; - import loadingIcon from '../../vue_shared/components/loading_icon.vue'; - import tooltip from '../../vue_shared/directives/tooltip'; import editSvg from 'icons/_icon_pencil.svg'; import ellipsisSvg from 'icons/_ellipsis_v.svg'; + import loadingIcon from '../../vue_shared/components/loading_icon.vue'; + import tooltip from '../../vue_shared/directives/tooltip'; export default { name: 'issueNoteActions', diff --git a/app/assets/javascripts/notes/components/issue_note_awards_list.vue b/app/assets/javascripts/notes/components/issue_note_awards_list.vue index 518042e39af..d42e61e3899 100644 --- a/app/assets/javascripts/notes/components/issue_note_awards_list.vue +++ b/app/assets/javascripts/notes/components/issue_note_awards_list.vue @@ -140,6 +140,10 @@ return title; }, handleAward(awardName) { + if (!this.isLoggedIn) { + return; + } + let parsedName; // 100 and 1234 emoji are a number. Callback for v-for click sends it as a string diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index b52ec9700d8..d8119d8ac2e 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -201,6 +201,7 @@ export const toggleAward = ({ commit, state, getters, dispatch }, { awardName, n export const toggleAwardRequest = ({ commit, getters, dispatch }, data) => { const { endpoint, awardName } = data; + return service .toggleAward(endpoint, { name: awardName }) .then(res => res.json()) |