All files / app/assets/javascripts/vue_shared/alert_details/components/system_notes system_note.vue

100% Statements 6/6
100% Branches 4/4
100% Functions 3/3
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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  2x 2x                                   1x     1x       1x           9x                                  
<script>
import { GlIcon, GlSafeHtmlDirective } from '@gitlab/ui';
import NoteHeader from '~/notes/components/note_header.vue';
 
export default {
  components: {
    NoteHeader,
    GlIcon,
  },
  directives: {
    SafeHtml: GlSafeHtmlDirective,
  },
  props: {
    note: {
      type: Object,
      required: true,
    },
  },
  computed: {
    noteAnchorId() {
      return `note_${this.note?.id?.split('/').pop()}`;
    },
    noteAuthor() {
      const {
        author,
        author: { id },
      } = this.note;
      return { ...author, id: id?.split('/').pop() };
    },
  },
};
</script>
 
<template>
  <li :id="noteAnchorId" class="timeline-entry note system-note note-wrapper gl-p-0!">
    <div class="gl-display-inline-flex gl-align-items-center">
      <div
        class="gl-display-inline gl-bg-white gl-text-gray-200 gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-full gl-box-sizing-content-box gl-p-3 gl-mt-n2 gl-mr-6"
      >
        <gl-icon :name="note.systemNoteIconName" />
      </div>
 
      <div class="note-header">
        <note-header :author="noteAuthor" :created-at="note.createdAt" :note-id="note.id">
          <span v-safe-html="note.bodyHtml"></span>
        </note-header>
      </div>
    </div>
  </li>
</template>