Commit 56b6b242 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '324994-roll-out-swimlanes_buffered_rendering-feature' into 'master'

Clean up swimlanes_buffered_rendering feature flag

See merge request gitlab-org/gitlab!78244
parents e9155538 93fdd8d9
...@@ -9,7 +9,6 @@ class Groups::BoardsController < Groups::ApplicationController ...@@ -9,7 +9,6 @@ class Groups::BoardsController < Groups::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:issue_boards_filtered_search, group, default_enabled: :yaml) push_frontend_feature_flag(:issue_boards_filtered_search, group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml) push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
push_frontend_feature_flag(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
experiment(:prominent_create_board_btn, subject: current_user) do |e| experiment(:prominent_create_board_btn, subject: current_user) do |e|
e.use { } e.use { }
......
...@@ -7,7 +7,6 @@ class Projects::BoardsController < Projects::ApplicationController ...@@ -7,7 +7,6 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available! before_action :check_issues_available!
before_action :assign_endpoint_vars before_action :assign_endpoint_vars
before_action do before_action do
push_frontend_feature_flag(:swimlanes_buffered_rendering, project, default_enabled: :yaml)
push_frontend_feature_flag(:issue_boards_filtered_search, project&.group, default_enabled: :yaml) push_frontend_feature_flag(:issue_boards_filtered_search, project&.group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml) push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml)
......
---
name: swimlanes_buffered_rendering
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56614
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/324994
milestone: '13.11'
type: development
group: group::product planning
default_enabled: false
\ No newline at end of file
...@@ -9,7 +9,6 @@ import { isListDraggable } from '~/boards/boards_util'; ...@@ -9,7 +9,6 @@ import { isListDraggable } from '~/boards/boards_util';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import { s__, n__, __ } from '~/locale'; import { s__, n__, __ } from '~/locale';
import defaultSortableConfig from '~/sortable/sortable_config'; import defaultSortableConfig from '~/sortable/sortable_config';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { calculateSwimlanesBufferSize } from '../boards_util'; import { calculateSwimlanesBufferSize } from '../boards_util';
import { DRAGGABLE_TAG, EPIC_LANE_BASE_HEIGHT, DraggableItemTypes } from '../constants'; import { DRAGGABLE_TAG, EPIC_LANE_BASE_HEIGHT, DraggableItemTypes } from '../constants';
import EpicLane from './epic_lane.vue'; import EpicLane from './epic_lane.vue';
...@@ -33,7 +32,6 @@ export default { ...@@ -33,7 +32,6 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
lists: { lists: {
type: Array, type: Array,
...@@ -227,28 +225,16 @@ export default { ...@@ -227,28 +225,16 @@ export default {
</div> </div>
</component> </component>
<div class="board-epics-swimlanes gl-display-table"> <div class="board-epics-swimlanes gl-display-table">
<template v-if="glFeatures.swimlanesBufferedRendering"> <virtual-list
<virtual-list v-if="epics.length"
v-if="epics.length" :size="$options.epicLaneBaseHeight"
:size="$options.epicLaneBaseHeight" :remain="bufferSize"
:remain="bufferSize" :bench="bufferSize"
:bench="bufferSize" :scrollelement="$refs.scrollableContainer"
:scrollelement="$refs.scrollableContainer" :item="$options.EpicLane"
:item="$options.EpicLane" :itemcount="epics.length"
:itemcount="epics.length" :itemprops="getEpicLaneProps"
:itemprops="getEpicLaneProps" />
/>
</template>
<template v-else>
<epic-lane
v-for="epic in epics"
:key="epic.id"
:epic="epic"
:lists="lists"
:disabled="disabled"
:can-admin-list="canAdminList"
/>
</template>
<div v-if="hasMoreEpics" class="swimlanes-button gl-pb-3 gl-pl-3 gl-sticky gl-left-0"> <div v-if="hasMoreEpics" class="swimlanes-button gl-pb-3 gl-pl-3 gl-sticky gl-left-0">
<gl-button <gl-button
category="tertiary" category="tertiary"
......
...@@ -4,7 +4,7 @@ import Vue from 'vue'; ...@@ -4,7 +4,7 @@ import Vue from 'vue';
import VirtualList from 'vue-virtual-scroll-list'; import VirtualList from 'vue-virtual-scroll-list';
import Draggable from 'vuedraggable'; import Draggable from 'vuedraggable';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { calculateSwimlanesBufferSize } from 'ee/boards/boards_util'; import * as BoardUtils from 'ee/boards/boards_util';
import EpicLane from 'ee/boards/components/epic_lane.vue'; import EpicLane from 'ee/boards/components/epic_lane.vue';
import EpicsSwimlanes from 'ee/boards/components/epics_swimlanes.vue'; import EpicsSwimlanes from 'ee/boards/components/epics_swimlanes.vue';
import IssueLaneList from 'ee/boards/components/issues_lane_list.vue'; import IssueLaneList from 'ee/boards/components/issues_lane_list.vue';
...@@ -20,6 +20,7 @@ jest.mock('ee/boards/boards_util'); ...@@ -20,6 +20,7 @@ jest.mock('ee/boards/boards_util');
describe('EpicsSwimlanes', () => { describe('EpicsSwimlanes', () => {
let wrapper; let wrapper;
const bufferSize = 100;
const findDraggable = () => wrapper.findComponent(Draggable); const findDraggable = () => wrapper.findComponent(Draggable);
const findLoadMoreEpicsButton = () => wrapper.findByTestId('load-more-epics'); const findLoadMoreEpicsButton = () => wrapper.findByTestId('load-more-epics');
...@@ -69,7 +70,6 @@ describe('EpicsSwimlanes', () => { ...@@ -69,7 +70,6 @@ describe('EpicsSwimlanes', () => {
const createComponent = ({ const createComponent = ({
canAdminList = false, canAdminList = false,
swimlanesBufferedRendering = false,
epicLanesFetchInProgress = false, epicLanesFetchInProgress = false,
listItemsFetchInProgress = false, listItemsFetchInProgress = false,
hasMoreEpics = false, hasMoreEpics = false,
...@@ -84,13 +84,14 @@ describe('EpicsSwimlanes', () => { ...@@ -84,13 +84,14 @@ describe('EpicsSwimlanes', () => {
shallowMount(EpicsSwimlanes, { shallowMount(EpicsSwimlanes, {
propsData: { ...defaultProps, canAdminList }, propsData: { ...defaultProps, canAdminList },
store, store,
provide: {
glFeatures: { swimlanesBufferedRendering },
},
}), }),
); );
}; };
beforeEach(() => {
jest.spyOn(BoardUtils, 'calculateSwimlanesBufferSize').mockReturnValue(bufferSize);
});
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
...@@ -133,14 +134,29 @@ describe('EpicsSwimlanes', () => { ...@@ -133,14 +134,29 @@ describe('EpicsSwimlanes', () => {
expect(wrapper.findAllComponents(BoardListHeader)).toHaveLength(4); expect(wrapper.findAllComponents(BoardListHeader)).toHaveLength(4);
}); });
it('displays EpicLane components for epic', () => {
expect(wrapper.findAllComponents(EpicLane)).toHaveLength(5);
});
it('does not display IssueLaneList component by default', () => { it('does not display IssueLaneList component by default', () => {
expect(wrapper.findComponent(IssueLaneList).exists()).toBe(false); expect(wrapper.findComponent(IssueLaneList).exists()).toBe(false);
}); });
it('renders virtual-list', () => {
const virtualList = wrapper.findComponent(VirtualList);
const scrollableContainer = wrapper.find({ ref: 'scrollableContainer' }).element;
expect(BoardUtils.calculateSwimlanesBufferSize).toHaveBeenCalledWith(
wrapper.element.offsetTop,
);
expect(virtualList.props()).toMatchObject({
remain: bufferSize,
bench: bufferSize,
item: EpicLane,
size: EPIC_LANE_BASE_HEIGHT,
itemcount: mockEpics.length,
itemprops: expect.any(Function),
});
expect(virtualList.props().scrollelement).toBe(scrollableContainer);
});
it('does not display load more epics button if there are no more epics', () => { it('does not display load more epics button if there are no more epics', () => {
expect(findLoadMoreEpicsButton().exists()).toBe(false); expect(findLoadMoreEpicsButton().exists()).toBe(false);
}); });
...@@ -204,30 +220,4 @@ describe('EpicsSwimlanes', () => { ...@@ -204,30 +220,4 @@ describe('EpicsSwimlanes', () => {
}, },
); );
}); });
describe('when swimlanesBufferedRendering is true', () => {
const bufferSize = 100;
beforeEach(() => {
calculateSwimlanesBufferSize.mockReturnValueOnce(bufferSize);
createComponent({ swimlanesBufferedRendering: true });
});
it('renders virtual-list', () => {
const virtualList = wrapper.find(VirtualList);
const scrollableContainer = wrapper.find({ ref: 'scrollableContainer' }).element;
expect(calculateSwimlanesBufferSize).toHaveBeenCalledWith(wrapper.element.offsetTop);
expect(virtualList.props()).toMatchObject({
remain: bufferSize,
bench: bufferSize,
item: EpicLane,
size: EPIC_LANE_BASE_HEIGHT,
itemcount: mockEpics.length,
itemprops: expect.any(Function),
});
expect(virtualList.props().scrollelement).toBe(scrollableContainer);
});
});
}); });
...@@ -16,15 +16,6 @@ RSpec.describe Groups::BoardsController do ...@@ -16,15 +16,6 @@ RSpec.describe Groups::BoardsController do
expect { list_boards }.to change(group.boards, :count).by(1) expect { list_boards }.to change(group.boards, :count).by(1)
end end
it 'pushes swimlanes_buffered_rendering feature flag' do
allow(controller).to receive(:push_frontend_feature_flag).and_call_original
expect(controller).to receive(:push_frontend_feature_flag)
.with(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
list_boards
end
context 'when format is HTML' do context 'when format is HTML' do
it 'renders template' do it 'renders template' do
list_boards list_boards
...@@ -107,15 +98,6 @@ RSpec.describe Groups::BoardsController do ...@@ -107,15 +98,6 @@ RSpec.describe Groups::BoardsController do
describe 'GET show' do describe 'GET show' do
let!(:board) { create(:board, group: group) } let!(:board) { create(:board, group: group) }
it 'pushes swimlanes_buffered_rendering feature flag' do
allow(controller).to receive(:push_frontend_feature_flag).and_call_original
expect(controller).to receive(:push_frontend_feature_flag)
.with(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
read_board board: board
end
context 'when format is HTML' do context 'when format is HTML' do
it 'renders template' do it 'renders template' do
expect { read_board board: board }.to change(BoardGroupRecentVisit, :count).by(1) expect { read_board board: board }.to change(BoardGroupRecentVisit, :count).by(1)
......
...@@ -22,15 +22,6 @@ RSpec.describe Projects::BoardsController do ...@@ -22,15 +22,6 @@ RSpec.describe Projects::BoardsController do
expect(assigns(:boards_endpoint)).to eq project_boards_path(project) expect(assigns(:boards_endpoint)).to eq project_boards_path(project)
end end
it 'pushes swimlanes_buffered_rendering feature flag' do
allow(controller).to receive(:push_frontend_feature_flag).and_call_original
expect(controller).to receive(:push_frontend_feature_flag)
.with(:swimlanes_buffered_rendering, project, default_enabled: :yaml)
list_boards
end
context 'when format is HTML' do context 'when format is HTML' do
it 'renders template' do it 'renders template' do
list_boards list_boards
...@@ -125,15 +116,6 @@ RSpec.describe Projects::BoardsController do ...@@ -125,15 +116,6 @@ RSpec.describe Projects::BoardsController do
describe 'GET show' do describe 'GET show' do
let!(:board) { create(:board, project: project) } let!(:board) { create(:board, project: project) }
it 'pushes swimlanes_buffered_rendering feature flag' do
allow(controller).to receive(:push_frontend_feature_flag).and_call_original
expect(controller).to receive(:push_frontend_feature_flag)
.with(:swimlanes_buffered_rendering, project, default_enabled: :yaml)
read_board board: board
end
it 'sets boards_endpoint instance variable to a boards path' do it 'sets boards_endpoint instance variable to a boards path' do
read_board board: board read_board board: board
......
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