Commit 735b6fb1 authored by Fatih Acet's avatar Fatih Acet

Merge branch '61657-allow-report-section-list-to-not-have-redundant-status-icon' into 'master'

Resolve "Allow report section list to not have redundant status icon"

Closes #61657

See merge request gitlab-org/gitlab-ce!28226
parents d0857d44 c7d57f27
...@@ -52,6 +52,11 @@ export default { ...@@ -52,6 +52,11 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
showReportSectionStatus: {
type: Boolean,
required: false,
default: true,
},
}, },
computed: { computed: {
issuesWithState() { issuesWithState() {
...@@ -81,6 +86,7 @@ export default { ...@@ -81,6 +86,7 @@ export default {
:status="wrapped.status" :status="wrapped.status"
:component="component" :component="component"
:is-new="wrapped.isNew" :is-new="wrapped.isNew"
:show-report-section-status="showReportSectionStatus"
/> />
</smart-virtual-list> </smart-virtual-list>
</template> </template>
...@@ -34,12 +34,22 @@ export default { ...@@ -34,12 +34,22 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
showReportSectionStatusIcon: {
type: Boolean,
required: false,
default: true,
},
}, },
}; };
</script> </script>
<template> <template>
<li :class="{ 'is-dismissed': issue.isDismissed }" class="report-block-list-issue"> <li :class="{ 'is-dismissed': issue.isDismissed }" class="report-block-list-issue">
<issue-status-icon :status="status" :status-icon-size="statusIconSize" class="append-right-5" /> <issue-status-icon
v-if="showReportSectionStatusIcon"
:status="status"
:status-icon-size="statusIconSize"
class="append-right-5"
/>
<component :is="component" v-if="component" :issue="issue" :status="status" :is-new="isNew" /> <component :is="component" v-if="component" :issue="issue" :status="status" :is-new="isNew" />
</li> </li>
......
...@@ -73,6 +73,11 @@ export default { ...@@ -73,6 +73,11 @@ export default {
default: () => ({}), default: () => ({}),
required: false, required: false,
}, },
showReportSectionStatusIcon: {
type: Boolean,
required: false,
default: true,
},
}, },
data() { data() {
...@@ -166,6 +171,7 @@ export default { ...@@ -166,6 +171,7 @@ export default {
:resolved-issues="resolvedIssues" :resolved-issues="resolvedIssues"
:neutral-issues="neutralIssues" :neutral-issues="neutralIssues"
:component="component" :component="component"
:show-report-section-status-icon="showReportSectionStatusIcon"
/> />
</slot> </slot>
</div> </div>
......
import { shallowMount } from '@vue/test-utils';
import { STATUS_SUCCESS } from '~/reports/constants';
import ReportItem from '~/reports/components/report_item.vue';
import { componentNames } from '~/reports/components/issue_body';
describe('ReportItem', () => {
describe('showReportSectionStatusIcon', () => {
it('does not render CI Status Icon when showReportSectionStatusIcon is false', () => {
const wrapper = shallowMount(ReportItem, {
propsData: {
issue: { foo: 'bar' },
component: componentNames.TestIssueBody,
status: STATUS_SUCCESS,
showReportSectionStatusIcon: false,
},
});
expect(wrapper.find('issuestatusicon-stub').exists()).toBe(false);
});
it('shows status icon when unspecified', () => {
const wrapper = shallowMount(ReportItem, {
propsData: {
issue: { foo: 'bar' },
component: componentNames.TestIssueBody,
status: STATUS_SUCCESS,
},
});
expect(wrapper.find('issuestatusicon-stub').exists()).toBe(true);
});
});
});
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