Commit c4dcab3b authored by Winnie Hellmann's avatar Winnie Hellmann

Run Prettier on app/assets/javascripts/notes/components/noteable_discussion.vue

parent 1454b8c1
...@@ -314,159 +314,159 @@ Please check your network connection and try again.`; ...@@ -314,159 +314,159 @@ Please check your network connection and try again.`;
<template> <template>
<timeline-entry-item class="note note-discussion" :class="componentClassName"> <timeline-entry-item class="note note-discussion" :class="componentClassName">
<div :data-discussion-id="discussion.id" class="discussion js-discussion-container"> <div :data-discussion-id="discussion.id" class="discussion js-discussion-container">
<div v-if="shouldRenderDiffs" class="discussion-header note-wrapper"> <div v-if="shouldRenderDiffs" class="discussion-header note-wrapper">
<div v-once class="timeline-icon"> <div v-once class="timeline-icon">
<user-avatar-link <user-avatar-link
v-if="author" v-if="author"
:link-href="author.path" :link-href="author.path"
:img-src="author.avatar_url" :img-src="author.avatar_url"
:img-alt="author.name" :img-alt="author.name"
:img-size="40" :img-size="40"
/>
</div>
<note-header
:author="author"
:created-at="initialDiscussion.created_at"
:note-id="initialDiscussion.id"
:include-toggle="true"
:expanded="discussion.expanded"
@toggleHandler="toggleDiscussionHandler"
>
<span v-html="actionText"></span>
</note-header>
<note-edited-text
v-if="discussion.resolved"
:edited-at="discussion.resolved_at"
:edited-by="discussion.resolved_by"
:action-text="resolvedText"
class-name="discussion-headline-light js-discussion-headline"
/>
<note-edited-text
v-else-if="lastUpdatedAt"
:edited-at="lastUpdatedAt"
:edited-by="lastUpdatedBy"
action-text="Last updated"
class-name="discussion-headline-light js-discussion-headline"
/> />
</div> </div>
<div v-if="shouldShowDiscussions" class="discussion-body"> <note-header
<component :author="author"
:is="wrapperComponent" :created-at="initialDiscussion.created_at"
v-bind="wrapperComponentProps" :note-id="initialDiscussion.id"
class="card discussion-wrapper" :include-toggle="true"
> :expanded="discussion.expanded"
<div class="discussion-notes"> @toggleHandler="toggleDiscussionHandler"
<ul class="notes"> >
<template v-if="shouldGroupReplies"> <span v-html="actionText"></span>
<component </note-header>
:is="componentName(initialDiscussion)" <note-edited-text
:note="componentData(initialDiscussion)" v-if="discussion.resolved"
@handleDeleteNote="deleteNoteHandler" :edited-at="discussion.resolved_at"
> :edited-by="discussion.resolved_by"
<slot slot="avatar-badge" name="avatar-badge"></slot> :action-text="resolvedText"
</component> class-name="discussion-headline-light js-discussion-headline"
<toggle-replies-widget />
v-if="hasReplies" <note-edited-text
:collapsed="isRepliesCollapsed" v-else-if="lastUpdatedAt"
:replies="replies" :edited-at="lastUpdatedAt"
@toggle="toggleReplies" :edited-by="lastUpdatedBy"
/> action-text="Last updated"
<template v-if="!isRepliesCollapsed"> class-name="discussion-headline-light js-discussion-headline"
<component />
:is="componentName(note)" </div>
v-for="note in replies" <div v-if="shouldShowDiscussions" class="discussion-body">
:key="note.id" <component
:note="componentData(note)" :is="wrapperComponent"
@handleDeleteNote="deleteNoteHandler" v-bind="wrapperComponentProps"
/> class="card discussion-wrapper"
</template> >
</template> <div class="discussion-notes">
<template v-else> <ul class="notes">
<template v-if="shouldGroupReplies">
<component
:is="componentName(initialDiscussion)"
:note="componentData(initialDiscussion)"
@handleDeleteNote="deleteNoteHandler"
>
<slot slot="avatar-badge" name="avatar-badge"></slot>
</component>
<toggle-replies-widget
v-if="hasReplies"
:collapsed="isRepliesCollapsed"
:replies="replies"
@toggle="toggleReplies"
/>
<template v-if="!isRepliesCollapsed">
<component <component
:is="componentName(note)" :is="componentName(note)"
v-for="(note, index) in discussion.notes" v-for="note in replies"
:key="note.id" :key="note.id"
:note="componentData(note)" :note="componentData(note)"
@handleDeleteNote="deleteNoteHandler" @handleDeleteNote="deleteNoteHandler"
> />
<slot v-if="index === 0" slot="avatar-badge" name="avatar-badge"></slot>
</component>
</template> </template>
</ul> </template>
<draft-note <template v-else>
v-if="showDraft(discussion.reply_id)" <component
:key="`draft_${discussion.id}`" :is="componentName(note)"
:draft="draftForDiscussion(discussion.reply_id)" v-for="(note, index) in discussion.notes"
/> :key="note.id"
<div :note="componentData(note)"
v-else-if="!isRepliesCollapsed" @handleDeleteNote="deleteNoteHandler"
:class="{ 'is-replying': isReplying }" >
class="discussion-reply-holder" <slot v-if="index === 0" slot="avatar-badge" name="avatar-badge"></slot>
> </component>
<template v-if="!isReplying && canReply"> </template>
<div class="discussion-with-resolve-btn"> </ul>
<draft-note
v-if="showDraft(discussion.reply_id)"
:key="`draft_${discussion.id}`"
:draft="draftForDiscussion(discussion.reply_id)"
/>
<div
v-else-if="!isRepliesCollapsed"
:class="{ 'is-replying': isReplying }"
class="discussion-reply-holder"
>
<template v-if="!isReplying && canReply">
<div class="discussion-with-resolve-btn">
<button
type="button"
class="js-vue-discussion-reply btn btn-text-field mr-sm-2 qa-discussion-reply"
title="Add a reply"
@click="showReplyForm"
>
Reply...
</button>
<div v-if="discussion.resolvable">
<button <button
type="button" type="button"
class="js-vue-discussion-reply btn btn-text-field mr-sm-2 qa-discussion-reply" class="btn btn-default mr-sm-2"
title="Add a reply" @click="resolveHandler();"
@click="showReplyForm"
> >
Reply... <i v-if="isResolving" aria-hidden="true" class="fa fa-spinner fa-spin"></i>
{{ resolveButtonTitle }}
</button> </button>
<div v-if="discussion.resolvable"> </div>
<div
v-if="discussion.resolvable"
class="btn-group discussion-actions ml-sm-2"
role="group"
>
<div v-if="!discussionResolved" class="btn-group" role="group">
<a
v-gl-tooltip
:href="discussion.resolve_with_issue_path"
:title="s__('MergeRequests|Resolve this discussion in a new issue')"
class="new-issue-for-discussion btn btn-default discussion-create-issue-btn"
>
<icon name="issue-new" />
</a>
</div>
<div v-if="hasUnresolvedDiscussions" class="btn-group" role="group">
<button <button
type="button" v-gl-tooltip
class="btn btn-default mr-sm-2" class="btn btn-default discussion-next-btn"
@click="resolveHandler();" title="Jump to next unresolved discussion"
@click="jumpToNextDiscussion"
> >
<i v-if="isResolving" aria-hidden="true" class="fa fa-spinner fa-spin"></i> <icon name="comment-next" />
{{ resolveButtonTitle }}
</button> </button>
</div> </div>
<div
v-if="discussion.resolvable"
class="btn-group discussion-actions ml-sm-2"
role="group"
>
<div v-if="!discussionResolved" class="btn-group" role="group">
<a
v-gl-tooltip
:href="discussion.resolve_with_issue_path"
:title="s__('MergeRequests|Resolve this discussion in a new issue')"
class="new-issue-for-discussion btn btn-default discussion-create-issue-btn"
>
<icon name="issue-new" />
</a>
</div>
<div v-if="hasUnresolvedDiscussions" class="btn-group" role="group">
<button
v-gl-tooltip
class="btn btn-default discussion-next-btn"
title="Jump to next unresolved discussion"
@click="jumpToNextDiscussion"
>
<icon name="comment-next" />
</button>
</div>
</div>
</div> </div>
</template> </div>
<note-form </template>
v-if="isReplying" <note-form
ref="noteForm" v-if="isReplying"
:discussion="discussion" ref="noteForm"
:is-editing="false" :discussion="discussion"
save-button-title="Comment" :is-editing="false"
@handleFormUpdateAddToReview="addReplyToReview" save-button-title="Comment"
@handleFormUpdate="saveReply" @handleFormUpdateAddToReview="addReplyToReview"
@cancelForm="cancelReplyForm" @handleFormUpdate="saveReply"
/> @cancelForm="cancelReplyForm"
<note-signed-out-widget v-if="!canReply" /> />
</div> <note-signed-out-widget v-if="!canReply" />
</div> </div>
</component> </div>
</div> </component>
</div> </div>
</div>
</timeline-entry-item> </timeline-entry-item>
</template> </template>
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