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