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>
import VirtualList from 'vue-virtual-scroll-list';
import { mapState, mapActions } from 'vuex';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
......@@ -14,7 +13,6 @@ export default {
EpicItem,
epicItemHeight: EPIC_ITEM_HEIGHT,
components: {
VirtualList,
EpicItem,
CurrentDayIndicator,
},
......@@ -140,22 +138,6 @@ export default {
handleEpicsListScroll({ 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) {
this.toggleEpic({ parentItem: epic });
},
......@@ -166,34 +148,20 @@ export default {
<template>
<div :style="sectionContainerStyles" class="epics-list-section">
<template v-if="glFeatures.roadmapBufferedRendering && !emptyRowContainerVisible">
<virtual-list
v-if="displayedEpics.length"
:size="$options.epicItemHeight"
:remain="bufferSize"
:bench="bufferSize"
:scrollelement="roadmapShellEl"
:item="$options.EpicItem"
:itemcount="displayedEpics.length"
:itemprops="getEpicItemProps"
/>
</template>
<template v-else>
<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>
<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"
/>
<div
v-if="emptyRowContainerVisible"
:style="emptyRowContainerStyles"
......
......@@ -8,7 +8,6 @@ module Groups
before_action :check_epics_available!
before_action :persist_roadmap_layout, only: [:show]
before_action do
push_frontend_feature_flag(:roadmap_buffered_rendering, @group)
push_frontend_feature_flag(:async_filtering, @group, default_enabled: true)
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 VirtualList from 'vue-virtual-scroll-list';
import EpicItem from 'ee/roadmap/components/epic_item.vue';
import EpicsListSection from 'ee/roadmap/components/epics_list_section.vue';
import {
......@@ -44,7 +43,6 @@ const createComponent = ({
timeframe = mockTimeframeMonths,
currentGroupId = mockGroupId,
presetType = PRESET_TYPES.MONTHS,
roadmapBufferedRendering = true,
hasFiltersApplied = false,
} = {}) => {
return shallowMount(EpicsListSection, {
......@@ -61,9 +59,6 @@ const createComponent = ({
currentGroupId,
hasFiltersApplied,
},
provide: {
glFeatures: { roadmapBufferedRendering },
},
});
};
......@@ -234,34 +229,6 @@ describe('EpicsListSectionComponent', () => {
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', () => {
......@@ -269,30 +236,7 @@ describe('EpicsListSectionComponent', () => {
expect(wrapper.classes('epics-list-section')).toBe(true);
});
it('renders virtual-list when roadmapBufferedRendering is `true` and `epics.length` is more than `bufferSize`', () => {
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);
it('renders epic-item', () => {
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