diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-05-31 22:07:24 +0200 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2018-06-05 09:54:05 +0200 |
commit | cade9c5fdca54d8ed60f7e542c9d56c361239d92 (patch) | |
tree | 6fab2adf2dc038c1ea9eb2d8fadd3851dc584961 | |
parent | 6bd39ee53feb162190384c37258d4ec907e64e52 (diff) | |
download | gitlab-ce-cade9c5fdca54d8ed60f7e542c9d56c361239d92.tar.gz |
Fix linting
-rw-r--r-- | app/assets/javascripts/notes/components/noteable_discussion.vue | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index b2c9370bff2..3b6f9687b00 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -3,7 +3,7 @@ import _ from 'underscore'; import { mapActions, mapGetters } from 'vuex'; import resolveDiscussionsSvg from 'icons/_icon_mr_issue.svg'; import nextDiscussionsSvg from 'icons/_next_discussion.svg'; -import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +import { convertObjectPropsToCamelCase, scrollToElement } from '~/lib/utils/common_utils'; import Flash from '../../flash'; import { SYSTEM_NOTE } from '../constants'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; @@ -19,7 +19,6 @@ import autosave from '../mixins/autosave'; import noteable from '../mixins/noteable'; import resolvable from '../mixins/resolvable'; import tooltip from '../../vue_shared/directives/tooltip'; -import { scrollToElement } from '../../lib/utils/common_utils'; export default { name: 'NoteableDiscussion', @@ -150,6 +149,13 @@ export default { wrapperComponent() { return this.shouldRenderDiffs ? diffWithNote : 'div'; }, + wrapperComponentProps() { + if (this.shouldRenderDiffs) { + return { discussion: convertObjectPropsToCamelCase(this.discussion) }; + } + + return {}; + }, wrapperClass() { return this.isDiffDiscussion ? '' : 'card discussion-wrapper'; }, @@ -180,7 +186,6 @@ export default { 'toggleResolveNote', 'expandDiscussion', ]), - convertObjectPropsToCamelCase, componentName(note) { if (note.isPlaceholderNote) { if (note.placeholderType === SYSTEM_NOTE) { @@ -312,7 +317,7 @@ Please check your network connection and try again.`; class="discussion-body"> <component :is="wrapperComponent" - :discussion="shouldRenderDiffs ? convertObjectPropsToCamelCase(discussion) : undefined" + v-bind="wrapperComponentProps" :class="wrapperClass" > <div class="discussion-notes"> |