summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components/issue_system_note.vue
blob: 0cfb6522e77664fd884bf49ea8bd11477f0c36a5 (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
<script>
  import { mapGetters } from 'vuex';
  import issueNoteHeader from './issue_note_header.vue';

  export default {
    name: 'systemNote',
    props: {
      note: {
        type: Object,
        required: true,
      },
    },
    components: {
      issueNoteHeader,
    },
    computed: {
      ...mapGetters([
        'targetNoteHash',
      ]),
      noteAnchorId() {
        return `note_${this.note.id}`;
      },
      isTargetNote() {
        return this.targetNoteHash === this.noteAnchorId;
      },
      iconHtml() {
        return gl.utils.spriteIcon(this.note.system_note_icon_name);
      },
    },
  };
</script>

<template>
  <li
    :id="noteAnchorId"
    :class="{ target: isTargetNote }"
    class="note system-note timeline-entry">
    <div class="timeline-entry-inner">
      <div
        class="timeline-icon"
        v-html="iconHtml">
      </div>
      <div class="timeline-content">
        <div class="note-header">
          <issue-note-header
            :author="note.author"
            :created-at="note.created_at"
            :note-id="note.id"
            :action-text-html="note.note_html" />
        </div>
      </div>
    </div>
  </li>
</template>