Commit 4914f003 authored by Phil Hughes's avatar Phil Hughes

Fixed EE differences in noteable_note.vue

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9972
parent f4c80603
...@@ -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;
}, },
...@@ -164,7 +162,7 @@ export default { ...@@ -164,7 +162,7 @@ export default {
callback: () => this.updateSuccess(), callback: () => this.updateSuccess(),
}); });
if (this.note.isDraft) return; if (this.isDraft) return;
const data = { const data = {
endpoint: this.note.path, endpoint: this.note.path,
...@@ -252,9 +250,7 @@ export default { ...@@ -252,9 +250,7 @@ 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=" :can-resolve="canResolve"
note.current_user.can_resolve || (note.isDraft && note.discussion_id !== null)
"
:report-abuse-path="note.report_abuse_path" :report-abuse-path="note.report_abuse_path"
:resolvable="note.resolvable || note.isDraft" :resolvable="note.resolvable || note.isDraft"
:is-resolved="note.resolved || note.resolve_discussion" :is-resolved="note.resolved || note.resolve_discussion"
......
export default {
computed: {
isDraft: () => false,
canResolve() {
return this.note.current_user.can_resolve;
},
},
};
export default {
computed: {
isDraft() {
return this.note.isDraft;
},
canResolve() {
return (
this.note.current_user.can_resolve ||
(this.note.isDraft && this.note.discussion_id !== null)
);
},
},
};
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