debian-mirror-gitlab/app/assets/javascripts/diffs/components/diff_discussion_reply.vue

47 lines
1.1 KiB
Vue
Raw Normal View History

2019-09-30 21:07:59 +05:30
<script>
import { mapGetters } from 'vuex';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
2021-03-11 19:13:27 +05:30
import NoteSignedOutWidget from '~/notes/components/note_signed_out_widget.vue';
2019-09-30 21:07:59 +05:30
export default {
name: 'DiffDiscussionReply',
components: {
NoteSignedOutWidget,
ReplyPlaceholder,
},
props: {
hasForm: {
type: Boolean,
required: false,
default: false,
},
renderReplyPlaceholder: {
type: Boolean,
required: true,
},
},
computed: {
...mapGetters({
currentUser: 'getUserData',
userCanReply: 'userCanReply',
}),
},
};
</script>
<template>
<div class="discussion-reply-holder d-flex clearfix">
<template v-if="userCanReply">
<slot v-if="hasForm" name="form"></slot>
<template v-else-if="renderReplyPlaceholder">
<reply-placeholder
2021-04-17 20:07:23 +05:30
:placeholder-text="__('Start a new discussion…')"
:label-text="__('New discussion')"
@focus="$emit('showNewDiscussionForm')"
2019-09-30 21:07:59 +05:30
/>
</template>
</template>
<note-signed-out-widget v-else />
</div>
</template>