diff --git a/components/dashboard/src/Analytics.tsx b/components/dashboard/src/Analytics.tsx index b6f127850942b1..9099f07d5b0076 100644 --- a/components/dashboard/src/Analytics.tsx +++ b/components/dashboard/src/Analytics.tsx @@ -10,10 +10,10 @@ import Cookies from "js-cookie"; import { v4 } from "uuid"; import { Experiment } from "./experiments"; -export type Event = "invite_url_requested" | "organisation_authorised" | "dotfile_repo_changed"; +export type Event = "invite_url_requested" | "organisation_authorised" | "dotfile_repo_changed" | "feedback_submitted"; type InternalEvent = Event | "path_changed" | "dashboard_clicked"; -export type EventProperties = TrackOrgAuthorised | TrackInviteUrlRequested | TrackDotfileRepo; +export type EventProperties = TrackOrgAuthorised | TrackInviteUrlRequested | TrackDotfileRepo | TrackFeedback; type InternalEventProperties = TrackUIExperiments & (EventProperties | TrackDashboardClick | TrackPathChanged); export interface TrackOrgAuthorised { @@ -30,6 +30,12 @@ export interface TrackDotfileRepo { current: string; } +export interface TrackFeedback { + selectedEmoji: number; + text: string; + href: string; + path: string; +} interface TrackDashboardClick { dnt?: boolean; path: string; diff --git a/components/dashboard/src/App.tsx b/components/dashboard/src/App.tsx index 1db31a3a659df5..49821b7930661c 100644 --- a/components/dashboard/src/App.tsx +++ b/components/dashboard/src/App.tsx @@ -48,6 +48,7 @@ import { parseProps } from "./start/StartWorkspace"; import SelectIDEModal from "./settings/SelectIDEModal"; import { StartPage, StartPhase } from "./start/StartPage"; import { isGitpodIo } from "./utils"; +import FeedbackFormModal from "./feedback-form/FeedbackModal"; const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "./Setup")); const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "./workspaces/Workspaces")); @@ -372,6 +373,7 @@ function App() { + diff --git a/components/dashboard/src/Menu.tsx b/components/dashboard/src/Menu.tsx index 225c1b5f6d3414..5c330b0b4f9928 100644 --- a/components/dashboard/src/Menu.tsx +++ b/components/dashboard/src/Menu.tsx @@ -26,6 +26,7 @@ import { getTeamSettingsMenu } from "./teams/TeamSettings"; import { getProjectSettingsMenu } from "./projects/ProjectSettings"; import { ProjectContext } from "./projects/project-context"; import { PaymentContext } from "./payment-context"; +import FeedbackFormModal from "./feedback-form/FeedbackModal"; interface Entry { title: string; @@ -41,6 +42,7 @@ export default function Menu() { const { showPaymentUI, setShowPaymentUI, setCurrency, setIsStudent, setIsChargebeeCustomer } = useContext(PaymentContext); const { project, setProject } = useContext(ProjectContext); + const [isFeedbackFormVisible, setFeedbackFormVisible] = useState(false); const match = useRouteMatch<{ segment1?: string; segment2?: string; segment3?: string }>( "/(t/)?:segment1/:segment2?/:segment3?", @@ -227,12 +229,15 @@ export default function Menu() { title: "Docs", link: "https://www.gitpod.io/docs/", }, - { - title: "Help", - link: "https://www.gitpod.io/support", - }, ]; + const handleFeedbackFormClick = () => { + setFeedbackFormVisible(true); + }; + + const onFeedbackFormClose = () => { + setFeedbackFormVisible(false); + }; const renderTeamMenu = () => { return (
@@ -371,6 +376,9 @@ export default function Menu() { /> ))} +
  • + +
  • + {isFeedbackFormVisible && } {!isMinimalUI && !prebuildId && (