Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9c764c7f
Commit
9c764c7f
authored
Mar 10, 2021
by
Angelo Gulina
Committed by
Jan Provaznik
Mar 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `saas_add_seats_button` FF [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
5492f611
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
89 deletions
+21
-89
config/feature_flags/development/saas_add_seats_button.yml
config/feature_flags/development/saas_add_seats_button.yml
+0
-8
ee/app/assets/javascripts/billings/subscriptions/components/subscription_table.vue
.../billings/subscriptions/components/subscription_table.vue
+8
-13
ee/app/controllers/groups/billings_controller.rb
ee/app/controllers/groups/billings_controller.rb
+0
-4
ee/changelogs/unreleased/ag-291060-feature-flag-rollout-of-saas_add_seats_button.yml
...-291060-feature-flag-rollout-of-saas_add_seats_button.yml
+5
-0
ee/spec/features/groups/billing_spec.rb
ee/spec/features/groups/billing_spec.rb
+0
-41
ee/spec/frontend/billings/subscriptions/components/subscription_table_spec.js
...lings/subscriptions/components/subscription_table_spec.js
+8
-23
No files found.
config/feature_flags/development/saas_add_seats_button.yml
deleted
100644 → 0
View file @
5492f611
---
name
:
saas_add_seats_button
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49242
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/291060
milestone
:
'
13.7'
type
:
development
group
:
group::purchase
default_enabled
:
false
ee/app/assets/javascripts/billings/subscriptions/components/subscription_table.vue
View file @
9c764c7f
...
...
@@ -4,7 +4,6 @@ import { escape } from 'lodash';
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
TABLE_TYPE_DEFAULT
,
TABLE_TYPE_FREE
,
TABLE_TYPE_TRIAL
}
from
'
ee/billings/constants
'
;
import
{
s__
}
from
'
~/locale
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
SubscriptionTableRow
from
'
./subscription_table_row.vue
'
;
const
createButtonProps
=
(
text
,
href
,
testId
)
=>
({
text
,
href
,
testId
});
...
...
@@ -16,7 +15,6 @@ export default {
GlLoadingIcon
,
SubscriptionTableRow
,
},
mixins
:
[
glFeatureFlagsMixin
()],
inject
:
{
planUpgradeHref
:
{
default
:
''
,
...
...
@@ -43,26 +41,23 @@ export default {
computed
:
{
...
mapState
([
'
isLoadingSubscription
'
,
'
hasErrorSubscription
'
,
'
plan
'
,
'
tables
'
,
'
endpoint
'
]),
...
mapGetters
([
'
isFreePlan
'
]),
isSubscription
()
{
return
!
this
.
isFreePlan
;
},
subscriptionHeader
()
{
const
planName
=
this
.
isFreePlan
?
s__
(
'
SubscriptionTable|Free
'
)
:
escape
(
this
.
planName
);
const
suffix
=
!
this
.
isFreePla
n
&&
this
.
plan
.
trial
?
s__
(
'
SubscriptionTable|Trial
'
)
:
''
;
const
suffix
=
this
.
isSubscriptio
n
&&
this
.
plan
.
trial
?
s__
(
'
SubscriptionTable|Trial
'
)
:
''
;
return
`
${
this
.
namespaceName
}
:
${
planName
}
${
suffix
}
`
;
},
canAddSeats
()
{
return
this
.
glFeatures
.
saasAddSeatsButton
&&
!
this
.
isFreePlan
;
},
canRenew
()
{
return
!
this
.
isFreePlan
;
},
canUpgrade
()
{
return
this
.
isFreePlan
||
this
.
plan
.
upgradable
;
},
canUpgradeEEPlan
()
{
return
!
this
.
isFreePla
n
&&
this
.
planUpgradeHref
;
return
this
.
isSubscriptio
n
&&
this
.
planUpgradeHref
;
},
addSeatsButton
()
{
return
this
.
canAddSeats
return
this
.
isSubscription
?
createButtonProps
(
s__
(
'
SubscriptionTable|Add seats
'
),
this
.
addSeatsHref
,
...
...
@@ -83,12 +78,12 @@ export default {
return
this
.
canUpgradeEEPlan
?
this
.
planUpgradeHref
:
this
.
customerPortalUrl
;
},
renewButton
()
{
return
this
.
canRenew
return
this
.
isSubscription
?
createButtonProps
(
s__
(
'
SubscriptionTable|Renew
'
),
this
.
planRenewHref
,
'
renew-button
'
)
:
null
;
},
manageButton
()
{
return
!
this
.
isFreePla
n
return
this
.
isSubscriptio
n
?
createButtonProps
(
s__
(
'
SubscriptionTable|Manage
'
),
this
.
customerPortalUrl
,
...
...
ee/app/controllers/groups/billings_controller.rb
View file @
9c764c7f
...
...
@@ -4,10 +4,6 @@ class Groups::BillingsController < Groups::ApplicationController
before_action
:authorize_admin_group!
before_action
:verify_namespace_plan_check_enabled
before_action
only:
[
:index
]
do
push_frontend_feature_flag
(
:saas_add_seats_button
)
end
layout
'group_settings'
feature_category
:purchase
...
...
ee/changelogs/unreleased/ag-291060-feature-flag-rollout-of-saas_add_seats_button.yml
0 → 100644
View file @
9c764c7f
---
title
:
Show 'Add Seats' Button on Billing Page
merge_request
:
55964
author
:
type
:
added
ee/spec/features/groups/billing_spec.rb
View file @
9c764c7f
...
...
@@ -75,19 +75,6 @@ RSpec.describe 'Groups > Billing', :js do
expect
(
page
).
to
have_link
(
"See usage"
,
href:
group_seat_usage_path
(
group
))
end
end
context
'with disabled feature flags'
do
before
do
stub_feature_flags
(
saas_add_seats_button:
false
)
visit
group_billings_path
(
group
)
end
it
'does not show "Add Seats" button'
do
within
subscription_table
do
expect
(
page
).
not_to
have_link
(
"Add seats"
)
end
end
end
end
context
'with a legacy paid plan'
do
...
...
@@ -107,32 +94,4 @@ RSpec.describe 'Groups > Billing', :js do
end
end
end
context
'with feature flags'
do
where
(
:saas_add_seats_button
)
do
[
true
,
false
]
end
let
(
:plan
)
{
'bronze'
}
let_it_be
(
:subscription
)
do
create
(
:gitlab_subscription
,
namespace:
group
,
hosted_plan:
bronze_plan
,
seats:
15
)
end
with_them
do
before
do
stub_feature_flags
(
saas_add_seats_button:
saas_add_seats_button
)
end
it
'pushes the correct feature flags'
do
visit
group_billings_path
(
group
)
expect
(
page
).
to
have_pushed_frontend_feature_flags
(
saasAddSeatsButton:
saas_add_seats_button
)
end
end
end
end
ee/spec/frontend/billings/subscriptions/components/subscription_table_spec.js
View file @
9c764c7f
...
...
@@ -19,19 +19,12 @@ describe('SubscriptionTable component', () => {
let
store
;
let
wrapper
;
const
defaultFlags
=
{
saasAddSeatsButton
:
false
};
const
findAddSeatsButton
=
()
=>
wrapper
.
findByTestId
(
'
add-seats-button
'
);
const
findManageButton
=
()
=>
wrapper
.
findByTestId
(
'
manage-button
'
);
const
findRenewButton
=
()
=>
wrapper
.
findByTestId
(
'
renew-button
'
);
const
findUpgradeButton
=
()
=>
wrapper
.
findByTestId
(
'
upgrade-button
'
);
const
createComponentWithStore
=
({
props
=
{},
featureFlags
=
{},
provide
=
{},
state
=
{},
}
=
{})
=>
{
const
createComponentWithStore
=
({
props
=
{},
provide
=
{},
state
=
{}
}
=
{})
=>
{
store
=
new
Vuex
.
Store
(
initialStore
());
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
...
...
@@ -44,10 +37,6 @@ describe('SubscriptionTable component', () => {
namespaceName
,
planName
,
...
provide
,
glFeatures
:
{
defaultFlags
,
...
featureFlags
,
},
},
propsData
:
props
,
}),
...
...
@@ -120,7 +109,7 @@ describe('SubscriptionTable component', () => {
${
null
}
|
${
false
}
|
${
'
does not render the button
'
}
${
'
free
'
}
|
${
false
}
|
${
'
does not render the button
'
}
`
(
'
given a plan with state: planCode = $planCode
and saasAddSeatsButton = $featureFlag
'
,
'
given a plan with state: planCode = $planCode
'
,
({
planCode
,
upgradable
,
expected
,
testDescription
})
=>
{
beforeEach
(()
=>
{
createComponentWithStore
({
...
...
@@ -170,19 +159,15 @@ describe('SubscriptionTable component', () => {
describe
(
'
Add seats button
'
,
()
=>
{
describe
.
each
`
planCode | featureFlag | expected | testDescription
${
'
silver
'
}
|
${
true
}
|
${
true
}
|
${
'
renders the button
'
}
${
'
silver
'
}
|
${
false
}
|
${
false
}
|
${
'
does not render the button
'
}
${
null
}
|
${
true
}
|
${
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
'
}
planCode | expected | testDescription
${
'
silver
'
}
|
${
true
}
|
${
'
renders the button
'
}
${
null
}
|
${
false
}
|
${
'
does not render the button
'
}
${
'
free
'
}
|
${
false
}
|
${
'
does not render the button
'
}
`
(
'
given a plan with state: planCode = $planCode
and saasAddSeatsButton = $featureFlag
'
,
({
planCode
,
featureFlag
,
expected
,
testDescription
})
=>
{
'
given a plan with state: planCode = $planCode
'
,
({
planCode
,
expected
,
testDescription
})
=>
{
beforeEach
(()
=>
{
createComponentWithStore
({
featureFlags
:
{
saasAddSeatsButton
:
featureFlag
},
state
:
{
isLoadingSubscription
:
false
,
plan
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment