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
c38d11ff
Commit
c38d11ff
authored
Dec 08, 2020
by
Angelo Gulina
Committed by
Bob Van Landuyt
Dec 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push feature flag to frontend
Signed-off-by:
Angelo Gulina
<
agulina@gitlab.com
>
parent
c69f85f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
config/feature_flags/development/saas_add_seats_button.yml
config/feature_flags/development/saas_add_seats_button.yml
+8
-0
ee/app/controllers/groups/billings_controller.rb
ee/app/controllers/groups/billings_controller.rb
+1
-0
ee/app/helpers/billing_plans_helper.rb
ee/app/helpers/billing_plans_helper.rb
+7
-0
ee/spec/helpers/billing_plans_helper_spec.rb
ee/spec/helpers/billing_plans_helper_spec.rb
+6
-4
No files found.
config/feature_flags/development/saas_add_seats_button.yml
0 → 100644
View file @
c38d11ff
---
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/controllers/groups/billings_controller.rb
View file @
c38d11ff
...
...
@@ -7,6 +7,7 @@ class Groups::BillingsController < Groups::ApplicationController
before_action
only:
[
:index
]
do
push_frontend_feature_flag
(
:api_billable_member_list
)
push_frontend_feature_flag
(
:saas_manual_renew_button
)
push_frontend_feature_flag
(
:saas_add_seats_button
)
end
layout
'group_settings'
...
...
ee/app/helpers/billing_plans_helper.rb
View file @
c38d11ff
...
...
@@ -15,6 +15,7 @@ module BillingPlansHelper
{
namespace_id:
group
.
id
,
namespace_name:
group
.
name
,
add_seats_href:
add_seats_url
(
group
),
plan_upgrade_href:
plan_upgrade_url
(
group
,
plan
),
plan_renew_href:
plan_renew_url
(
group
),
customer_portal_url:
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/subscriptions"
,
...
...
@@ -96,6 +97,12 @@ module BillingPlansHelper
private
def
add_seats_url
(
group
)
return
unless
group
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/extra_seats"
end
def
plan_purchase_url
(
group
,
plan
)
if
use_new_purchase_flow?
(
group
)
new_subscriptions_path
(
plan_id:
plan
.
id
,
namespace_id:
group
.
id
)
...
...
ee/spec/helpers/billing_plans_helper_spec.rb
View file @
c38d11ff
...
...
@@ -13,15 +13,15 @@ RSpec.describe BillingPlansHelper do
context
'when group and plan with ID present'
do
it
'returns data attributes'
do
upgrade_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/upgrade/
#{
plan
.
id
}
"
renew_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/renew"
add_seats_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/extra_seats"
upgrade_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/upgrade/
#{
plan
.
id
}
"
renew_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/renew"
billable_seats_href
=
helper
.
group_seat_usage_path
(
group
)
expect
(
helper
.
subscription_plan_data_attributes
(
group
,
plan
))
.
to
eq
(
namespace_id:
group
.
id
,
namespace_name:
group
.
name
,
add_seats_href:
add_seats_href
,
plan_upgrade_href:
upgrade_href
,
plan_renew_href:
renew_href
,
customer_portal_url:
customer_portal_url
,
...
...
@@ -41,6 +41,7 @@ RSpec.describe BillingPlansHelper do
let
(
:plan
)
{
Hashie
::
Mash
.
new
(
id:
nil
)
}
it
'returns data attributes without upgrade href'
do
add_seats_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/extra_seats"
renew_href
=
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab/namespaces/
#{
group
.
id
}
/renew"
billable_seats_href
=
helper
.
group_seat_usage_path
(
group
)
...
...
@@ -49,6 +50,7 @@ RSpec.describe BillingPlansHelper do
namespace_name:
group
.
name
,
customer_portal_url:
customer_portal_url
,
billable_seats_href:
billable_seats_href
,
add_seats_href:
add_seats_href
,
plan_renew_href:
renew_href
,
plan_upgrade_href:
nil
)
end
...
...
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