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

commit_comments_button.vue « components « commit « projects « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67b5e1e512c6db4b44ea4ce28485e184afedc5d0 (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
<script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { n__ } from '~/locale';

export default {
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  components: {
    GlButton,
  },
  props: {
    commentsCount: {
      type: Number,
      required: true,
    },
  },
  computed: {
    tooltipText() {
      return n__('%d comment on this commit', '%d comments on this commit', this.commentsCount);
    },
    showCommentButton() {
      return this.commentsCount > 0;
    },
  },
};
</script>

<template>
  <span
    v-if="showCommentButton"
    v-gl-tooltip
    class="gl-display-none gl-sm-display-inline-block"
    tabindex="0"
    :title="tooltipText"
    data-testid="comment-button-wrapper"
  >
    <gl-button icon="comment" class="gl-mr-3" disabled>
      {{ commentsCount }}
    </gl-button>
  </span>
</template>