Send how many favorited rooms a user has to Posthog (#7772)
This commit is contained in:
parent
871032e1bc
commit
f6565bfbc8
13 changed files with 47 additions and 15 deletions
|
@ -38,6 +38,7 @@ import SettingsStore from "../../../settings/SettingsStore";
|
|||
import { Action } from "../../../dispatcher/actions";
|
||||
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents";
|
||||
import { UIComponent } from "../../../settings/UIFeature";
|
||||
import PosthogTrackers from "../../../PosthogTrackers";
|
||||
|
||||
interface IProps extends IContextMenuProps {
|
||||
space: Room;
|
||||
|
@ -141,6 +142,7 @@ const SpaceContextMenu = ({ space, hideHeader, onFinished, ...props }: IProps) =
|
|||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
PosthogTrackers.trackInteraction("WebSpaceContextMenuNewRoomItem", ev);
|
||||
showCreateNewRoom(space);
|
||||
onFinished();
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ import SearchBox from "../../structures/SearchBox";
|
|||
import SpaceStore from "../../../stores/spaces/SpaceStore";
|
||||
import RoomAvatar from "../avatars/RoomAvatar";
|
||||
import { getDisplayAliasForRoom } from "../../../Rooms";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton";
|
||||
import AutoHideScrollbar from "../../structures/AutoHideScrollbar";
|
||||
import DMRoomMap from "../../../utils/DMRoomMap";
|
||||
import { calculateRoomVia } from "../../../utils/permalinks/Permalinks";
|
||||
|
@ -47,7 +47,7 @@ const GROUP_MARGIN = 24;
|
|||
|
||||
interface IProps {
|
||||
space: Room;
|
||||
onCreateRoomClick(): void;
|
||||
onCreateRoomClick(ev: ButtonEvent): void;
|
||||
onAddSubspaceClick(): void;
|
||||
onFinished(added?: boolean): void;
|
||||
}
|
||||
|
@ -439,8 +439,8 @@ const AddExistingToSpaceDialog: React.FC<IProps> = ({ space, onCreateRoomClick,
|
|||
<div>{ _t("Want to add a new room instead?") }</div>
|
||||
<AccessibleButton
|
||||
kind="link"
|
||||
onClick={() => {
|
||||
onCreateRoomClick();
|
||||
onClick={(ev: ButtonEvent) => {
|
||||
onCreateRoomClick(ev);
|
||||
onFinished();
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -64,6 +64,7 @@ import { useEventEmitterState } from "../../../hooks/useEventEmitter";
|
|||
import { ChevronFace, ContextMenuTooltipButton, useContextMenu } from "../../structures/ContextMenu";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import PosthogTrackers from "../../../PosthogTrackers";
|
||||
|
||||
interface IProps {
|
||||
onKeyDown: (ev: React.KeyboardEvent, state: IRovingTabIndexState) => void;
|
||||
|
@ -233,6 +234,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
|
|||
e.stopPropagation();
|
||||
closeMenu();
|
||||
showCreateNewRoom(activeSpace);
|
||||
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateRoomItem", e);
|
||||
}}
|
||||
disabled={!canAddRooms}
|
||||
tooltip={canAddRooms ? undefined
|
||||
|
@ -265,6 +267,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
|
|||
e.stopPropagation();
|
||||
closeMenu();
|
||||
defaultDispatcher.dispatch({ action: "view_create_room" });
|
||||
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateRoomItem", e);
|
||||
}}
|
||||
/> }
|
||||
<IconizedContextMenuOption
|
||||
|
|
|
@ -59,6 +59,7 @@ import {
|
|||
import RightPanelStore from "../../../stores/right-panel/RightPanelStore";
|
||||
import TooltipTarget from "../elements/TooltipTarget";
|
||||
import { BetaPill } from "../beta/BetaCard";
|
||||
import PosthogTrackers from "../../../PosthogTrackers";
|
||||
|
||||
const contextMenuBelow = (elementRect: DOMRect) => {
|
||||
// align the context menu's icons with the icon which opened the context menu
|
||||
|
@ -253,6 +254,7 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
showCreateNewRoom(activeSpace);
|
||||
PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuCreateRoomItem", e);
|
||||
closePlusMenu();
|
||||
}}
|
||||
/>;
|
||||
|
@ -331,6 +333,7 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
defaultDispatcher.dispatch({ action: "view_create_room" });
|
||||
PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuCreateRoomItem", e);
|
||||
closePlusMenu();
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -38,6 +38,7 @@ import JoinRuleSettings from "../../JoinRuleSettings";
|
|||
import ErrorDialog from "../../../dialogs/ErrorDialog";
|
||||
import SettingsFieldset from '../../SettingsFieldset';
|
||||
import ExternalLink from '../../../elements/ExternalLink';
|
||||
import PosthogTrackers from "../../../../../PosthogTrackers";
|
||||
|
||||
interface IProps {
|
||||
roomId: string;
|
||||
|
@ -212,6 +213,9 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
CreateRoomDialog,
|
||||
{ defaultPublic, defaultEncrypted },
|
||||
);
|
||||
|
||||
PosthogTrackers.trackInteraction("WebRoomSettingsSecurityTabCreateNewRoomButton");
|
||||
|
||||
const [shouldCreate, opts] = await modal.finished;
|
||||
if (shouldCreate) {
|
||||
await createRoom(opts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue