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
before_action do
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(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
experiment(:prominent_create_board_btn, subject: current_user) do |e|
e.use { }
......
......@@ -7,7 +7,6 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available!
before_action :assign_endpoint_vars
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(:board_multi_select, project, 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';
import eventHub from '~/boards/eventhub';
import { s__, n__, __ } from '~/locale';
import defaultSortableConfig from '~/sortable/sortable_config';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { calculateSwimlanesBufferSize } from '../boards_util';
import { DRAGGABLE_TAG, EPIC_LANE_BASE_HEIGHT, DraggableItemTypes } from '../constants';
import EpicLane from './epic_lane.vue';
......@@ -33,7 +32,6 @@ export default {
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [glFeatureFlagsMixin()],
props: {
lists: {
type: Array,
......@@ -227,28 +225,16 @@ export default {
</div>
</component>
<div class="board-epics-swimlanes gl-display-table">
<template v-if="glFeatures.swimlanesBufferedRendering">
<virtual-list
v-if="epics.length"
:size="$options.epicLaneBaseHeight"
:remain="bufferSize"
:bench="bufferSize"
:scrollelement="$refs.scrollableContainer"
:item="$options.EpicLane"
:itemcount="epics.length"
: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>
<virtual-list
v-if="epics.length"
:size="$options.epicLaneBaseHeight"
:remain="bufferSize"
:bench="bufferSize"
:scrollelement="$refs.scrollableContainer"
:item="$options.EpicLane"
:itemcount="epics.length"
:itemprops="getEpicLaneProps"
/>
<div v-if="hasMoreEpics" class="swimlanes-button gl-pb-3 gl-pl-3 gl-sticky gl-left-0">
<gl-button
category="tertiary"
......
......@@ -4,7 +4,7 @@ import Vue from 'vue';
import VirtualList from 'vue-virtual-scroll-list';
import Draggable from 'vuedraggable';
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 EpicsSwimlanes from 'ee/boards/components/epics_swimlanes.vue';
import IssueLaneList from 'ee/boards/components/issues_lane_list.vue';
......@@ -20,6 +20,7 @@ jest.mock('ee/boards/boards_util');
describe('EpicsSwimlanes', () => {
let wrapper;
const bufferSize = 100;
const findDraggable = () => wrapper.findComponent(Draggable);
const findLoadMoreEpicsButton = () => wrapper.findByTestId('load-more-epics');
......@@ -69,7 +70,6 @@ describe('EpicsSwimlanes', () => {
const createComponent = ({
canAdminList = false,
swimlanesBufferedRendering = false,
epicLanesFetchInProgress = false,
listItemsFetchInProgress = false,
hasMoreEpics = false,
......@@ -84,13 +84,14 @@ describe('EpicsSwimlanes', () => {
shallowMount(EpicsSwimlanes, {
propsData: { ...defaultProps, canAdminList },
store,
provide: {
glFeatures: { swimlanesBufferedRendering },
},
}),
);
};
beforeEach(() => {
jest.spyOn(BoardUtils, 'calculateSwimlanesBufferSize').mockReturnValue(bufferSize);
});
afterEach(() => {
wrapper.destroy();
});
......@@ -133,14 +134,29 @@ describe('EpicsSwimlanes', () => {
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', () => {
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', () => {
expect(findLoadMoreEpicsButton().exists()).toBe(false);
});
......@@ -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
expect { list_boards }.to change(group.boards, :count).by(1)
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
it 'renders template' do
list_boards
......@@ -107,15 +98,6 @@ RSpec.describe Groups::BoardsController do
describe 'GET show' do
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
it 'renders template' do
expect { read_board board: board }.to change(BoardGroupRecentVisit, :count).by(1)
......
......@@ -22,15 +22,6 @@ RSpec.describe Projects::BoardsController do
expect(assigns(:boards_endpoint)).to eq project_boards_path(project)
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
it 'renders template' do
list_boards
......@@ -125,15 +116,6 @@ RSpec.describe Projects::BoardsController do
describe 'GET show' do
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
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