diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-08-11 15:28:46 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-08-11 15:54:56 +0100 |
commit | b96a3d4d60747102bc437c99b4d040c5c0329689 (patch) | |
tree | 46431fe817e9788eb74aa7659b5e61491738941a /app/assets/javascripts/notes | |
parent | b38e690344a3d37e3be0305c88ea96adbc82aca6 (diff) | |
download | gitlab-ce-b96a3d4d60747102bc437c99b4d040c5c0329689.tar.gz |
Fix open discussions
Put back deleted tests
Diffstat (limited to 'app/assets/javascripts/notes')
4 files changed, 18 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes/components/issue_discussion.vue b/app/assets/javascripts/notes/components/issue_discussion.vue index 54bc607c431..58770111378 100644 --- a/app/assets/javascripts/notes/components/issue_discussion.vue +++ b/app/assets/javascripts/notes/components/issue_discussion.vue @@ -1,5 +1,5 @@ <script> - /* global Flash, Autosave */ + /* global Flash */ import { mapActions, mapGetters } from 'vuex'; import { SYSTEM_NOTE } from '../constants'; import issueNote from './issue_note.vue'; 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 b44be05c8eb..f6d27e0a0ae 100644 --- a/app/assets/javascripts/notes/components/issue_note_awards_list.vue +++ b/app/assets/javascripts/notes/components/issue_note_awards_list.vue @@ -140,11 +140,25 @@ return title; }, handleAward(awardName) { + let parsedName; + + // 100 and 1234 emoji are a number. Callback for v-for click sends it as a string + switch(awardName) { + case '100': + parsedName = 100; + break; + case '1234': + parsedName = 1234; + break; + default: + parsedName = awardName; + break; + } + const data = { endpoint: this.toggleAwardPath, noteId: this.noteId, - // 100 emoji is a number. Callback for v-for click sends it as a string - awardName: awardName === '100' ? 100 : awardName, + awardName: parsedName, }; this.toggleAwardRequest(data) diff --git a/app/assets/javascripts/notes/components/issue_note_form.vue b/app/assets/javascripts/notes/components/issue_note_form.vue index fcfeb17edb5..fb6e16c5590 100644 --- a/app/assets/javascripts/notes/components/issue_note_form.vue +++ b/app/assets/javascripts/notes/components/issue_note_form.vue @@ -129,7 +129,6 @@ :quick-actions-docs="quickActionsDocsUrl" :add-spacing-classes="false"> <textarea - id="note-body" name="note[note]" class="note-textarea js-gfm-input js-autosize markdown-area js-vue-issue-note-form" :data-supports-quick-actions="!isEditing" diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index bb9c2c53b79..b52ec9700d8 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -86,7 +86,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => { const { errors } = res; const commandsChanges = res.commands_changes; - if (hasQuickActions && Object.keys(errors).length) { + if (hasQuickActions && errors && Object.keys(errors).length) { dispatch('fetchData'); $('.js-gfm-input').trigger('clear-commands-cache.atwho'); |