File tree Expand file tree Collapse file tree 4 files changed +7
-14
lines changed
organization-[organization]/billing Expand file tree Collapse file tree 4 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 170
170
171
171
trackEvent (Submit .OrganizationCreate , {
172
172
plan: tierToPlan (billingPlan )?.name ,
173
- budget_cap_enabled: billingBudget !== null ,
173
+ budget_cap_enabled: !! billingBudget ,
174
174
members_invited: collaborators ?.length
175
175
});
176
176
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { Container } from ' $lib/layout' ;
3
3
import { organization } from ' $lib/stores/organization' ;
4
+ import BudgetAlert from ' ./budgetAlert.svelte' ;
4
5
import BudgetCap from ' ./budgetCap.svelte' ;
5
6
import PlanSummary from ' ./planSummary.svelte' ;
6
7
import BillingAddress from ' ./billingAddress.svelte' ;
127
128
<BillingAddress billingAddress ={data ?.billingAddress } />
128
129
<TaxId />
129
130
<BudgetCap />
131
+ <BudgetAlert />
130
132
<AvailableCredit />
131
133
</Container >
132
134
Original file line number Diff line number Diff line change 20
20
import { sdk } from ' $lib/stores/sdk' ;
21
21
import { onMount } from ' svelte' ;
22
22
23
- export let alertsEnabled = false ;
24
-
25
23
let search: string ;
26
24
let selectedAlert: number ;
27
25
let alerts: number [] = [];
76
74
}
77
75
}
78
76
79
- $ : isButtonDisabled =
80
- symmetricDifference (alerts , $organization .budgetAlerts ).length === 0 || ! alertsEnabled ;
77
+ $ : isButtonDisabled = symmetricDifference (alerts , $organization .budgetAlerts ).length === 0 ;
81
78
</script >
82
79
83
80
<Form onSubmit ={updateBudget }>
110
107
111
108
<div class =" u-flex u-gap-16" >
112
109
<InputSelectSearch
113
- disabled ={! alertsEnabled }
114
110
label =" Percentage (%) of budget cap"
115
111
placeholder =" Select a percentage"
116
112
id =" alerts"
122
118
<div style =" align-self: flex-end" >
123
119
<Button
124
120
secondary
125
- disabled ={alerts .length > 3 ||
126
- (! search && ! selectedAlert ) ||
127
- ! alertsEnabled }
121
+ disabled ={alerts .length > 3 || (! search && ! selectedAlert )}
128
122
on:click ={addAlert }>
129
123
Add alert
130
124
</Button >
Original file line number Diff line number Diff line change 9
9
import { organization , currentPlan } from ' $lib/stores/organization' ;
10
10
import { sdk } from ' $lib/stores/sdk' ;
11
11
import { onMount } from ' svelte' ;
12
- import BudgetAlert from ' ./budgetAlert.svelte' ;
13
12
14
13
let capActive = false ;
15
14
let budget: number ;
16
15
17
16
onMount (() => {
18
17
budget = $organization ?.billingBudget ;
19
- capActive = $organization ?.billingBudget !== null ;
18
+ capActive = !! $organization ?.billingBudget ;
20
19
});
21
20
22
21
async function updateBudget() {
45
44
}
46
45
47
46
$ : if (! capActive ) {
48
- budget = null ;
47
+ budget = 0 ;
49
48
}
50
49
</script >
51
50
114
113
</svelte:fragment >
115
114
</CardGrid >
116
115
</Form >
117
-
118
- <BudgetAlert alertsEnabled ={capActive && budget > 0 } />
You can’t perform that action at this time.
0 commit comments