Move EE differences for `app/assets/javascripts/notes/components/noteable_note.vue`
The file `` has differences between CE and EE.
Differences
diff --git a/home/yorickpeterse/Projects/gitlab/gdk-ce/gitlab/app/assets/javascripts/notes/components/noteable_note.vue b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/app/assets/javascripts/notes/components/noteable_note.vue
index 3c48d81ed05..8077d63f663 100644
--- a/home/yorickpeterse/Projects/gitlab/gdk-ce/gitlab/app/assets/javascripts/notes/components/noteable_note.vue
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/app/assets/javascripts/notes/components/noteable_note.vue
@@ -145,12 +145,16 @@ export default {
this.$refs.noteBody.resetAutoSave();
this.$emit('updateSuccess');
},
- formUpdateHandler(noteText, parentElement, callback) {
+ formUpdateHandler(noteText, parentElement, callback, resolveDiscussion) {
this.$emit('handleUpdateNote', {
note: this.note,
noteText,
+ resolveDiscussion,
callback: () => this.updateSuccess(),
});
+
+ if (this.note.isDraft) return;
+
const data = {
endpoint: this.note.path,
note: {
@@ -223,6 +227,7 @@ export default {
<div class="timeline-content">
<div class="note-header">
<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-else class="d-none d-sm-inline">·</span>
</note-header>
@@ -235,12 +240,16 @@ export default {
:can-award-emoji="note.current_user.can_award_emoji"
:can-delete="note.current_user.can_edit"
:can-report-as-abuse="canReportAsAbuse"
- :can-resolve="note.current_user.can_resolve"
+ :can-resolve="
+ note.current_user.can_resolve || (note.isDraft && note.discussion_id !== null)
+ "
:report-abuse-path="note.report_abuse_path"
- :resolvable="note.resolvable"
- :is-resolved="note.resolved"
+ :resolvable="note.resolvable || note.isDraft"
+ :is-resolved="note.resolved || note.resolve_discussion"
:is-resolving="isResolving"
:resolved-by="note.resolved_by"
+ :discussion-id="note.isDraft && note.discussion_id"
+ :resolve-discussion="note.isDraft && note.resolve_discussion"
@handleEdit="editHandler"
@handleDelete="deleteHandler"
@handleResolve="resolveHandler"
What needs to be done Guarantee that specs exist or are added
- Create a mixin in
ee/
folder - Create a backport for CE
- Use
ee_else_ce
to import the mixin into this file. - Move the script tags differences into the mixins
- Create computed properties in the mixins to handle the following differences:
:can-resolve="note.current_user.can_resolve"
+ :can-resolve="
+ note.current_user.can_resolve || (note.isDraft && note.discussion_id !== null)
+ "
:report-abuse-path="note.report_abuse_path"
- :resolvable="note.resolvable"
- :is-resolved="note.resolved"
+ :resolvable="note.resolvable || note.isDraft"
+ :is-resolved="note.resolved || note.resolve_discussion"
:is-resolving="isResolving"
:resolved-by="note.resolved_by"
+ :discussion-id="note.isDraft && note.discussion_id"
+ :resolve-discussion="note.isDraft && note.resolve_discussion"
- Add a
v-if
withrenderIfExists
to<slot slot="note-header-info" name="note-header-info"></slot>
- Guarantee that specs exist or are added