debian-mirror-gitlab/app/assets/javascripts/batch_comments/components/publish_button.vue

52 lines
980 B
Vue
Raw Normal View History

2020-06-23 00:09:42 +05:30
<script>
import { mapActions, mapState } from 'vuex';
2020-10-24 23:57:45 +05:30
import { GlButton } from '@gitlab/ui';
2020-06-23 00:09:42 +05:30
import DraftsCount from './drafts_count.vue';
export default {
components: {
2020-10-24 23:57:45 +05:30
GlButton,
2020-06-23 00:09:42 +05:30
DraftsCount,
},
props: {
showCount: {
type: Boolean,
required: false,
default: false,
},
2020-10-24 23:57:45 +05:30
category: {
type: String,
required: false,
default: 'primary',
},
variant: {
type: String,
required: false,
default: 'success',
},
2020-06-23 00:09:42 +05:30
},
computed: {
...mapState('batchComments', ['isPublishing']),
},
methods: {
2021-01-03 14:25:43 +05:30
...mapActions('batchComments', ['publishReview']),
2020-06-23 00:09:42 +05:30
onClick() {
2021-01-03 14:25:43 +05:30
this.publishReview();
2020-06-23 00:09:42 +05:30
},
},
};
</script>
<template>
2020-10-24 23:57:45 +05:30
<gl-button
2020-06-23 00:09:42 +05:30
:loading="isPublishing"
2020-10-24 23:57:45 +05:30
class="js-publish-draft-button qa-submit-review"
:category="category"
:variant="variant"
2020-06-23 00:09:42 +05:30
@click="onClick"
>
2021-01-03 14:25:43 +05:30
{{ __('Submit review') }}
2020-10-24 23:57:45 +05:30
<drafts-count v-if="showCount" />
</gl-button>
2020-06-23 00:09:42 +05:30
</template>