summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/work_items/components/notes/work_item_note_replying.vue
blob: 46f61ccd204082aef1f772cd3105a0d847525971 (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
<script>
import { GlAvatar } from '@gitlab/ui';
import SafeHtml from '~/vue_shared/directives/safe_html';
import NoteHeader from '~/notes/components/note_header.vue';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';

export default {
  name: 'WorkItemNoteReplying',
  components: {
    TimelineEntryItem,
    GlAvatar,
    NoteHeader,
  },
  directives: {
    SafeHtml,
  },
  safeHtmlConfig: {
    ADD_TAGS: ['use', 'gl-emoji', 'copy-code'],
  },
  constantOptions: {
    avatarUrl: window.gon.current_user_avatar_url,
  },
  props: {
    body: {
      type: String,
      required: false,
      default: '',
    },
  },
  computed: {
    author() {
      return {
        avatarUrl: window.gon.current_user_avatar_url,
        id: window.gon.current_user_id,
        name: window.gon.current_user_fullname,
        username: window.gon.current_username,
      };
    },
  },
};
</script>

<template>
  <timeline-entry-item class="note note-wrapper note-comment gl-p-4 being-posted">
    <div class="timeline-avatar gl-float-left">
      <gl-avatar :src="$options.constantOptions.avatarUrl" :size="32" class="gl-mr-3" />
    </div>
    <div class="note-header">
      <note-header :author="author" />
    </div>
    <div ref="note-body" v-safe-html:[$options.safeHtmlConfig]="body" class="note-body"></div>
  </timeline-entry-item>
</template>