Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Background report changes to Tags page after clicking Custom tag name in RHP #50416

Merged
merged 23 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c45fe04
Add new routes for tags RHP
twilight2294 Oct 8, 2024
a379e49
Background report changes to Tags page after clicking Tag pages
twilight2294 Oct 8, 2024
86cd87b
Merge branch 'main' into fixRHPIssues
twilight2294 Oct 8, 2024
a51d9b4
Fix rightModal navigator
twilight2294 Oct 8, 2024
4f38b4e
Fix navigation issues on all tag screens
twilight2294 Oct 10, 2024
671179a
add backTo as dependency
twilight2294 Oct 10, 2024
8694a58
Fix routes for RHP on categories
twilight2294 Oct 11, 2024
19d8f83
Merge branch 'fixRHPIssues' of https://github.com/twilight294/App int…
twilight2294 Oct 11, 2024
92f5990
add dependency and use
twilight2294 Oct 11, 2024
6fa8216
Merge branch 'Expensify:main' into fixRHPIssues
twilight2294 Oct 11, 2024
5d8e2df
fix navigation issues on tag create and settings
twilight2294 Oct 12, 2024
80fc8ce
Merge branch 'fixRHPIssues' of https://github.com/twilight294/App int…
twilight2294 Oct 12, 2024
c3e7ca9
correct backTo for workspace upgrade
twilight2294 Oct 12, 2024
a531f90
pass backTo route to create tag
twilight2294 Oct 12, 2024
0478e9c
add route to category settings and add fallback to delete tag
twilight2294 Oct 12, 2024
7f62051
remove unused import
twilight2294 Oct 12, 2024
2552497
fix route mismatch in tags import
twilight2294 Oct 12, 2024
edcd249
remove unnecessary `tagName` param
twilight2294 Oct 14, 2024
887c85c
add isQuickSettingsFlow const for clarity in ternary operator
twilight2294 Oct 14, 2024
7e497a6
Merge branch 'fixRHPIssues' of https://github.com/twilight294/App int…
twilight2294 Oct 14, 2024
39130e3
add backTo as dependency
twilight2294 Oct 14, 2024
82f5ba0
fix wrong dependency import
twilight2294 Oct 14, 2024
1dd6f99
get ride of lodash
twilight2294 Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 68 additions & 6 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,54 @@ const ROUTES = {
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backTo = '', reportActionID?: string) =>
getUrlWithBackToParam(`${action as string}/${iouType as string}/category/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo),
},
SETTINGS_TAGS_ROOT: {
route: 'settings/:policyID/tags',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags`, backTo),
},
SETTINGS_TAGS_SETTINGS: {
route: 'settings/:policyID/tags/settings',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags/settings` as const, backTo),
},
SETTINGS_TAGS_EDIT: {
route: 'settings/:policyID/tags/:orderWeight/edit',
getRoute: (policyID: string, orderWeight: number, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags/${orderWeight}/edit` as const, backTo),
},
SETTINGS_TAG_CREATE: {
route: 'settings/:policyID/tags/new',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags/new` as const, backTo),
},
SETTINGS_TAG_EDIT: {
route: 'settings/:policyID/tag/:orderWeight/:tagName/edit',
getRoute: (policyID: string, orderWeight: number, tagName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}/edit` as const, backTo),
},
SETTINGS_TAG_SETTINGS: {
route: 'settings/:policyID/tag/:orderWeight/:tagName',
getRoute: (policyID: string, orderWeight: number, tagName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}` as const, backTo),
},
SETTINGS_TAG_APPROVER: {
route: 'settings/:policyID/tag/:orderWeight/:tagName/approver',
getRoute: (policyID: string, orderWeight: number, tagName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}/approver` as const, backTo),
},
SETTINGS_TAG_LIST_VIEW: {
route: 'settings/:policyID/tag-list/:orderWeight',
getRoute: (policyID: string, orderWeight: number, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tag-list/${orderWeight}` as const, backTo),
},
SETTINGS_TAG_GL_CODE: {
route: 'settings/:policyID/tag/:orderWeight/:tagName/gl-code',
getRoute: (policyID: string, orderWeight: number, tagName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}/gl-code` as const, backTo),
},
SETTINGS_TAGS_IMPORT: {
route: 'settings/:policyID/tags/import',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags/import` as const, backTo),
},
SETTINGS_TAGS_IMPORTED: {
route: 'settings/:policyID/tags/imported',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags/imported` as const, backTo),
},
SETTINGS_CATEGORIES_ROOT: {
route: 'settings/:policyID/categories',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/categories`, backTo),
Expand All @@ -467,7 +515,25 @@ const ROUTES = {
},
SETTINGS_CATEGORY_EDIT: {
route: 'settings/:policyID/category/:categoryName/edit',
getRoute: (policyID: string, categoryName: string, backTo = '') => getUrlWithBackToParam(`settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/edit`, backTo),
getRoute: (policyID: string, categoryName: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/category/${encodeURIComponent(categoryName)}/edit`, backTo),
},
SETTINGS_CATEGORIES_IMPORT: {
route: 'settings/:policyID/categories/import',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/categories/import` as const, backTo),
},
SETTINGS_CATEGORIES_IMPORTED: {
route: 'settings/:policyID/categories/imported',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/categories/imported` as const, backTo),
},
SETTINGS_CATEGORY_PAYROLL_CODE: {
route: 'settings/:policyID/category/:categoryName/payroll-code',
getRoute: (policyID: string, categoryName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/category/${encodeURIComponent(categoryName)}/payroll-code` as const, backTo),
},
SETTINGS_CATEGORY_GL_CODE: {
route: 'settings/:policyID/category/:categoryName/gl-code',
getRoute: (policyID: string, categoryName: string, backTo = '') =>
getUrlWithBackToParam(`settings/${policyID}/category/${encodeURIComponent(categoryName)}/gl-code` as const, backTo),
},
MONEY_REQUEST_STEP_CURRENCY: {
route: ':action/:iouType/currency/:transactionID/:reportID/:pageIndex?',
Expand Down Expand Up @@ -519,10 +585,6 @@ const ROUTES = {
getRoute: (action: IOUAction, iouType: IOUType, orderWeight: number, transactionID: string, reportID: string, backTo = '', reportActionID?: string) =>
getUrlWithBackToParam(`${action as string}/${iouType as string}/tag/${orderWeight}/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}`, backTo),
},
SETTINGS_TAGS_ROOT: {
route: 'settings/:policyID/tags',
getRoute: (policyID: string, backTo = '') => getUrlWithBackToParam(`settings/${policyID}/tags`, backTo),
},
MONEY_REQUEST_STEP_WAYPOINT: {
route: ':action/:iouType/waypoint/:transactionID/:reportID/:pageIndex',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID?: string, pageIndex = '', backTo = '') =>
Expand Down Expand Up @@ -911,7 +973,7 @@ const ROUTES = {
},
WORKSPACE_TAG_APPROVER: {
route: 'settings/workspaces/:policyID/tag/:orderWeight/:tagName/approver',
getRoute: (policyID: string, orderWeight: number, tagName: string) => `settings/workspaces/${policyID}/tag/${orderWeight}/${tagName}/approver` as const,
getRoute: (policyID: string, orderWeight: number, tagName: string) => `settings/workspaces/${policyID}/tag/${orderWeight}/${encodeURIComponent(tagName)}/approver` as const,
},
WORKSPACE_TAG_LIST_VIEW: {
route: 'settings/workspaces/:policyID/tag-list/:orderWeight',
Expand Down
19 changes: 18 additions & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const SCREENS = {
SEARCH_ADVANCED_FILTERS: 'SearchAdvancedFilters',
SEARCH_SAVED_SEARCH: 'SearchSavedSearch',
SETTINGS_CATEGORIES: 'SettingsCategories',
SETTINGS_TAGS: 'SettingsTags',
EXPENSIFY_CARD: 'ExpensifyCard',
DOMAIN_CARD: 'DomainCard',
RESTRICTED_ACTION: 'RestrictedAction',
Expand Down Expand Up @@ -247,6 +248,10 @@ const SCREENS = {
SETTINGS_CATEGORY_CREATE: 'Settings_Category_Create',
SETTINGS_CATEGORY_EDIT: 'Settings_Category_Edit',
SETTINGS_CATEGORIES_ROOT: 'Settings_Categories',
SETTINGS_CATEGORIES_IMPORT: 'Settings_Categories_Import',
SETTINGS_CATEGORIES_IMPORTED: 'Settings_Categories_Imported',
SETTINGS_CATEGORY_PAYROLL_CODE: 'Settings_Category_Payroll_Code',
SETTINGS_CATEGORY_GL_CODE: 'Settings_Category_GL_Code',
},
EXPENSIFY_CARD: {
EXPENSIFY_CARD_DETAILS: 'Expensify_Card_Details',
Expand All @@ -259,7 +264,19 @@ const SCREENS = {
DOMAIN_CARD_REPORT_FRAUD: 'Domain_Card_Report_Fraud',
},

SETTINGS_TAGS_ROOT: 'Settings_Tags',
SETTINGS_TAGS: {
SETTINGS_TAGS_ROOT: 'Settings_Tags',
SETTINGS_TAGS_SETTINGS: 'Settings_Tags_Settings',
SETTINGS_TAGS_EDIT: 'Settings_Tags_Edit',
SETTINGS_TAG_CREATE: 'Settings_Tag_Create',
SETTINGS_TAG_EDIT: 'Settings_Tag_Edit',
SETTINGS_TAG_SETTINGS: 'Settings_Tag_Settings',
SETTINGS_TAG_APPROVER: 'Settings_Tag_Approver',
SETTINGS_TAG_LIST_VIEW: 'Settings_Tag_List_View',
SETTINGS_TAG_GL_CODE: 'Settings_Tag_GL_Code',
SETTINGS_TAGS_IMPORT: 'Settings_Tags_Import',
SETTINGS_TAGS_IMPORTED: 'Settings_Tags_Imported',
},

REPORT_SETTINGS: {
ROOT: 'Report_Settings_Root',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImportSpreadsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function ImportSpreedsheet({backTo, goTo}: ImportSpreedsheetProps) {
<View style={[styles.flex1, safeAreaPaddingBottomStyle]}>
<HeaderWithBackButton
title={translate('spreadsheet.importSpreadsheet')}
onBackButtonPress={() => Navigation.navigate(backTo)}
onBackButtonPress={() => Navigation.goBack(backTo)}
/>

<View style={[styles.flex1, styles.uploadFileView(isSmallScreenWidth)]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[SCREENS.MONEY_REQUEST.STEP_MERCHANT]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepMerchant').default,
[SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepParticipants').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_ROOT]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/WorkspaceCategoriesPage').default,
[SCREENS.SETTINGS_TAGS_ROOT]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceTagsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_ROOT]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceTagsPage').default,
[SCREENS.MONEY_REQUEST.STEP_SCAN]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepScan').default,
[SCREENS.MONEY_REQUEST.STEP_TAG]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepTag').default,
[SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepWaypoint').default,
Expand Down Expand Up @@ -142,6 +142,23 @@ const CategoriesModalStackNavigator = createModalStackNavigator({
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_CREATE]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/CreateCategoryPage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_EDIT]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/EditCategoryPage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_SETTINGS]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/CategorySettingsPage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORT]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/ImportCategoriesPage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORTED]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/ImportedCategoriesPage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_PAYROLL_CODE]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/CategoryPayrollCodePage').default,
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_GL_CODE]: () => require<ReactComponentModule>('../../../../pages/workspace/categories/CategoryGLCodePage').default,
});

const TagsModalStackNavigator = createModalStackNavigator({
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_SETTINGS]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceTagsSettingsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_EDIT]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceEditTagsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORT]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/ImportTagsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORTED]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/ImportedTagsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_SETTINGS]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/TagSettingsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_LIST_VIEW]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceViewTagsPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_CREATE]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/WorkspaceCreateTagPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_EDIT]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/EditTagPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_APPROVER]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/TagApproverPage').default,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_GL_CODE]: () => require<ReactComponentModule>('../../../../pages/workspace/tags/TagGLCodePage').default,
});

const ExpensifyCardModalStackNavigator = createModalStackNavigator({
Expand Down Expand Up @@ -640,6 +657,7 @@ export {
SettingsModalStackNavigator,
SignInModalStackNavigator,
CategoriesModalStackNavigator,
TagsModalStackNavigator,
ExpensifyCardModalStackNavigator,
DomainCardModalStackNavigator,
SplitDetailsModalStackNavigator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
name={SCREENS.RIGHT_MODAL.SETTINGS_CATEGORIES}
component={ModalStackNavigators.CategoriesModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.SETTINGS_TAGS}
component={ModalStackNavigators.TagsModalStackNavigator}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.EXPENSIFY_CARD}
component={ModalStackNavigators.ExpensifyCardModalStackNavigator}
Expand Down
76 changes: 75 additions & 1 deletion src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,80 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
categoryName: (categoryName: string) => decodeURIComponent(categoryName),
},
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORT]: {
path: ROUTES.SETTINGS_CATEGORIES_IMPORT.route,
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORTED]: {
path: ROUTES.SETTINGS_CATEGORIES_IMPORTED.route,
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_PAYROLL_CODE]: {
path: ROUTES.SETTINGS_CATEGORY_PAYROLL_CODE.route,
parse: {
categoryName: (categoryName: string) => decodeURIComponent(categoryName),
},
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_GL_CODE]: {
path: ROUTES.SETTINGS_CATEGORY_GL_CODE.route,
parse: {
categoryName: (categoryName: string) => decodeURIComponent(categoryName),
},
},
},
},
[SCREENS.RIGHT_MODAL.SETTINGS_TAGS]: {
screens: {
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_SETTINGS]: {
path: ROUTES.SETTINGS_TAGS_SETTINGS.route,
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_EDIT]: {
path: ROUTES.SETTINGS_TAGS_EDIT.route,
parse: {
orderWeight: Number,
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_CREATE]: {
path: ROUTES.SETTINGS_TAG_CREATE.route,
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_EDIT]: {
path: ROUTES.SETTINGS_TAG_EDIT.route,
parse: {
orderWeight: Number,
tagName: (tagName: string) => decodeURIComponent(tagName),
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_SETTINGS]: {
path: ROUTES.SETTINGS_TAG_SETTINGS.route,
parse: {
orderWeight: Number,
tagName: (tagName: string) => decodeURIComponent(tagName),
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_APPROVER]: {
path: ROUTES.SETTINGS_TAG_APPROVER.route,
parse: {
orderWeight: Number,
tagName: (tagName: string) => decodeURIComponent(tagName),
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_LIST_VIEW]: {
path: ROUTES.SETTINGS_TAG_LIST_VIEW.route,
parse: {
orderWeight: Number,
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAG_GL_CODE]: {
path: ROUTES.SETTINGS_TAG_GL_CODE.route,
parse: {
orderWeight: Number,
tagName: (tagName: string) => decodeURIComponent(tagName),
},
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORT]: {
path: ROUTES.SETTINGS_TAGS_IMPORT.route,
},
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORTED]: {
path: ROUTES.SETTINGS_TAGS_IMPORTED.route,
},
},
},
[SCREENS.RIGHT_MODAL.EXPENSIFY_CARD]: {
Expand Down Expand Up @@ -1078,7 +1152,7 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
},
},
[SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_ROOT]: ROUTES.SETTINGS_CATEGORIES_ROOT.route,
[SCREENS.SETTINGS_TAGS_ROOT]: ROUTES.SETTINGS_TAGS_ROOT.route,
[SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_ROOT]: ROUTES.SETTINGS_TAGS_ROOT.route,
[SCREENS.MONEY_REQUEST.STEP_SEND_FROM]: ROUTES.MONEY_REQUEST_STEP_SEND_FROM.route,
[SCREENS.MONEY_REQUEST.STEP_COMPANY_INFO]: ROUTES.MONEY_REQUEST_STEP_COMPANY_INFO.route,
[SCREENS.MONEY_REQUEST.STEP_AMOUNT]: ROUTES.MONEY_REQUEST_STEP_AMOUNT.route,
Expand Down
Loading
Loading