summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cycle_analytics/components/stage_component.vue
blob: 56e851fa528c9cf62b356a7dba9b5c009983b1c5 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<script>
import userAvatarImage from '../../vue_shared/components/user_avatar/user_avatar_image.vue';
import limitWarning from './limit_warning_component.vue';
import totalTime from './total_time_component.vue';

export default {
  components: {
    userAvatarImage,
    limitWarning,
    totalTime,
  },
  props: {
    items: {
      type: Array,
      default: () => [],
    },
    stage: {
      type: Object,
      default: () => ({}),
    },
  },
};
</script>
<template>
  <div>
    <div class="events-description">
      {{ stage.description }}
      <limit-warning :count="items.length" />
    </div>
    <ul class="stage-event-list">
      <li
        v-for="(issue, i) in items"
        :key="i"
        class="stage-event-item"
      >
        <div class="item-details">
          <!-- FIXME: Pass an alt attribute here for accessibility -->
          <user-avatar-image :img-src="issue.author.avatarUrl"/>
          <h5 class="item-title issue-title">
            <a
              :href="issue.url"
              class="issue-title"
            >
              {{ issue.title }}
            </a>
          </h5>
          <a
            :href="issue.url"
            class="issue-link"
          >#{{ issue.iid }}</a>
          &middot;
          <span>
            {{ s__('OpenedNDaysAgo|Opened') }}
            <a
              :href="issue.url"
              class="issue-date"
            >{{ issue.createdAt }}</a>
          </span>
          <span>
            {{ s__('ByAuthor|by') }}
            <a
              :href="issue.author.webUrl"
              class="issue-author-link"
            >
              {{ issue.author.name }}
            </a>
          </span>
        </div>
        <div class="item-time">
          <total-time :time="issue.totalTime" />
        </div>
      </li>
    </ul>
  </div>
</template>