Commit 460c1eb7 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'ss/fix-wip-limits-ff-issue' into 'master'

Convert all FF calls to beta_feature_available?

See merge request gitlab-org/gitlab!21518
parents 79959871 b7ba25a6
......@@ -9,7 +9,7 @@ module BoardsActions
before_action :boards, only: :index
before_action :board, only: :show
before_action :push_wip_limits, only: :index
before_action :push_wip_limits, only: [:index, :show]
end
def index
......
......@@ -11,9 +11,7 @@ module EE
private
def push_wip_limits
if parent.feature_available?(:wip_limits)
push_frontend_feature_flag(:wip_limits)
end
push_frontend_feature_flag(:wip_limits, parent)
end
end
end
......@@ -36,7 +36,7 @@ module EE
private
def wip_limits_available?
board_parent.feature_available?(:wip_limits)
board_parent.beta_feature_available?(:wip_limits)
end
end
end
......
......@@ -38,7 +38,7 @@ module EE
def wip_limits_available?
strong_memoize(:wip_limits_available) do
board.resource_parent.feature_available?(:wip_limits)
board.resource_parent.beta_feature_available?(:wip_limits)
end
end
......
......@@ -69,7 +69,7 @@ module EE
end
def wip_limits_available?
parent.feature_available?(:wip_limits)
parent.beta_feature_available?(:wip_limits)
end
end
end
......
- if current_board_parent.feature_available?(:wip_limits)
- if current_board_parent.beta_feature_available?(:wip_limits)
%gl-button.no-drag.rounded-right{ type: "button",
"v-if" => "isSettingsShown",
"aria-label" => _("List Settings"),
......
......@@ -70,10 +70,6 @@ describe Boards::ListsController do
let(:label) { create(:group_label, group: group, name: 'Development') }
context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the created list' do
create_board_list user: user, board: board, label_id: label.id, params: { max_issue_count: 2 }
......@@ -84,7 +80,7 @@ describe Boards::ListsController do
context 'without licensed wip limits' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
end
it 'ignores max issue count' do
......@@ -100,10 +96,6 @@ describe Boards::ListsController do
let(:label) { create(:group_label, group: group, name: 'Development') }
context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the created list' do
create_board_list user: user, board: board, label_id: label.id, params: { max_issue_weight: 3 }
......@@ -114,7 +106,7 @@ describe Boards::ListsController do
context 'without licensed wip limits' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
end
it 'ignores max issue count' do
......@@ -174,7 +166,6 @@ describe Boards::ListsController do
context 'when updating max limits' do
before do
sign_in(user)
stub_licensed_features(wip_limits: true)
end
it 'returns a successful 200 response when max issue count should be updated' do
......@@ -329,7 +320,7 @@ describe Boards::ListsController do
context 'when wip limits are not licensed' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
end
it 'fails to update max issue count with expected status' do
......
......@@ -174,10 +174,6 @@ describe 'issue boards', :js do
end
context 'When FF is turned on' do
before do
stub_licensed_features(wip_limits: true)
end
context 'when max issue count is set' do
let(:total_development_issues) { "1" }
......@@ -196,25 +192,20 @@ describe 'issue boards', :js do
let!(:list) { create(:list, board: board, label: label, position: 1) }
before do
stub_licensed_features(wip_limits: wip_limits)
project.add_developer(user)
login_as(user)
visit project_boards_path(project)
end
context 'When FF is turned on' do
let(:wip_limits) { true }
it 'shows the list settings button' do
expect(page).to have_selector(:button, "List Settings")
end
end
context 'When FF is turned off' do
let(:wip_limits) { false }
it 'shows the list settings button' do
it 'does not show the list settings button' do
stub_licensed_features(wip_limits: false)
expect(page).to have_no_selector(:button, "List Settings")
end
end
......
......@@ -71,10 +71,6 @@ describe List do
let!(:list2) { create(:list, board: board2) }
context 'with enabled wip_limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'returns the expected values' do
expect(list1.wip_limits_available?).to be_truthy
expect(list2.wip_limits_available?).to be_truthy
......@@ -83,7 +79,7 @@ describe List do
context 'with disabled wip_limits' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
end
it 'returns the expected values' do
......
......@@ -44,8 +44,6 @@ describe API::Boards do
context 'with WIP limits license' do
before do
stub_licensed_features(wip_limits: true)
get api(url, user)
end
......@@ -60,7 +58,7 @@ describe API::Boards do
context 'without WIP limits license' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
get api(url, user)
end
......
......@@ -9,10 +9,6 @@ describe 'EE::Boards::Lists::UpdateService' do
shared_examples 'board list update' do
context 'with licensed wip limits' do
before do
stub_licensed_features(wip_limits: true)
end
it 'updates the list if max_issue_count is given' do
update_list_and_test_result(list, { max_issue_count: 42 }, { max_issue_count: 42 })
end
......@@ -100,7 +96,7 @@ describe 'EE::Boards::Lists::UpdateService' do
context 'without licensed wip limits' do
before do
stub_licensed_features(wip_limits: false)
stub_feature_flags(wip_limits: false)
end
it 'does not update the list even if max_issue_count is given' do
......
......@@ -50,7 +50,7 @@ describe Boards::Lists::CreateService do
describe '#create_list_attributes' do
shared_examples 'attribute provider for list creation' do
before do
stub_licensed_features(wip_limits: wip_limits_enabled)
stub_feature_flags(wip_limits: wip_limits_enabled)
end
where(:params, :expected_max_issue_count, :expected_max_issue_weight) do
......
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