Commit 00c5c91c authored by Florie Guibert's avatar Florie Guibert

Fix epics on roadmap when using VirtualList

parent f48bd763
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
if (this.$refs.epicItems && this.$refs.epicItems.length) { if (this.$refs.epicItems && this.$refs.epicItems.length) {
return { return {
height: `${this.$el.clientHeight - height: `${this.$el.clientHeight -
this.epics.length * this.$refs.epicItems[0].$el.clientHeight}px`, this.displayedEpics.length * this.$refs.epicItems[0].$el.clientHeight}px`,
}; };
} }
return {}; return {};
...@@ -154,10 +154,15 @@ export default { ...@@ -154,10 +154,15 @@ export default {
return { return {
key: index, key: index,
props: { props: {
epic: this.epics[index], epic: this.displayedEpics[index],
presetType: this.presetType, presetType: this.presetType,
timeframe: this.timeframe, timeframe: this.timeframe,
currentGroupId: this.currentGroupId, currentGroupId: this.currentGroupId,
clientWidth: this.clientWidth,
childLevel: 0,
childrenEpics: this.childrenEpics,
childrenFlags: this.childrenFlags,
hasFiltersApplied: this.hasFiltersApplied,
}, },
}; };
}, },
...@@ -173,22 +178,21 @@ export default { ...@@ -173,22 +178,21 @@ export default {
<div :style="sectionContainerStyles" class="epics-list-section"> <div :style="sectionContainerStyles" class="epics-list-section">
<template v-if="glFeatures.roadmapBufferedRendering && !emptyRowContainerVisible"> <template v-if="glFeatures.roadmapBufferedRendering && !emptyRowContainerVisible">
<virtual-list <virtual-list
v-if="epics.length" v-if="displayedEpics.length"
:size="$options.epicItemHeight" :size="$options.epicItemHeight"
:remain="bufferSize" :remain="bufferSize"
:bench="bufferSize" :bench="bufferSize"
:scrollelement="roadmapShellEl" :scrollelement="roadmapShellEl"
:item="$options.EpicItem" :item="$options.EpicItem"
:itemcount="epics.length" :itemcount="displayedEpics.length"
:itemprops="getEpicItemProps" :itemprops="getEpicItemProps"
/> />
</template> </template>
<template v-else> <template v-else>
<epic-item <epic-item
v-for="(epic, index) in displayedEpics" v-for="epic in displayedEpics"
ref="epicItems" ref="epicItems"
:key="generateKey(epic)" :key="generateKey(epic)"
:first-epic="index === 0"
:preset-type="presetType" :preset-type="presetType"
:epic="epic" :epic="epic"
:timeframe="timeframe" :timeframe="timeframe"
......
...@@ -245,6 +245,18 @@ describe('EpicsListSectionComponent', () => { ...@@ -245,6 +245,18 @@ describe('EpicsListSectionComponent', () => {
presetType: wrapper.vm.presetType, presetType: wrapper.vm.presetType,
timeframe: wrapper.vm.timeframe, timeframe: wrapper.vm.timeframe,
currentGroupId: wrapper.vm.currentGroupId, currentGroupId: wrapper.vm.currentGroupId,
clientWidth: wrapper.vm.clientWidth,
childLevel: 0,
childrenEpics: expect.objectContaining({
41: expect.arrayContaining([mockFormattedChildEpic1]),
}),
childrenFlags: expect.objectContaining({
1: {
itemChildrenFetchInProgress: false,
itemExpanded: false,
},
}),
hasFiltersApplied: false,
}, },
}), }),
); );
......
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