diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-19 20:57:17 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-19 20:57:17 +0000 |
commit | d82f90cd6cf1f12cb5f72ff9ac9417c10ea9c920 (patch) | |
tree | b7f9ff5e436ae85ff7cd3effca1d766e3ecb07dc | |
parent | bf344a4abca5675aec8ed0122f3cb213c4ad96e8 (diff) | |
parent | b2f43b799d109c37de86e67df68a087e9b629d4a (diff) | |
download | gitlab-ce-d82f90cd6cf1f12cb5f72ff9ac9417c10ea9c920.tar.gz |
Merge branch '_mr-refactor-part-4' into '_mr-refector-review-target'
MR Diffs Refactor Part 04: Minor refactor on old code.
See merge request gitlab-org/gitlab-ce!17848
6 files changed, 20 insertions, 10 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_counter.vue b/app/assets/javascripts/notes/components/discussion_counter.vue index d492d1cd001..cbe4774a360 100644 --- a/app/assets/javascripts/notes/components/discussion_counter.vue +++ b/app/assets/javascripts/notes/components/discussion_counter.vue @@ -86,7 +86,7 @@ export default { v-html="resolveSvg" ></span> </span> - <span class=".line-resolve-text"> + <span class="line-resolve-text"> {{ resolvedDiscussionCount }}/{{ discussionCount }} {{ countText }} resolved </span> </div> diff --git a/app/assets/javascripts/notes/components/note_body.vue b/app/assets/javascripts/notes/components/note_body.vue index 069f94c5845..1bd0a1bd8f3 100644 --- a/app/assets/javascripts/notes/components/note_body.vue +++ b/app/assets/javascripts/notes/components/note_body.vue @@ -72,7 +72,7 @@ export default { this.$emit('handleFormUpdate', note, parentElement, callback); }, formCancelHandler(shouldConfirm, isDirty) { - this.$emit('cancelFormEdition', shouldConfirm, isDirty); + this.$emit('cancelForm', shouldConfirm, isDirty); }, }, }; @@ -90,7 +90,7 @@ export default { v-if="isEditing" ref="noteForm" @handleFormUpdate="handleFormUpdate" - @cancelFormEdition="formCancelHandler" + @cancelForm="formCancelHandler" :is-editing="isEditing" :note-body="noteBody" :note-id="note.id" diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index c59a2e7a406..da50fcb70e8 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -124,7 +124,7 @@ export default { cancelHandler(shouldConfirm = false) { // Sends information about confirm message and if the textarea has changed this.$emit( - 'cancelFormEdition', + 'cancelForm', shouldConfirm, this.noteBody !== this.updatedNoteBody, ); diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index cf579c5d4dc..c78dc464bdb 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -149,10 +149,10 @@ export default { }, cancelReplyForm(shouldConfirm) { if (shouldConfirm && this.$refs.noteForm.isDirty) { - const msg = 'Are you sure you want to cancel creating this comment?'; - // eslint-disable-next-line no-alert - if (!confirm(msg)) { + if ( + !confirm('Are you sure you want to cancel creating this comment?') + ) { return; } } @@ -332,7 +332,7 @@ Please check your network connection and try again.`; :note="note" :is-editing="false" @handleFormUpdate="saveReply" - @cancelFormEdition="cancelReplyForm" + @cancelForm="cancelReplyForm" ref="noteForm" /> <note-signed-out-widget v-if="!canReply" /> </div> diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index 3554027d2b4..730983ca1fd 100644 --- a/app/assets/javascripts/notes/components/noteable_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -154,7 +154,8 @@ export default { class="note timeline-entry" :id="noteAnchorId" :class="classNameBindings" - :data-award-url="note.toggle_award_path"> + :data-award-url="note.toggle_award_path" + > <div class="timeline-entry-inner"> <div class="timeline-icon"> <user-avatar-link @@ -194,7 +195,7 @@ export default { :can-edit="note.current_user.can_edit" :is-editing="isEditing" @handleFormUpdate="formUpdateHandler" - @cancelFormEdition="formCancelHandler" + @cancelForm="formCancelHandler" ref="noteBody" /> </div> diff --git a/spec/javascripts/helpers/index.js b/spec/javascripts/helpers/index.js new file mode 100644 index 00000000000..f15b0532a2b --- /dev/null +++ b/spec/javascripts/helpers/index.js @@ -0,0 +1,9 @@ +import mountComponent from './vue_mount_component_helper'; + +export { + mountComponent, +}; + +export default { + mountComponent, +}; |