diff options
Diffstat (limited to 'app/assets/javascripts/notes/components/note_form.vue')
-rw-r--r-- | app/assets/javascripts/notes/components/note_form.vue | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index 31ee8fed984..95164183ccb 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -48,13 +48,19 @@ export default { required: false, default: '', }, + resolveDiscussion: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { updatedNoteBody: this.noteBody, conflictWhileEditing: false, isSubmitting: false, - isResolving: false, + isResolving: this.resolveDiscussion, + isUnresolving: !this.resolveDiscussion, resolveAsThread: true, }; }, @@ -146,27 +152,14 @@ export default { </script> <template> - <div - ref="editNoteForm" - class="note-edit-form current-note-edit-form js-discussion-note-form"> - <div - v-if="conflictWhileEditing" - class="js-conflict-edit-warning alert alert-danger"> + <div ref="editNoteForm" class="note-edit-form current-note-edit-form js-discussion-note-form"> + <div v-if="conflictWhileEditing" class="js-conflict-edit-warning alert alert-danger"> This comment has changed since you started editing, please review the - <a - :href="noteHash" - target="_blank" - rel="noopener noreferrer"> - updated comment - </a> - to ensure information is not lost. + <a :href="noteHash" target="_blank" rel="noopener noreferrer">updated comment</a> to ensure + information is not lost. </div> <div class="flash-container timeline-content"></div> - <form - :data-line-code="lineCode" - class="edit-note common-note-form js-quick-submit gfm-form" - > - + <form :data-line-code="lineCode" class="edit-note common-note-form js-quick-submit gfm-form"> <issue-warning v-if="hasWarning(getNoteableData)" :is-locked="isLocked(getNoteableData)" @@ -178,7 +171,8 @@ export default { :markdown-docs-path="markdownDocsPath" :markdown-version="markdownVersion" :quick-actions-docs-path="quickActionsDocsPath" - :add-spacing-classes="false"> + :add-spacing-classes="false" + > <textarea id="note_note" ref="textarea" @@ -186,35 +180,36 @@ export default { v-model="updatedNoteBody" :data-supports-quick-actions="!isEditing" name="note[note]" - class="note-textarea js-gfm-input js-note-text -js-autosize markdown-area js-vue-issue-note-form js-vue-textarea qa-reply-input" + class="note-textarea js-gfm-input js-note-text js-autosize markdown-area js-vue-issue-note-form js-vue-textarea qa-reply-input" aria-label="Description" placeholder="Write a comment or drag your files hereā¦" - @keydown.meta.enter="handleUpdate()" - @keydown.ctrl.enter="handleUpdate()" - @keydown.up="editMyLastNote()" - @keydown.esc="cancelHandler(true)"> - </textarea> + @keydown.meta.enter="handleUpdate();" + @keydown.ctrl.enter="handleUpdate();" + @keydown.up="editMyLastNote();" + @keydown.esc="cancelHandler(true);" + ></textarea> </markdown-field> <div class="note-form-actions clearfix"> <button :disabled="isDisabled" type="button" - class="js-vue-issue-save btn btn-success js-comment-button " - @click="handleUpdate()"> + class="js-vue-issue-save btn btn-success js-comment-button" + @click="handleUpdate();" + > {{ saveButtonTitle }} </button> <button v-if="discussion.resolvable" class="btn btn-nr btn-default append-right-10 js-comment-resolve-button" - @click.prevent="handleUpdate(true)" + @click.prevent="handleUpdate(true);" > {{ resolveButtonTitle }} </button> <button class="btn btn-cancel note-edit-cancel js-close-discussion-note-form" type="button" - @click="cancelHandler()"> + @click="cancelHandler();" + > Cancel </button> </div> |