Skip to content

Commit e43ce26

Browse files
committed
next/support: on ticket page, if you need further help or ticketing is not configured, show help email, not the organizations email
1 parent 0bc2f9c commit e43ce26

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

src/packages/next/components/landing/contact.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { useCustomize } from "lib/customize";
76
import A from "components/misc/A";
7+
import { useCustomize } from "lib/customize";
88

99
export default function Contact({
1010
lower,
1111
showEmail = true,
12+
useHelpEmail = false,
1213
}: {
1314
lower?: boolean;
1415
showEmail?: boolean;
16+
useHelpEmail?: boolean;
1517
}) {
16-
const { contactEmail } = useCustomize();
17-
if (!contactEmail) return <span>{lower ? "c" : "C"}ontact your site administrator</span>
18+
const { contactEmail, helpEmail } = useCustomize();
19+
20+
const email = useHelpEmail ? helpEmail : contactEmail;
21+
22+
if (!email)
23+
return <span>{lower ? "c" : "C"}ontact your site administrator</span>;
1824
return (
19-
<A href={"mailto:" + contactEmail}>
20-
{lower ? "c" : "C"}ontact {showEmail && contactEmail }
25+
<A href={"mailto:" + email}>
26+
{lower ? "c" : "C"}ontact {showEmail ? email : ""}
2127
</A>
2228
);
2329
}

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ import {
1010
} from "antd";
1111
import { useRouter } from "next/router";
1212
import { ReactNode, useRef, useState } from "react";
13-
import CodeMirror from "components/share/codemirror";
13+
1414
import { Icon } from "@cocalc/frontend/components/icon";
1515
import { is_valid_email_address as isValidEmailAddress } from "@cocalc/util/misc";
1616
import { COLORS } from "@cocalc/util/theme";
17+
import { Paragraph, Title } from "components/misc";
1718
import A from "components/misc/A";
19+
import ChatGPTHelp from "components/openai/chatgpt-help";
20+
import CodeMirror from "components/share/codemirror";
1821
import Loading from "components/share/loading";
1922
import SiteName from "components/share/site-name";
2023
import apiPost from "lib/api/post";
@@ -24,8 +27,6 @@ import getBrowserInfo from "./browser-info";
2427
import RecentFiles from "./recent-files";
2528
import { Type } from "./tickets";
2629
import { NoZendesk } from "./util";
27-
import { Paragraph, Title } from "components/misc";
28-
import ChatGPTHelp from "components/openai/chatgpt-help";
2930

3031
const CHATGPT_DISABLED = true;
3132
const MIN_BODY_LENGTH = 16;
@@ -47,7 +48,7 @@ function stringToType(s?: any): Type {
4748
}
4849

4950
export default function Create() {
50-
const { contactEmail, zendesk, account, openaiEnabled, siteName } =
51+
const { helpEmail, zendesk, account, openaiEnabled, siteName } =
5152
useCustomize();
5253
const router = useRouter();
5354
// The URL the user was viewing when they requested support.
@@ -140,12 +141,12 @@ export default function Create() {
140141
check the status of your support tickets
141142
</A>
142143
.{" "}
143-
{contactEmail && (
144+
{helpEmail ? (
144145
<>
145146
You can also email us directly at{" "}
146-
<A href={`mailto:${contactEmail}`}>{contactEmail}</A>.
147+
<A href={`mailto:${helpEmail}`}>{helpEmail}</A>.
147148
</>
148-
)}
149+
) : undefined}
149150
</p>
150151
{openaiEnabled && !CHATGPT_DISABLED && (
151152
<ChatGPT siteName={siteName} />
@@ -283,12 +284,12 @@ export default function Create() {
283284
style={{ margin: "15px auto", maxWidth: "500px" }}
284285
/>
285286
<br />
286-
{contactEmail && (
287+
{helpEmail ? (
287288
<>
288289
If you continue to have problems, email us directly at{" "}
289-
<A href={`mailto:${contactEmail}`}>{contactEmail}</A>.
290+
<A href={`mailto:${helpEmail}`}>{helpEmail}</A>.
290291
</>
291-
)}
292+
) : undefined}
292293
</div>
293294
)}
294295
{success && (

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Alert } from "antd";
2+
23
import Contact from "components/landing/contact";
34
import { useCustomize } from "lib/customize";
45

@@ -8,12 +9,12 @@ export function NoZendesk() {
89
return (
910
<Alert
1011
type="error"
11-
message="Zendesk Support is not configured."
12+
message="Support system is not configured."
1213
style={{ margin: "30px auto", maxWidth: "400px", fontSize: "13pt" }}
1314
description={
1415
contactEmail && (
1516
<>
16-
You can still <Contact lower />.
17+
You can still <Contact lower useHelpEmail />.
1718
</>
1819
)
1920
}

0 commit comments

Comments
 (0)