Commit e0abe44f authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'noteable-note-ee-differences' into 'master'

Fixed EE differences in noteable_note.vue

Closes gitlab-ee#9972

See merge request gitlab-org/gitlab-ce!27128
parents 51d7ea47 b6a23cac
...@@ -4,6 +4,7 @@ import { mapGetters, mapActions } from 'vuex'; ...@@ -4,6 +4,7 @@ import { mapGetters, mapActions } from 'vuex';
import { escape } from 'underscore'; import { escape } from 'underscore';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import draftMixin from 'ee_else_ce/notes/mixins/draft';
import { s__, sprintf } from '../../locale'; import { s__, sprintf } from '../../locale';
import Flash from '../../flash'; import Flash from '../../flash';
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
...@@ -23,7 +24,7 @@ export default { ...@@ -23,7 +24,7 @@ export default {
noteBody, noteBody,
TimelineEntryItem, TimelineEntryItem,
}, },
mixins: [noteable, resolvable], mixins: [noteable, resolvable, draftMixin],
props: { props: {
note: { note: {
type: Object, type: Object,
...@@ -73,9 +74,6 @@ export default { ...@@ -73,9 +74,6 @@ export default {
'is-editable': this.note.current_user.can_edit, 'is-editable': this.note.current_user.can_edit,
}; };
}, },
canResolve() {
return this.note.resolvable && !!this.getUserData.id;
},
canReportAsAbuse() { canReportAsAbuse() {
return !!this.note.report_abuse_path && this.author.id !== this.getUserData.id; return !!this.note.report_abuse_path && this.author.id !== this.getUserData.id;
}, },
...@@ -156,12 +154,16 @@ export default { ...@@ -156,12 +154,16 @@ export default {
this.$refs.noteBody.resetAutoSave(); this.$refs.noteBody.resetAutoSave();
this.$emit('updateSuccess'); this.$emit('updateSuccess');
}, },
formUpdateHandler(noteText, parentElement, callback) { formUpdateHandler(noteText, parentElement, callback, resolveDiscussion) {
this.$emit('handleUpdateNote', { this.$emit('handleUpdateNote', {
note: this.note, note: this.note,
noteText, noteText,
resolveDiscussion,
callback: () => this.updateSuccess(), callback: () => this.updateSuccess(),
}); });
if (this.isDraft) return;
const data = { const data = {
endpoint: this.note.path, endpoint: this.note.path,
note: { note: {
...@@ -234,6 +236,7 @@ export default { ...@@ -234,6 +236,7 @@ export default {
<div class="timeline-content"> <div class="timeline-content">
<div class="note-header"> <div class="note-header">
<note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id"> <note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id">
<slot slot="note-header-info" name="note-header-info"></slot>
<span v-if="commit" v-html="actionText"></span> <span v-if="commit" v-html="actionText"></span>
<span v-else class="d-none d-sm-inline">&middot;</span> <span v-else class="d-none d-sm-inline">&middot;</span>
</note-header> </note-header>
...@@ -247,12 +250,15 @@ export default { ...@@ -247,12 +250,15 @@ export default {
:can-award-emoji="note.current_user.can_award_emoji" :can-award-emoji="note.current_user.can_award_emoji"
:can-delete="note.current_user.can_edit" :can-delete="note.current_user.can_edit"
:can-report-as-abuse="canReportAsAbuse" :can-report-as-abuse="canReportAsAbuse"
:can-resolve="note.current_user.can_resolve" :can-resolve="canResolve"
:report-abuse-path="note.report_abuse_path" :report-abuse-path="note.report_abuse_path"
:resolvable="note.resolvable" :resolvable="note.resolvable || note.isDraft"
:is-resolved="note.resolved" :is-resolved="note.resolved || note.resolve_discussion"
:is-resolving="isResolving" :is-resolving="isResolving"
:resolved-by="note.resolved_by" :resolved-by="note.resolved_by"
:is-draft="note.isDraft"
:resolve-discussion="note.isDraft && note.resolve_discussion"
:discussion-id="discussionId"
@handleEdit="editHandler" @handleEdit="editHandler"
@handleDelete="deleteHandler" @handleDelete="deleteHandler"
@handleResolve="resolveHandler" @handleResolve="resolveHandler"
......
export default {
computed: {
isDraft: () => false,
canResolve() {
return this.note.current_user.can_resolve;
},
},
};
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