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