Commit 8b215f30 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '288804-clean-up-feature-flag' into 'master'

Clean up saas_manual_renew_button feature flag

See merge request gitlab-org/gitlab!52652
parents 3fd2e47c 907dc8ba
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
return this.glFeatures.saasAddSeatsButton && !this.isFreePlan; return this.glFeatures.saasAddSeatsButton && !this.isFreePlan;
}, },
canRenew() { canRenew() {
return this.glFeatures.saasManualRenewButton && !this.isFreePlan; return !this.isFreePlan;
}, },
canUpgrade() { canUpgrade() {
return this.isFreePlan || this.plan.upgradable; return this.isFreePlan || this.plan.upgradable;
......
...@@ -5,7 +5,6 @@ class Groups::BillingsController < Groups::ApplicationController ...@@ -5,7 +5,6 @@ class Groups::BillingsController < Groups::ApplicationController
before_action :verify_namespace_plan_check_enabled before_action :verify_namespace_plan_check_enabled
before_action only: [:index] do before_action only: [:index] do
push_frontend_feature_flag(:saas_manual_renew_button)
push_frontend_feature_flag(:saas_add_seats_button) push_frontend_feature_flag(:saas_add_seats_button)
end end
......
---
title: Add manual renew button to billings page
merge_request: 52652
author:
type: other
---
name: saas_manual_renew_button
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48610
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/288804
milestone: '13.7'
type: development
group: group::fulfillment
default_enabled: false
...@@ -78,7 +78,6 @@ RSpec.describe 'Groups > Billing', :js do ...@@ -78,7 +78,6 @@ RSpec.describe 'Groups > Billing', :js do
context 'with disabled feature flags' do context 'with disabled feature flags' do
before do before do
stub_feature_flags(saas_manual_renew_button: false)
stub_feature_flags(saas_add_seats_button: false) stub_feature_flags(saas_add_seats_button: false)
visit group_billings_path(group) visit group_billings_path(group)
end end
...@@ -86,7 +85,6 @@ RSpec.describe 'Groups > Billing', :js do ...@@ -86,7 +85,6 @@ RSpec.describe 'Groups > Billing', :js do
it 'does not show "Add Seats" button' do it 'does not show "Add Seats" button' do
within subscription_table do within subscription_table do
expect(page).not_to have_link("Add seats") expect(page).not_to have_link("Add seats")
expect(page).not_to have_link("Renew")
end end
end end
end end
...@@ -111,13 +109,10 @@ RSpec.describe 'Groups > Billing', :js do ...@@ -111,13 +109,10 @@ RSpec.describe 'Groups > Billing', :js do
end end
context 'with feature flags' do context 'with feature flags' do
using RSpec::Parameterized::TableSyntax where(:saas_add_seats_button) do
[
where(:saas_manual_renew_button, :saas_add_seats_button) do true, false
true | true ]
true | false
false | true
false | false
end end
let(:plan) { 'bronze' } let(:plan) { 'bronze' }
...@@ -128,7 +123,6 @@ RSpec.describe 'Groups > Billing', :js do ...@@ -128,7 +123,6 @@ RSpec.describe 'Groups > Billing', :js do
with_them do with_them do
before do before do
stub_feature_flags(saas_manual_renew_button: saas_manual_renew_button)
stub_feature_flags(saas_add_seats_button: saas_add_seats_button) stub_feature_flags(saas_add_seats_button: saas_add_seats_button)
end end
...@@ -136,8 +130,7 @@ RSpec.describe 'Groups > Billing', :js do ...@@ -136,8 +130,7 @@ RSpec.describe 'Groups > Billing', :js do
visit group_billings_path(group) visit group_billings_path(group)
expect(page).to have_pushed_frontend_feature_flags( expect(page).to have_pushed_frontend_feature_flags(
saasAddSeatsButton: saas_add_seats_button, saasAddSeatsButton: saas_add_seats_button
saasManualRenewButton: saas_manual_renew_button
) )
end end
end end
......
...@@ -19,7 +19,7 @@ describe('SubscriptionTable component', () => { ...@@ -19,7 +19,7 @@ describe('SubscriptionTable component', () => {
let store; let store;
let wrapper; let wrapper;
const defaultFlags = { saasManualRenewButton: false, saasAddSeatsButton: false }; const defaultFlags = { saasAddSeatsButton: false };
const findAddSeatsButton = () => wrapper.findByTestId('add-seats-button'); const findAddSeatsButton = () => wrapper.findByTestId('add-seats-button');
const findManageButton = () => wrapper.findByTestId('manage-button'); const findManageButton = () => wrapper.findByTestId('manage-button');
...@@ -143,19 +143,15 @@ describe('SubscriptionTable component', () => { ...@@ -143,19 +143,15 @@ describe('SubscriptionTable component', () => {
describe('Renew button', () => { describe('Renew button', () => {
describe.each` describe.each`
planCode | featureFlag | expected | testDescription planCode | expected | testDescription
${'silver'} | ${true} | ${true} | ${'renders the button'} ${'silver'} | ${true} | ${'renders the button'}
${'silver'} | ${false} | ${false} | ${'does not render the button'} ${null} | ${false} | ${'does not render the button'}
${null} | ${true} | ${false} | ${'does not render the button'} ${'free'} | ${false} | ${'does not render the button'}
${null} | ${false} | ${false} | ${'does not render the button'}
${'free'} | ${true} | ${false} | ${'does not render the button'}
${'free'} | ${false} | ${false} | ${'does not render the button'}
`( `(
'given a plan with state: planCode = $planCode and saasManualRenewButton = $featureFlag', 'given a plan with state: planCode = $planCode',
({ planCode, featureFlag, expected, testDescription }) => { ({ planCode, expected, testDescription }) => {
beforeEach(() => { beforeEach(() => {
createComponentWithStore({ createComponentWithStore({
featureFlags: { saasManualRenewButton: featureFlag },
state: { state: {
isLoadingSubscription: false, isLoadingSubscription: false,
plan: { plan: {
......
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