Commit c9ec5e32 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch 'kp-remove-roadmap-buffered-rendering-ff' into 'master'

Remove unused feature flag `roadmap_buffered_rendering` [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!57486
parents 63a18c1c 75456ad0
---
title: Remove unused feature flag ':roadmap_buffered_rendering'
merge_request: 57486
author:
type: removed
<script> <script>
import VirtualList from 'vue-virtual-scroll-list';
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...@@ -14,7 +13,6 @@ export default { ...@@ -14,7 +13,6 @@ export default {
EpicItem, EpicItem,
epicItemHeight: EPIC_ITEM_HEIGHT, epicItemHeight: EPIC_ITEM_HEIGHT,
components: { components: {
VirtualList,
EpicItem, EpicItem,
CurrentDayIndicator, CurrentDayIndicator,
}, },
...@@ -140,22 +138,6 @@ export default { ...@@ -140,22 +138,6 @@ export default {
handleEpicsListScroll({ scrollTop, clientHeight, scrollHeight }) { handleEpicsListScroll({ scrollTop, clientHeight, scrollHeight }) {
this.showBottomShadow = Math.ceil(scrollTop) + clientHeight < scrollHeight; this.showBottomShadow = Math.ceil(scrollTop) + clientHeight < scrollHeight;
}, },
getEpicItemProps(index) {
return {
key: generateKey(this.displayedEpics[index]),
props: {
epic: this.displayedEpics[index],
presetType: this.presetType,
timeframe: this.timeframe,
currentGroupId: this.currentGroupId,
clientWidth: this.clientWidth,
childLevel: 0,
childrenEpics: this.childrenEpics,
childrenFlags: this.childrenFlags,
hasFiltersApplied: this.hasFiltersApplied,
},
};
},
toggleIsEpicExpanded(epic) { toggleIsEpicExpanded(epic) {
this.toggleEpic({ parentItem: epic }); this.toggleEpic({ parentItem: epic });
}, },
...@@ -166,34 +148,20 @@ export default { ...@@ -166,34 +148,20 @@ export default {
<template> <template>
<div :style="sectionContainerStyles" class="epics-list-section"> <div :style="sectionContainerStyles" class="epics-list-section">
<template v-if="glFeatures.roadmapBufferedRendering && !emptyRowContainerVisible"> <epic-item
<virtual-list v-for="epic in displayedEpics"
v-if="displayedEpics.length" ref="epicItems"
:size="$options.epicItemHeight" :key="generateKey(epic)"
:remain="bufferSize" :preset-type="presetType"
:bench="bufferSize" :epic="epic"
:scrollelement="roadmapShellEl" :timeframe="timeframe"
:item="$options.EpicItem" :current-group-id="currentGroupId"
:itemcount="displayedEpics.length" :client-width="clientWidth"
:itemprops="getEpicItemProps" :child-level="0"
/> :children-epics="childrenEpics"
</template> :children-flags="childrenFlags"
<template v-else> :has-filters-applied="hasFiltersApplied"
<epic-item />
v-for="epic in displayedEpics"
ref="epicItems"
:key="generateKey(epic)"
:preset-type="presetType"
:epic="epic"
:timeframe="timeframe"
:current-group-id="currentGroupId"
:client-width="clientWidth"
:child-level="0"
:children-epics="childrenEpics"
:children-flags="childrenFlags"
:has-filters-applied="hasFiltersApplied"
/>
</template>
<div <div
v-if="emptyRowContainerVisible" v-if="emptyRowContainerVisible"
:style="emptyRowContainerStyles" :style="emptyRowContainerStyles"
......
...@@ -8,7 +8,6 @@ module Groups ...@@ -8,7 +8,6 @@ module Groups
before_action :check_epics_available! before_action :check_epics_available!
before_action :persist_roadmap_layout, only: [:show] before_action :persist_roadmap_layout, only: [:show]
before_action do before_action do
push_frontend_feature_flag(:roadmap_buffered_rendering, @group)
push_frontend_feature_flag(:async_filtering, @group, default_enabled: true) push_frontend_feature_flag(:async_filtering, @group, default_enabled: true)
end end
......
---
name: roadmap_buffered_rendering
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19875
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/216792
milestone: '12.6'
type: development
group: group::product planning
default_enabled: false
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import VirtualList from 'vue-virtual-scroll-list';
import EpicItem from 'ee/roadmap/components/epic_item.vue'; import EpicItem from 'ee/roadmap/components/epic_item.vue';
import EpicsListSection from 'ee/roadmap/components/epics_list_section.vue'; import EpicsListSection from 'ee/roadmap/components/epics_list_section.vue';
import { import {
...@@ -44,7 +43,6 @@ const createComponent = ({ ...@@ -44,7 +43,6 @@ const createComponent = ({
timeframe = mockTimeframeMonths, timeframe = mockTimeframeMonths,
currentGroupId = mockGroupId, currentGroupId = mockGroupId,
presetType = PRESET_TYPES.MONTHS, presetType = PRESET_TYPES.MONTHS,
roadmapBufferedRendering = true,
hasFiltersApplied = false, hasFiltersApplied = false,
} = {}) => { } = {}) => {
return shallowMount(EpicsListSection, { return shallowMount(EpicsListSection, {
...@@ -61,9 +59,6 @@ const createComponent = ({ ...@@ -61,9 +59,6 @@ const createComponent = ({
currentGroupId, currentGroupId,
hasFiltersApplied, hasFiltersApplied,
}, },
provide: {
glFeatures: { roadmapBufferedRendering },
},
}); });
}; };
...@@ -234,34 +229,6 @@ describe('EpicsListSectionComponent', () => { ...@@ -234,34 +229,6 @@ describe('EpicsListSectionComponent', () => {
expect(wrapper.vm.showBottomShadow).toBe(false); expect(wrapper.vm.showBottomShadow).toBe(false);
}); });
}); });
describe('getEpicItemProps', () => {
it('returns an object containing props for EpicItem component', () => {
expect(wrapper.vm.getEpicItemProps(1)).toEqual(
expect.objectContaining({
key: `epic-${wrapper.vm.epics[1].id}`,
props: {
epic: wrapper.vm.epics[1],
presetType: wrapper.vm.presetType,
timeframe: wrapper.vm.timeframe,
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,
},
}),
);
});
});
}); });
describe('template', () => { describe('template', () => {
...@@ -269,30 +236,7 @@ describe('EpicsListSectionComponent', () => { ...@@ -269,30 +236,7 @@ describe('EpicsListSectionComponent', () => {
expect(wrapper.classes('epics-list-section')).toBe(true); expect(wrapper.classes('epics-list-section')).toBe(true);
}); });
it('renders virtual-list when roadmapBufferedRendering is `true` and `epics.length` is more than `bufferSize`', () => { it('renders epic-item', () => {
wrapper.vm.setBufferSize(5);
return wrapper.vm.$nextTick(() => {
expect(wrapper.find(VirtualList).exists()).toBe(true);
});
});
it('renders epic-item when roadmapBufferedRendering is `false`', () => {
// Destroy the wrapper created in the beforeEach above
wrapper.destroy();
const wrapperFlagOff = createComponent({
roadmapBufferedRendering: false,
});
expect(wrapperFlagOff.find(EpicItem).exists()).toBe(true);
wrapperFlagOff.destroy();
});
it('renders epic-item when roadmapBufferedRendering is `true` and `epics.length` is less than `bufferSize`', () => {
wrapper.vm.setBufferSize(50);
expect(wrapper.find(EpicItem).exists()).toBe(true); expect(wrapper.find(EpicItem).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