summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/mixins/noteable.js
blob: 5bf8216a1f331aaf01f2199c8796732655006bed (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
import * as constants from '../constants';

export default {
  props: {
    note: {
      type: Object,
      required: true,
    },
  },
  computed: {
    noteableType() {
      switch (this.note.noteable_type) {
        case 'MergeRequest':
          return constants.MERGE_REQUEST_NOTEABLE_TYPE;
        case 'Issue':
          return constants.ISSUE_NOTEABLE_TYPE;
        case 'Epic':
          return constants.EPIC_NOTEABLE_TYPE;
        default:
          return '';
      }
    },
  },
};