summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cycle_analytics/components/item_issue_component.js.es6
blob: 17a77cf43694915d17a861e31b1b25bad6f9b739 (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 || {};

  /*
  `issue` prop should have

  - Issue title
  - Issue URL
  - Issue ID
  - Issue date created
  - Issue author
  - Issue author profile URL
  - Issue author avatar URL
  - Total time
  */

  global.cycleAnalytics.ItemIssueComponent = Vue.extend({
    props: {
      issue: Object,
    },
    template: `
      <div>
        <div class="item-details">
          <img class="avatar" :src="issue.author.avatarUrl">
          <h5 class="item-title issue-title">
            <a class="issue-title" :href="issue.url">
              {{ issue.title }}
            </a>
          </h5>
          <a :href="issue.url" class="issue-link">
            #{{ issue.iid }}
          </a>
          &middot;
          <span>
            Opened
            <a :href="issue.url" class="issue-date">
              {{ issue.createdAt }}
            </a>
          </span>
          <span>
          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"></total-time>
        </div>
      </div>
    `,
  });
})(window.gl || (window.gl = {}));