Skip to content

Commit 090a725

Browse files
committed
fix: add old route mapping
1 parent aacb4ec commit 090a725

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/libs/Navigation/linkingConfig/OldRoutes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const oldRoutes: Record<string, string> = {
55
'/r/*/settings/name': '/r/$1/details/settings/name',
66
'/workspaces/*/overview/address': '/workspaces/$1/overview/workspace-address',
77
'/workspaces/*/accounting/*/card-reconciliation/account': '/workspaces/$1/accounting/$2/card-reconciliation/account-reconciliation-settings',
8+
'/workspaces/*/connections/quickbooks-online/advanced/autosync/accounting-method':
9+
'/workspaces/$1/accounting/quickbooks-online/advanced/quickbooks-online-autosync/quickbooks-online-accounting-method',
10+
'/workspaces/*/connections/quickbooks-online/advanced/autosync': '/workspaces/$1/accounting/quickbooks-online/advanced/quickbooks-online-autosync',
811
'/flag/*/*': '/r/$1/flag/$1/$2',
912
'/home-page': '/home',
1013
/* eslint-enable @typescript-eslint/naming-convention */

tests/navigation/getMatchingNewRouteTest.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,16 @@ describe('getBestMatchingPath', () => {
6464
it('preserves fragment when redirecting', () => {
6565
expect(getMatchingNewRoute('/home-page?backTo=r/123')).toBe('/home?backTo=r/123');
6666
});
67+
68+
it('redirects legacy QuickBooks Online connections autosync paths to dynamic routes', () => {
69+
expect(getMatchingNewRoute('/workspaces/p123/connections/quickbooks-online/advanced/autosync')).toBe(
70+
'/workspaces/p123/accounting/quickbooks-online/advanced/quickbooks-online-autosync',
71+
);
72+
expect(getMatchingNewRoute('/workspaces/p123/connections/quickbooks-online/advanced/autosync/accounting-method')).toBe(
73+
'/workspaces/p123/accounting/quickbooks-online/advanced/quickbooks-online-autosync/quickbooks-online-accounting-method',
74+
);
75+
expect(getMatchingNewRoute('/workspaces/p123/connections/quickbooks-online/advanced/autosync?backTo=/x')).toBe(
76+
'/workspaces/p123/accounting/quickbooks-online/advanced/quickbooks-online-autosync?backTo=/x',
77+
);
78+
});
6779
});

0 commit comments

Comments
 (0)