Skip to content

Commit ac1522e

Browse files
committed
update on prem pricing page a little
1 parent 47da82a commit ac1522e

File tree

3 files changed

+51
-62
lines changed

3 files changed

+51
-62
lines changed

src/packages/frontend/support/url.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ export default function getURL(options: Options = {}) {
2929
const params = {
3030
hideExtra: options.hideExtra,
3131
url: options.url,
32-
type: options.type ?? "",
33-
subject: options.subject ?? "",
34-
body: options.body ?? "",
35-
required: options.required ?? "",
36-
context: options.context ?? "",
32+
type: options.type,
33+
subject: options.subject,
34+
body: options.body,
35+
required: options.required,
36+
context: options.context,
3737
};
3838

3939
const queryParams = Object.keys(params)
40+
.filter((key) => params[key])
4041
.map((key) => `${key}=${encodeURIComponent(params[key] as string)}`)
4142
.join("&");
4243

src/packages/next/components/support/create.tsx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -290,28 +290,30 @@ export default function Create() {
290290
description={`You must replace the text '${required}' everywhere above with the requested information.`}
291291
/>
292292
)}
293-
<Button
294-
shape="round"
295-
size="large"
296-
disabled={!submittable.current}
297-
type="primary"
298-
onClick={createSupportTicket}
299-
>
300-
<Icon name="paper-plane" />{" "}
301-
{submitting
302-
? "Submitting..."
303-
: success
304-
? "Thank you for creating a ticket"
305-
: submitError
306-
? "Close the error box to try again"
307-
: !isValidEmailAddress(email)
308-
? "Enter Valid Email Address above"
309-
: !subject
310-
? "Enter Subject above"
311-
: (body ?? "").length < MIN_BODY_LENGTH
312-
? `Describe your ${type} in detail above`
313-
: "Create Support Ticket"}
314-
</Button>
293+
{type != "chat" && (
294+
<Button
295+
shape="round"
296+
size="large"
297+
disabled={!submittable.current}
298+
type="primary"
299+
onClick={createSupportTicket}
300+
>
301+
<Icon name="paper-plane" />{" "}
302+
{submitting
303+
? "Submitting..."
304+
: success
305+
? "Thank you for creating a ticket"
306+
: submitError
307+
? "Close the error box to try again"
308+
: !isValidEmailAddress(email)
309+
? "Enter Valid Email Address above"
310+
: !subject
311+
? "Enter Subject above"
312+
: (body ?? "").length < MIN_BODY_LENGTH
313+
? `Describe your ${type} in detail above`
314+
: "Create Support Ticket"}
315+
</Button>
316+
)}
315317
{submitting && <Loading style={{ fontSize: "32pt" }} />}
316318
{submitError && (
317319
<div>

src/packages/next/pages/pricing/onprem.tsx

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55

66
import { Alert, Button, Divider, Layout, List } from "antd";
7-
import { useRouter } from "next/router";
8-
97
import { Icon, IconName } from "@cocalc/frontend/components/icon";
108
import { money } from "@cocalc/util/licenses/purchase/utils";
119
import { COLORS } from "@cocalc/util/theme";
@@ -19,6 +17,7 @@ import { MAX_WIDTH } from "lib/config";
1917
import { Customize } from "lib/customize";
2018
import withCustomize from "lib/with-customize";
2119
import { ReactNode } from "react";
20+
import getSupportUrl from "@cocalc/frontend/support/url";
2221

2322
const PUBLISH_PRICE = true;
2423

@@ -40,8 +39,7 @@ const data: Item[] = [
4039
title: "Small Business",
4140
icon: "experiment",
4241
individuals: "≤ 25",
43-
price: 5000,
44-
extra: 5000,
42+
price: 10000,
4543
},
4644
{
4745
title: "Large Organization",
@@ -54,8 +52,7 @@ const data: Item[] = [
5452
title: "University",
5553
icon: "graduation-cap",
5654
individuals: "≤ 150",
57-
price: 3000,
58-
extra: 3000,
55+
price: 6000,
5956
academic: CM,
6057
},
6158
];
@@ -81,19 +78,17 @@ export default function OnPrem({ customize }) {
8178
}
8279

8380
function Body() {
84-
const router = useRouter();
85-
86-
const body = encodeURIComponent(
87-
"PLEASE EXPLAIN YOUR EXPECTED USE CASE TO HELP US GUIDE YOU:\n\nWE WOULD LOVE TO SETUP A VIDEO CALL WITH YOU! WHEN ARE YOU AVAILABLE (DAYS, TIMESLOTS, TIMEZONE)?",
88-
);
89-
90-
const contactURL = `/support/new?hideExtra=true&type=purchase&subject=CoCalc%20OnPrem&body=${body}&title=Purchase%20CoCalc%20On-prem`;
81+
const contactURL = getSupportUrl({
82+
subject: "Purchase CoCalc OnPrem",
83+
type: "chat",
84+
url: "",
85+
});
9186

9287
function renderContactButton(
93-
text: string | ReactNode = "Contact us",
88+
text: string | ReactNode = "Contact Us",
9489
): JSX.Element {
9590
return (
96-
<Button size="large" onClick={() => router.push(contactURL)}>
91+
<Button size="large" href={contactURL}>
9792
{text}
9893
</Button>
9994
);
@@ -115,7 +110,7 @@ function Body() {
115110
message={
116111
<>
117112
<Paragraph strong style={{ fontSize: "150%" }}>
118-
Please <A href={contactURL}>contact us</A> for questions,
113+
Please <A href={contactURL} external>contact us</A> for questions,
119114
licensing details, and purchasing.
120115
</Paragraph>
121116
<Paragraph>
@@ -143,7 +138,6 @@ function Body() {
143138
icon,
144139
title,
145140
academic,
146-
extra,
147141
prod,
148142
}) => {
149143
return (
@@ -155,24 +149,18 @@ function Body() {
155149
<Line amount={INF} desc="Project Collaborators" />
156150
<Line amount={INF} desc="Cluster Resources²" />
157151
<Line amount={CM} desc="Help for Initial Setup" />
152+
<Line amount={CM} desc="Premium Support" />
158153
<Divider />
159-
<Line amount={CM} desc="Collaborative Jupyter, LaTeX, ..." />
154+
<Line
155+
amount={CM}
156+
desc="Collaborative Jupyter, LaTeX, SageMath, R, ..."
157+
/>
160158
<Line amount={CM} desc="Custom Software Environments" />
161159
<Line amount={CM} desc="Regular Software Upgrades" />
162160
<Line amount={CM} desc="Flexible LLM integration³" />
163161
<Line amount={CM} desc="GPU Support" />
164162
<Line amount={CM} desc="SAML SSO" />
165163

166-
{academic ? (
167-
<>
168-
<Divider />
169-
<Line
170-
amount={academic}
171-
desc={<Text strong>Academic discount</Text>}
172-
/>
173-
</>
174-
) : undefined}
175-
176164
<br />
177165
<div
178166
style={{
@@ -195,15 +183,13 @@ function Body() {
195183
)
196184
: renderContactButton()}
197185
</div>
198-
{extra ? (
186+
{academic ? (
199187
<>
200188
<Divider />
201-
<Paragraph type="secondary">
202-
<Line
203-
amount={`$${extra}`}
204-
desc={<span>Premium Support (optional)</span>}
205-
/>
206-
</Paragraph>
189+
<Line
190+
amount={academic}
191+
desc={<Text strong>Academic discount</Text>}
192+
/>
207193
</>
208194
) : undefined}
209195
</PricingItem>

0 commit comments

Comments
 (0)