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

46 lines
1.1 KiB
Vue
Raw Normal View History

2020-06-23 00:09:42 +05:30
<script>
2021-01-03 14:25:43 +05:30
import { mapActions, mapGetters } from 'vuex';
2021-11-11 11:23:49 +05:30
import { REVIEW_BAR_VISIBLE_CLASS_NAME } from '../constants';
2020-06-23 00:09:42 +05:30
import PreviewDropdown from './preview_dropdown.vue';
2021-01-03 14:25:43 +05:30
import PublishButton from './publish_button.vue';
2020-06-23 00:09:42 +05:30
export default {
components: {
PreviewDropdown,
2021-01-03 14:25:43 +05:30
PublishButton,
2020-06-23 00:09:42 +05:30
},
computed: {
...mapGetters(['isNotesFetched']),
},
watch: {
isNotesFetched() {
if (this.isNotesFetched) {
this.expandAllDiscussions();
}
},
},
2021-11-11 11:23:49 +05:30
mounted() {
document.body.classList.add(REVIEW_BAR_VISIBLE_CLASS_NAME);
},
beforeDestroy() {
document.body.classList.remove(REVIEW_BAR_VISIBLE_CLASS_NAME);
},
2020-06-23 00:09:42 +05:30
methods: {
2021-01-03 14:25:43 +05:30
...mapActions('batchComments', ['expandAllDiscussions']),
2020-06-23 00:09:42 +05:30
},
};
</script>
<template>
2021-11-11 11:23:49 +05:30
<div>
2021-09-30 23:02:18 +05:30
<nav class="review-bar-component" data-testid="review_bar_component">
2021-04-17 20:07:23 +05:30
<div
class="review-bar-content d-flex gl-justify-content-end"
data-qa-selector="review_bar_content"
>
2020-06-23 00:09:42 +05:30
<preview-dropdown />
2021-01-03 14:25:43 +05:30
<publish-button class="gl-ml-3" show-count />
2020-06-23 00:09:42 +05:30
</div>
</nav>
</div>
</template>