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

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

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