Skip to content
Snippets Groups Projects

Draft: Test N+1 fix

Closed Pedro Pombeiro requested to merge pedropombeiro/test/96070 into master
1 unresolved thread
Files
11
<script>
import { GlBadge } from '@gitlab/ui';
import { GlBadge, GlTooltipDirective } from '@gitlab/ui';
import isProjectPendingRemoval from 'ee_else_ce/groups/mixins/is_project_pending_removal';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { sprintf, s__ } from '~/locale';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import {
ITEM_TYPE,
VISIBILITY_TYPE_ICON,
@@ -15,6 +17,10 @@ export default {
TimeAgoTooltip,
ItemStatsValue,
GlBadge,
CiIcon,
},
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [isProjectPendingRemoval],
props: {
@@ -39,6 +45,17 @@ export default {
isGroup() {
return this.item.type === ITEM_TYPE.GROUP;
},
hasPipeline() {
return Boolean(this.item.lastPipeline);
},
statusTitle() {
return sprintf(s__('PipelineStatusTooltip|Pipeline: %{ciStatus}'), {
ciStatus: this.item.lastPipeline.text || '',
});
},
pipelinePath() {
return this.item.lastPipeline.details_path || '';
},
},
methods: {
displayValue(value) {
@@ -50,6 +67,15 @@ export default {
<template>
<div class="stats gl-text-gray-500">
<a v-if="hasPipeline" class="gl-mr-5" :href="pipelinePath" data-testid="pipeline-status">
<ci-icon
v-gl-tooltip
:title="statusTitle"
:aria-label="statusTitle"
:status="item.lastPipeline"
data-container="body"
/>
</a>
<item-stats-value
v-if="displayValue(item.subgroupCount)"
:title="__('Subgroups')"
Loading