summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cycle_analytics/components/item_merge_request_component.js.es6
blob: 36da613cccf4b731167a5107421d1083625f1b40 (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
((global) => {
  global.cycleAnalytics = global.cycleAnalytics || {};

  /*
  `mergeRequest` prop should have

  - MR title
  - MR URL
  - MR ID
  - MR date opened
  - MR author
  - MR author profile URL
  - MR author avatar URL
  - Total time
  */

  global.cycleAnalytics.ItemMergeRequestComponent = Vue.extend({
    props: {
      mergeRequest: Object,
    },
    template: `
      <div>
        <div class="item-details">
          <img class="avatar" :src="mergeRequest.author.avatarUrl">
          <h5 class="item-title merge-merquest-title">
            <a :href="mergeRequest.url">
              {{ mergeRequest.title }}
            </a>
          </h5>
          <a :href="mergeRequest.url" class="issue-link">
            !{{ mergeRequest.iid }}
          </a>
          &middot;
          <span>
            Opened
            <a :href="mergeRequest.url" class="issue-date">
              {{ mergeRequest.createdAt }}
            </a>
          </span>
          <span>
          by
          <a :href="mergeRequest.author.webUrl" class="issue-author-link">
            {{ mergeRequest.author.name }}
          </a>
          </span>
        </div>
        <div class="item-time">
          <total-time :time="mergeRequest.totalTime"></total-time>
        </div>
      </div>
    `,
  });
}(window.gl || (window.gl = {})));