1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<script>
import { GlButton } from '@gitlab/ui';
import { mapGetters } from 'vuex';
import NoteSignedOutWidget from '~/notes/components/note_signed_out_widget.vue';
import { START_THREAD } from '../i18n';
export default {
name: 'DiffDiscussionReply',
i18n: {
START_THREAD,
},
components: {
GlButton,
NoteSignedOutWidget,
},
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">
<gl-button @click="$emit('showNewDiscussionForm')">
{{ $options.i18n.START_THREAD }}
</gl-button>
</template>
</template>
<note-signed-out-widget v-else />
</div>
</template>
|