Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions contributingGuides/NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ In Expensify, we use an extended implementation of this function because:

Here are examples how the state is generated based on route:

- `workspaces/1/overview`
- `settings/workspaces/1/overview`

```json
{
Expand Down Expand Up @@ -536,7 +536,7 @@ Here are examples how the state is generated based on route:
"params": {
"policyID": "1"
},
"path": "workspaces/1/overview",
"path": "/settings/workspaces/1/overview",
"key": "Workspace_Overview-key"
}
]
Expand Down
8 changes: 4 additions & 4 deletions contributingGuides/NAVIGATION_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@

1. Open any workspace settings (Settings → Workspaces → Select any workspace)
2. Click the Settings button on the bottom tab.
3. Verify that the Workspace list is displayed (`/workspaces`)
3. Verify that the Workspace list is displayed (`/settings/workspaces`)
4. Select any workspace again.
5. Reload the page.
6. Click the Settings button on the bottom tab.
7. Verify that the Workspace list is displayed (`/workspaces/`)
7. Verify that the Workspace list is displayed (`/settings/workspaces`)


#### The last visited screen in the settings tab is saved when switching between tabs
Expand All @@ -52,7 +52,7 @@

#### Going up to the workspace list page after refreshing on the workspace settings and pressing the up button

1. Open the workspace settings from the deep link (use a link in format: `/workspaces/:policyID:/profile`)
1. Open the workspace settings from the deep link (use a link in format: `/settings/workspaces/:policyID:/profile`)
2. Click the app’s back button.
3. Verify if the workspace list is displayed.

Expand Down Expand Up @@ -241,4 +241,4 @@ Linked issue: https://github.com/Expensify/App/issues/50177
11. Go back.
12. Verify you are navigated back to the employee size step.
13. Go back.
14. Verify you are navigated back to the Purpose step.
14. Verify you are navigated back to the Purpose step.
6 changes: 3 additions & 3 deletions contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ We need to change the `getRoute()` `policyID` argument type to allow `undefined`

```diff
WORKSPACE_PROFILE_ADDRESS: {
route: 'workspaces/:policyID/profile/address',
- getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`workspaces/${policyID}/profile/address` as const, backTo),
route: 'settings/workspaces/:policyID/profile/address',
- getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/profile/address` as const, backTo),
+ getRoute: (policyID: string | undefined, backTo?: string) => {
+ if (!policyID) {
+ Log.warn("Invalid policyID is used to build the WORKSPACE_PROFILE_ADDRESS route")
+ }
+ return getUrlWithBackToParam(`workspaces/${policyID}/profile/address` as const, backTo);
+ return getUrlWithBackToParam(`settings/workspaces/${policyID}/profile/address` as const, backTo);
+ },
},
```
Expand Down
33 changes: 33 additions & 0 deletions help/ref/settings/workspaces/:policyId/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: product
title: Expensify Chat
---

# Workspace

This is where you configure all the settings of the many features associated with your workspace.

## Default features

Here are the features that are enabled by default:

- **Overview** - Configure how it appears to others.
- **Members** - Add/remove members and admins.
- **Workflows** - Configure submission, approval, and reimbursement.
- **Categories** - Group expenses into a chart of accounts.
- **Expensify Card** - Issue native Expensify Cards to employees.
- **Accounting** - Sync with external accounting systems.

## Optional features

These can be enabled via More Features:

- **Distance rates** - Configure mileage reimbursement.
- **Company card** - Connect and manage third-party corporate card feeds.
- **Per diem** - Configure daily rates.
- **Rules** - Customize expense violations and set policy.
- **Invoices** - Collect revenue from customers.
- **Tags** - Group expenses by project or client.
- **Taxes** - Track VAT and other taxes.
- **Report fields** - Capture extra expense report information.

File renamed without changes.
1,040 changes: 525 additions & 515 deletions src/ROUTES.ts

Large diffs are not rendered by default.

1,083 changes: 438 additions & 645 deletions src/components/SidePanel/HelpContent/helpContentMap.tsx

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
import ONYXKEYS from '@src/ONYXKEYS';
import SCREENS from '@src/SCREENS';
import type {Report} from '@src/types/onyx';
import getMatchingNewRoute from './getMatchingNewRoute';
import getParamsFromRoute from './getParamsFromRoute';
import {isFullScreenName} from './isNavigatorName';
import replacePathInNestedState from './replacePathInNestedState';

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 20 in src/libs/Navigation/helpers/getAdaptedStateFromPath.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -227,8 +226,6 @@
const getAdaptedStateFromPath: GetAdaptedStateFromPath = (path, options, shouldReplacePathInNestedState = true) => {
let normalizedPath = !path.startsWith('/') ? `/${path}` : path;

normalizedPath = getMatchingNewRoute(normalizedPath) ?? normalizedPath;

// Bing search results still link to /signin when searching for “Expensify”, but the /signin route no longer exists in our repo, so we redirect it to the home page to avoid showing a Not Found page.
if (normalizedPath === CONST.SIGNIN_ROUTE) {
normalizedPath = '/';
Expand Down
33 changes: 0 additions & 33 deletions src/libs/Navigation/helpers/getMatchingNewRoute.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/libs/Navigation/helpers/getStateFromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import type {NavigationState, PartialState} from '@react-navigation/native';
import {getStateFromPath as RNGetStateFromPath} from '@react-navigation/native';
import {linkingConfig} from '@libs/Navigation/linkingConfig';
import type {Route} from '@src/ROUTES';
import getMatchingNewRoute from './getMatchingNewRoute';

/**
* @param path - The path to parse
* @returns - It's possible that there is no navigation action for the given path
*/
function getStateFromPath(path: Route): PartialState<NavigationState> {
const normalizedPath = !path.startsWith('/') ? `/${path}` : path;
const normalizedPathAfterRedirection = getMatchingNewRoute(normalizedPath) ?? normalizedPath;

// This function is used in the linkTo function where we want to use default getStateFromPath function.
const state = RNGetStateFromPath(normalizedPathAfterRedirection, linkingConfig.config);
const state = RNGetStateFromPath(normalizedPath, linkingConfig.config);

if (!state) {
throw new Error('Failed to parse the path to a navigation state.');
Expand Down
4 changes: 1 addition & 3 deletions src/libs/Navigation/helpers/linkTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import getStateFromPath from '@libs/Navigation/helpers/getStateFromPath';
import normalizePath from '@libs/Navigation/helpers/normalizePath';
import {linkingConfig} from '@libs/Navigation/linkingConfig';
import {shallowCompare} from '@libs/ObjectUtils';
import getMatchingNewRoute from '@navigation/helpers/getMatchingNewRoute';
import type {NavigationPartialRoute, ReportsSplitNavigatorParamList, RootNavigatorParamList, StackNavigationAction} from '@navigation/types';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
Expand Down Expand Up @@ -57,12 +56,11 @@ export default function linkTo(navigation: NavigationContainerRef<RootNavigatorP
const {forceReplace} = {...defaultLinkToOptions, ...options} as Required<LinkToOptions>;

const normalizedPath = normalizePath(path) as Route;
const normalizedPathAfterRedirection = (getMatchingNewRoute(normalizedPath) ?? normalizedPath) as Route;

// This is the state generated with the default getStateFromPath function.
// It won't include the whole state that will be generated for this path but the focused route will be correct.
// It is necessary because getActionFromState will generate RESET action for whole state generated with our custom getStateFromPath function.
const stateFromPath = getStateFromPath(normalizedPathAfterRedirection) as PartialState<NavigationState<RootNavigatorParamList>>;
const stateFromPath = getStateFromPath(normalizedPath) as PartialState<NavigationState<RootNavigatorParamList>>;
const currentState = navigation.getRootState() as NavigationState<RootNavigatorParamList>;

const focusedRouteFromPath = findFocusedRoute(stateFromPath);
Expand Down
8 changes: 0 additions & 8 deletions src/libs/Navigation/linkingConfig/OldRoutes.ts

This file was deleted.

25 changes: 0 additions & 25 deletions tests/navigation/getMatchingNewRouteTest.ts

This file was deleted.

Loading