Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resolve_count.vue « components « diff_notes « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c090d21eabe822795e5fa18f6300da8fdf548249 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
  import jumpToDiscussionBtn from './jump_to_discussion.vue';
  import statusSuccessSvg from '../icons/status_success.svg';

  export default {
    mixins: [DiscussionMixins],
    components: {
      jumpToDiscussionBtn,
    },
    props: {
      loggedOut: {
        type: Boolean,
        required: true,
      },
    },
    data() {
      return {
        discussions: CommentsStore.state
      };
    },
    computed: {
      allResolved() {
        return this.resolvedDiscussionCount === this.discussionCount;
      },
      resolvedCountText() {
        return this.discussionCount === 1 ? 'discussion' : 'discussions';
      },
    },
    created() {
      this.statusSuccessSvg = statusSuccessSvg;
    }
  };
</script>

<template>
  <div class="line-resolve-all-container prepend-top-10">
    <div class="line-resolve-all"
      v-if="discussionCount > 0"
      :class="{ 'has-next-btn': !loggedOut && !allResolved }">
      <span class="line-resolve-btn is-disabled"
        :class="{ 'is-active': allResolved }"
        v-html="statusSuccessSvg">
      </span>
      <span class="line-resolve-text">
        {{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
      </span>
    </div>
    <jump-to-discussion-btn />
  </div>
</template>