Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin'
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-liang committed May 27, 2024
2 parents 50ecf11 + 525ad6f commit 6034aee
Show file tree
Hide file tree
Showing 145 changed files with 1,534 additions and 938 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ module.exports = {
__DEV__: 'readonly',
},
rules: {
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
Expand Down
11 changes: 8 additions & 3 deletions .github/actions/javascript/bumpVersion/bumpVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as core from '@actions/core';
import {exec as originalExec} from 'child_process';
import fs from 'fs';
import type {PackageJson} from 'type-fest';
import {promisify} from 'util';
import {generateAndroidVersionCode, updateAndroidVersion, updateiOSVersion} from '@github/libs/nativeVersionUpdater';
import * as versionUpdater from '@github/libs/versionUpdater';
Expand All @@ -19,7 +20,7 @@ function updateNativeVersions(version: string) {
.then(() => {
console.log('Successfully updated Android!');
})
.catch((err) => {
.catch((err: string | Error) => {
console.error('Error updating Android');
core.setFailed(err);
});
Expand Down Expand Up @@ -47,8 +48,12 @@ if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
}

const {version: previousVersion} = JSON.parse(fs.readFileSync('./package.json').toString());
const newVersion = versionUpdater.incrementVersion(previousVersion, semanticVersionLevel);
const {version: previousVersion}: PackageJson = JSON.parse(fs.readFileSync('./package.json').toString());
if (!previousVersion) {
core.setFailed('Error: Could not read package.json');
}

const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel);
console.log(`Previous version: ${previousVersion}`, `New version: ${newVersion}`);

updateNativeVersions(newVersion);
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/javascript/bumpVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,10 @@ if (!semanticVersionLevel || !Object.keys(versionUpdater.SEMANTIC_VERSION_LEVELS
console.log(`Invalid input for 'SEMVER_LEVEL': ${semanticVersionLevel}`, `Defaulting to: ${semanticVersionLevel}`);
}
const { version: previousVersion } = JSON.parse(fs_1.default.readFileSync('./package.json').toString());
const newVersion = versionUpdater.incrementVersion(previousVersion, semanticVersionLevel);
if (!previousVersion) {
core.setFailed('Error: Could not read package.json');
}
const newVersion = versionUpdater.incrementVersion(previousVersion ?? '', semanticVersionLevel);
console.log(`Previous version: ${previousVersion}`, `New version: ${newVersion}`);
updateNativeVersions(newVersion);
console.log(`Setting npm version to ${newVersion}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const run = function (): Promise<void> {
core.setOutput('HAS_DEPLOY_BLOCKERS', false);
}
})
.catch((error) => {
.catch((error: string | Error) => {
console.error('A problem occurred while trying to communicate with the GitHub API', error);
core.setFailed(error);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const run = () => {

// Extract timestamp, Graphite accepts timestamp in seconds
if (current.metadata?.creationDate) {
timestamp = Math.floor(new Date(current.metadata.creationDate).getTime() / 1000);
timestamp = Math.floor(new Date(current.metadata.creationDate as string).getTime() / 1000);
}

if (current.name && current.meanDuration && current.meanCount && timestamp) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import * as core from '@actions/core';
import {readFileSync} from 'fs';
import type {PackageJson} from 'type-fest';
import * as versionUpdater from '@github/libs/versionUpdater';

const semverLevel = core.getInput('SEMVER_LEVEL', {required: true});
if (!semverLevel || !Object.values<string>(versionUpdater.SEMANTIC_VERSION_LEVELS).includes(semverLevel)) {
core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`);
}

const {version: currentVersion} = JSON.parse(readFileSync('./package.json', 'utf8'));
const previousVersion = versionUpdater.getPreviousVersion(currentVersion, semverLevel);
const {version: currentVersion}: PackageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
if (!currentVersion) {
core.setFailed('Error: Could not read package.json');
}

const previousVersion = versionUpdater.getPreviousVersion(currentVersion ?? '', semverLevel);
core.setOutput('PREVIOUS_VERSION', previousVersion);
5 changes: 4 additions & 1 deletion .github/actions/javascript/getPreviousVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,10 @@ if (!semverLevel || !Object.values(versionUpdater.SEMANTIC_VERSION_LEVELS).inclu
core.setFailed(`'Error: Invalid input for 'SEMVER_LEVEL': ${semverLevel}`);
}
const { version: currentVersion } = JSON.parse((0, fs_1.readFileSync)('./package.json', 'utf8'));
const previousVersion = versionUpdater.getPreviousVersion(currentVersion, semverLevel);
if (!currentVersion) {
core.setFailed('Error: Could not read package.json');
}
const previousVersion = versionUpdater.getPreviousVersion(currentVersion ?? '', semverLevel);
core.setOutput('PREVIOUS_VERSION', previousVersion);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function checkIssueForCompletedChecklist(numberOfChecklistItems: number) {

getNumberOfItemsFromReviewerChecklist()
.then(checkIssueForCompletedChecklist)
.catch((err) => {
.catch((err: string | Error) => {
console.error(err);
core.setFailed(err);
});
2 changes: 1 addition & 1 deletion .github/scripts/detectRedirectCycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function detectCycle(): boolean {

fs.createReadStream(`${process.cwd()}/docs/redirects.csv`)
.pipe(parser)
.on('data', (row) => {
.on('data', (row: [string, string]) => {
// Create a directed graph of sourceURL -> targetURL
addEdge(row[0], row[1]);
})
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001047404
versionName "1.4.74-4"
versionCode 1001047501
versionName "1.4.75-1"
// 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
9 changes: 5 additions & 4 deletions contributingGuides/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,19 @@ Additionally, if you want to discuss an idea with the open source community with

#### Propose a solution for the job
4. You can propose solutions on any issue at any time, but if you propose solutions to jobs before the `Help Wanted` label is applied, you do so at your own risk. Proposals will not be reviewed until the label is added and there is always a chance that we might not add the label or hire an external contributor for the job.
5. After you reproduce the issue, complete the [proposal template here](./PROPOSAL_TEMPLATE.md) and post it as a comment in the corresponding GitHub issue (linked in the Upwork job).
5. Contributors should **not** submit proposals on issues when they have assigned issues or PRs that are awaiting an action from them. If so, they will be in violation of Rule #1 (Get Shit Done) in our [Code of Conduct](https://github.com/Expensify/App/blob/main/CODE_OF_CONDUCT.md) and will receive a warning. Multiple warnings can lead to removal from the program.
6. After you reproduce the issue, complete the [proposal template here](./PROPOSAL_TEMPLATE.md) and post it as a comment in the corresponding GitHub issue (linked in the Upwork job).
- Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The *difference* should be important, meaningful or considerable.
6. Refrain from leaving additional comments until someone from the Contributor-Plus team and / or someone from Expensify provides feedback on your proposal (do not create a pull request yet).
7. Refrain from leaving additional comments until someone from the Contributor-Plus team and / or someone from Expensify provides feedback on your proposal (do not create a pull request yet).
- Do not leave more than one proposal.
- Do not make extensive changes to your current proposal until after it has been reviewed.
- If you want to make an entirely new proposal or update an existing proposal, please go back and edit your original proposal, then post a new comment to the issue in this format to alert everyone that it has been updated:
```
## Proposal
[Updated](link to proposal)
```
7. If your proposal is accepted by the Expensify engineer assigned to the issue, Expensify will hire you on Upwork and assign the GitHub issue to you.
8. Once hired, post a comment in the Github issue stating when you expect to have your PR ready for review.
8. If your proposal is accepted by the Expensify engineer assigned to the issue, Expensify will hire you on Upwork and assign the GitHub issue to you.
9. Once hired, post a comment in the Github issue stating when you expect to have your PR ready for review.

#### Begin coding your solution in a pull request
9. When you are ready to start, fork the repository and create a new branch.
Expand Down
2 changes: 1 addition & 1 deletion desktop/contextBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contextBridge.exposeInMainWorld('electron', {
}

// Deliberately strip event as it includes `sender`
ipcRenderer.on(channel, (event, ...args) => func(...args));
ipcRenderer.on(channel, (event, ...args: unknown[]) => func(...args));
},

/** Remove listeners for a single channel from the main process and sent to the renderer process. */
Expand Down
4 changes: 2 additions & 2 deletions desktop/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ const mainWindow = (): Promise<void> => {
app.hide();
}

ipcMain.on(ELECTRON_EVENTS.LOCALE_UPDATED, (event, updatedLocale) => {
ipcMain.on(ELECTRON_EVENTS.LOCALE_UPDATED, (event, updatedLocale: Locale) => {
Menu.setApplicationMenu(Menu.buildFromTemplate(localizeMenuItems(initialMenuTemplate, updatedLocale)));
disposeContextMenu();
disposeContextMenu = createContextMenu(updatedLocale);
Expand All @@ -601,7 +601,7 @@ const mainWindow = (): Promise<void> => {

// Listen to badge updater event emitted by the render process
// and update the app badge count (MacOS only)
ipcMain.on(ELECTRON_EVENTS.REQUEST_UPDATE_BADGE_COUNT, (event, totalCount) => {
ipcMain.on(ELECTRON_EVENTS.REQUEST_UPDATE_BADGE_COUNT, (event, totalCount?: number) => {
if (totalCount === -1) {
// The electron docs say you should be able to update this and pass no parameters to set the badge
// to a single red dot, but in practice it resulted in an error "TypeError: Insufficient number of
Expand Down
49 changes: 0 additions & 49 deletions docs/articles/expensify-classic/expenses/Referral-Program.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Change Expensify Card limit
description: Increase or decrease the limit for an Expensify Card or for a group
---
<div id="expensify-classic" markdown="1">

You can set Expensify Card limits for each group in your organization, or you can set the limit per card.

# Set a limit per card

1. Hover over Settings, then click **Domains**.
2. Click the name of the domain.
3. Next to the card, click **Edit Limit**.
4. Ensure the Custom Smart Limit toggle is enabled to be able to set a specific card limit. Otherwise, the card limit will be determined by the limit set for the group that the employee is in.
5. In the Limit Amount field, enter the desired limit. If set to $0, the card will be disabled for use until the limit is increased.
6. Click **Save**.

# Set a limit per group

1. Hover over Settings, then click **Domains**.
2. Click the name of the domain.
3. Click the **Groups** tab on the left.
4. Click the Expensify Card Smart Limit field for the card and enter the desired limit.

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Deactivate or cancel an Expensify Card
description: Close an Expensify Card
---
<div id="expensify-classic" markdown="1">

A cardholder or a Domain Admin can cancel an Expensify Card. You may want to cancel a card:
- To cancel an old Expensify Card after upgrading to the new Expensify Visa® Commercial Card
- After a fraudulent or suspicious charge
- After an employee leaves the company

# Domain Admins

To cancel an employee's Expensify Card as a Domain Admin,

1. Hover over Settings, then click **Domains**.
2. Click the name of the domain.
3. Next to the card, click **Terminate**.

# Cardholders

To cancel an Expensify Card assigned to you,

1. Hover over Settings, then click **Account**.
2. Click the **Credit Card Import** tab.
3. Click **Cancel** next to the card.

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ To add a Custom Segment to your workspace, you’ll need to locate three fields

**To find the Script/Field ID:**

If configuring Custom Segments as Report Fields, use the Field ID on the Transactions tab (under _Custom Segments > Transactions_).
Note that as of 2019.1, any new custom segments that you create automatically use the unified ID, and the Use as Field ID box is not visible. If you are editing a custom segment definition that was created before 2019.1, the Use as Field ID box is available.
To use a unified ID for the entire custom segment definition, check the Use as Field ID box. When the box is checked, no field ID fields or columns are shown on the Application & Sourcing subtabs because one ID is used for all fields.

If configuring Custom Segments as Tags, use the Field ID on the Transaction Columns tab (under _Custom Segments > Transaction Columns_).
- If configuring Custom Segments as Report Fields, use the Field ID on the Transactions tab (under _Custom Segments > Transactions_), or if no Field ID is shown, use the unified ID (just called "ID" right below the "Label").
- If configuring Custom Segments as Tags, use the Field ID on the Transaction Columns tab (under _Custom Segments > Transaction Columns_), or if no Field ID is shown, use the unified ID (just called "ID" right below the "Label").

Lastly, head over to Expensify and do the following:
1. Navigate to **Settings > Workspace > Group > _[Workspace Name]_ > Connections > Configure > Coding tab**
Expand Down
Loading

0 comments on commit 6034aee

Please sign in to comment.