Commit d8ebcb74 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Fix toggle discussion

parent 91481002
<script>
/* global Flash */
import { mapActions, mapMutations } from 'vuex';
import { TOGGLE_DISCUSSION } from '../stores/mutation_types';
import { mapActions } from 'vuex';
import { SYSTEM_NOTE } from '../constants';
import issueNote from './issue_note.vue';
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
......@@ -51,10 +50,8 @@
methods: {
...mapActions([
'saveNote',
'toggleDiscussion'
]),
...mapMutations({
toggleDiscussion: TOGGLE_DISCUSSION,
}),
componentName(note) {
if (note.isPlaceholderNote) {
if (note.placeholderType === SYSTEM_NOTE) {
......@@ -68,7 +65,7 @@
componentData(note) {
return note.isPlaceholderNote ? note.notes[0] : note;
},
toggleDiscussion() {
toggleDiscussionHandler() {
this.toggleDiscussion({ discussionId: this.note.id });
},
showReplyForm() {
......@@ -128,7 +125,7 @@
:created-at="discussion.created_at"
:note-id="discussion.id"
:include-toggle="true"
:toggle-handler="toggleDiscussion"
:toggle-handler="toggleDiscussionHandler"
action-text="started a discussion"
/>
<issue-note-edited-text
......
......@@ -82,7 +82,7 @@
full_data: true,
target_type: 'issue',
target_id: this.note.noteable_id,
note,
note: { note: note },
},
};
......
......@@ -14,6 +14,7 @@ export const setUserData = ({ commit }, data) => commit(types.SET_USER_DATA, dat
export const setLastFetchedAt = ({ commit }, data) => commit(types.SET_LAST_FETCHED_AT, data);
export const setInitialNotes = ({ commit }, data) => commit(types.SET_INITAL_NOTES, data);
export const setTargetNoteHash = ({ commit }, data) => commit(types.SET_TARGET_NOTE_HASH, data);
export const toggleDiscussion = ({ commit }, data) => commit(types.TOGGLE_DISCUSSION, data);
export const fetchNotes = ({ commit }, path) => service
.fetchNotes(path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment