Commit 9b284083 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch '293655-de-emphasize-nested-reports-in-mr-widget' into 'master'

De-emphasize nested reports in MR widget

See merge request gitlab-org/gitlab!55001
parents 35a6042b 43b23756
...@@ -151,7 +151,11 @@ export default { ...@@ -151,7 +151,11 @@ export default {
<template #body> <template #body>
<div class="mr-widget-grouped-section report-block"> <div class="mr-widget-grouped-section report-block">
<template v-for="(report, i) in reports"> <template v-for="(report, i) in reports">
<summary-row :key="`summary-row-${i}`" :status-icon="getReportIcon(report)"> <summary-row
:key="`summary-row-${i}`"
:status-icon="getReportIcon(report)"
nested-summary
>
<template #summary> <template #summary>
<div class="gl-display-inline-flex gl-flex-direction-column"> <div class="gl-display-inline-flex gl-flex-direction-column">
<div>{{ reportText(report) }}</div> <div>{{ reportText(report) }}</div>
...@@ -168,7 +172,7 @@ export default { ...@@ -168,7 +172,7 @@ export default {
:new-issues="newIssues(report)" :new-issues="newIssues(report)"
:resolved-issues="resolvedIssues(report)" :resolved-issues="resolvedIssues(report)"
:component="$options.componentNames.TestIssueBody" :component="$options.componentNames.TestIssueBody"
class="report-block-group-list" :nested-level="2"
/> />
</template> </template>
<modal <modal
......
...@@ -67,6 +67,12 @@ export default { ...@@ -67,6 +67,12 @@ export default {
required: false, required: false,
default: null, default: null,
}, },
nestedLevel: {
type: Number,
required: false,
default: 0,
validator: (value) => [0, 1, 2].includes(value),
},
}, },
computed: { computed: {
issuesWithState() { issuesWithState() {
...@@ -80,6 +86,12 @@ export default { ...@@ -80,6 +86,12 @@ export default {
wclass() { wclass() {
return `report-block-list ${this.issuesUlElementClass}`; return `report-block-list ${this.issuesUlElementClass}`;
}, },
listClasses() {
return {
'gl-pl-7': this.nestedLevel === 1,
'gl-pl-8': this.nestedLevel === 2,
};
},
}, },
}; };
</script> </script>
...@@ -89,6 +101,7 @@ export default { ...@@ -89,6 +101,7 @@ export default {
:remain="$options.maxShownReportItems" :remain="$options.maxShownReportItems"
:size="$options.typicalReportItemHeight" :size="$options.typicalReportItemHeight"
class="report-block-container" class="report-block-container"
:class="listClasses"
wtag="ul" wtag="ul"
:wclass="wclass" :wclass="wclass"
> >
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Popover from '~/vue_shared/components/help_popover.vue'; import Popover from '~/vue_shared/components/help_popover.vue';
import { ICON_WARNING } from '../constants';
/** /**
* Renders the summary row for each report * Renders the summary row for each report
...@@ -19,6 +20,11 @@ export default { ...@@ -19,6 +20,11 @@ export default {
GlLoadingIcon, GlLoadingIcon,
}, },
props: { props: {
nestedSummary: {
type: Boolean,
required: false,
default: false,
},
summary: { summary: {
type: String, type: String,
required: false, required: false,
...@@ -41,24 +47,36 @@ export default { ...@@ -41,24 +47,36 @@ export default {
icon: `status_${this.statusIcon}`, icon: `status_${this.statusIcon}`,
}; };
}, },
rowClasses() {
if (!this.nestedSummary) {
return ['gl-px-5'];
}
return ['gl-pl-7', 'gl-pr-5', { 'gl-bg-gray-10': this.statusIcon === ICON_WARNING }];
},
statusIconSize() {
if (!this.nestedSummary) {
return 24;
}
return 16;
},
}, },
}; };
</script> </script>
<template> <template>
<div class="report-block-list-issue report-block-list-issue-parent align-items-center"> <div
<div class="report-block-list-icon gl-mr-3"> class="gl-border-t-solid gl-border-t-gray-100 gl-border-t-1 gl-py-3 gl-display-flex gl-align-items-center"
:class="rowClasses"
>
<div class="gl-mr-3">
<gl-loading-icon <gl-loading-icon
v-if="statusIcon === 'loading'" v-if="statusIcon === 'loading'"
css-class="report-block-list-loading-icon" css-class="report-block-list-loading-icon"
size="md" size="md"
/> />
<ci-icon v-else :status="iconStatus" :size="24" /> <ci-icon v-else :status="iconStatus" :size="statusIconSize" data-testid="summary-row-icon" />
</div> </div>
<div class="report-block-list-issue-description"> <div class="report-block-list-issue-description">
<div <div class="report-block-list-issue-description-text" data-testid="summary-row-description">
class="report-block-list-issue-description-text"
data-testid="test-summary-row-description"
>
<slot name="summary">{{ summary }}</slot <slot name="summary">{{ summary }}</slot
><span v-if="popoverOptions" class="text-nowrap" ><span v-if="popoverOptions" class="text-nowrap"
>&nbsp;<popover v-if="popoverOptions" :options="popoverOptions" class="align-top" /> >&nbsp;<popover v-if="popoverOptions" :options="popoverOptions" class="align-top" />
......
...@@ -5,11 +5,6 @@ ...@@ -5,11 +5,6 @@
max-height: 170px; max-height: 170px;
overflow: auto; overflow: auto;
} }
.report-block-list-issue-parent {
padding: $gl-padding-top $gl-padding;
border-top: 1px solid var(--border-color, $border-color);
}
} }
.report-block-container { .report-block-container {
......
---
title: Add styling to de-emphasize nested test reports in merge requests
merge_request: 55001
author:
type: added
...@@ -42,7 +42,7 @@ describe('Grouped test reports app', () => { ...@@ -42,7 +42,7 @@ describe('Grouped test reports app', () => {
const findHeader = () => wrapper.find('[data-testid="report-section-code-text"]'); const findHeader = () => wrapper.find('[data-testid="report-section-code-text"]');
const findExpandButton = () => wrapper.find('[data-testid="report-section-expand-button"]'); const findExpandButton = () => wrapper.find('[data-testid="report-section-expand-button"]');
const findFullTestReportLink = () => wrapper.find('[data-testid="group-test-reports-full-link"]'); const findFullTestReportLink = () => wrapper.find('[data-testid="group-test-reports-full-link"]');
const findSummaryDescription = () => wrapper.find('[data-testid="test-summary-row-description"]'); const findSummaryDescription = () => wrapper.find('[data-testid="summary-row-description"]');
const findIssueDescription = () => wrapper.find('[data-testid="test-issue-body-description"]'); const findIssueDescription = () => wrapper.find('[data-testid="test-issue-body-description"]');
const findAllIssueDescriptions = () => const findAllIssueDescriptions = () =>
wrapper.findAll('[data-testid="test-issue-body-description"]'); wrapper.findAll('[data-testid="test-issue-body-description"]');
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import SummaryRow from '~/reports/components/summary_row.vue'; import SummaryRow from '~/reports/components/summary_row.vue';
describe('Summary row', () => { describe('Summary row', () => {
...@@ -14,16 +15,19 @@ describe('Summary row', () => { ...@@ -14,16 +15,19 @@ describe('Summary row', () => {
}; };
const createComponent = ({ propsData = {}, slots = {} } = {}) => { const createComponent = ({ propsData = {}, slots = {} } = {}) => {
wrapper = mount(SummaryRow, { wrapper = extendedWrapper(
mount(SummaryRow, {
propsData: { propsData: {
...props, ...props,
...propsData, ...propsData,
}, },
slots, slots,
}); }),
);
}; };
const findSummary = () => wrapper.find('.report-block-list-issue-description-text'); const findSummary = () => wrapper.findByTestId('summary-row-description');
const findStatusIcon = () => wrapper.findByTestId('summary-row-icon');
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -37,9 +41,7 @@ describe('Summary row', () => { ...@@ -37,9 +41,7 @@ describe('Summary row', () => {
it('renders provided icon', () => { it('renders provided icon', () => {
createComponent(); createComponent();
expect(wrapper.find('.report-block-list-icon span').classes()).toContain( expect(findStatusIcon().classes()).toContain('js-ci-status-icon-warning');
'js-ci-status-icon-warning',
);
}); });
describe('summary slot', () => { describe('summary slot', () => {
......
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