diff --git a/components/dashboard/src/Analytics.tsx b/components/dashboard/src/Analytics.tsx index 027718858ce05e..e40c9752dbe40e 100644 --- a/components/dashboard/src/Analytics.tsx +++ b/components/dashboard/src/Analytics.tsx @@ -9,6 +9,7 @@ import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import Cookies from "js-cookie"; import { v4 } from "uuid"; import { Experiment } from "./experiments"; +import { StartWorkspaceError } from "./start/StartPage"; export type Event = | "invite_url_requested" @@ -40,6 +41,8 @@ export interface TrackFeedback { feedback: string; href: string; path: string; + error_object?: StartWorkspaceError; + error_message?: string; } interface TrackDashboardClick { dnt?: boolean; diff --git a/components/dashboard/src/components/ErrorMessage.tsx b/components/dashboard/src/components/ErrorMessage.tsx index 9d1fd3337eeac8..e32bce0c81c341 100644 --- a/components/dashboard/src/components/ErrorMessage.tsx +++ b/components/dashboard/src/components/ErrorMessage.tsx @@ -22,6 +22,7 @@ function ErrorMessage(props: { imgSrc: string; imgAlt?: string; message: string initialSize={24} isError={true} isModal={false} + errorMessage={props.message} /> )} diff --git a/components/dashboard/src/feedback-form/FeedbackComponent.tsx b/components/dashboard/src/feedback-form/FeedbackComponent.tsx index 819e6e3e6989ca..d9f2debae11c0a 100644 --- a/components/dashboard/src/feedback-form/FeedbackComponent.tsx +++ b/components/dashboard/src/feedback-form/FeedbackComponent.tsx @@ -9,7 +9,8 @@ import starry from "../images/feedback/starry-emoji.svg"; import happy from "../images/feedback/happy-emoji.svg"; import meh from "../images/feedback/meh-emoji.svg"; import crying from "../images/feedback/crying-emoji.svg"; -import { trackEvent } from "../Analytics"; +import { trackEvent, TrackFeedback } from "../Analytics"; +import { StartWorkspaceError } from "../start/StartPage"; function FeedbackComponent(props: { onClose?: () => void; @@ -17,6 +18,8 @@ function FeedbackComponent(props: { isError: boolean; message?: string; initialSize?: number; + errorObject?: StartWorkspaceError; + errorMessage?: string; }) { const [text, setText] = useState(""); const [selectedEmoji, setSelectedEmoji] = useState(); @@ -30,11 +33,13 @@ function FeedbackComponent(props: { }; const onSubmit = () => { if (selectedEmoji) { - const feedbackObj = { + const feedbackObj: TrackFeedback = { score: selectedEmoji, feedback: text, href: window.location.href, path: window.location.pathname, + error_object: props.errorObject || undefined, + error_message: props.errorMessage, }; trackEvent("feedback_submitted", feedbackObj); } diff --git a/components/dashboard/src/start/CreateWorkspace.tsx b/components/dashboard/src/start/CreateWorkspace.tsx index 17b2d0906ec990..6da718bef90cc7 100644 --- a/components/dashboard/src/start/CreateWorkspace.tsx +++ b/components/dashboard/src/start/CreateWorkspace.tsx @@ -515,6 +515,8 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) { message={"Was this error message helpful?"} isError={true} initialSize={24} + errorObject={p.error} + errorMessage={p.error.message} /> )}