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
6 files
+ 129
1
Compare changes
  • Side-by-side
  • Inline
Files
6
  • 4780ef72
    Base commit · 4780ef72
    Pedro Pombeiro authored
    # |<----          Using a Maximum Of 72 Characters                ---->|
    
    # Explain why this change is being made
    # |<----   Try To Limit Each Line to a Maximum Of 72 Characters   ---->|
    
    # Provide links or keys to any relevant tickets, articles or other resources
    # Use issues and merge requests' full URLs instead of short references,
    # as they are displayed as plain text outside of GitLab
    
    # --- COMMIT END ---
    # --------------------
    # Remember to
    #    Capitalize the subject line
    #    Use the imperative mood in the subject line
    #    Do not end the subject line with a period
    #    Subject must contain at least 3 words
    #    Separate subject from body with a blank line
    #    Commits that change 30 or more lines across at least 3 files should
    #    describe these changes in the commit body
    #    Do not use Emojis
    #    Use the body to explain what and why vs. how
    #    Can use multiple lines with "-" for bullet points in body
    #    For more information: https://cbea.ms/git-commit/
    # --------------------
<script>
<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 isProjectPendingRemoval from 'ee_else_ce/groups/mixins/is_project_pending_removal';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
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 {
import {
ITEM_TYPE,
ITEM_TYPE,
VISIBILITY_TYPE_ICON,
VISIBILITY_TYPE_ICON,
@@ -15,6 +17,10 @@ export default {
@@ -15,6 +17,10 @@ export default {
TimeAgoTooltip,
TimeAgoTooltip,
ItemStatsValue,
ItemStatsValue,
GlBadge,
GlBadge,
 
CiIcon,
 
},
 
directives: {
 
GlTooltip: GlTooltipDirective,
},
},
mixins: [isProjectPendingRemoval],
mixins: [isProjectPendingRemoval],
props: {
props: {
@@ -39,6 +45,17 @@ export default {
@@ -39,6 +45,17 @@ export default {
isGroup() {
isGroup() {
return this.item.type === ITEM_TYPE.GROUP;
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: {
methods: {
displayValue(value) {
displayValue(value) {
@@ -50,6 +67,15 @@ export default {
@@ -50,6 +67,15 @@ export default {
<template>
<template>
<div class="stats gl-text-gray-500">
<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
<item-stats-value
v-if="displayValue(item.subgroupCount)"
v-if="displayValue(item.subgroupCount)"
:title="__('Subgroups')"
:title="__('Subgroups')"
Loading