Commit 6da8ef16 authored by Rajat Jain's avatar Rajat Jain

Add license check to swimlanes

Add license check to swimlanes
parent b58d35dd
...@@ -369,6 +369,10 @@ export default () => { ...@@ -369,6 +369,10 @@ export default () => {
toggleFocusMode(ModalStore, boardsStore); toggleFocusMode(ModalStore, boardsStore);
toggleLabels(); toggleLabels();
if (gon.features?.swimlanes) {
toggleEpicsSwimlanes(); toggleEpicsSwimlanes();
}
mountMultipleBoardsSwitcher(); mountMultipleBoardsSwitcher();
}; };
...@@ -5,7 +5,7 @@ export default { ...@@ -5,7 +5,7 @@ export default {
getLabelToggleState: state => (state.isShowingLabels ? 'on' : 'off'), getLabelToggleState: state => (state.isShowingLabels ? 'on' : 'off'),
isSidebarOpen: state => state.activeId !== inactiveId, isSidebarOpen: state => state.activeId !== inactiveId,
isSwimlanesOn: state => { isSwimlanesOn: state => {
if (!gon?.features?.boardsWithSwimlanes) { if (!gon?.features?.boardsWithSwimlanes && !gon?.features?.swimlanes) {
return false; return false;
} }
......
---
title: Add swimlanes license check
merge_request: 44880
author:
type: changed
...@@ -77,7 +77,8 @@ RSpec.describe 'issue boards', :js do ...@@ -77,7 +77,8 @@ RSpec.describe 'issue boards', :js do
context 'swimlanes dropdown' do context 'swimlanes dropdown' do
context 'feature flag on' do context 'feature flag on' do
before do before do
stub_feature_flags(boards_with_swimlanes: true) stub_licensed_features(swimlanes: true)
stub_feature_flags(boards_with_swimlanes: true, swimlanes: true)
end end
it 'does not show Group by dropdown when user is not logged in' do it 'does not show Group by dropdown when user is not logged in' do
...@@ -97,7 +98,7 @@ RSpec.describe 'issue boards', :js do ...@@ -97,7 +98,7 @@ RSpec.describe 'issue boards', :js do
context 'feature flag off' do context 'feature flag off' do
before do before do
stub_feature_flags(boards_with_swimlanes: false) stub_feature_flags(boards_with_swimlanes: false, swimlanes: false)
end end
it 'does not show Group by dropdown when user is not logged in' do it 'does not show Group by dropdown when user is not logged in' do
......
...@@ -29,7 +29,9 @@ RSpec.describe 'epics swimlanes', :js do ...@@ -29,7 +29,9 @@ RSpec.describe 'epics swimlanes', :js do
before do before do
project.add_maintainer(user) project.add_maintainer(user)
group.add_maintainer(user) group.add_maintainer(user)
stub_licensed_features(epics: true) stub_licensed_features(epics: true, swimlanes: true)
stub_feature_flags(epics: true, boards_with_swimlanes: true, swimlanes: true)
sign_in(user) sign_in(user)
visit_board_page visit_board_page
select_epics select_epics
......
...@@ -34,7 +34,7 @@ RSpec.describe 'epics swimlanes filtering', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'epics swimlanes filtering', :js do
project.add_maintainer(user) project.add_maintainer(user)
project.add_maintainer(user2) project.add_maintainer(user2)
stub_licensed_features(epics: true) stub_licensed_features(epics: true, swimlanes: true)
sign_in(user) sign_in(user)
visit_board_page visit_board_page
......
...@@ -22,7 +22,7 @@ RSpec.describe 'epics swimlanes', :js do ...@@ -22,7 +22,7 @@ RSpec.describe 'epics swimlanes', :js do
let_it_be(:epic_issue2) { create(:epic_issue, epic: epic2, issue: issue2) } let_it_be(:epic_issue2) { create(:epic_issue, epic: epic2, issue: issue2) }
before do before do
stub_licensed_features(epics: true) stub_licensed_features(epics: true, swimlanes: true)
sign_in(user) sign_in(user)
visit_board_page visit_board_page
select_epics select_epics
......
...@@ -10,6 +10,10 @@ RSpec.describe API::Boards do ...@@ -10,6 +10,10 @@ RSpec.describe API::Boards do
it_behaves_like 'multiple and scoped issue boards', "/projects/:id/boards" it_behaves_like 'multiple and scoped issue boards', "/projects/:id/boards"
before do
stub_licensed_features(swimlanes: true)
end
describe 'POST /projects/:id/boards/:board_id/lists' do describe 'POST /projects/:id/boards/:board_id/lists' do
let(:url) { "/projects/#{board_parent.id}/boards/#{board.id}/lists" } let(:url) { "/projects/#{board_parent.id}/boards/#{board.id}/lists" }
......
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