Skip to content

Commit

Permalink
Merge pull request #46428 from callstack-internal/chore/firebase-events
Browse files Browse the repository at this point in the history
chore: add new triggers for the analytics event
  • Loading branch information
marcaaron authored Jul 30, 2024
2 parents dac740b + 6423ba3 commit 3c9c7b0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import * as TransactionUtils from '@libs/TransactionUtils';
import type {ContextMenuAnchor} from '@pages/home/report/ContextMenu/ReportActionContextMenu';
import variables from '@styles/variables';
import * as IOU from '@userActions/IOU';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -360,6 +361,7 @@ function ReportPreview({
<View style={[styles.chatItemMessage, containerStyles]}>
<PressableWithoutFeedback
onPress={() => {
Timing.start(CONST.TIMING.SWITCH_REPORT);
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(iouReportID));
}}
onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import Performance from '@libs/Performance';
import SignInButton from '@pages/home/sidebar/SignInButton';
import * as Session from '@userActions/Session';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -62,7 +64,11 @@ function TopBar({breadcrumbLabel, activeWorkspaceID, shouldDisplaySearch = true}
<PressableWithoutFeedback
accessibilityLabel={translate('sidebarScreen.buttonFind')}
style={[styles.flexRow, styles.mr2, styles.touchableButtonImage]}
onPress={Session.checkIfActionIsAllowed(() => Navigation.navigate(ROUTES.CHAT_FINDER))}
onPress={Session.checkIfActionIsAllowed(() => {
Timing.start(CONST.TIMING.CHAT_FINDER_RENDER);
Performance.markStart(CONST.TIMING.CHAT_FINDER_RENDER);
Navigation.navigate(ROUTES.CHAT_FINDER);
})}
>
<Icon
src={Expensicons.MagnifyingGlass}
Expand Down
5 changes: 0 additions & 5 deletions src/pages/ChatFinderPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa
);
useCancelSearchOnModalClose();

useEffect(() => {
Timing.start(CONST.TIMING.CHAT_FINDER_RENDER);
Performance.markStart(CONST.TIMING.CHAT_FINDER_RENDER);
}, []);

useEffect(() => {
Report.searchInServer(debouncedSearchValueInServer.trim());
}, [debouncedSearchValueInServer]);
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/ReportActionItemParentAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import onyxSubscribe from '@libs/onyxSubscribe';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as Report from '@userActions/Report';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';
Expand Down Expand Up @@ -124,6 +126,7 @@ function ReportActionItemParentAction({
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '-1', ancestor.reportAction.reportActionID));
}
Timing.start(CONST.TIMING.SWITCH_REPORT);
}
: undefined
}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/report/ReportActionItemThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PressableWithSecondaryInteraction from '@components/PressableWithSecondar
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Timing from '@libs/actions/Timing';
import * as Report from '@userActions/Report';
import CONST from '@src/CONST';
import type {Icon} from '@src/types/onyx/OnyxCommon';
Expand Down Expand Up @@ -45,6 +46,7 @@ function ReportActionItemThread({numberOfReplies, icons, mostRecentReply, childR
<PressableWithSecondaryInteraction
onPress={() => {
Report.navigateToAndOpenChildReport(childReportID);
Timing.start(CONST.TIMING.SWITCH_REPORT);
}}
role={CONST.ROLE.BUTTON}
accessibilityLabel={`${numberOfReplies} ${replyText}`}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/report/ThreadDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Navigation from '@libs/Navigation/Navigation';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import type {Ancestor} from '@libs/ReportUtils';
import variables from '@styles/variables';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';

Expand Down Expand Up @@ -47,6 +48,7 @@ function ThreadDivider({ancestor, isLinkDisabled = false}: ThreadDividerProps) {
) : (
<PressableWithoutFeedback
onPress={() => {
Timing.start(CONST.TIMING.SWITCH_REPORT);
const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(ancestor.reportAction, ancestor.reportAction.reportActionID ?? '-1');
// Pop the thread report screen before navigating to the chat report.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '-1'));
Expand Down

0 comments on commit 3c9c7b0

Please sign in to comment.