BigW Consortium Gitlab

issue_system_note.vue 1.17 KB
Newer Older
1
<script>
2 3
  import { mapGetters } from 'vuex';
  import issueNoteHeader from './issue_note_header.vue';
4

5
  export default {
6
    name: 'systemNote',
7 8 9 10 11
    props: {
      note: {
        type: Object,
        required: true,
      },
12
    },
13 14
    components: {
      issueNoteHeader,
15
    },
16 17 18 19 20 21 22 23 24 25
    computed: {
      ...mapGetters([
        'targetNoteHash',
      ]),
      noteAnchorId() {
        return `note_${this.note.id}`;
      },
      isTargetNote() {
        return this.targetNoteHash === this.noteAnchorId;
      },
26 27 28
      iconHtml() {
        return gl.utils.spriteIcon(this.note.system_note_icon_name);
      },
Filipa Lacerda committed
29
    },
30
  };
31 32
</script>

33
<template>
34 35 36 37
  <li
    :id="noteAnchorId"
    :class="{ target: isTargetNote }"
    class="note system-note timeline-entry">
38
    <div class="timeline-entry-inner">
39 40
      <div
        class="timeline-icon"
41
        v-html="iconHtml">
42 43 44 45 46
      </div>
      <div class="timeline-content">
        <div class="note-header">
          <issue-note-header
            :author="note.author"
47 48 49
            :created-at="note.created_at"
            :note-id="note.id"
            :action-text-html="note.note_html" />
50 51 52 53
        </div>
      </div>
    </div>
  </li>
54
</template>