summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/batch_comments/components/review_bar.vue
blob: 035d6f4e0ab7fd7eb54efb4ae9b4b5ad9ba156cd (plain)
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
<script>
import { mapActions, mapGetters } from 'vuex';
import PreviewDropdown from './preview_dropdown.vue';
import PublishButton from './publish_button.vue';

export default {
  components: {
    PreviewDropdown,
    PublishButton,
  },
  computed: {
    ...mapGetters(['isNotesFetched']),
    ...mapGetters('batchComments', ['draftsCount']),
  },
  watch: {
    isNotesFetched() {
      if (this.isNotesFetched) {
        this.expandAllDiscussions();
      }
    },
  },
  methods: {
    ...mapActions('batchComments', ['expandAllDiscussions']),
  },
};
</script>
<template>
  <div v-show="draftsCount > 0">
    <nav class="review-bar-component">
      <div class="review-bar-content qa-review-bar d-flex gl-justify-content-end">
        <preview-dropdown />
        <publish-button class="gl-ml-3" show-count />
      </div>
    </nav>
  </div>
</template>