Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/header-when-creat…
Browse files Browse the repository at this point in the history
…ing-group-chat
  • Loading branch information
TMisiukiewicz committed Dec 20, 2024
2 parents 4ae7592 + 207622d commit 1e68871
Show file tree
Hide file tree
Showing 82 changed files with 1,822 additions and 478 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ module.exports = {
},
overrides: [
{
files: ['src/libs/ReportUtils.ts', 'src/libs/actions/IOU.ts', 'src/libs/actions/Report.ts', 'src/libs/actions/Task.ts'],
files: [
'src/libs/ReportUtils.ts',
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/libs/actions/Task.ts',
'src/libs/OptionsListUtils.ts',
'src/libs/ReportActionsUtils.ts',
'src/libs/TransactionUtils/index.ts',
'src/pages/home/ReportScreen.tsx',
'src/pages/workspace/WorkspaceInitialPage.tsx',
],
rules: {
'rulesdir/no-default-id-values': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion Mobile-Expensify
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009007702
versionName "9.0.77-2"
versionCode 1009007704
versionName "9.0.77-4"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
// We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later.
// This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server.
{
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.min.mjs'),
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
type: 'asset/source',
},

Expand Down
34 changes: 17 additions & 17 deletions docs/articles/expensify-classic/connections/Expensify-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,50 @@ To begin, review our [Integration Server Manual](https://integrations.expensify.

We've compiled answers to some frequently asked questions to help you get started.

**Should I give your support team my API credentials when I need help?**
## Should I give your support team my API credentials when I need help?

If you’re seeking help with Expensify's API, do not share your partnerUserSecret. If you do, immediately rotate your credentials on [this page](https://www.expensify.com/tools/integrations/).

**Is there a rate limit?**
## Is there a rate limit?

To keep our platform stable and handle high traffic, Expensify limits how many API requests you can send:
- Up to 5 requests every 10 seconds
- Up to 20 requests every 60 seconds

Sending more requests than allowed may result in an error with status code `429`.

**What is a Policy ID?**
## What is a Policy ID?

This is also known as a Workspace ID. To find your Policy/Workspace ID,
Hover over Settings and click Workspaces.
Click the name of the Workspace.
Copy the ID number from the URL. For example, if the URL is https://www.expensify.com/policy?param={"policyID":"0810E551A5F2A9C2”}, then your workspace ID is 0810E551A5F2A9C2.

**Can I use the parent type `file` to export workspace/policy data?**
## Can I use the parent type `file` to export workspace/policy data?

No. The parent type `file` can only be used to export expense and report data — not policy information. To export policy data (e.g., categories, tags), you must use the `get` type with `inputSettings.type` set to `policy`.

**Can I use the API to create Domain Groups?**
## Can I use the API to create Domain Groups?

No, you cannot create domain groups. You can only assign users to them.

**I’m exporting expense IDs `${expense.transactionID}` but when I open my CSV in Excel, it’s changing all the IDs and making them look the same. How can I prevent this?**
## I’m exporting expense IDs `${expense.transactionID}` but when I open my CSV in Excel, it’s changing all the IDs and making them look the same. How can I prevent this?

Try prepending a non-numeric character like a quote to force Excel to interpret the value as a string and not a number (i.e., `'${expense.transactionID}`).

**How can we export the person who will approve a report while the reports are still processing?**
## How can we export the person who will approve a report while the reports are still processing?

Use the field ${report.managerEmail}.

**Why won’t my boolean field return any data?**
## Why won’t my boolean field return any data?

Boolean fields won't output values without a string. For example, instead of using `${expense.billable}`, use `${expense.billable?string("Yes", "No")}`. This will display "Yes" if the expense is billable and "No" if it is not.

**Can I export the reports for just one user?**
## Can I export the reports for just one user?

Not in a quick convenient way, as you would need to include the user in your template. The simplest approach is to export data for all users and then apply a filter in your preferred spreadsheet program.

**Can I create expenses on behalf of users?**
## Can I create expenses on behalf of users?

Yes. However, to access the Expense Creator API on behalf of employees, Expensify needs to verify the following setup:

Expand All @@ -63,17 +63,17 @@ Verify you have internal authorization to add data to other accounts within your

If you need this access, contact [email protected] and reference this help page.

## Using Postman
# Using Postman

Many customers use Postman to help them build out their APIs. Below are some guides contributed by our customers. Please note, in all cases, you will need to first generate your authentication credentials, the steps for which can be found [here](https://integrations.expensify.com/Integration-Server/doc/#introduction) and have them ready:

### Download expenses from a report as a CSV file
## Download expenses from a report as a CSV file

**Step 1: Get the ID of a report you want to export in Expensify**

Find the ID by opening the expense report and clicking Details at the top right corner of the page. At the top of the menu, the ID is provided as the “Long ID.”

**Step 3: Export (generate) a "Report" as a CSV file**
**Step 2: Export (generate) a "Report" as a CSV file**
{% include info.html %}
For this you'll use the Documentation under [Report Exporter](https://integrations.expensify.com/Integration-Server/doc/#export).
{% include end-info.html %}
Expand Down Expand Up @@ -146,11 +146,11 @@ The template key will have the value like below:

The template variable determines what information is saved in your CSV file. If you want more columns than merchant, amount, and transaction date, follow the syntax as defined in the export template format documentation.

**Step 4: Save your generated file name**
**Step 3: Save your generated file name**

Expensify currently supports only the "onReceive":{"immediateResponse":["returnRandomFileName"]} option in step 3, so you should receive a random filename back from the API like "exportc111111d-a1a1-a1a1-a1a1-d1111111f.csv". You will need to document this filename if you plan on running the download command after this one.
Expensify currently supports only the "onReceive":{"immediateResponse":["returnRandomFileName"]} option in step 2, so you should receive a random filename back from the API like "exportc111111d-a1a1-a1a1-a1a1-d1111111f.csv". You will need to document this filename if you plan on running the download command after this one.

**Step 5: Download your exported report**
**Step 4: Download your exported report**

Set up another API call in almost the same way you did before. You don't need the template key in the Body anymore, so delete that and set the Body type to "none". Then modify your requestJobDescription to read like below, but with your own credentials and file name:

Expand All @@ -170,7 +170,7 @@ Click Go and you should see the CSV in the response body.

*Thank you to our customer Frederico Pettinella who originally wrote and shared this guide.*

### Use Advanced Employee Updater API with Postman
## Use Advanced Employee Updater API with Postman

1. Create a new request.
2. Select POST as the method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ When an expense is submitted to a workspace, your approver will receive an email

{% include end-selector.html %}

![Click Global Create]({{site.url}}/assets/images/ExpensifyHelp-CreateExpense-1.png){:width="100%"}
![Click Submit expense]({{site.url}}/assets/images/ExpensifyHelp-CreateExpense-2.png){:width="100%"}
![Click Scan]({{site.url}}/assets/images/ExpensifyHelp-CreateExpense-3.png){:width="100%"}
![Enter workspace or individual's name]({{site.url}}/assets/images/ExpensifyHelp-CreateExpense-4.png){:width="100%"}

{% include info.html %}
You can also forward receipts to [email protected] using your primary or secondary email address. SmartScan will automatically extract all the details from the receipt and add them to your expenses.
{% include end-info.html %}
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.77.2</string>
<string>9.0.77.4</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.77.2</string>
<string>9.0.77.4</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>9.0.77</string>
<key>CFBundleVersion</key>
<string>9.0.77.2</string>
<string>9.0.77.4</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
3 changes: 2 additions & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {getDefaultConfig: getReactNativeDefaultConfig} = require('@react-native/m
const {mergeConfig} = require('@react-native/metro-config');
const defaultAssetExts = require('metro-config/src/defaults/defaults').assetExts;
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;
const {wrapWithReanimatedMetroConfig} = require('react-native-reanimated/metro-config');
require('dotenv').config();

const defaultConfig = getReactNativeDefaultConfig(__dirname);
Expand All @@ -26,4 +27,4 @@ const config = {
},
};

module.exports = mergeConfig(defaultConfig, expoConfig, config);
module.exports = wrapWithReanimatedMetroConfig(mergeConfig(defaultConfig, expoConfig, config));
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "9.0.77-2",
"version": "9.0.77-4",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -139,7 +139,7 @@
"react-content-loader": "^7.0.0",
"react-dom": "18.3.1",
"react-error-boundary": "^4.0.11",
"react-fast-pdf": "1.0.20",
"react-fast-pdf": "1.0.21",
"react-map-gl": "^7.1.3",
"react-native": "0.75.2",
"react-native-android-location-enabler": "^2.0.1",
Expand Down
12 changes: 5 additions & 7 deletions patches/react-native-draggable-flatlist+4.0.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index d7d98c2..2f59c7a 100644
runOnJS(onDragEnd)({
from: activeIndexAnim.value,
diff --git a/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx b/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
index ea21575..66c5eed 100644
index ea21575..dc6b095 100644
--- a/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
+++ b/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
@@ -1,14 +1,14 @@
Expand All @@ -32,14 +32,13 @@ index ea21575..66c5eed 100644
cellDataRef: React.MutableRefObject<Map<string, CellData>>;
keyToIndexRef: React.MutableRefObject<Map<string, number>>;
containerRef: React.RefObject<Animated.View>;
@@ -54,8 +54,8 @@ function useSetupRefs<T>({
@@ -54,8 +54,7 @@ function useSetupRefs<T>({
...DEFAULT_PROPS.animationConfig,
...animationConfig,
} as WithSpringConfig;
- const animationConfigRef = useRef(animConfig);
- animationConfigRef.current = animConfig;
+ const animationConfigRef = useSharedValue(animConfig);
+ animationConfigRef.value = animConfig;

const cellDataRef = useRef(new Map<string, CellData>());
const keyToIndexRef = useRef(new Map<string, number>());
Expand All @@ -57,7 +56,7 @@ index ce4ab68..efea240 100644

return translate;
diff --git a/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts b/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
index 7c20587..857c7d0 100644
index 7c20587..33042e9 100644
--- a/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
+++ b/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
@@ -1,8 +1,9 @@
Expand All @@ -72,18 +71,17 @@ index 7c20587..857c7d0 100644
} from "react-native-reanimated";
import { DEFAULT_ANIMATION_CONFIG } from "../constants";
import { useAnimatedValues } from "../context/animatedValueContext";
@@ -15,8 +16,8 @@ type Params = {
@@ -15,8 +16,7 @@ type Params = {
export function useOnCellActiveAnimation(
{ animationConfig }: Params = { animationConfig: {} }
) {
- const animationConfigRef = useRef(animationConfig);
- animationConfigRef.current = animationConfig;
+ const animationConfigRef = useSharedValue(animationConfig);
+ animationConfigRef.value = animationConfig;

const isActive = useIsActive();

@@ -26,7 +27,7 @@ export function useOnCellActiveAnimation(
@@ -26,7 +26,7 @@ export function useOnCellActiveAnimation(
const toVal = isActive && isTouchActiveNative.value ? 1 : 0;
return withSpring(toVal, {
...DEFAULT_ANIMATION_CONFIG,
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ const ONYXKEYS = {
RULES_MAX_EXPENSE_AGE_FORM_DRAFT: 'rulesMaxExpenseAgeFormDraft',
DEBUG_DETAILS_FORM: 'debugDetailsForm',
DEBUG_DETAILS_FORM_DRAFT: 'debugDetailsFormDraft',
WORKSPACE_PER_DIEM_FORM: 'workspacePerDiemForm',
WORKSPACE_PER_DIEM_FORM_DRAFT: 'workspacePerDiemFormDraft',
},
} as const;

Expand Down Expand Up @@ -826,6 +828,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.RULES_MAX_EXPENSE_AGE_FORM]: FormTypes.RulesMaxExpenseAgeForm;
[ONYXKEYS.FORMS.SEARCH_SAVED_SEARCH_RENAME_FORM]: FormTypes.SearchSavedSearchRenameForm;
[ONYXKEYS.FORMS.DEBUG_DETAILS_FORM]: FormTypes.DebugReportForm | FormTypes.DebugReportActionForm | FormTypes.DebugTransactionForm | FormTypes.DebugTransactionViolationForm;
[ONYXKEYS.FORMS.WORKSPACE_PER_DIEM_FORM]: FormTypes.WorkspacePerDiemForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down
20 changes: 20 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,26 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/per-diem/settings',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/per-diem/settings` as const,
},
WORKSPACE_PER_DIEM_DETAILS: {
route: 'settings/workspaces/:policyID/per-diem/details/:rateID/:subRateID',
getRoute: (policyID: string, rateID: string, subRateID: string) => `settings/workspaces/${policyID}/per-diem/details/${rateID}/${subRateID}` as const,
},
WORKSPACE_PER_DIEM_EDIT_DESTINATION: {
route: 'settings/workspaces/:policyID/per-diem/edit/destination/:rateID/:subRateID',
getRoute: (policyID: string, rateID: string, subRateID: string) => `settings/workspaces/${policyID}/per-diem/edit/destination/${rateID}/${subRateID}` as const,
},
WORKSPACE_PER_DIEM_EDIT_SUBRATE: {
route: 'settings/workspaces/:policyID/per-diem/edit/subrate/:rateID/:subRateID',
getRoute: (policyID: string, rateID: string, subRateID: string) => `settings/workspaces/${policyID}/per-diem/edit/subrate/${rateID}/${subRateID}` as const,
},
WORKSPACE_PER_DIEM_EDIT_AMOUNT: {
route: 'settings/workspaces/:policyID/per-diem/edit/amount/:rateID/:subRateID',
getRoute: (policyID: string, rateID: string, subRateID: string) => `settings/workspaces/${policyID}/per-diem/edit/amount/${rateID}/${subRateID}` as const,
},
WORKSPACE_PER_DIEM_EDIT_CURRENCY: {
route: 'settings/workspaces/:policyID/per-diem/edit/currency/:rateID/:subRateID',
getRoute: (policyID: string, rateID: string, subRateID: string) => `settings/workspaces/${policyID}/per-diem/edit/currency/${rateID}/${subRateID}` as const,
},
RULES_CUSTOM_NAME: {
route: 'settings/workspaces/:policyID/rules/name',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/rules/name` as const,
Expand Down
5 changes: 5 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ const SCREENS = {
PER_DIEM_IMPORT: 'Per_Diem_Import',
PER_DIEM_IMPORTED: 'Per_Diem_Imported',
PER_DIEM_SETTINGS: 'Per_Diem_Settings',
PER_DIEM_DETAILS: 'Per_Diem_Details',
PER_DIEM_EDIT_DESTINATION: 'Per_Diem_Edit_Destination',
PER_DIEM_EDIT_SUBRATE: 'Per_Diem_Edit_Subrate',
PER_DIEM_EDIT_AMOUNT: 'Per_Diem_Edit_Amount',
PER_DIEM_EDIT_CURRENCY: 'Per_Diem_Edit_Currency',
},

EDIT_REQUEST: {
Expand Down
Loading

0 comments on commit 1e68871

Please sign in to comment.