Read about our upcoming Code of Conduct on this issue

release_block_milestones.vue 1.08 KB
Newer Older
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
51
<script>
import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import { n__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';

export default {
  name: 'ReleaseBlockMilestones',
  components: {
    GlLink,
    Icon,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    milestones: {
      type: Array,
      required: true,
    },
  },
  computed: {
    labelText() {
      return n__('Milestone', 'Milestones', this.milestones.length);
    },
  },
};
</script>

<template>
  <div>
    <div class="js-milestone-list-label">
      <icon name="flag" class="align-middle" />
      <span class="js-label-text">{{ labelText }}</span>
    </div>

    <template v-for="(milestone, index) in milestones">
      <gl-link
        :key="milestone.id"
        v-gl-tooltip
        :title="milestone.description"
        :href="milestone.web_url"
        class="mx-1 js-milestone-link"
      >
        {{ milestone.title }}
      </gl-link>
      <template v-if="index !== milestones.length - 1">
        &bull;
      </template>
    </template>
  </div>
</template>