From 8b33f4be6c43e4ddf62c772f32fea91f311d7149 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 21 Aug 2026 10:28:42 +0100 Subject: [PATCH] Hide yearly billing toggle if there are no yearly billing deets to show --- frontend/src/api/teamTypes.js | 2 +- frontend/src/components/TeamTypeSelection.vue | 2 ++ frontend/src/pages/team/changeType.vue | 8 ++------ frontend/src/pages/team/create.vue | 2 ++ 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/api/teamTypes.js b/frontend/src/api/teamTypes.js index 064e8c59d4..4075c32aa8 100644 --- a/frontend/src/api/teamTypes.js +++ b/frontend/src/api/teamTypes.js @@ -37,7 +37,7 @@ const getTeamTypes = async (cursor, limit, filter) => { teamType.annualBillingInterval = annualInterval } } else { - teamType.billingPrice = 'free' + teamType.billingPrice = '' teamType.billingInterval = '' } return teamType diff --git a/frontend/src/components/TeamTypeSelection.vue b/frontend/src/components/TeamTypeSelection.vue index f4a3651cd1..86d629a73a 100644 --- a/frontend/src/components/TeamTypeSelection.vue +++ b/frontend/src/components/TeamTypeSelection.vue @@ -46,6 +46,8 @@ export default { async created () { const { types } = await teamTypesApi.getTeamTypes() this.types = types.sort((a, b) => a.order - b.order) + // If any of the available types has an annualBillingPrice, show the annual billing toggle + this.annualBillingAvailable = this.types.some(type => !!type.annualBillingPrice) } } diff --git a/frontend/src/pages/team/changeType.vue b/frontend/src/pages/team/changeType.vue index a41f7498fa..c2d3af78ce 100644 --- a/frontend/src/pages/team/changeType.vue +++ b/frontend/src/pages/team/changeType.vue @@ -309,12 +309,8 @@ export default { }).sort((a, b) => a.order - b.order) this.input.teamTypeId = this.team.type.id - this.teamTypes.forEach(tt => { - // Check if *any* team type has annual billing available - if (tt.annualBillingPrice) { - this.annualBillingAvailable = true - } - }) + // If any of the available types has an annualBillingPrice, show the annual billing toggle + this.annualBillingAvailable = this.teamTypes.some(type => !!type.annualBillingPrice) const instanceTypes = (await instanceTypesApi.getInstanceTypes()).types instanceTypes.forEach(instanceType => { diff --git a/frontend/src/pages/team/create.vue b/frontend/src/pages/team/create.vue index 3760f60966..2d37c546ed 100644 --- a/frontend/src/pages/team/create.vue +++ b/frontend/src/pages/team/create.vue @@ -211,6 +211,8 @@ export default { this.teamTypes = (await teamTypesPromise).types.sort((a, b) => a.order - b.order) this.input.teamTypeId = this.teamTypes[0].id + // If any of the available types has an annualBillingPrice, show the annual billing toggle + this.annualBillingAvailable = this.teamTypes.some(type => !!type.annualBillingPrice) if (this.$route.query.teamType) { this.input.teamTypeId = this.$route.query.teamType