summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-09-17 09:49:52 +0100
committerAndré Luís <aluis@gitlab.com>2018-09-21 11:59:44 +0100
commite3cc9d53d2fb69be8a79daacaecb28d45280880a (patch)
tree73bdd4a0791b6104282e88df4ebdcd15f5364fb4
parent2497c29ef0d1e178c8b3aa96e8304ee6765bae4e (diff)
downloadgitlab-ce-e3cc9d53d2fb69be8a79daacaecb28d45280880a.tar.gz
Fixed karma spec for getNoteFormData
Fixed toggling new notes caused by not returning the stores discussion
-rw-r--r--app/assets/javascripts/notes/stores/actions.js4
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/javascripts/diffs/store/utils_spec.js1
3 files changed, 3 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 62b36f300ff..320dfa47d5a 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -44,10 +44,10 @@ export const fetchDiscussions = ({ commit }, path) =>
commit(types.SET_INITIAL_DISCUSSIONS, discussions);
});
-export const updateDiscussion = ({ commit }, discussion) => {
+export const updateDiscussion = ({ commit, state }, discussion) => {
commit(types.UPDATE_DISCUSSION, discussion);
- return discussion;
+ return utils.findNoteObjectById(state.discussions, discussion.id);
};
export const deleteNote = ({ commit, dispatch }, note) =>
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a55cf9c5927..d3c34b2838c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3687,9 +3687,6 @@ msgstr ""
msgid "MergeRequests|Toggle comments for this file"
msgstr ""
-msgid "MergeRequests|Updating discussions failed"
-msgstr ""
-
msgid "MergeRequests|View file @ %{commitId}"
msgstr ""
diff --git a/spec/javascripts/diffs/store/utils_spec.js b/spec/javascripts/diffs/store/utils_spec.js
index 6138b9701f4..06254dde852 100644
--- a/spec/javascripts/diffs/store/utils_spec.js
+++ b/spec/javascripts/diffs/store/utils_spec.js
@@ -136,6 +136,7 @@ describe('DiffsStoreUtils', () => {
note_project_id: '',
target_type: options.noteableType,
target_id: options.noteableData.id,
+ return_discussion: 'true',
note: {
noteable_type: options.noteableType,
noteable_id: options.noteableData.id,