2019-09-30 21:07:59 +05:30
|
|
|
<script>
|
2023-03-04 22:38:38 +05:30
|
|
|
import { GlButton } from '@gitlab/ui';
|
2019-09-30 21:07:59 +05:30
|
|
|
import { mapGetters } from 'vuex';
|
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
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
import { START_THREAD } from '../i18n';
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
export default {
|
|
|
|
name: 'DiffDiscussionReply',
|
2023-03-04 22:38:38 +05:30
|
|
|
i18n: {
|
|
|
|
START_THREAD,
|
|
|
|
},
|
2019-09-30 21:07:59 +05:30
|
|
|
components: {
|
2023-03-04 22:38:38 +05:30
|
|
|
GlButton,
|
2019-09-30 21:07:59 +05:30
|
|
|
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">
|
2023-03-04 22:38:38 +05:30
|
|
|
<gl-button @click="$emit('showNewDiscussionForm')">
|
|
|
|
{{ $options.i18n.START_THREAD }}
|
|
|
|
</gl-button>
|
2019-09-30 21:07:59 +05:30
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<note-signed-out-widget v-else />
|
|
|
|
</div>
|
|
|
|
</template>
|