diff options
-rw-r--r-- | app/assets/javascripts/notes/components/comment_form.vue (renamed from app/assets/javascripts/notes/components/issue_comment_form.vue) | 2 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/note_body.vue (renamed from app/assets/javascripts/notes/components/issue_note_body.vue) | 6 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/note_form.vue (renamed from app/assets/javascripts/notes/components/issue_note_form.vue) | 0 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/noteable_discussion.vue (renamed from app/assets/javascripts/notes/components/issue_discussion.vue) | 12 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/noteable_note.vue (renamed from app/assets/javascripts/notes/components/issue_note.vue) | 6 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/notes_app.vue (renamed from app/assets/javascripts/notes/components/issue_notes_app.vue) | 22 | ||||
-rw-r--r-- | app/assets/javascripts/notes/index.js | 6 | ||||
-rw-r--r-- | spec/javascripts/notes/components/comment_form_spec.js (renamed from spec/javascripts/notes/components/issue_comment_form_spec.js) | 2 | ||||
-rw-r--r-- | spec/javascripts/notes/components/note_app_spec.js (renamed from spec/javascripts/notes/components/issue_note_app_spec.js) | 6 | ||||
-rw-r--r-- | spec/javascripts/notes/components/note_body_spec.js (renamed from spec/javascripts/notes/components/issue_note_body_spec.js) | 2 | ||||
-rw-r--r-- | spec/javascripts/notes/components/note_form_spec.js (renamed from spec/javascripts/notes/components/issue_note_form_spec.js) | 2 | ||||
-rw-r--r-- | spec/javascripts/notes/components/noteable_discussion_spec.js (renamed from spec/javascripts/notes/components/issue_discussion_spec.js) | 4 | ||||
-rw-r--r-- | spec/javascripts/notes/components/noteable_note_spec.js (renamed from spec/javascripts/notes/components/issue_note_spec.js) | 2 |
13 files changed, 36 insertions, 36 deletions
diff --git a/app/assets/javascripts/notes/components/issue_comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 78986a450c2..e594377bc40 100644 --- a/app/assets/javascripts/notes/components/issue_comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -15,7 +15,7 @@ import issuableStateMixin from '../mixins/issuable_state'; export default { - name: 'issueCommentForm', + name: 'commentForm', data() { return { note: '', diff --git a/app/assets/javascripts/notes/components/issue_note_body.vue b/app/assets/javascripts/notes/components/note_body.vue index a16c5f6a785..ac4e1ffe53a 100644 --- a/app/assets/javascripts/notes/components/issue_note_body.vue +++ b/app/assets/javascripts/notes/components/note_body.vue @@ -2,7 +2,7 @@ import noteEditedText from './note_edited_text.vue'; import noteAwardsList from './note_awards_list.vue'; import noteAttachment from './note_attachment.vue'; - import issueNoteForm from './issue_note_form.vue'; + import noteForm from './note_form.vue'; import TaskList from '../../task_list'; import autosave from '../mixins/autosave'; @@ -29,7 +29,7 @@ noteEditedText, noteAwardsList, noteAttachment, - issueNoteForm, + noteForm, }, computed: { noteBody() { @@ -87,7 +87,7 @@ <div v-html="note.note_html" class="note-text md"></div> - <issue-note-form + <note-form v-if="isEditing" ref="noteForm" @handleFormUpdate="handleFormUpdate" diff --git a/app/assets/javascripts/notes/components/issue_note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index 4d527cb6643..4d527cb6643 100644 --- a/app/assets/javascripts/notes/components/issue_note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue diff --git a/app/assets/javascripts/notes/components/issue_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index 460fde9b62a..11e8f805635 100644 --- a/app/assets/javascripts/notes/components/issue_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -2,12 +2,12 @@ import { mapActions, mapGetters } from 'vuex'; import Flash from '../../flash'; import { SYSTEM_NOTE } from '../constants'; - import issueNote from './issue_note.vue'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; + import noteableNote from './noteable_note.vue'; import noteHeader from './note_header.vue'; import noteSignedOutWidget from './note_signed_out_widget.vue'; import noteEditedText from './note_edited_text.vue'; - import issueNoteForm from './issue_note_form.vue'; + import noteForm from './note_form.vue'; import placeholderNote from '../../vue_shared/components/notes/placeholder_note.vue'; import placeholderSystemNote from '../../vue_shared/components/notes/placeholder_system_note.vue'; import autosave from '../mixins/autosave'; @@ -25,12 +25,12 @@ }; }, components: { - issueNote, + noteableNote, userAvatarLink, noteHeader, noteSignedOutWidget, noteEditedText, - issueNoteForm, + noteForm, placeholderNote, placeholderSystemNote, }, @@ -86,7 +86,7 @@ return placeholderNote; } - return issueNote; + return noteableNote; }, componentData(note) { return note.isPlaceholderNote ? note.notes[0] : note; @@ -209,7 +209,7 @@ type="button" class="js-vue-discussion-reply btn btn-text-field" title="Add a reply">Reply...</button> - <issue-note-form + <note-form v-if="isReplying" save-button-title="Comment" :discussion="note" diff --git a/app/assets/javascripts/notes/components/issue_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index 8c81c5d6df3..32e0332b711 100644 --- a/app/assets/javascripts/notes/components/issue_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -4,7 +4,7 @@ import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import noteHeader from './note_header.vue'; import noteActions from './note_actions.vue'; - import issueNoteBody from './issue_note_body.vue'; + import noteBody from './note_body.vue'; import eventHub from '../event_hub'; export default { @@ -25,7 +25,7 @@ userAvatarLink, noteHeader, noteActions, - issueNoteBody, + noteBody, }, computed: { ...mapGetters([ @@ -173,7 +173,7 @@ @handleDelete="deleteHandler" /> </div> - <issue-note-body + <note-body :note="note" :can-edit="note.current_user.can_edit" :is-editing="isEditing" diff --git a/app/assets/javascripts/notes/components/issue_notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue index 4cfcffa2391..e526c2491f5 100644 --- a/app/assets/javascripts/notes/components/issue_notes_app.vue +++ b/app/assets/javascripts/notes/components/notes_app.vue @@ -3,16 +3,16 @@ import Flash from '../../flash'; import store from '../stores/'; import * as constants from '../constants'; - import issueNote from './issue_note.vue'; - import issueDiscussion from './issue_discussion.vue'; + import noteableNote from './noteable_note.vue'; + import noteableDiscussion from './noteable_discussion.vue'; import systemNote from '../../vue_shared/components/notes/system_note.vue'; - import issueCommentForm from './issue_comment_form.vue'; + import commentForm from './comment_form.vue'; import placeholderNote from '../../vue_shared/components/notes/placeholder_note.vue'; import placeholderSystemNote from '../../vue_shared/components/notes/placeholder_system_note.vue'; import loadingIcon from '../../vue_shared/components/loading_icon.vue'; export default { - name: 'issueNotesApp', + name: 'notesApp', props: { noteableData: { type: Object, @@ -35,10 +35,10 @@ }; }, components: { - issueNote, - issueDiscussion, + noteableNote, + noteableDiscussion, systemNote, - issueCommentForm, + commentForm, loadingIcon, placeholderNote, placeholderSystemNote, @@ -68,10 +68,10 @@ } return placeholderNote; } else if (note.individual_note) { - return note.notes[0].system ? systemNote : issueNote; + return note.notes[0].system ? systemNote : noteableNote; } - return issueDiscussion; + return noteableDiscussion; }, getComponentData(note) { return note.individual_note ? note.notes[0] : note; @@ -86,7 +86,7 @@ .then(() => this.checkLocationHash()) .catch(() => { this.isLoading = false; - Flash('Something went wrong while fetching issue comments. Please try again.'); + Flash('Something went wrong while fetching comments. Please try again.'); }); }, initPolling() { @@ -146,6 +146,6 @@ /> </ul> - <issue-comment-form /> + <comment-form /> </div> </template> diff --git a/app/assets/javascripts/notes/index.js b/app/assets/javascripts/notes/index.js index a94163a5f87..d250dd8d25b 100644 --- a/app/assets/javascripts/notes/index.js +++ b/app/assets/javascripts/notes/index.js @@ -1,10 +1,10 @@ import Vue from 'vue'; -import issueNotesApp from './components/issue_notes_app.vue'; +import notesApp from './components/notes_app.vue'; document.addEventListener('DOMContentLoaded', () => new Vue({ el: '#js-vue-notes', components: { - issueNotesApp, + notesApp, }, data() { const notesDataset = document.getElementById('js-vue-notes').dataset; @@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', () => new Vue({ }; }, render(createElement) { - return createElement('issue-notes-app', { + return createElement('notes-app', { props: { noteableData: this.noteableData, notesData: this.notesData, diff --git a/spec/javascripts/notes/components/issue_comment_form_spec.js b/spec/javascripts/notes/components/comment_form_spec.js index 04a7f8e32f1..20e352dd8bd 100644 --- a/spec/javascripts/notes/components/issue_comment_form_spec.js +++ b/spec/javascripts/notes/components/comment_form_spec.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import Autosize from 'autosize'; import store from '~/notes/stores'; -import issueCommentForm from '~/notes/components/issue_comment_form.vue'; +import issueCommentForm from '~/notes/components/comment_form.vue'; import { loggedOutnoteableData, notesDataMock, userDataMock, noteableDataMock } from '../mock_data'; import { keyboardDownEvent } from '../../issue_show/helpers'; diff --git a/spec/javascripts/notes/components/issue_note_app_spec.js b/spec/javascripts/notes/components/note_app_spec.js index 8e43037f356..a0352b6395e 100644 --- a/spec/javascripts/notes/components/issue_note_app_spec.js +++ b/spec/javascripts/notes/components/note_app_spec.js @@ -1,9 +1,9 @@ import Vue from 'vue'; -import issueNotesApp from '~/notes/components/issue_notes_app.vue'; +import notesApp from '~/notes/components/notes_app.vue'; import service from '~/notes/services/notes_service'; import * as mockData from '../mock_data'; -describe('issue_note_app', () => { +describe('note_app', () => { let mountComponent; let vm; @@ -20,7 +20,7 @@ describe('issue_note_app', () => { }; beforeEach(() => { - const IssueNotesApp = Vue.extend(issueNotesApp); + const IssueNotesApp = Vue.extend(notesApp); mountComponent = (data) => { const props = data || { diff --git a/spec/javascripts/notes/components/issue_note_body_spec.js b/spec/javascripts/notes/components/note_body_spec.js index 37aad50737b..b42e7943b98 100644 --- a/spec/javascripts/notes/components/issue_note_body_spec.js +++ b/spec/javascripts/notes/components/note_body_spec.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import store from '~/notes/stores'; -import noteBody from '~/notes/components/issue_note_body.vue'; +import noteBody from '~/notes/components/note_body.vue'; import { noteableDataMock, notesDataMock, note } from '../mock_data'; describe('issue_note_body component', () => { diff --git a/spec/javascripts/notes/components/issue_note_form_spec.js b/spec/javascripts/notes/components/note_form_spec.js index d42ef239711..86e9e2a32a9 100644 --- a/spec/javascripts/notes/components/issue_note_form_spec.js +++ b/spec/javascripts/notes/components/note_form_spec.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import store from '~/notes/stores'; -import issueNoteForm from '~/notes/components/issue_note_form.vue'; +import issueNoteForm from '~/notes/components/note_form.vue'; import { noteableDataMock, notesDataMock } from '../mock_data'; import { keyboardDownEvent } from '../../issue_show/helpers'; diff --git a/spec/javascripts/notes/components/issue_discussion_spec.js b/spec/javascripts/notes/components/noteable_discussion_spec.js index b6ae55d44f5..19504e4f7c8 100644 --- a/spec/javascripts/notes/components/issue_discussion_spec.js +++ b/spec/javascripts/notes/components/noteable_discussion_spec.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import store from '~/notes/stores'; -import issueDiscussion from '~/notes/components/issue_discussion.vue'; +import issueDiscussion from '~/notes/components/noteable_discussion.vue'; import { noteableDataMock, discussionMock, notesDataMock } from '../mock_data'; describe('issue_discussion component', () => { @@ -30,7 +30,7 @@ describe('issue_discussion component', () => { it('should render discussion header', () => { expect(vm.$el.querySelector('.discussion-header')).toBeDefined(); - expect(vm.$el.querySelectorAll('.notes li').length).toEqual(discussionMock.notes.length); + expect(vm.$el.querySelector('.notes').children.length).toEqual(discussionMock.notes.length); }); describe('actions', () => { diff --git a/spec/javascripts/notes/components/issue_note_spec.js b/spec/javascripts/notes/components/noteable_note_spec.js index 73fd188dbe5..623a2d6d9d7 100644 --- a/spec/javascripts/notes/components/issue_note_spec.js +++ b/spec/javascripts/notes/components/noteable_note_spec.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import store from '~/notes/stores'; -import issueNote from '~/notes/components/issue_note.vue'; +import issueNote from '~/notes/components/noteable_note.vue'; import { noteableDataMock, notesDataMock, note } from '../mock_data'; describe('issue_note', () => { |