Commit b2f86aba authored by Andrei Stoicescu's avatar Andrei Stoicescu Committed by Martin Wortschack

Fix "See Usage" button not showing

 - Make the data attribute "isGroup" take a string
value instead of boolean, then convert that value to
boolean on the front-end
parent fcd8d219
import Vue from 'vue';
import Vuex from 'vuex';
import { parseBoolean } from '~/lib/utils/common_utils';
import SubscriptionApp from './components/app.vue';
import initialStore from './store';
......@@ -30,7 +31,7 @@ export default (containerId = 'js-billing-plans') => {
namespaceId,
namespaceName,
addSeatsHref,
isGroup,
isGroup: parseBoolean(isGroup),
planUpgradeHref,
planRenewHref,
customerPortalUrl,
......
......@@ -15,7 +15,7 @@ module BillingPlansHelper
{
namespace_id: namespace.id,
namespace_name: namespace.name,
is_group: namespace.group?,
is_group: namespace.group?.to_s,
add_seats_href: add_seats_url(namespace),
plan_upgrade_href: plan_upgrade_url(namespace, plan),
plan_renew_href: plan_renew_url(namespace),
......
......@@ -70,6 +70,7 @@ RSpec.describe 'Groups > Billing', :js do
expect(page).to have_link("Manage", href: "#{EE::SUBSCRIPTIONS_URL}/subscriptions")
expect(page).to have_link("Add seats", href: extra_seats_url)
expect(page).to have_link("Renew", href: renew_url)
expect(page).to have_link("See usage", href: group_seat_usage_path(group))
end
end
......
......@@ -21,7 +21,7 @@ RSpec.describe BillingPlansHelper do
expect(helper.subscription_plan_data_attributes(group, plan))
.to eq(namespace_id: group.id,
namespace_name: group.name,
is_group: true,
is_group: "true",
add_seats_href: add_seats_href,
plan_upgrade_href: upgrade_href,
plan_renew_href: renew_href,
......@@ -49,7 +49,7 @@ RSpec.describe BillingPlansHelper do
expect(helper.subscription_plan_data_attributes(group, plan))
.to eq(namespace_id: group.id,
namespace_name: group.name,
is_group: true,
is_group: "true",
customer_portal_url: customer_portal_url,
billable_seats_href: billable_seats_href,
add_seats_href: add_seats_href,
......@@ -64,7 +64,7 @@ RSpec.describe BillingPlansHelper do
result = helper.subscription_plan_data_attributes(namespace, plan)
expect(result).to include(is_group: false)
expect(result).to include(is_group: "false")
end
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