diff --git a/src/CONST/index.ts b/src/CONST/index.ts index b3f875c62c42b..4fd6ae9d5a6f7 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7528,6 +7528,98 @@ const CONST = { WORKSPACES: 'NavigationTabBar-Workspaces', ACCOUNT: 'NavigationTabBar-Account', }, + HEADER_VIEW: { + BACK_BUTTON: 'HeaderView-BackButton', + DETAILS_BUTTON: 'HeaderView-DetailsButton', + TASK_ACTION_BUTTON: 'HeaderView-TaskActionButton', + }, + SEARCH: { + SEARCH_BUTTON: 'Search-SearchButton', + }, + REPORT: { + FLOATING_MESSAGE_COUNTER: 'Report-FloatingMessageCounter', + LIST_BOUNDARY_LOADER_RETRY: 'Report-ListBoundaryLoaderRetry', + SEND_BUTTON: 'Report-SendButton', + ATTACHMENT_PICKER_CREATE_BUTTON: 'Report-AttachmentPickerCreateButton', + ATTACHMENT_PICKER_EXPAND_BUTTON: 'Report-AttachmentPickerExpandButton', + ATTACHMENT_PICKER_COLLAPSE_BUTTON: 'Report-AttachmentPickerCollapseButton', + ATTACHMENT_PICKER_MENU_CREATE_EXPENSE: 'Report-AttachmentPickerMenuCreateExpense', + ATTACHMENT_PICKER_MENU_TRACK_DISTANCE: 'Report-AttachmentPickerMenuTrackDistance', + ATTACHMENT_PICKER_MENU_SPLIT_EXPENSE: 'Report-AttachmentPickerMenuSplitExpense', + ATTACHMENT_PICKER_MENU_PAY_SOMEONE: 'Report-AttachmentPickerMenuPaySomeone', + ATTACHMENT_PICKER_MENU_SEND_INVOICE: 'Report-AttachmentPickerMenuSendInvoice', + ATTACHMENT_PICKER_MENU_CREATE_REPORT: 'Report-AttachmentPickerMenuCreateReport', + ATTACHMENT_PICKER_MENU_ASSIGN_TASK: 'Report-AttachmentPickerMenuAssignTask', + ATTACHMENT_PICKER_MENU_ADD_ATTACHMENT: 'Report-AttachmentPickerMenuAddAttachment', + EMOJI_PICKER_BUTTON: 'Report-EmojiPickerButton', + REPORT_ACTION_ITEM_CREATED: 'Report-ReportActionItemCreated', + REPORT_ACTION_ITEM_MESSAGE_ENTER_SIGNER_INFO: 'Report-ReportActionItemMessageEnterSignerInfo', + REPORT_ACTION_ITEM_MESSAGE_ADD_BANK_ACCOUNT: 'Report-ReportActionItemMessageAddBankAccount', + REPORT_ACTION_ITEM_MESSAGE_EDIT_CANCEL_BUTTON: 'Report-ReportActionItemMessageEditCancelButton', + REPORT_ACTION_ITEM_MESSAGE_EDIT_SAVE_BUTTON: 'Report-ReportActionItemMessageEditSaveButton', + REPORT_ACTION_ITEM_SINGLE_AVATAR_BUTTON: 'Report-ReportActionItemSingleAvatarButton', + REPORT_ACTION_ITEM_SINGLE_ACTOR_BUTTON: 'Report-ReportActionItemSingleActorButton', + REPORT_ACTION_ITEM_THREAD: 'Report-ReportActionItemThread', + THREAD_DIVIDER: 'Report-ThreadDivider', + PURE_REPORT_ACTION_ITEM: 'Report-PureReportActionItem', + MODERATION_BUTTON: 'Report-ModerationButton', + }, + SIDEBAR: { + SIGN_IN_BUTTON: 'Sidebar-SignInButton', + }, + LHN: { + OPTION_ROW: 'LHN-OptionRow', + }, + CONTEXT_MENU: { + REPLY_IN_THREAD: 'ContextMenu-ReplyInThread', + MARK_AS_UNREAD: 'ContextMenu-MarkAsUnread', + MARK_AS_READ: 'ContextMenu-MarkAsRead', + EDIT_COMMENT: 'ContextMenu-EditComment', + UNHOLD: 'ContextMenu-Unhold', + HOLD: 'ContextMenu-Hold', + JOIN_THREAD: 'ContextMenu-JoinThread', + LEAVE_THREAD: 'ContextMenu-LeaveThread', + COPY_URL: 'ContextMenu-CopyUrl', + COPY_TO_CLIPBOARD: 'ContextMenu-CopyToClipboard', + COPY_EMAIL: 'ContextMenu-CopyEmail', + COPY_MESSAGE: 'ContextMenu-CopyMessage', + COPY_LINK: 'ContextMenu-CopyLink', + PIN: 'ContextMenu-Pin', + UNPIN: 'ContextMenu-Unpin', + FLAG_AS_OFFENSIVE: 'ContextMenu-FlagAsOffensive', + DOWNLOAD: 'ContextMenu-Download', + COPY_ONYX_DATA: 'ContextMenu-CopyOnyxData', + DEBUG: 'ContextMenu-Debug', + DELETE: 'ContextMenu-Delete', + MENU: 'ContextMenu-Menu', + }, + MORE_MENU: { + MORE_BUTTON: 'MoreMenu-MoreButton', + VIEW_DETAILS: 'MoreMenu-ViewDetails', + EXPORT: 'MoreMenu-Export', + EXPORT_FILE: 'MoreMenu-ExportFile', + DOWNLOAD_PDF: 'MoreMenu-DownloadPDF', + SUBMIT: 'MoreMenu-Submit', + APPROVE: 'MoreMenu-Approve', + UNAPPROVE: 'MoreMenu-Unapprove', + CANCEL_PAYMENT: 'MoreMenu-CancelPayment', + HOLD: 'MoreMenu-Hold', + REMOVE_HOLD: 'MoreMenu-RemoveHold', + SPLIT: 'MoreMenu-Split', + MERGE: 'MoreMenu-Merge', + CHANGE_WORKSPACE: 'MoreMenu-ChangeWorkspace', + CHANGE_APPROVER: 'MoreMenu-ChangeApprover', + REPORT_LAYOUT: 'MoreMenu-ReportLayout', + DELETE: 'MoreMenu-Delete', + RETRACT: 'MoreMenu-Retract', + REOPEN: 'MoreMenu-Reopen', + REJECT: 'MoreMenu-Reject', + ADD_EXPENSE: 'MoreMenu-AddExpense', + ADD_EXPENSE_CREATE: 'MoreMenu-AddExpenseCreate', + ADD_EXPENSE_TRACK_DISTANCE: 'MoreMenu-AddExpenseTrackDistance', + ADD_EXPENSE_UNREPORTED: 'MoreMenu-AddExpenseUnreported', + PAY: 'MoreMenu-Pay', + }, }, } as const; diff --git a/src/components/BaseMiniContextMenuItem.tsx b/src/components/BaseMiniContextMenuItem.tsx index c9738970bbe3e..ac83a4d3e5b73 100644 --- a/src/components/BaseMiniContextMenuItem.tsx +++ b/src/components/BaseMiniContextMenuItem.tsx @@ -41,13 +41,26 @@ type BaseMiniContextMenuItemProps = { * Reference to the outer element */ ref?: PressableRef; + + /** + * Label for Sentry tracking + */ + sentryLabel?: string; }; /** * Component that renders a mini context menu item with a * pressable. Also renders a tooltip when hovering the item. */ -function BaseMiniContextMenuItem({tooltipText, onPress, children, isDelayButtonStateComplete = true, shouldPreventDefaultFocusOnPress = true, ref}: BaseMiniContextMenuItemProps) { +function BaseMiniContextMenuItem({ + tooltipText, + onPress, + children, + isDelayButtonStateComplete = true, + shouldPreventDefaultFocusOnPress = true, + ref, + sentryLabel, +}: BaseMiniContextMenuItemProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); return ( @@ -79,6 +92,7 @@ function BaseMiniContextMenuItem({tooltipText, onPress, children, isDelayButtonS }} accessibilityLabel={tooltipText} role={CONST.ROLE.BUTTON} + sentryLabel={sentryLabel} style={({hovered, pressed}) => [ styles.reportActionContextMenuMiniButton, StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, isDelayButtonStateComplete), true), diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index efa05d4482a3a..1a55f377406ca 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -60,6 +60,7 @@ function ButtonWithDropdownMenu({ref, ...props}: ButtonWithDropdownM shouldUseShortForm = false, shouldUseOptionIcon = false, shouldStayNormalOnDisable = false, + sentryLabel, } = props; const theme = useTheme(); @@ -187,6 +188,7 @@ function ButtonWithDropdownMenu({ref, ...props}: ButtonWithDropdownM textStyles={[isTextTooLong && shouldUseShortForm ? {...styles.textExtraSmall, ...styles.textBold} : {}]} secondLineText={secondLineText} icon={icon} + sentryLabel={sentryLabel} /> {isSplitButton && ( @@ -204,6 +206,7 @@ function ButtonWithDropdownMenu({ref, ...props}: ButtonWithDropdownM small={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.SMALL} innerStyles={[styles.dropDownButtonCartIconContainerPadding, innerStyleDropButton, isButtonSizeSmall && styles.dropDownButtonCartIcon]} enterKeyEventListenerPriority={enterKeyEventListenerPriority} + sentryLabel={sentryLabel} > @@ -253,6 +256,7 @@ function ButtonWithDropdownMenu({ref, ...props}: ButtonWithDropdownM iconRight={shouldShowButtonRightIcon ? options.at(0)?.icon : undefined} shouldShowRightIcon={shouldShowButtonRightIcon} testID={testID} + sentryLabel={sentryLabel} /> )} {(shouldAlwaysShowDropdownMenu || options.length > 1) && !!popoverAnchorPosition && ( diff --git a/src/components/ButtonWithDropdownMenu/types.ts b/src/components/ButtonWithDropdownMenu/types.ts index 5224c0afd3378..47458710d62ed 100644 --- a/src/components/ButtonWithDropdownMenu/types.ts +++ b/src/components/ButtonWithDropdownMenu/types.ts @@ -49,6 +49,8 @@ type DropdownOption = { shouldShow?: boolean; /** Whether to show a loading spinner for this option */ shouldShowLoadingSpinnerIcon?: boolean; + /** Label for sentry to identify the dropdown option */ + sentryLabel?: string; }; type ButtonWithDropdownMenuProps = { @@ -157,6 +159,9 @@ type ButtonWithDropdownMenuProps = { /** Reference to the outer element */ ref?: React.Ref; + + /** Label for the sentry to identify the button */ + sentryLabel?: string; }; type ButtonWithDropdownMenuRef = { diff --git a/src/components/ContextMenuItem.tsx b/src/components/ContextMenuItem.tsx index 214e7bd616ec3..315fb34b72121 100644 --- a/src/components/ContextMenuItem.tsx +++ b/src/components/ContextMenuItem.tsx @@ -64,6 +64,9 @@ type ContextMenuItemProps = { /** Reference to the outer element */ ref?: ForwardedRef; + + /** Label for Sentry tracking */ + sentryLabel?: string; }; type ContextMenuItemHandle = { @@ -89,6 +92,7 @@ function ContextMenuItem({ disabled = false, shouldShowLoadingSpinnerIcon = false, ref, + sentryLabel, }: ContextMenuItemProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -120,6 +124,7 @@ function ContextMenuItem({ onPress={triggerPressAndUpdateSuccess} isDelayButtonStateComplete={!isThrottledButtonActive} shouldPreventDefaultFocusOnPress={shouldPreventDefaultFocusOnPress} + sentryLabel={sentryLabel} > {({hovered, pressed}) => ( ); } diff --git a/src/components/EmojiPicker/EmojiPickerButton.tsx b/src/components/EmojiPicker/EmojiPickerButton.tsx index 29b12ba0abce2..46fd69bc87f9f 100644 --- a/src/components/EmojiPicker/EmojiPickerButton.tsx +++ b/src/components/EmojiPicker/EmojiPickerButton.tsx @@ -78,6 +78,7 @@ function EmojiPickerButton({isDisabled = false, emojiPickerID = '', shiftVertica onPress={openEmojiPicker} id={CONST.EMOJI_PICKER_BUTTON_NATIVE_ID} accessibilityLabel={translate('reportActionCompose.emoji')} + sentryLabel={CONST.SENTRY_LABEL.REPORT.EMOJI_PICKER_BUTTON} > {({hovered, pressed}) => ( = 2} + sentryLabel={CONST.SENTRY_LABEL.LHN.OPTION_ROW} > diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 7d65a8c4294a6..b2fa949596c58 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -394,6 +394,9 @@ type MenuItemBaseProps = ForwardedFSClassProps & { /** Whether the screen containing the item is focused */ isFocused?: boolean; + + /** Label for Sentry tracking */ + sentryLabel?: string; }; type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps; @@ -522,6 +525,7 @@ function MenuItem({ forwardedFSClass, ref, isFocused, + sentryLabel, }: MenuItemProps) { const theme = useTheme(); const styles = useThemeStyles(); @@ -722,6 +726,7 @@ function MenuItem({ accessibilityLabel={title ? title.toString() : ''} accessible onFocus={onFocus} + sentryLabel={sentryLabel} > {({pressed}) => ( diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index c97b6e6cc65e7..4bf04d05765f4 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -773,6 +773,7 @@ function MoneyReportHeader({ text: translate('export.basicExport'), icon: expensifyIcons.Table, value: CONST.REPORT.EXPORT_OPTIONS.DOWNLOAD_CSV, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.EXPORT_FILE, onSelected: () => { if (!moneyRequestReport) { return; @@ -794,6 +795,7 @@ function MoneyReportHeader({ return iconName ? expensifyIcons[iconName] : undefined; })(), value: CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.EXPORT_FILE, onSelected: () => { if (!connectedIntegration || !moneyRequestReport) { return; @@ -812,6 +814,7 @@ function MoneyReportHeader({ return iconName ? expensifyIcons[iconName] : undefined; })(), value: CONST.REPORT.EXPORT_OPTIONS.MARK_AS_EXPORTED, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.EXPORT_FILE, onSelected: () => { if (!connectedIntegration || !moneyRequestReport) { return; @@ -831,6 +834,7 @@ function MoneyReportHeader({ icon: expensifyIcons.Table, value: template.templateName, description: template.description, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.EXPORT_FILE, onSelected: () => beginExportWithTemplate(template.templateName, template.type, transactionIDs, template.policyID), }; } @@ -1049,6 +1053,7 @@ function MoneyReportHeader({ value: CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS, text: translate('iou.viewDetails'), icon: expensifyIcons.Info, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.VIEW_DETAILS, onSelected: () => { navigateToDetailsPage(moneyRequestReport, Navigation.getReportRHPActiveRoute()); }, @@ -1059,12 +1064,14 @@ function MoneyReportHeader({ backButtonText: translate('common.export'), icon: expensifyIcons.Export, rightIcon: expensifyIcons.ArrowRight, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.EXPORT, subMenuItems: secondaryExportActions.map((action) => exportSubmenuOptions[action as string]), }, [CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_PDF]: { value: CONST.REPORT.SECONDARY_ACTIONS.DOWNLOAD_PDF, text: translate('common.downloadAsPDF'), icon: expensifyIcons.Document, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.DOWNLOAD_PDF, onSelected: () => { if (!moneyRequestReport) { return; @@ -1076,6 +1083,7 @@ function MoneyReportHeader({ value: CONST.REPORT.SECONDARY_ACTIONS.SUBMIT, text: translate('common.submit'), icon: expensifyIcons.Send, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.SUBMIT, onSelected: () => { if (!moneyRequestReport) { return; @@ -1091,12 +1099,14 @@ function MoneyReportHeader({ text: translate('iou.approve'), icon: expensifyIcons.ThumbsUp, value: CONST.REPORT.SECONDARY_ACTIONS.APPROVE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.APPROVE, onSelected: confirmApproval, }, [CONST.REPORT.SECONDARY_ACTIONS.UNAPPROVE]: { text: translate('iou.unapprove'), icon: expensifyIcons.CircularArrowBackwards, value: CONST.REPORT.SECONDARY_ACTIONS.UNAPPROVE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.UNAPPROVE, onSelected: async () => { if (isDelegateAccessRestricted) { showDelegateNoAccessModal(); @@ -1126,6 +1136,7 @@ function MoneyReportHeader({ text: translate('iou.cancelPayment'), icon: expensifyIcons.Clear, value: CONST.REPORT.SECONDARY_ACTIONS.CANCEL_PAYMENT, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.CANCEL_PAYMENT, onSelected: async () => { const result = await showConfirmModal({ title: translate('iou.cancelPayment'), @@ -1145,6 +1156,7 @@ function MoneyReportHeader({ text: translate('iou.hold'), icon: expensifyIcons.Stopwatch, value: CONST.REPORT.SECONDARY_ACTIONS.HOLD, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.HOLD, onSelected: () => { if (!requestParentReportAction) { throw new Error('Parent action does not exist'); @@ -1170,6 +1182,7 @@ function MoneyReportHeader({ text: translate('iou.unhold'), icon: expensifyIcons.Stopwatch, value: CONST.REPORT.SECONDARY_ACTIONS.REMOVE_HOLD, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.REMOVE_HOLD, onSelected: () => { if (!requestParentReportAction) { throw new Error('Parent action does not exist'); @@ -1182,6 +1195,7 @@ function MoneyReportHeader({ text: isExpenseSplit ? translate('iou.editSplits') : translate('iou.split'), icon: expensifyIcons.ArrowSplit, value: CONST.REPORT.SECONDARY_ACTIONS.SPLIT, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.SPLIT, onSelected: () => { if (Number(transactions?.length) !== 1) { return; @@ -1194,6 +1208,7 @@ function MoneyReportHeader({ text: translate('common.merge'), icon: expensifyIcons.ArrowCollapse, value: CONST.REPORT.SECONDARY_ACTIONS.MERGE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.MERGE, onSelected: () => { if (!currentTransaction) { return; @@ -1222,6 +1237,7 @@ function MoneyReportHeader({ text: translate('iou.changeWorkspace'), icon: expensifyIcons.Buildings, value: CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.CHANGE_WORKSPACE, onSelected: () => { if (!moneyRequestReport) { return; @@ -1233,6 +1249,7 @@ function MoneyReportHeader({ text: translate('iou.changeApprover.title'), icon: expensifyIcons.Workflows, value: CONST.REPORT.SECONDARY_ACTIONS.CHANGE_APPROVER, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.CHANGE_APPROVER, onSelected: () => { if (!moneyRequestReport) { Log.warn('Change approver secondary action triggered without moneyRequestReport data.'); @@ -1245,6 +1262,7 @@ function MoneyReportHeader({ text: translate('reportLayout.reportLayout'), icon: expensifyIcons.Feed, value: CONST.REPORT.SECONDARY_ACTIONS.REPORT_LAYOUT, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.REPORT_LAYOUT, onSelected: () => { if (!moneyRequestReport) { return; @@ -1256,6 +1274,7 @@ function MoneyReportHeader({ text: translate('common.delete'), icon: expensifyIcons.Trashcan, value: CONST.REPORT.SECONDARY_ACTIONS.DELETE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.DELETE, onSelected: async () => { const transactionCount = Object.keys(transactions).length; @@ -1314,6 +1333,7 @@ function MoneyReportHeader({ text: translate('iou.retract'), icon: expensifyIcons.CircularArrowBackwards, value: CONST.REPORT.SECONDARY_ACTIONS.RETRACT, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.RETRACT, onSelected: () => { retractReport(moneyRequestReport, chatReport, policy, accountID, email ?? '', hasViolations, isASAPSubmitBetaEnabled, nextStep); }, @@ -1322,6 +1342,7 @@ function MoneyReportHeader({ text: translate('iou.retract'), icon: expensifyIcons.CircularArrowBackwards, value: CONST.REPORT.SECONDARY_ACTIONS.REOPEN, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.REOPEN, onSelected: async () => { if (isExported) { const result = await showConfirmModal({ @@ -1345,6 +1366,7 @@ function MoneyReportHeader({ text: translate('common.reject'), icon: expensifyIcons.ThumbsDown, value: CONST.REPORT.SECONDARY_ACTIONS.REJECT, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.REJECT, onSelected: () => { if (isDelegateAccessRestricted) { showDelegateNoAccessModal(); @@ -1367,6 +1389,7 @@ function MoneyReportHeader({ icon: expensifyIcons.Plus, rightIcon: expensifyIcons.ArrowRight, value: CONST.REPORT.SECONDARY_ACTIONS.ADD_EXPENSE, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.ADD_EXPENSE, subMenuItems: addExpenseDropdownOptions, onSelected: () => { if (!moneyRequestReport?.reportID) { @@ -1384,6 +1407,7 @@ function MoneyReportHeader({ icon: expensifyIcons.Cash, value: CONST.REPORT.SECONDARY_ACTIONS.PAY, backButtonText: translate('iou.settlePayment', {formattedAmount: totalAmount}), + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.PAY, subMenuItems: Object.values(paymentButtonOptions), }, }; diff --git a/src/components/MoneyReportHeaderKYCDropdown.tsx b/src/components/MoneyReportHeaderKYCDropdown.tsx index 9e97ce72fc8f9..20200407172eb 100644 --- a/src/components/MoneyReportHeaderKYCDropdown.tsx +++ b/src/components/MoneyReportHeaderKYCDropdown.tsx @@ -73,6 +73,7 @@ function MoneyReportHeaderKYCDropdown({ isSplitButton={false} wrapperStyle={shouldDisplayNarrowVersion && [!primaryAction && styles.flex1]} shouldUseModalPaddingStyle + sentryLabel={CONST.SENTRY_LABEL.MORE_MENU.MORE_BUTTON} /> )} diff --git a/src/components/Search/SearchRouter/SearchButton.tsx b/src/components/Search/SearchRouter/SearchButton.tsx index b2f463d3f4e59..271f9a7ac0563 100644 --- a/src/components/Search/SearchRouter/SearchButton.tsx +++ b/src/components/Search/SearchRouter/SearchButton.tsx @@ -35,6 +35,7 @@ function SearchButton({style, shouldUseAutoHitSlop = false}: SearchButtonProps) accessibilityLabel={translate('common.search')} style={[styles.flexRow, styles.touchableButtonImage, style]} shouldUseAutoHitSlop={shouldUseAutoHitSlop} + sentryLabel={CONST.SENTRY_LABEL.SEARCH.SEARCH_BUTTON} // eslint-disable-next-line react-compiler/react-compiler onPress={callFunctionIfActionIsAllowed(() => { pressableRef?.current?.blur(); diff --git a/src/components/TaskHeaderActionButton.tsx b/src/components/TaskHeaderActionButton.tsx index a041da910c885..51f0374f5eb69 100644 --- a/src/components/TaskHeaderActionButton.tsx +++ b/src/components/TaskHeaderActionButton.tsx @@ -11,6 +11,7 @@ import {canWriteInReport, isCompletedTaskReport} from '@libs/ReportUtils'; import {isActiveTaskEditRoute} from '@libs/TaskUtils'; import {callFunctionIfActionIsAllowed} from '@userActions/Session'; import {canActionTask, completeTask, reopenTask} from '@userActions/Task'; +import CONST from '@src/CONST'; import type * as OnyxTypes from '@src/types/onyx'; import Button from './Button'; @@ -51,6 +52,7 @@ function TaskHeaderActionButton({report}: TaskHeaderActionButtonProps) { } })} style={styles.flex1} + sentryLabel={CONST.SENTRY_LABEL.HEADER_VIEW.TASK_ACTION_BUTTON} /> ); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 14d13da15db1f..9c37f7dddc1cd 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2869,6 +2869,7 @@ function getAddExpenseDropdownOptions( // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.createExpense'), icon: Expensicons.Plus, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.ADD_EXPENSE_CREATE, onSelected: () => { if (!iouReportID) { return; @@ -2885,6 +2886,7 @@ function getAddExpenseDropdownOptions( // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.trackDistance'), icon: icons.Location, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.ADD_EXPENSE_TRACK_DISTANCE, onSelected: () => { if (!iouReportID) { return; @@ -2901,6 +2903,7 @@ function getAddExpenseDropdownOptions( // eslint-disable-next-line @typescript-eslint/no-deprecated text: translateLocal('iou.addUnreportedExpense'), icon: Expensicons.ReceiptPlus, + sentryLabel: CONST.SENTRY_LABEL.MORE_MENU.ADD_EXPENSE_UNREPORTED, onSelected: () => { if (policy && shouldRestrictUserBillableActions(policy.id)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policy.id)); diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index 0e5aa65259586..aa1a6e768d63e 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -272,6 +272,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked, accessibilityHint={translate('accessibilityHints.navigateToChatsList')} accessibilityLabel={translate('common.back')} role={CONST.ROLE.BUTTON} + sentryLabel={CONST.SENTRY_LABEL.HEADER_VIEW.BACK_BUTTON} > {shouldShowSubscript ? multipleAvatars : {multipleAvatars}} (index === filteredContextMenuActions.length - 1 || index === 1) && setFocusedIndex(-1)} disabled={contextAction?.shouldDisable ? contextAction?.shouldDisable(download) : false} shouldShowLoadingSpinnerIcon={contextAction?.shouldDisable ? contextAction?.shouldDisable(download) : false} + sentryLabel={contextAction.sentryLabel} /> ); })} diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 493ec6a7a90a6..dd2d41e14d67f 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -273,6 +273,7 @@ type ContextMenuActionWithIcon = { >; onPress: OnPress; getDescription: GetDescription; + sentryLabel?: string; }; type ContextMenuAction = (ContextMenuActionWithContent | ContextMenuActionWithIcon) & { @@ -361,6 +362,7 @@ const ContextMenuActions: ContextMenuAction[] = [ navigateToAndOpenChildReport(reportAction?.childReportID, reportAction, originalReportID); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.REPLY_IN_THREAD, }, { isAnonymousAction: false, @@ -375,6 +377,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.MARK_AS_UNREAD, }, { isAnonymousAction: false, @@ -389,6 +392,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.MARK_AS_READ, }, { isAnonymousAction: false, @@ -428,6 +432,7 @@ const ContextMenuActions: ContextMenuAction[] = [ editAction(); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.EDIT_COMMENT, }, { isAnonymousAction: false, @@ -450,6 +455,7 @@ const ContextMenuActions: ContextMenuAction[] = [ changeMoneyRequestHoldStatus(moneyRequestAction); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.UNHOLD, }, { isAnonymousAction: false, @@ -472,6 +478,7 @@ const ContextMenuActions: ContextMenuAction[] = [ changeMoneyRequestHoldStatus(moneyRequestAction); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.HOLD, }, { isAnonymousAction: false, @@ -511,6 +518,7 @@ const ContextMenuActions: ContextMenuAction[] = [ toggleSubscribeToChildReport(reportAction?.childReportID, reportAction, originalReportID, childReportNotificationPreference); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.JOIN_THREAD, }, { isAnonymousAction: false, @@ -550,6 +558,7 @@ const ContextMenuActions: ContextMenuAction[] = [ toggleSubscribeToChildReport(reportAction?.childReportID, reportAction, originalReportID, childReportNotificationPreference); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.LEAVE_THREAD, }, { isAnonymousAction: true, @@ -563,6 +572,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(true, ReportActionComposeFocusManager.focus); }, getDescription: (selection) => selection, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_URL, }, { isAnonymousAction: true, @@ -576,6 +586,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(true, ReportActionComposeFocusManager.focus); }, getDescription: () => undefined, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_TO_CLIPBOARD, }, { isAnonymousAction: true, @@ -589,6 +600,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(true, ReportActionComposeFocusManager.focus); }, getDescription: (selection) => EmailUtils.prefixMailSeparatorsWithBreakOpportunities(EmailUtils.trimMailTo(selection ?? '')), + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_EMAIL, }, { isAnonymousAction: true, @@ -872,6 +884,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_MESSAGE, }, { isAnonymousAction: true, @@ -895,6 +908,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(true, ReportActionComposeFocusManager.focus); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_LINK, }, { isAnonymousAction: false, @@ -908,6 +922,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.PIN, }, { isAnonymousAction: false, @@ -921,6 +936,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.UNPIN, }, { isAnonymousAction: false, @@ -950,6 +966,7 @@ const ContextMenuActions: ContextMenuAction[] = [ Navigation.navigate(ROUTES.FLAG_COMMENT.getRoute(reportID, reportAction?.reportActionID, activeRoute)); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.FLAG_AS_OFFENSIVE, }, { isAnonymousAction: true, @@ -978,6 +995,7 @@ const ContextMenuActions: ContextMenuAction[] = [ }, getDescription: () => {}, shouldDisable: (download) => download?.isDownloading ?? false, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.DOWNLOAD, }, { isAnonymousAction: true, @@ -991,6 +1009,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(true, ReportActionComposeFocusManager.focus); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_ONYX_DATA, }, { isAnonymousAction: true, @@ -1006,6 +1025,7 @@ const ContextMenuActions: ContextMenuAction[] = [ hideContextMenu(false, ReportActionComposeFocusManager.focus); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.DEBUG, }, { isAnonymousAction: false, @@ -1042,6 +1062,7 @@ const ContextMenuActions: ContextMenuAction[] = [ showDeleteModal(reportID, moneyRequestAction ?? reportAction); }, getDescription: () => {}, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.DELETE, }, { isAnonymousAction: true, @@ -1054,6 +1075,7 @@ const ContextMenuActions: ContextMenuAction[] = [ }, getDescription: () => {}, shouldPreventDefaultFocusOnPress: false, + sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.MENU, }, ]; diff --git a/src/pages/home/report/FloatingMessageCounter.tsx b/src/pages/home/report/FloatingMessageCounter.tsx index 6c8e40a738563..ae5d5e804620a 100644 --- a/src/pages/home/report/FloatingMessageCounter.tsx +++ b/src/pages/home/report/FloatingMessageCounter.tsx @@ -66,6 +66,7 @@ function FloatingMessageCounter({isActive = false, onClick = () => {}, hasNewMes success={hasNewMessages} small onPress={onClick} + sentryLabel={CONST.SENTRY_LABEL.REPORT.FLOATING_MESSAGE_COUNTER} > )} diff --git a/src/pages/home/report/PureReportActionItem.tsx b/src/pages/home/report/PureReportActionItem.tsx index 1d7e4510a4a75..ce554d6f5be64 100644 --- a/src/pages/home/report/PureReportActionItem.tsx +++ b/src/pages/home/report/PureReportActionItem.tsx @@ -1533,6 +1533,7 @@ function PureReportActionItem({ small style={[styles.mt2, styles.alignSelfStart]} onPress={() => updateHiddenState(!isHidden)} + sentryLabel={CONST.SENTRY_LABEL.REPORT.MODERATION_BUTTON} > selectOption(() => startMoneyRequest(CONST.IOU.TYPE.SPLIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID)), true), }, ], @@ -217,12 +218,14 @@ function AttachmentPickerWithMenuItems({ icon: getIconForAction(CONST.IOU.TYPE.CREATE), text: translate('iou.createExpense'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_CREATE_EXPENSE, onSelected: () => selectOption(() => startMoneyRequest(CONST.IOU.TYPE.SUBMIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID)), true), }, { icon: icons.Location, text: translate('quickAction.recordDistance'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_TRACK_DISTANCE, onSelected: () => selectOption(() => startDistanceRequest(CONST.IOU.TYPE.SUBMIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID), lastDistanceExpenseType), true), }, ], @@ -231,6 +234,7 @@ function AttachmentPickerWithMenuItems({ icon: getIconForAction(CONST.IOU.TYPE.SEND), text: translate('iou.paySomeone', {name: getPayeeName(report)}), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_PAY_SOMEONE, onSelected: () => { if (isDelegateAccessRestricted) { close(() => { @@ -247,12 +251,14 @@ function AttachmentPickerWithMenuItems({ icon: getIconForAction(CONST.IOU.TYPE.CREATE), text: translate('iou.createExpense'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_CREATE_EXPENSE, onSelected: () => selectOption(() => startMoneyRequest(CONST.IOU.TYPE.TRACK, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID)), true), }, { icon: icons.Location, text: translate('iou.trackDistance'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_TRACK_DISTANCE, onSelected: () => selectOption(() => startDistanceRequest(CONST.IOU.TYPE.TRACK, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID), lastDistanceExpenseType), true), }, ], @@ -261,6 +267,7 @@ function AttachmentPickerWithMenuItems({ icon: Expensicons.InvoiceGeneric, text: translate('workspace.invoices.sendInvoice'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_SEND_INVOICE, onSelected: () => selectOption(() => startMoneyRequest(CONST.IOU.TYPE.INVOICE, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID)), false), }, ], @@ -296,6 +303,7 @@ function AttachmentPickerWithMenuItems({ icon: icons.Document, text: translate('report.newReport.createReport'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_CREATE_REPORT, onSelected: () => selectOption(() => handleCreateReport(), true), }, ]; @@ -314,6 +322,7 @@ function AttachmentPickerWithMenuItems({ icon: icons.Task, text: translate('newTaskPage.assignTask'), shouldCallAfterModalHide: shouldUseNarrowLayout, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_ASSIGN_TASK, onSelected: () => clearOutTaskInfoAndNavigate(currentUserPersonalDetails.accountID, undefined, reportID, report), }, ]; @@ -392,6 +401,7 @@ function AttachmentPickerWithMenuItems({ icon: icons.Paperclip, text: translate('reportActionCompose.addAttachment'), disabled: shouldDisableAttachmentItem, + sentryLabel: CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_MENU_ADD_ATTACHMENT, }, ]; return ( @@ -418,6 +428,7 @@ function AttachmentPickerWithMenuItems({ disabled={disabled} role={CONST.ROLE.BUTTON} accessibilityLabel={translate('common.create')} + sentryLabel={CONST.SENTRY_LABEL.REPORT.ATTACHMENT_PICKER_CREATE_BUTTON} > {({pressed}) => ( handleEnterSignerInfoPress(policyID, bankAccountID, !!completed)} + sentryLabel={CONST.SENTRY_LABEL.REPORT.REPORT_ACTION_ITEM_MESSAGE_ENTER_SIGNER_INFO} /> ); @@ -186,6 +189,7 @@ function ReportActionItemMessage({action, displayAsGroup, reportID, style, isHid success text={translate('bankAccount.addBankAccount')} onPress={openWorkspaceInvoicesPage} + sentryLabel={CONST.SENTRY_LABEL.REPORT.REPORT_ACTION_ITEM_MESSAGE_ADD_BANK_ACCOUNT} /> )} diff --git a/src/pages/home/report/ReportActionItemMessageEdit.tsx b/src/pages/home/report/ReportActionItemMessageEdit.tsx index 3d9c635349a96..7f9658a24dddd 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.tsx +++ b/src/pages/home/report/ReportActionItemMessageEdit.tsx @@ -481,6 +481,7 @@ function ReportActionItemMessageEdit({ pressDimmingValue={1} // Keep focus on the composer when cancel button is clicked. onMouseDown={(e) => e.preventDefault()} + sentryLabel={CONST.SENTRY_LABEL.REPORT.REPORT_ACTION_ITEM_MESSAGE_EDIT_CANCEL_BUTTON} > e.preventDefault()} + sentryLabel={CONST.SENTRY_LABEL.REPORT.REPORT_ACTION_ITEM_MESSAGE_EDIT_SAVE_BUTTON} > {personArray?.map((fragment, index) => ( signOutAndRedirectToSignIn()} + sentryLabel={CONST.SENTRY_LABEL.SIDEBAR.SIGN_IN_BUTTON} >