Skip to content

Commit 25bb7c3

Browse files
committed
Add sentryLabel to Settings pages for INP tracking
1 parent 3ee7240 commit 25bb7c3

13 files changed

Lines changed: 132 additions & 4 deletions

File tree

src/CONST/index.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8780,6 +8780,74 @@ const CONST = {
87808780
SEND: 'SignIn-Send',
87818781
CONFIRM: 'SignIn-Confirm',
87828782
},
8783+
SETTINGS_GENERAL: {
8784+
HELP: 'SettingsGeneral-Help',
8785+
WHATS_NEW: 'SettingsGeneral-WhatsNew',
8786+
ABOUT: 'SettingsGeneral-About',
8787+
TROUBLESHOOT: 'SettingsGeneral-Troubleshoot',
8788+
SAVE_THE_WORLD: 'SettingsGeneral-SaveTheWorld',
8789+
SIGN_OUT: 'SettingsGeneral-SignOut',
8790+
GO_TO_CLASSIC: 'SettingsGeneral-GoToExpensifyClassic',
8791+
},
8792+
SETTINGS_PROFILE: {
8793+
AVATAR: 'SettingsProfile-Avatar',
8794+
DISPLAY_NAME: 'SettingsProfile-DisplayName',
8795+
CONTACT_METHODS: 'SettingsProfile-ContactMethods',
8796+
STATUS: 'SettingsProfile-Status',
8797+
PRONOUNS: 'SettingsProfile-Pronouns',
8798+
TIMEZONE: 'SettingsProfile-Timezone',
8799+
SHARE_CODE: 'SettingsProfile-ShareCode',
8800+
LEGAL_NAME: 'SettingsProfile-LegalName',
8801+
DATE_OF_BIRTH: 'SettingsProfile-DateOfBirth',
8802+
PHONE_NUMBER: 'SettingsProfile-PhoneNumber',
8803+
ADDRESS: 'SettingsProfile-Address',
8804+
},
8805+
SETTINGS_PREFERENCES: {
8806+
PRIORITY_MODE: 'SettingsPreferences-PriorityMode',
8807+
LANGUAGE: 'SettingsPreferences-Language',
8808+
PAYMENT_CURRENCY: 'SettingsPreferences-PaymentCurrency',
8809+
THEME: 'SettingsPreferences-Theme',
8810+
},
8811+
SETTINGS_SECURITY: {
8812+
TWO_FACTOR_AUTH: 'SettingsSecurity-TwoFactorAuth',
8813+
REVOKE_MFA: 'SettingsSecurity-RevokeMFA',
8814+
MERGE_ACCOUNTS: 'SettingsSecurity-MergeAccounts',
8815+
LOCK_UNLOCK_ACCOUNT: 'SettingsSecurity-LockUnlockAccount',
8816+
CLOSE_ACCOUNT: 'SettingsSecurity-CloseAccount',
8817+
ADD_COPILOT: 'SettingsSecurity-AddCopilot',
8818+
DELEGATE_ITEM: 'SettingsSecurity-DelegateItem',
8819+
DELEGATE_CHANGE_ACCESS: 'SettingsSecurity-DelegateChangeAccess',
8820+
DELEGATE_REMOVE: 'SettingsSecurity-DelegateRemove',
8821+
},
8822+
SETTINGS_WALLET: {
8823+
IMPORT_TRANSACTIONS: 'SettingsWallet-ImportTransactions',
8824+
TRANSFER_BALANCE: 'SettingsWallet-TransferBalance',
8825+
ENABLE_WALLET: 'SettingsWallet-EnableWallet',
8826+
},
8827+
SETTINGS_SUBSCRIPTION: {
8828+
EXPLORE_PLANS: 'SettingsSubscription-ExplorePlans',
8829+
SAVE_WITH_EXPENSIFY: 'SettingsSubscription-SaveWithExpensify',
8830+
RETRY_PAYMENT: 'SettingsSubscription-RetryPayment',
8831+
AUTHENTICATE_PAYMENT: 'SettingsSubscription-AuthenticatePayment',
8832+
VIEW_PAYMENT_HISTORY: 'SettingsSubscription-ViewPaymentHistory',
8833+
REQUEST_REFUND: 'SettingsSubscription-RequestRefund',
8834+
REQUEST_EARLY_CANCELLATION: 'SettingsSubscription-RequestEarlyCancellation',
8835+
},
8836+
SETTINGS_ABOUT: {
8837+
APP_DOWNLOAD_LINKS: 'SettingsAbout-AppDownloadLinks',
8838+
VIEW_KEYBOARD_SHORTCUTS: 'SettingsAbout-ViewKeyboardShortcuts',
8839+
VIEW_THE_CODE: 'SettingsAbout-ViewTheCode',
8840+
VIEW_OPEN_JOBS: 'SettingsAbout-ViewOpenJobs',
8841+
REPORT_A_BUG: 'SettingsAbout-ReportABug',
8842+
},
8843+
SETTINGS_TROUBLESHOOT: {
8844+
CLEAR_CACHE: 'SettingsTroubleshoot-ClearCache',
8845+
EXPORT_ONYX: 'SettingsTroubleshoot-ExportOnyx',
8846+
GO_TO_CLASSIC: 'SettingsTroubleshoot-GoToExpensifyClassic',
8847+
},
8848+
SETTINGS_EXIT_SURVEY: {
8849+
GO_TO_CLASSIC: 'SettingsExitSurvey-GoToExpensifyClassic',
8850+
},
87838851
},
87848852

87858853
DOMAIN: {

src/pages/settings/AboutPage/AboutPage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import type {TranslationPaths} from '@src/languages/types';
2727
import ONYXKEYS from '@src/ONYXKEYS';
2828
import ROUTES from '@src/ROUTES';
2929
import type IconAsset from '@src/types/utils/IconAsset';
30+
import type WithSentryLabel from '@src/types/utils/SentryLabel';
3031
import pkg from '../../../../package.json';
3132
import useAboutSectionIllustration from './useAboutSectionIllustration';
3233

@@ -41,7 +42,7 @@ function getFlavor(): string {
4142
return '';
4243
}
4344

44-
type MenuItem = {
45+
type MenuItem = WithSentryLabel & {
4546
translationKey: TranslationPaths;
4647
icon: IconAsset;
4748
iconRight?: IconAsset;
@@ -66,17 +67,20 @@ function AboutPage() {
6667
{
6768
translationKey: 'initialSettingsPage.aboutPage.appDownloadLinks',
6869
icon: icons.Link,
70+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.APP_DOWNLOAD_LINKS,
6971
action: waitForNavigate(() => Navigation.navigate(ROUTES.SETTINGS_APP_DOWNLOAD_LINKS)),
7072
},
7173
{
7274
translationKey: 'initialSettingsPage.aboutPage.viewKeyboardShortcuts',
7375
icon: icons.Keyboard,
76+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.VIEW_KEYBOARD_SHORTCUTS,
7477
action: waitForNavigate(() => Navigation.navigate(ROUTES.KEYBOARD_SHORTCUTS.getRoute(Navigation.getActiveRoute()))),
7578
},
7679
{
7780
translationKey: 'initialSettingsPage.aboutPage.viewTheCode',
7881
icon: icons.Eye,
7982
iconRight: icons.NewWindow,
83+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.VIEW_THE_CODE,
8084
action: () => {
8185
openExternalLink(CONST.GITHUB_URL);
8286
return Promise.resolve();
@@ -87,6 +91,7 @@ function AboutPage() {
8791
translationKey: 'initialSettingsPage.aboutPage.viewOpenJobs',
8892
icon: icons.MoneyBag,
8993
iconRight: icons.NewWindow,
94+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.VIEW_OPEN_JOBS,
9095
action: () => {
9196
openExternalLink(CONST.UPWORK_URL);
9297
return Promise.resolve();
@@ -96,11 +101,12 @@ function AboutPage() {
96101
{
97102
translationKey: 'initialSettingsPage.aboutPage.reportABug',
98103
icon: icons.Bug,
104+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.REPORT_A_BUG,
99105
action: waitForNavigate(() => navigateToConciergeChat(conciergeReportID, false)),
100106
},
101107
];
102108

103-
return baseMenuItems.map(({translationKey, icon, iconRight, action, link}: MenuItem) => ({
109+
return baseMenuItems.map(({translationKey, icon, iconRight, action, link, sentryLabel}: MenuItem) => ({
104110
key: translationKey,
105111
title: translate(translationKey),
106112
icon,
@@ -119,6 +125,7 @@ function AboutPage() {
119125
ref: popoverAnchor,
120126
shouldBlockSelection: !!link,
121127
wrapperStyle: [styles.sectionMenuItemTopDescription],
128+
sentryLabel,
122129
}));
123130
}, [icons, styles, translate, waitForNavigate, conciergeReportID]);
124131

src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function ExitSurveyConfirmPage({route, navigation}: ExitSurveyConfirmPageProps)
9595
large
9696
text={translate(shouldShowQuickTips ? 'exitSurvey.takeMeToExpensifyClassic' : 'exitSurvey.goToExpensifyClassic')}
9797
pressOnEnter
98+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_EXIT_SURVEY.GO_TO_CLASSIC}
9899
onPress={() => {
99100
switchToOldDot(exitSurveyResponse);
100101
Navigation.dismissModal();

src/pages/settings/InitialSettingsPage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
301301
classicRedirectMenuItem = {
302302
translationKey: 'exitSurvey.goToExpensifyClassic',
303303
icon: icons.ExpensifyLogoNew,
304+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.GO_TO_CLASSIC,
304305
...(CONFIG.IS_HYBRID_APP
305306
? {
306307
action: () => closeReactNativeApp({shouldSetNVP: true, isTrackingGPS}),
@@ -341,6 +342,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
341342
icon: icons.QuestionMark,
342343
iconRight: icons.NewWindow,
343344
shouldShowRightIcon: true,
345+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.HELP,
344346
link: CONST.NEWHELP_URL,
345347
action: () => {
346348
openExternalLink(CONST.NEWHELP_URL);
@@ -351,6 +353,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
351353
icon: icons.TreasureChest,
352354
iconRight: icons.NewWindow,
353355
shouldShowRightIcon: true,
356+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.WHATS_NEW,
354357
link: CONST.WHATS_NEW_URL,
355358
action: () => {
356359
openExternalLink(CONST.WHATS_NEW_URL);
@@ -360,23 +363,27 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
360363
translationKey: 'initialSettingsPage.about',
361364
icon: icons.Info,
362365
screenName: SCREENS.SETTINGS.ABOUT,
366+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.ABOUT,
363367
action: () => Navigation.navigate(ROUTES.SETTINGS_ABOUT),
364368
},
365369
{
366370
translationKey: 'initialSettingsPage.aboutPage.troubleshoot',
367371
icon: icons.Lightbulb,
368372
screenName: SCREENS.SETTINGS.TROUBLESHOOT,
373+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.TROUBLESHOOT,
369374
action: () => Navigation.navigate(ROUTES.SETTINGS_TROUBLESHOOT),
370375
},
371376
{
372377
translationKey: 'sidebarScreen.saveTheWorld',
373378
icon: icons.Heart,
374379
screenName: SCREENS.SETTINGS.SAVE_THE_WORLD,
380+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.SAVE_THE_WORLD,
375381
action: () => Navigation.navigate(ROUTES.SETTINGS_SAVE_THE_WORLD),
376382
},
377383
{
378384
translationKey: signOutTranslationKey,
379385
icon: icons.Exit,
386+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_GENERAL.SIGN_OUT,
380387
action: () => {
381388
signOut(false);
382389
},

src/pages/settings/Preferences/PreferencesPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function PreferencesPage() {
105105
description={translate('priorityModePage.priorityMode')}
106106
onPress={() => Navigation.navigate(ROUTES.SETTINGS_PRIORITY_MODE)}
107107
wrapperStyle={styles.sectionMenuItemTopDescription}
108+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PREFERENCES.PRIORITY_MODE}
108109
/>
109110
<MenuItemWithTopDescription
110111
shouldShowRightIcon
@@ -113,20 +114,23 @@ function PreferencesPage() {
113114
onPress={() => Navigation.navigate(ROUTES.SETTINGS_LANGUAGE)}
114115
wrapperStyle={styles.sectionMenuItemTopDescription}
115116
hintText={!preferredLocale || !isFullySupportedLocale(preferredLocale) ? translate('languagePage.aiGenerated') : ''}
117+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PREFERENCES.LANGUAGE}
116118
/>
117119
<MenuItemWithTopDescription
118120
shouldShowRightIcon
119121
title={`${paymentCurrency} - ${getCurrencySymbol(paymentCurrency)}`}
120122
description={translate('billingCurrency.paymentCurrency')}
121123
onPress={() => Navigation.navigate(ROUTES.SETTINGS_PAYMENT_CURRENCY)}
122124
wrapperStyle={styles.sectionMenuItemTopDescription}
125+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PREFERENCES.PAYMENT_CURRENCY}
123126
/>
124127
<MenuItemWithTopDescription
125128
shouldShowRightIcon
126129
title={translate(`themePage.themes.${preferredTheme ?? CONST.THEME.DEFAULT}.label`)}
127130
description={translate('themePage.theme')}
128131
onPress={() => Navigation.navigate(ROUTES.SETTINGS_THEME)}
129132
wrapperStyle={styles.sectionMenuItemTopDescription}
133+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PREFERENCES.THEME}
130134
/>
131135
</View>
132136
</Section>

src/pages/settings/Profile/ProfilePage.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function ProfilePage() {
7575
description: translate('displayNamePage.headerTitle'),
7676
title: formatPhoneNumber(getDisplayNameOrDefault(currentUserPersonalDetails)),
7777
pageRoute: ROUTES.SETTINGS_DISPLAY_NAME,
78+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.DISPLAY_NAME,
7879
},
7980
{
8081
description: translate('contacts.contactMethods'),
@@ -85,29 +86,34 @@ function ProfilePage() {
8586
pageRoute: ROUTES.SETTINGS_CONTACT_METHODS.route,
8687
brickRoadIndicator: contactMethodBrickRoadIndicator,
8788
testID: 'contact-method-menu-item',
89+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.CONTACT_METHODS,
8890
},
8991
{
9092
description: translate('statusPage.status'),
9193
title: emojiCode ? `${emojiCode} ${currentUserPersonalDetails?.status?.text ?? ''}` : '',
9294
pageRoute: ROUTES.SETTINGS_STATUS,
9395
brickRoadIndicator: isEmptyObject(vacationDelegate?.errors) ? undefined : CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR,
96+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.STATUS,
9497
},
9598
{
9699
description: translate('pronounsPage.pronouns'),
97100
title: getPronouns(),
98101
pageRoute: ROUTES.SETTINGS_PRONOUNS,
102+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.PRONOUNS,
99103
},
100104
{
101105
description: translate('timezonePage.timezone'),
102106
title: currentUserPersonalDetails?.timezone?.selected ?? '',
103107
pageRoute: ROUTES.SETTINGS_TIMEZONE,
108+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.TIMEZONE,
104109
},
105110
];
106111

107112
const privateOptions = [
108113
{
109114
description: translate('privatePersonalDetails.legalName'),
110115
title: legalName,
116+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.LEGAL_NAME,
111117
action: () => {
112118
if (isActingAsDelegate) {
113119
showDelegateNoAccessModal();
@@ -119,6 +125,7 @@ function ProfilePage() {
119125
{
120126
description: translate('common.dob'),
121127
title: privateDetails.dob ?? '',
128+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.DATE_OF_BIRTH,
122129
action: () => {
123130
if (isActingAsDelegate) {
124131
showDelegateNoAccessModal();
@@ -130,6 +137,7 @@ function ProfilePage() {
130137
{
131138
description: translate('common.phoneNumber'),
132139
title: privateDetails.phoneNumber ?? '',
140+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.PHONE_NUMBER,
133141
action: () => {
134142
if (isActingAsDelegate) {
135143
showDelegateNoAccessModal();
@@ -142,6 +150,7 @@ function ProfilePage() {
142150
{
143151
description: translate('privatePersonalDetails.address'),
144152
title: getFormattedAddress(privateDetails),
153+
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_PROFILE.ADDRESS,
145154
action: () => {
146155
if (isActingAsDelegate) {
147156
showDelegateNoAccessModal();
@@ -202,6 +211,7 @@ function ProfilePage() {
202211
pendingAction={currentUserPersonalDetails?.pendingFields?.avatar ?? undefined}
203212
fallbackIcon={currentUserPersonalDetails?.fallbackIcon}
204213
editIconStyle={styles.profilePageAvatar}
214+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PROFILE.AVATAR}
205215
/>
206216
</MenuItemGroup>
207217
)}
@@ -217,6 +227,7 @@ function ProfilePage() {
217227
onPress={() => Navigation.navigate(detail.pageRoute)}
218228
brickRoadIndicator={detail.brickRoadIndicator}
219229
pressableTestID={detail?.testID}
230+
sentryLabel={detail.sentryLabel}
220231
/>
221232
))}
222233
<Button
@@ -225,6 +236,7 @@ function ProfilePage() {
225236
onPress={() => Navigation.navigate(ROUTES.SETTINGS_SHARE_CODE)}
226237
icon={icons.QrCode}
227238
style={[styles.alignSelfStart, styles.mt6]}
239+
sentryLabel={CONST.SENTRY_LABEL.SETTINGS_PROFILE.SHARE_CODE}
228240
/>
229241
</Section>
230242
<Section
@@ -251,6 +263,7 @@ function ProfilePage() {
251263
wrapperStyle={styles.sectionMenuItemTopDescription}
252264
onPress={detail.action}
253265
brickRoadIndicator={detail.brickRoadIndicator}
266+
sentryLabel={detail.sentryLabel}
254267
/>
255268
))}
256269
</MenuItemGroup>

0 commit comments

Comments
 (0)