diff options
author | Natalia Tepluhina <ntepluhina@gitlab.com> | 2019-07-09 04:22:48 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-07-09 04:22:48 +0000 |
commit | 9613a34a24bda78661ce74348ceb55d1e3b50b53 (patch) | |
tree | a19d31bb8c5c1266bf0b66e96cc4ee72817bd007 /app/assets/javascripts | |
parent | 56e3fc40b80b8f2231f15d57c73d3f5995f01eca (diff) | |
download | gitlab-ce-9613a34a24bda78661ce74348ceb55d1e3b50b53.tar.gz |
Fixed editing form
- applied functional component patch
- fixed border radius for list
- fixed Karma test to take a correct li amount
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/notes/components/discussion_notes.vue | 8 | ||||
-rw-r--r-- | app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue | 27 |
2 files changed, 31 insertions, 4 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_notes.vue b/app/assets/javascripts/notes/components/discussion_notes.vue index 2ff0fee62f3..0b136549c14 100644 --- a/app/assets/javascripts/notes/components/discussion_notes.vue +++ b/app/assets/javascripts/notes/components/discussion_notes.vue @@ -8,12 +8,14 @@ import SystemNote from '~/vue_shared/components/notes/system_note.vue'; import NoteableNote from './noteable_note.vue'; import ToggleRepliesWidget from './toggle_replies_widget.vue'; import NoteEditedText from './note_edited_text.vue'; +import DiscussionNotesRepliesWrapper from './discussion_notes_replies_wrapper.vue'; export default { name: 'DiscussionNotes', components: { ToggleRepliesWidget, NoteEditedText, + DiscussionNotesRepliesWrapper, }, props: { discussion: { @@ -119,9 +121,7 @@ export default { /> <slot slot="avatar-badge" name="avatar-badge"></slot> </component> - <div - :class="discussion.diff_discussion ? 'discussion-collapsible bordered-box clearfix' : ''" - > + <discussion-notes-replies-wrapper :is-diff-discussion="discussion.diff_discussion"> <toggle-replies-widget v-if="hasReplies" :collapsed="!isExpanded" @@ -141,7 +141,7 @@ export default { /> </template> <slot :show-replies="isExpanded || !hasReplies" name="footer"></slot> - </div> + </discussion-notes-replies-wrapper> </template> <template v-else> <component diff --git a/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue b/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue new file mode 100644 index 00000000000..2ddca56ddd5 --- /dev/null +++ b/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue @@ -0,0 +1,27 @@ +<script> +/** + * Wrapper for discussion notes replies section. + * + * This is a functional component using the render method because in some cases + * the wrapper is not needed and we want to simply render along the children. + */ +export default { + functional: true, + props: { + isDiffDiscussion: { + type: Boolean, + required: false, + default: false, + }, + }, + render(h, { props, children }) { + if (props.isDiffDiscussion) { + return h('li', { class: 'discussion-collapsible bordered-box clearfix' }, [ + h('ul', { class: 'notes' }, children), + ]); + } + + return children; + }, +}; +</script> |