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
Hide 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';
...
@@ -4,7 +4,6 @@ import { escape } from 'lodash';
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
TABLE_TYPE_DEFAULT
,
TABLE_TYPE_FREE
,
TABLE_TYPE_TRIAL
}
from
'
ee/billings/constants
'
;
import
{
TABLE_TYPE_DEFAULT
,
TABLE_TYPE_FREE
,
TABLE_TYPE_TRIAL
}
from
'
ee/billings/constants
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
SubscriptionTableRow
from
'
./subscription_table_row.vue
'
;
import
SubscriptionTableRow
from
'
./subscription_table_row.vue
'
;
const
createButtonProps
=
(
text
,
href
,
testId
)
=>
({
text
,
href
,
testId
});
const
createButtonProps
=
(
text
,
href
,
testId
)
=>
({
text
,
href
,
testId
});
...
@@ -16,7 +15,6 @@ export default {
...
@@ -16,7 +15,6 @@ export default {
GlLoadingIcon
,
GlLoadingIcon
,
SubscriptionTableRow
,
SubscriptionTableRow
,
},
},
mixins
:
[
glFeatureFlagsMixin
()],
inject
:
{
inject
:
{
planUpgradeHref
:
{
planUpgradeHref
:
{
default
:
''
,
default
:
''
,
...
@@ -43,26 +41,23 @@ export default {
...
@@ -43,26 +41,23 @@ export default {
computed
:
{
computed
:
{
...
mapState
([
'
isLoadingSubscription
'
,
'
hasErrorSubscription
'
,
'
plan
'
,
'
tables
'
,
'
endpoint
'
]),
...
mapState
([
'
isLoadingSubscription
'
,
'
hasErrorSubscription
'
,
'
plan
'
,
'
tables
'
,
'
endpoint
'
]),
...
mapGetters
([
'
isFreePlan
'
]),
...
mapGetters
([
'
isFreePlan
'
]),
isSubscription
()
{
return
!
this
.
isFreePlan
;
},
subscriptionHeader
()
{
subscriptionHeader
()
{
const
planName
=
this
.
isFreePlan
?
s__
(
'
SubscriptionTable|Free
'
)
:
escape
(
this
.
planName
);
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
}
`
;
return
`
${
this
.
namespaceName
}
:
${
planName
}
${
suffix
}
`
;
},
},
canAddSeats
()
{
return
this
.
glFeatures
.
saasAddSeatsButton
&&
!
this
.
isFreePlan
;
},
canRenew
()
{
return
!
this
.
isFreePlan
;
},
canUpgrade
()
{
canUpgrade
()
{
return
this
.
isFreePlan
||
this
.
plan
.
upgradable
;
return
this
.
isFreePlan
||
this
.
plan
.
upgradable
;
},
},
canUpgradeEEPlan
()
{
canUpgradeEEPlan
()
{
return
!
this
.
isFreePla
n
&&
this
.
planUpgradeHref
;
return
this
.
isSubscriptio
n
&&
this
.
planUpgradeHref
;
},
},
addSeatsButton
()
{
addSeatsButton
()
{
return
this
.
canAddSeats
return
this
.
isSubscription
?
createButtonProps
(
?
createButtonProps
(
s__
(
'
SubscriptionTable|Add seats
'
),
s__
(
'
SubscriptionTable|Add seats
'
),
this
.
addSeatsHref
,
this
.
addSeatsHref
,
...
@@ -83,12 +78,12 @@ export default {
...
@@ -83,12 +78,12 @@ export default {
return
this
.
canUpgradeEEPlan
?
this
.
planUpgradeHref
:
this
.
customerPortalUrl
;
return
this
.
canUpgradeEEPlan
?
this
.
planUpgradeHref
:
this
.
customerPortalUrl
;
},
},
renewButton
()
{
renewButton
()
{
return
this
.
canRenew
return
this
.
isSubscription
?
createButtonProps
(
s__
(
'
SubscriptionTable|Renew
'
),
this
.
planRenewHref
,
'
renew-button
'
)
?
createButtonProps
(
s__
(
'
SubscriptionTable|Renew
'
),
this
.
planRenewHref
,
'
renew-button
'
)
:
null
;
:
null
;
},
},
manageButton
()
{
manageButton
()
{
return
!
this
.
isFreePla
n
return
this
.
isSubscriptio
n
?
createButtonProps
(
?
createButtonProps
(
s__
(
'
SubscriptionTable|Manage
'
),
s__
(
'
SubscriptionTable|Manage
'
),
this
.
customerPortalUrl
,
this
.
customerPortalUrl
,
...
...
ee/app/controllers/groups/billings_controller.rb
View file @
9c764c7f
...
@@ -4,10 +4,6 @@ class Groups::BillingsController < Groups::ApplicationController
...
@@ -4,10 +4,6 @@ class Groups::BillingsController < Groups::ApplicationController
before_action
:authorize_admin_group!
before_action
:authorize_admin_group!
before_action
:verify_namespace_plan_check_enabled
before_action
:verify_namespace_plan_check_enabled
before_action
only:
[
:index
]
do
push_frontend_feature_flag
(
:saas_add_seats_button
)
end
layout
'group_settings'
layout
'group_settings'
feature_category
:purchase
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
...
@@ -75,19 +75,6 @@ RSpec.describe 'Groups > Billing', :js do
expect
(
page
).
to
have_link
(
"See usage"
,
href:
group_seat_usage_path
(
group
))
expect
(
page
).
to
have_link
(
"See usage"
,
href:
group_seat_usage_path
(
group
))
end
end
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
end
context
'with a legacy paid plan'
do
context
'with a legacy paid plan'
do
...
@@ -107,32 +94,4 @@ RSpec.describe 'Groups > Billing', :js do
...
@@ -107,32 +94,4 @@ RSpec.describe 'Groups > Billing', :js do
end
end
end
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
end
ee/spec/frontend/billings/subscriptions/components/subscription_table_spec.js
View file @
9c764c7f
...
@@ -19,19 +19,12 @@ describe('SubscriptionTable component', () => {
...
@@ -19,19 +19,12 @@ describe('SubscriptionTable component', () => {
let
store
;
let
store
;
let
wrapper
;
let
wrapper
;
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
'
);
const
findRenewButton
=
()
=>
wrapper
.
findByTestId
(
'
renew-button
'
);
const
findRenewButton
=
()
=>
wrapper
.
findByTestId
(
'
renew-button
'
);
const
findUpgradeButton
=
()
=>
wrapper
.
findByTestId
(
'
upgrade-button
'
);
const
findUpgradeButton
=
()
=>
wrapper
.
findByTestId
(
'
upgrade-button
'
);
const
createComponentWithStore
=
({
const
createComponentWithStore
=
({
props
=
{},
provide
=
{},
state
=
{}
}
=
{})
=>
{
props
=
{},
featureFlags
=
{},
provide
=
{},
state
=
{},
}
=
{})
=>
{
store
=
new
Vuex
.
Store
(
initialStore
());
store
=
new
Vuex
.
Store
(
initialStore
());
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
...
@@ -44,10 +37,6 @@ describe('SubscriptionTable component', () => {
...
@@ -44,10 +37,6 @@ describe('SubscriptionTable component', () => {
namespaceName
,
namespaceName
,
planName
,
planName
,
...
provide
,
...
provide
,
glFeatures
:
{
defaultFlags
,
...
featureFlags
,
},
},
},
propsData
:
props
,
propsData
:
props
,
}),
}),
...
@@ -120,7 +109,7 @@ describe('SubscriptionTable component', () => {
...
@@ -120,7 +109,7 @@ describe('SubscriptionTable component', () => {
${
null
}
|
${
false
}
|
${
'
does not render the button
'
}
${
null
}
|
${
false
}
|
${
'
does not render the button
'
}
${
'
free
'
}
|
${
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
})
=>
{
({
planCode
,
upgradable
,
expected
,
testDescription
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponentWithStore
({
createComponentWithStore
({
...
@@ -170,19 +159,15 @@ describe('SubscriptionTable component', () => {
...
@@ -170,19 +159,15 @@ describe('SubscriptionTable component', () => {
describe
(
'
Add seats button
'
,
()
=>
{
describe
(
'
Add seats 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 saasAddSeatsButton = $featureFlag
'
,
'
given a plan with state: planCode = $planCode
'
,
({
planCode
,
featureFlag
,
expected
,
testDescription
})
=>
{
({
planCode
,
expected
,
testDescription
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponentWithStore
({
createComponentWithStore
({
featureFlags
:
{
saasAddSeatsButton
:
featureFlag
},
state
:
{
state
:
{
isLoadingSubscription
:
false
,
isLoadingSubscription
:
false
,
plan
:
{
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