Commit c38d11ff authored by Angelo Gulina's avatar Angelo Gulina Committed by Bob Van Landuyt

Push feature flag to frontend

Signed-off-by: default avatarAngelo Gulina <agulina@gitlab.com>
parent c69f85f2
---
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
...@@ -7,6 +7,7 @@ class Groups::BillingsController < Groups::ApplicationController ...@@ -7,6 +7,7 @@ class Groups::BillingsController < Groups::ApplicationController
before_action only: [:index] do before_action only: [:index] do
push_frontend_feature_flag(:api_billable_member_list) push_frontend_feature_flag(:api_billable_member_list)
push_frontend_feature_flag(:saas_manual_renew_button) push_frontend_feature_flag(:saas_manual_renew_button)
push_frontend_feature_flag(:saas_add_seats_button)
end end
layout 'group_settings' layout 'group_settings'
......
...@@ -15,6 +15,7 @@ module BillingPlansHelper ...@@ -15,6 +15,7 @@ module BillingPlansHelper
{ {
namespace_id: group.id, namespace_id: group.id,
namespace_name: group.name, namespace_name: group.name,
add_seats_href: add_seats_url(group),
plan_upgrade_href: plan_upgrade_url(group, plan), plan_upgrade_href: plan_upgrade_url(group, plan),
plan_renew_href: plan_renew_url(group), plan_renew_href: plan_renew_url(group),
customer_portal_url: "#{EE::SUBSCRIPTIONS_URL}/subscriptions", customer_portal_url: "#{EE::SUBSCRIPTIONS_URL}/subscriptions",
...@@ -96,6 +97,12 @@ module BillingPlansHelper ...@@ -96,6 +97,12 @@ module BillingPlansHelper
private 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) def plan_purchase_url(group, plan)
if use_new_purchase_flow?(group) if use_new_purchase_flow?(group)
new_subscriptions_path(plan_id: plan.id, namespace_id: group.id) new_subscriptions_path(plan_id: plan.id, namespace_id: group.id)
......
...@@ -13,15 +13,15 @@ RSpec.describe BillingPlansHelper do ...@@ -13,15 +13,15 @@ RSpec.describe BillingPlansHelper do
context 'when group and plan with ID present' do context 'when group and plan with ID present' do
it 'returns data attributes' do it 'returns data attributes' do
upgrade_href = add_seats_href = "#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/extra_seats"
"#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/upgrade/#{plan.id}" upgrade_href = "#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/upgrade/#{plan.id}"
renew_href = renew_href = "#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/renew"
"#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/renew"
billable_seats_href = helper.group_seat_usage_path(group) billable_seats_href = helper.group_seat_usage_path(group)
expect(helper.subscription_plan_data_attributes(group, plan)) expect(helper.subscription_plan_data_attributes(group, plan))
.to eq(namespace_id: group.id, .to eq(namespace_id: group.id,
namespace_name: group.name, namespace_name: group.name,
add_seats_href: add_seats_href,
plan_upgrade_href: upgrade_href, plan_upgrade_href: upgrade_href,
plan_renew_href: renew_href, plan_renew_href: renew_href,
customer_portal_url: customer_portal_url, customer_portal_url: customer_portal_url,
...@@ -41,6 +41,7 @@ RSpec.describe BillingPlansHelper do ...@@ -41,6 +41,7 @@ RSpec.describe BillingPlansHelper do
let(:plan) { Hashie::Mash.new(id: nil) } let(:plan) { Hashie::Mash.new(id: nil) }
it 'returns data attributes without upgrade href' do 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" renew_href = "#{EE::SUBSCRIPTIONS_URL}/gitlab/namespaces/#{group.id}/renew"
billable_seats_href = helper.group_seat_usage_path(group) billable_seats_href = helper.group_seat_usage_path(group)
...@@ -49,6 +50,7 @@ RSpec.describe BillingPlansHelper do ...@@ -49,6 +50,7 @@ RSpec.describe BillingPlansHelper do
namespace_name: group.name, namespace_name: group.name,
customer_portal_url: customer_portal_url, customer_portal_url: customer_portal_url,
billable_seats_href: billable_seats_href, billable_seats_href: billable_seats_href,
add_seats_href: add_seats_href,
plan_renew_href: renew_href, plan_renew_href: renew_href,
plan_upgrade_href: nil) plan_upgrade_href: nil)
end end
......
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