Commit 787616d4 authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Update order of Vue properties to match docs.

parent cd5599a5
......@@ -24,17 +24,6 @@ export default {
isReplying: false,
};
},
computed: {
discussion() {
return this.note.notes[0];
},
author() {
return this.discussion.author;
},
canReply() {
return window.gl.issueData.current_user.can_create_note;
},
},
components: {
issueNote,
userAvatarLink,
......@@ -46,6 +35,17 @@ export default {
placeholderNote,
placeholderSystemNote,
},
computed: {
discussion() {
return this.note.notes[0];
},
author() {
return this.discussion.author;
},
canReply() {
return window.gl.issueData.current_user.can_create_note;
},
},
methods: {
componentName(note) {
if (note.isPlaceholderNote) {
......
......@@ -28,16 +28,16 @@ export default {
required: true,
},
},
computed: {
noteBody() {
return this.note.note;
},
},
components: {
issueNoteEditedText,
issueNoteAwardsList,
issueNoteForm,
},
computed: {
noteBody() {
return this.note.note;
},
},
methods: {
renderGFM() {
$(this.$refs['note-body']).renderGFM();
......
......@@ -36,18 +36,17 @@ export default {
conflictWhileEditing: false,
};
},
watch: {
noteBody() {
if (this.note === this.initialNote) {
this.note = this.noteBody;
} else {
this.conflictWhileEditing = true;
}
},
},
components: {
markdownField,
},
computed: {
isDirty() {
return this.initialNote !== this.note;
},
noteHash() {
return `#note_${this.noteId}`;
},
},
methods: {
handleUpdate() {
this.updateHandler({
......@@ -67,14 +66,6 @@ export default {
}
},
},
computed: {
isDirty() {
return this.initialNote !== this.note;
},
noteHash() {
return `#note_${this.noteId}`;
},
},
mounted() {
const issuableDataEl = document.getElementById('js-issuable-app-initial-data');
const issueData = JSON.parse(issuableDataEl.innerHTML.replace(/"/g, '"'));
......@@ -84,6 +75,15 @@ export default {
this.markdownPreviewUrl = markdownPreviewUrl;
this.$refs.textarea.focus();
},
watch: {
noteBody() {
if (this.note === this.initialNote) {
this.note = this.noteBody;
} else {
this.conflictWhileEditing = true;
}
},
},
};
</script>
......
......@@ -35,14 +35,14 @@ export default {
required: false,
},
},
components: {
timeAgoTooltip,
},
data() {
return {
isExpanded: true,
};
},
components: {
timeAgoTooltip,
},
computed: {
toggleChevronClass() {
return this.isExpanded ? 'fa-chevron-up' : 'fa-chevron-down';
......
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