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

formatted_stage_count.vue « components « cycle_analytics « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b622b0441e29a133ea00f35841af21dab177551e (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
<script>
import { s__, n__, sprintf, formatNumber } from '~/locale';

export default {
  props: {
    stageCount: {
      type: Number,
      required: false,
      default: null,
    },
  },
  computed: {
    formattedStageCount() {
      if (!this.stageCount) {
        return '-';
      } else if (this.stageCount > 1000) {
        return sprintf(s__('ValueStreamAnalytics|%{stageCount}+ items'), {
          stageCount: formatNumber(1000),
        });
      }

      return sprintf(n__('%{count} item', '%{count} items', this.stageCount), {
        count: formatNumber(this.stageCount),
      });
    },
  },
};
</script>

<template>
  <span>{{ formattedStageCount }}</span>
</template>