Wire up new fields on the ViewRoom posthog event and more interactions (#7787)
This commit is contained in:
parent
9141225a79
commit
cfa6e266cd
10 changed files with 54 additions and 11 deletions
|
@ -190,7 +190,7 @@ const SpaceContextMenu = ({ space, hideHeader, onFinished, ...props }: IProps) =
|
|||
onFinished();
|
||||
};
|
||||
|
||||
const onExploreRoomsClick = (ev: ButtonEvent) => {
|
||||
const openSpace = (ev: ButtonEvent) => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
|
@ -202,6 +202,16 @@ const SpaceContextMenu = ({ space, hideHeader, onFinished, ...props }: IProps) =
|
|||
onFinished();
|
||||
};
|
||||
|
||||
const onExploreRoomsClick = (ev: ButtonEvent) => {
|
||||
PosthogTrackers.trackInteraction("WebSpaceContextMenuExploreRoomsItem", ev);
|
||||
openSpace(ev);
|
||||
};
|
||||
|
||||
const onHomeClick = (ev: ButtonEvent) => {
|
||||
PosthogTrackers.trackInteraction("WebSpaceContextMenuHomeItem", ev);
|
||||
openSpace(ev);
|
||||
};
|
||||
|
||||
return <IconizedContextMenu
|
||||
{...props}
|
||||
onFinished={onFinished}
|
||||
|
@ -215,7 +225,7 @@ const SpaceContextMenu = ({ space, hideHeader, onFinished, ...props }: IProps) =
|
|||
<IconizedContextMenuOption
|
||||
iconClassName="mx_SpacePanel_iconHome"
|
||||
label={_t("Space home")}
|
||||
onClick={onExploreRoomsClick}
|
||||
onClick={onHomeClick}
|
||||
/>
|
||||
{ inviteOption }
|
||||
<IconizedContextMenuOption
|
||||
|
|
|
@ -43,7 +43,7 @@ import IconizedContextMenu, {
|
|||
IconizedContextMenuOption,
|
||||
IconizedContextMenuOptionList,
|
||||
} from "../context_menus/IconizedContextMenu";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton";
|
||||
import { CommunityPrototypeStore } from "../../../stores/CommunityPrototypeStore";
|
||||
import SpaceStore from "../../../stores/spaces/SpaceStore";
|
||||
import {
|
||||
|
@ -223,6 +223,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
|
|||
room_id: activeSpace.roomId,
|
||||
_trigger: undefined, // other
|
||||
});
|
||||
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuExploreRoomsItem", e);
|
||||
}}
|
||||
/>
|
||||
{
|
||||
|
@ -503,13 +504,14 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
|||
defaultDispatcher.dispatch({ action: "view_create_chat", initialText });
|
||||
};
|
||||
|
||||
private onExplore = () => {
|
||||
private onExplore = (ev: ButtonEvent) => {
|
||||
if (!isMetaSpace(this.props.activeSpace)) {
|
||||
defaultDispatcher.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: this.props.activeSpace,
|
||||
_trigger: undefined, // other
|
||||
});
|
||||
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuExploreRoomsItem", ev);
|
||||
} else {
|
||||
const initialText = RoomListStore.instance.getFirstNameFilterCondition()?.search;
|
||||
defaultDispatcher.dispatch({ action: Action.ViewRoomDirectory, initialText });
|
||||
|
|
|
@ -282,6 +282,7 @@ const RoomListHeader = ({ spacePanelDisabled, onVisibilityChange }: IProps) => {
|
|||
_trigger: undefined, // other
|
||||
});
|
||||
closePlusMenu();
|
||||
PosthogTrackers.trackInteraction("WebRoomListHeaderPlusMenuExploreRoomsItem", e);
|
||||
}}
|
||||
/>
|
||||
<IconizedContextMenuOption
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue