Wire up more Posthog tracking (#7689)
This commit is contained in:
parent
254dbeeccb
commit
5620b83d34
17 changed files with 221 additions and 77 deletions
|
@ -29,6 +29,7 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
|||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import Heading from '../typography/Heading';
|
||||
import { IDialogProps } from "./IDialogProps";
|
||||
import { PosthogScreenTracker, ScreenName } from "../../../PosthogTrackers";
|
||||
|
||||
interface IProps extends IDialogProps {
|
||||
// Whether the dialog should have a 'close' button that will
|
||||
|
@ -66,6 +67,9 @@ interface IProps extends IDialogProps {
|
|||
titleClass?: string | string[];
|
||||
|
||||
headerButton?: JSX.Element;
|
||||
|
||||
// optional Posthog ScreenName to supply during the lifetime of this dialog
|
||||
screenName?: ScreenName;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -119,6 +123,7 @@ export default class BaseDialog extends React.Component<IProps> {
|
|||
|
||||
return (
|
||||
<MatrixClientContext.Provider value={this.matrixClient}>
|
||||
<PosthogScreenTracker screenName={this.props.screenName} />
|
||||
<FocusLock
|
||||
returnFocus={true}
|
||||
lockProps={{
|
||||
|
|
|
@ -326,7 +326,12 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
return (
|
||||
<BaseDialog className="mx_CreateRoomDialog" onFinished={this.props.onFinished} title={title}>
|
||||
<BaseDialog
|
||||
className="mx_CreateRoomDialog"
|
||||
onFinished={this.props.onFinished}
|
||||
title={title}
|
||||
screenName="CreateRoom"
|
||||
>
|
||||
<form onSubmit={this.onOk} onKeyDown={this.onKeyDown}>
|
||||
<div className="mx_Dialog_content">
|
||||
<Field
|
||||
|
|
|
@ -199,10 +199,12 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
|||
|
||||
// this is on purpose not a <form /> to prevent Enter triggering submission, to further prevent accidents
|
||||
return (
|
||||
<BaseDialog className="mx_DeactivateAccountDialog"
|
||||
<BaseDialog
|
||||
className="mx_DeactivateAccountDialog"
|
||||
onFinished={this.props.onFinished}
|
||||
titleClass="danger"
|
||||
title={_t("Deactivate Account")}
|
||||
screenName="DeactivateAccount"
|
||||
>
|
||||
<div className="mx_Dialog_content">
|
||||
<p>{ _t(
|
||||
|
|
|
@ -70,6 +70,7 @@ import SpaceStore from "../../../stores/spaces/SpaceStore";
|
|||
import CallHandler from "../../../CallHandler";
|
||||
import UserIdentifierCustomisations from '../../../customisations/UserIdentifier';
|
||||
import CopyableText from "../elements/CopyableText";
|
||||
import { ScreenName } from '../../../PosthogTrackers';
|
||||
|
||||
// we have a number of types defined from the Matrix spec which can't reasonably be altered here.
|
||||
/* eslint-disable camelcase */
|
||||
|
@ -1307,6 +1308,13 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
selectText(e.target);
|
||||
}
|
||||
|
||||
private get screenName(): ScreenName {
|
||||
switch (this.props.kind) {
|
||||
case KIND_DM:
|
||||
return "StartChat";
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let spinner = null;
|
||||
if (this.state.busy) {
|
||||
|
@ -1584,6 +1592,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
hasCancel={true}
|
||||
onFinished={this.props.onFinished}
|
||||
title={title}
|
||||
screenName={this.screenName}
|
||||
>
|
||||
<div className='mx_InviteDialog_content'>
|
||||
{ dialogContent }
|
||||
|
|
|
@ -154,6 +154,7 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
|
|||
<TabbedView
|
||||
tabs={this.getTabs()}
|
||||
initialTabId={this.props.initialTabId}
|
||||
screenName="RoomSettings"
|
||||
/>
|
||||
</div>
|
||||
</BaseDialog>
|
||||
|
|
|
@ -94,12 +94,14 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("General"),
|
||||
"mx_UserSettingsDialog_settingsIcon",
|
||||
<GeneralUserSettingsTab closeSettingsFn={this.props.onFinished} />,
|
||||
"WebUserSettingsGeneral",
|
||||
));
|
||||
tabs.push(new Tab(
|
||||
UserTab.Appearance,
|
||||
_td("Appearance"),
|
||||
"mx_UserSettingsDialog_appearanceIcon",
|
||||
<AppearanceUserSettingsTab />,
|
||||
"WebUserSettingsAppearance",
|
||||
));
|
||||
if (SettingsStore.getValue(UIFeature.Flair)) {
|
||||
tabs.push(new Tab(
|
||||
|
@ -107,6 +109,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Flair"),
|
||||
"mx_UserSettingsDialog_flairIcon",
|
||||
<FlairUserSettingsTab />,
|
||||
"WebUserSettingFlair",
|
||||
));
|
||||
}
|
||||
tabs.push(new Tab(
|
||||
|
@ -114,24 +117,28 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Notifications"),
|
||||
"mx_UserSettingsDialog_bellIcon",
|
||||
<NotificationUserSettingsTab />,
|
||||
"WebUserSettingsNotifications",
|
||||
));
|
||||
tabs.push(new Tab(
|
||||
UserTab.Preferences,
|
||||
_td("Preferences"),
|
||||
"mx_UserSettingsDialog_preferencesIcon",
|
||||
<PreferencesUserSettingsTab closeSettingsFn={this.props.onFinished} />,
|
||||
"WebUserSettingsPreferences",
|
||||
));
|
||||
tabs.push(new Tab(
|
||||
UserTab.Keyboard,
|
||||
_td("Keyboard"),
|
||||
"mx_UserSettingsDialog_keyboardIcon",
|
||||
<KeyboardUserSettingsTab />,
|
||||
"WebUserSettingsKeyboard",
|
||||
));
|
||||
tabs.push(new Tab(
|
||||
UserTab.Sidebar,
|
||||
_td("Sidebar"),
|
||||
"mx_UserSettingsDialog_sidebarIcon",
|
||||
<SidebarUserSettingsTab />,
|
||||
"WebUserSettingsSidebar",
|
||||
));
|
||||
|
||||
if (SettingsStore.getValue(UIFeature.Voip)) {
|
||||
|
@ -140,6 +147,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Voice & Video"),
|
||||
"mx_UserSettingsDialog_voiceIcon",
|
||||
<VoiceUserSettingsTab />,
|
||||
"WebUserSettingsVoiceVideo",
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -148,6 +156,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Security & Privacy"),
|
||||
"mx_UserSettingsDialog_securityIcon",
|
||||
<SecurityUserSettingsTab closeSettingsFn={this.props.onFinished} />,
|
||||
"WebUserSettingsSecurityPrivacy",
|
||||
));
|
||||
// Show the Labs tab if enabled or if there are any active betas
|
||||
if (SdkConfig.get()['showLabsSettings']
|
||||
|
@ -158,6 +167,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Labs"),
|
||||
"mx_UserSettingsDialog_labsIcon",
|
||||
<LabsUserSettingsTab />,
|
||||
"WebUserSettingsLabs",
|
||||
));
|
||||
}
|
||||
if (this.state.mjolnirEnabled) {
|
||||
|
@ -166,6 +176,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Ignored users"),
|
||||
"mx_UserSettingsDialog_mjolnirIcon",
|
||||
<MjolnirUserSettingsTab />,
|
||||
"WebUserSettingMjolnir",
|
||||
));
|
||||
}
|
||||
tabs.push(new Tab(
|
||||
|
@ -173,6 +184,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
_td("Help & About"),
|
||||
"mx_UserSettingsDialog_helpIcon",
|
||||
<HelpUserSettingsTab closeSettingsFn={() => this.props.onFinished(true)} />,
|
||||
"WebUserSettingsHelpAbout",
|
||||
));
|
||||
|
||||
return tabs;
|
||||
|
|
|
@ -23,6 +23,7 @@ import { _t } from '../../../languageHandler';
|
|||
import { Key } from "../../../Keyboard";
|
||||
import DesktopBuildsNotice, { WarningKind } from "../elements/DesktopBuildsNotice";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { PosthogScreenTracker } from '../../../PosthogTrackers';
|
||||
|
||||
interface IProps {
|
||||
onCancelClick: () => void;
|
||||
|
@ -93,6 +94,7 @@ export default class SearchBar extends React.Component<IProps, IState> {
|
|||
|
||||
return (
|
||||
<>
|
||||
<PosthogScreenTracker screenName="RoomSearch" />
|
||||
<div className="mx_SearchBar">
|
||||
<div className="mx_SearchBar_buttons" role="radiogroup">
|
||||
<AccessibleButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue