Commit df3d8a2e authored by Nick Kipling's avatar Nick Kipling Committed by Mike Greiling

Added smart-virtual-list to test reports

Added smart-virtural-list component
Updated styles for adjusted height
parent 241b89b7
...@@ -3,11 +3,13 @@ import { mapGetters } from 'vuex'; ...@@ -3,11 +3,13 @@ import { mapGetters } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import store from '~/pipelines/stores/test_reports'; import store from '~/pipelines/stores/test_reports';
import { __ } from '~/locale'; import { __ } from '~/locale';
import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue';
export default { export default {
name: 'TestsSuiteTable', name: 'TestsSuiteTable',
components: { components: {
Icon, Icon,
SmartVirtualList,
}, },
store, store,
props: { props: {
...@@ -23,6 +25,8 @@ export default { ...@@ -23,6 +25,8 @@ export default {
return this.getSuiteTests.length > 0; return this.getSuiteTests.length > 0;
}, },
}, },
maxShownRows: 30,
typicalRowHeight: 75,
}; };
</script> </script>
...@@ -34,7 +38,7 @@ export default { ...@@ -34,7 +38,7 @@ export default {
</div> </div>
</div> </div>
<div v-if="hasSuites" class="test-reports-table js-test-cases-table"> <div v-if="hasSuites" class="test-reports-table append-bottom-default js-test-cases-table">
<div role="row" class="gl-responsive-table-row table-row-header font-weight-bold fgray"> <div role="row" class="gl-responsive-table-row table-row-header font-weight-bold fgray">
<div role="rowheader" class="table-section section-20"> <div role="rowheader" class="table-section section-20">
{{ __('Class') }} {{ __('Class') }}
...@@ -53,14 +57,19 @@ export default { ...@@ -53,14 +57,19 @@ export default {
</div> </div>
</div> </div>
<smart-virtual-list
:length="getSuiteTests.length"
:remain="$options.maxShownRows"
:size="$options.typicalRowHeight"
>
<div <div
v-for="(testCase, index) in getSuiteTests" v-for="(testCase, index) in getSuiteTests"
:key="index" :key="index"
class="gl-responsive-table-row rounded align-items-md-start mt-sm-3 js-case-row" class="gl-responsive-table-row rounded align-items-md-start mt-xs-3 js-case-row"
> >
<div class="table-section section-20 section-wrap"> <div class="table-section section-20 section-wrap">
<div role="rowheader" class="table-mobile-header">{{ __('Class') }}</div> <div role="rowheader" class="table-mobile-header">{{ __('Class') }}</div>
<div class="table-mobile-content pr-md-1">{{ testCase.classname }}</div> <div class="table-mobile-content pr-md-1 text-truncate">{{ testCase.classname }}</div>
</div> </div>
<div class="table-section section-20 section-wrap"> <div class="table-section section-20 section-wrap">
...@@ -94,11 +103,12 @@ export default { ...@@ -94,11 +103,12 @@ export default {
<div role="rowheader" class="table-mobile-header"> <div role="rowheader" class="table-mobile-header">
{{ __('Duration') }} {{ __('Duration') }}
</div> </div>
<div class="table-mobile-content text-right"> <div class="table-mobile-content text-right pr-sm-1">
{{ testCase.formattedTime }} {{ testCase.formattedTime }}
</div> </div>
</div> </div>
</div> </div>
</smart-virtual-list>
</div> </div>
<div v-else> <div v-else>
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import store from '~/pipelines/stores/test_reports'; import store from '~/pipelines/stores/test_reports';
import SmartVirtualList from '~/vue_shared/components/smart_virtual_list.vue';
export default { export default {
name: 'TestsSummaryTable', name: 'TestsSummaryTable',
components: {
SmartVirtualList,
},
store, store,
props: { props: {
heading: { heading: {
...@@ -24,6 +28,8 @@ export default { ...@@ -24,6 +28,8 @@ export default {
this.$emit('row-click', suite); this.$emit('row-click', suite);
}, },
}, },
maxShownRows: 20,
typicalRowHeight: 55,
}; };
</script> </script>
...@@ -35,7 +41,7 @@ export default { ...@@ -35,7 +41,7 @@ export default {
</div> </div>
</div> </div>
<div v-if="hasSuites" class="test-reports-table js-test-suites-table"> <div v-if="hasSuites" class="test-reports-table append-bottom-default js-test-suites-table">
<div role="row" class="gl-responsive-table-row table-row-header font-weight-bold"> <div role="row" class="gl-responsive-table-row table-row-header font-weight-bold">
<div role="rowheader" class="table-section section-25 pl-3"> <div role="rowheader" class="table-section section-25 pl-3">
{{ __('Suite') }} {{ __('Suite') }}
...@@ -60,6 +66,11 @@ export default { ...@@ -60,6 +66,11 @@ export default {
</div> </div>
</div> </div>
<smart-virtual-list
:length="getTestSuites.length"
:remain="$options.maxShownRows"
:size="$options.typicalRowHeight"
>
<div <div
v-for="(testSuite, index) in getTestSuites" v-for="(testSuite, index) in getTestSuites"
:key="index" :key="index"
...@@ -120,6 +131,7 @@ export default { ...@@ -120,6 +131,7 @@ export default {
<div class="table-mobile-content">{{ testSuite.total_count }}</div> <div class="table-mobile-content">{{ testSuite.total_count }}</div>
</div> </div>
</div> </div>
</smart-virtual-list>
</div> </div>
<div v-else> <div v-else>
......
---
title: Added smart virtual list component to test reports to enhance rendering performance
merge_request: 22381
author:
type: performance
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