2020-06-23 00:09:42 +05:30
|
|
|
<script>
|
2020-10-24 23:57:45 +05:30
|
|
|
import { GlButton } from '@gitlab/ui';
|
2021-03-11 19:13:27 +05:30
|
|
|
import { mapActions, mapState } from 'vuex';
|
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"
|
2021-04-17 20:07:23 +05:30
|
|
|
class="js-publish-draft-button"
|
|
|
|
data-qa-selector="submit_review_button"
|
2020-10-24 23:57:45 +05:30
|
|
|
: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>
|