summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/error_tracking/components/stacktrace.vue
blob: f58d54f2933ee4bc3dc994201832cab4a9447b29 (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
<script>
import StackTraceEntry from './stacktrace_entry.vue';

export default {
  components: {
    StackTraceEntry,
  },
  props: {
    entries: {
      type: Array,
      required: true,
    },
  },
  methods: {
    isFirstEntry(index) {
      return index === 0;
    },
  },
};
</script>

<template>
  <div class="stacktrace">
    <stack-trace-entry
      v-for="(entry, index) in entries"
      :key="`stacktrace-entry-${index}`"
      :lines="entry.context"
      :file-path="entry.filename"
      :error-line="entry.lineNo"
      :error-fn="entry.function"
      :error-column="entry.colNo"
      :expanded="isFirstEntry(index)"
    />
  </div>
</template>