Skip to content

Commit 11ab0ef

Browse files
authored
Merge pull request #589 from HarperDB/STUDIO-372_remove-auto-renew-checkbox
2 parents bd30ada + 1358349 commit 11ab0ef

File tree

4 files changed

+9
-35
lines changed

4 files changed

+9
-35
lines changed

src/features/clusters/upsert/ClusterBilling.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ interface ClusterBillingProps {
1818
readonly onSaveStateForBillingRedirect: (redirecting: boolean) => void;
1919
readonly onSubmit?: () => void;
2020
readonly organizationId: string;
21-
readonly selectedAutoRenew: boolean;
2221
readonly selectedPlan: SchemaPlan | undefined;
2322
}
2423

@@ -29,7 +28,6 @@ export function ClusterBilling({
2928
onSaveStateForBillingRedirect,
3029
onSubmit,
3130
organizationId,
32-
selectedAutoRenew,
3331
selectedPlan,
3432
}: ClusterBillingProps) {
3533
const { data: organization } = useQuery(getOrganizationQueryOptions(organizationId));
@@ -83,21 +81,20 @@ export function ClusterBilling({
8381
</>);
8482
}
8583

86-
const andMightAutoRenew = selectedAutoRenew ? ', and your next auto renewal will be for all purchased blocks' : '';
8784
const orPossiblyExpires = expirationMonths && `, or ${pluralize(expirationMonths, 'month', 'months')} elapse`;
88-
const maybeNot = selectedAutoRenew ? ' NOT' : '';
8985

9086
return (<>
9187
<ul className="list-disc ml-6 mb-6">
9288
<li>You will be billed for this cluster today, and will receive a license for the block of usage you've
9389
requested.
9490
</li>
9591
{clusterId && (
96-
<li>If you scale up, you'll be charged for the additional blocks you've purchased now{andMightAutoRenew}.
92+
<li>If you scale up, you'll be charged for the additional blocks you've purchased now, and your next
93+
auto renewal will be for all purchased blocks.
9794
</li>)}
9895
{clusterId && (<li>If you remove a region, that region's usage block will not be used anymore (because it is
9996
specific to that region).</li>)}
100-
<li>When that block is used up{orPossiblyExpires}, you will{maybeNot} be automatically renewed.
97+
<li>When that block is used up{orPossiblyExpires}, you will be automatically renewed.
10198
</li>
10299
<li>While refunds are not available, we’d be happy to assist you with... swag, depending on availability.
103100
</li>

src/features/clusters/upsert/ClusterDetails.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function ClusterDetails({
6666
control={form.control}
6767
name="systemName"
6868
render={({ field }) => (
69-
<FormItem className="col-span-3">
69+
<FormItem className="col-span-3 md:col-span-6">
7070
<FormLabel className="pb-1">Harper System Name</FormLabel>
7171
<FormControl>
7272
<Input
@@ -81,26 +81,6 @@ export function ClusterDetails({
8181
)}
8282
/>
8383

84-
<FormField
85-
control={form.control}
86-
name="autoRenew"
87-
render={({ field }) => (
88-
<FormItem className="col-span-3">
89-
<FormLabel className="pb-1">Auto Renew</FormLabel>
90-
<FormControl>
91-
<Input
92-
{...field}
93-
value={field.value as unknown as string}
94-
checked={field.value === true}
95-
type="checkbox"
96-
disabled={!!clusterId}
97-
/>
98-
</FormControl>
99-
<FormMessage />
100-
</FormItem>
101-
)}
102-
/>
103-
10484
<FormField
10585
control={form.control}
10686
name="deploymentDescription"

src/features/clusters/upsert/ClusterForm.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ export function ClusterForm({
130130
const selectedPerformance = form.watch('performanceDescription');
131131
const selectedRegionPlans = form.watch('regionPlans');
132132
const selectedInstances = form.watch('instances');
133-
const selectedAutoRenew = form.watch('autoRenew');
134133

135134
useEffect(function syncRegionsWithSelectedDeploymentType() {
136135
setLimitRegionParameters({
@@ -248,7 +247,7 @@ export function ClusterForm({
248247
if (isSelfManaged) {
249248
for (const instance of formData.instances) {
250249
plans.push({
251-
autoRenew: formData.autoRenew,
250+
autoRenew: true,
252251
instanceFqdn: instance.fqdn,
253252
operationsApiPort: instance.port || defaultOperationsApiPort,
254253
operationsApiSecure: instance.secure === 'true',
@@ -259,7 +258,7 @@ export function ClusterForm({
259258
for (const regionPlan of formData.regionPlans) {
260259
const region = regionNameToLatencyToRegion[regionPlan.regionName][regionPlan.latencyDescription];
261260
plans.push({
262-
autoRenew: formData.autoRenew,
261+
autoRenew: true,
263262
planId: plan.id,
264263
regionId: region.id,
265264
});
@@ -273,11 +272,11 @@ export function ClusterForm({
273272
}, { onSuccess: onClusterEditedCallback });
274273
} else {
275274
submitNewClusterData({
276-
organizationId,
277-
name: formData.systemName,
278275
abbreviatedName: isSelfManaged ? undefined : (formData.abbreviatedName || calculatedNames.suggestedAbbreviatedName),
276+
autoRenew: true,
279277
fqdn: isSelfManaged && formData.fqdn || undefined,
280-
autoRenew: formData.autoRenew,
278+
name: formData.systemName,
279+
organizationId,
281280
regionPlans: plans,
282281
}, { onSuccess: onClusterCreatedCallback });
283282
}
@@ -341,7 +340,6 @@ export function ClusterForm({
341340
onSaveStateForBillingRedirect={onSaveStateForBillingRedirect}
342341
onSubmit={submitCreateCluster}
343342
organizationId={organizationId}
344-
selectedAutoRenew={selectedAutoRenew}
345343
selectedPlan={selectedPlan}
346344
/>
347345
</>)

src/features/clusters/upsert/upsertClusterSchema.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const UpsertClusterSchema = z.object({
66
systemName: z.string()
77
.min(1, 'Must be at least 1 character long.')
88
.max(255, 'Must be at most 255 characters long.'),
9-
autoRenew: z.boolean(),
109
abbreviatedName: z
1110
.string()
1211
.max(10, 'Must be at most 10 characters long.')

0 commit comments

Comments
 (0)