File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
components/WorkspaceSetup/steps Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import track from '@codesandbox/common/lib/utils/analytics';
33import { Stack , Button , Text , Icon } from '@codesandbox/components' ;
44import * as dashboardUrls from '@codesandbox/common/lib/utils/url-generator/dashboard' ;
55
6+ import { SubscriptionInterval } from 'app/graphql/types' ;
67import { useURLSearchParams } from 'app/hooks/useURLSearchParams' ;
78import { useActions , useAppState } from 'app/overmind' ;
89import { StepProps } from '../types' ;
@@ -59,7 +60,11 @@ export const ChangePlan: React.FC<StepProps> = ({
5960 < Text > { checkout . newSubscription . totalCredits } VM credits</ Text >
6061 </ Stack >
6162 < Text size = { 6 } color = "#e5e5e5" >
62- ${ checkout . newSubscription . totalPrice } / month
63+ ${ checkout . newSubscription . totalPrice } /{ ' ' }
64+ { checkout . newSubscription . billingInterval ===
65+ SubscriptionInterval . Monthly
66+ ? 'month'
67+ : 'year' }
6368 </ Text >
6469 </ Stack >
6570
Original file line number Diff line number Diff line change @@ -2237,6 +2237,7 @@ export type RootMutationTypeChangeTeamMemberAuthorizationsArgs = {
22372237
22382238export type RootMutationTypeConvertToUsageBillingArgs = {
22392239 addons : Array < Scalars [ 'String' ] > ;
2240+ billingInterval : InputMaybe < SubscriptionInterval > ;
22402241 plan : Scalars [ 'String' ] ;
22412242 teamId : Scalars [ 'UUID4' ] ;
22422243} ;
@@ -2473,6 +2474,7 @@ export type RootMutationTypePermanentlyDeleteSandboxesArgs = {
24732474
24742475export type RootMutationTypePreviewConvertToUsageBillingArgs = {
24752476 addons : Array < Scalars [ 'String' ] > ;
2477+ billingInterval : InputMaybe < SubscriptionInterval > ;
24762478 plan : Scalars [ 'String' ] ;
24772479 teamId : Scalars [ 'UUID4' ] ;
24782480} ;
@@ -5684,6 +5686,7 @@ export type PreviewConvertToUsageBillingMutationVariables = Exact<{
56845686 teamId : Scalars [ 'UUID4' ] ;
56855687 addons : Array < Scalars [ 'String' ] > | Scalars [ 'String' ] ;
56865688 plan : Scalars [ 'String' ] ;
5689+ billingInterval : InputMaybe < SubscriptionInterval > ;
56875690} > ;
56885691
56895692export type PreviewConvertToUsageBillingMutation = {
@@ -5699,6 +5702,7 @@ export type ConvertToUsageBillingMutationVariables = Exact<{
56995702 teamId : Scalars [ 'UUID4' ] ;
57005703 addons : Array < Scalars [ 'String' ] > | Scalars [ 'String' ] ;
57015704 plan : Scalars [ 'String' ] ;
5705+ billingInterval : InputMaybe < SubscriptionInterval > ;
57025706} > ;
57035707
57045708export type ConvertToUsageBillingMutation = {
Original file line number Diff line number Diff line change @@ -436,11 +436,13 @@ export const previewConvertToUsageBilling: Query<
436436 $teamId: UUID4!
437437 $addons: [String!]!
438438 $plan: String!
439+ $billingInterval: SubscriptionInterval
439440 ) {
440441 previewConvertToUsageBilling(
441442 plan: $plan
442443 addons: $addons
443444 teamId: $teamId
445+ billingInterval: $billingInterval
444446 ) {
445447 total
446448 totalExcludingTax
@@ -456,8 +458,14 @@ export const convertToUsageBilling: Query<
456458 $teamId: UUID4!
457459 $addons: [String!]!
458460 $plan: String!
461+ $billingInterval: SubscriptionInterval
459462 ) {
460- convertToUsageBilling(plan: $plan, addons: $addons, teamId: $teamId)
463+ convertToUsageBilling(
464+ plan: $plan
465+ addons: $addons
466+ teamId: $teamId
467+ billingInterval: $billingInterval
468+ )
461469 }
462470` ;
463471
Original file line number Diff line number Diff line change @@ -355,6 +355,7 @@ export const calculateConversionCharge = async (
355355 teamId : workspaceId ,
356356 plan : newSubscription . basePlan . id ,
357357 addons : actions . checkout . getFlatAddonsList ( ) ,
358+ billingInterval : newSubscription . billingInterval ,
358359 } ) ;
359360
360361 // Cap the values to a min of 0
@@ -391,6 +392,7 @@ export const convertToUsageBilling = async (
391392 teamId : workspaceId ,
392393 plan : newSubscription . basePlan . id ,
393394 addons : actions . checkout . getFlatAddonsList ( ) ,
395+ billingInterval : newSubscription . billingInterval ,
394396 } ) ;
395397
396398 return { success : true } ;
You can’t perform that action at this time.
0 commit comments