Commit f204f965 authored by wortschi's avatar wortschi

MR Analytics: Add pipelines sanity check

- Adds a sanity check for the pipelines
property which can be null

Changelog: fixed
EE: true
parent 105179f7
...@@ -252,6 +252,9 @@ export default { ...@@ -252,6 +252,9 @@ export default {
resetPagination() { resetPagination() {
this.pagination = initialPaginationState; this.pagination = initialPaginationState;
}, },
hasPipelineNodes(item) {
return item.pipelines?.nodes;
},
}, },
assigneesVisible: ASSIGNEES_VISIBLE, assigneesVisible: ASSIGNEES_VISIBLE,
avatarSize: AVATAR_SIZE, avatarSize: AVATAR_SIZE,
...@@ -281,7 +284,7 @@ export default { ...@@ -281,7 +284,7 @@ export default {
> >
<ul class="horizontal-list gl-mb-0"> <ul class="horizontal-list gl-mb-0">
<li class="gl-mr-3">{{ formatMergeRequestId(item.iid) }}</li> <li class="gl-mr-3">{{ formatMergeRequestId(item.iid) }}</li>
<li v-if="item.pipelines.nodes.length" class="gl-mr-3"> <li v-if="hasPipelineNodes(item) && item.pipelines.nodes.length" class="gl-mr-3">
<gl-icon <gl-icon
:name="item.pipelines.nodes[0].detailedStatus.icon" :name="item.pipelines.nodes[0].detailedStatus.icon"
:class="pipelineStatusClass(item.pipelines.nodes[0].detailedStatus.icon)" :class="pipelineStatusClass(item.pipelines.nodes[0].detailedStatus.icon)"
...@@ -336,7 +339,9 @@ export default { ...@@ -336,7 +339,9 @@ export default {
</template> </template>
<template #cell(pipelines)="{ item }"> <template #cell(pipelines)="{ item }">
<div :data-testid="$options.testIds.PIPELINES">{{ item.pipelines.nodes.length }}</div> <div v-if="hasPipelineNodes(item)" :data-testid="$options.testIds.PIPELINES">
{{ item.pipelines.nodes.length }}
</div>
</template> </template>
<template #cell(line_changes)="{ item }"> <template #cell(line_changes)="{ item }">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment