summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-08-29 13:37:12 +0200
committerTim Zallmann <tzallmann@gitlab.com>2018-09-07 12:25:50 +0200
commit53def4e2ee2cffcf7d5106e1e8dd0505a641a018 (patch)
tree72ad4da909c33305a1965d9899035416fff3833f /app/assets/javascripts/diffs/components
parent6f46b274e66908860833521a7b1e440e9acc4aaa (diff)
downloadgitlab-ce-53def4e2ee2cffcf7d5106e1e8dd0505a641a018.tar.gz
Adding new threads to MR page
Diffstat (limited to 'app/assets/javascripts/diffs/components')
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_gutter_content.vue2
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_note_form.vue11
2 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
index 07a34946b06..f1299408904 100644
--- a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
@@ -105,7 +105,7 @@ export default {
methods: {
...mapActions('diffs', ['loadMoreLines', 'showCommentForm']),
handleCommentButton() {
- this.showCommentForm({ lineCode: this.line.code });
+ this.showCommentForm({ lineCode: this.line.lineCode });
},
handleLoadMoreLines() {
if (this.isRequesting) {
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
index cbe4551d06b..572c9457fc2 100644
--- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
@@ -6,6 +6,7 @@ import noteForm from '../../notes/components/note_form.vue';
import { getNoteFormData } from '../store/utils';
import autosave from '../../notes/mixins/autosave';
import { DIFF_NOTE_TYPE } from '../constants';
+import * as utils from '../../notes/stores/utils';
export default {
components: {
@@ -52,7 +53,7 @@ export default {
}
},
methods: {
- ...mapActions('diffs', ['cancelCommentForm']),
+ ...mapActions('diffs', ['cancelCommentForm', 'assignDiscussionsToDiff']),
...mapActions(['saveNote', 'refetchDiscussionById']),
handleCancelCommentForm(shouldConfirm, isDirty) {
if (shouldConfirm && isDirty) {
@@ -88,7 +89,13 @@ export default {
const endpoint = this.getNotesDataByProp('discussionsPath');
this.refetchDiscussionById({ path: endpoint, discussionId: result.discussion_id })
- .then(() => {
+ .then(selectedDiscussion => {
+ //debugger;
+ console.log('SEL DISCUSSION: ', selectedDiscussion);
+ const lineCodeDiscussions = utils.reduceDiscussionsToLineCodes([selectedDiscussion]);
+ console.log('LINE CODE DISCUSSIONS: ', lineCodeDiscussions);
+ this.assignDiscussionsToDiff(lineCodeDiscussions);
+
this.handleCancelCommentForm();
})
.catch(() => {