Skip to content

Commit

Permalink
Merge branch 'main' into fix-remove-sms-domain-in-htmlToText
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Sep 2, 2024
2 parents e144a67 + e60b821 commit 365c866
Show file tree
Hide file tree
Showing 169 changed files with 3,256 additions and 2,460 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ jobs:
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

- name: 🚀 Edit the release to be no longer a prerelease to deploy production 🚀
run: gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest
run: |
LATEST_RELEASE="$(gh release list --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')"
gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ env.PRODUCTION_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" >> releaseNotes.md
gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
env:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GEM
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
apktools (0.7.4)
apktools (0.7.5)
rubyzip (~> 2.0)
artifactory (3.0.17)
atomos (0.1.3)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* [Contributing to Expensify](contributingGuides/CONTRIBUTING.md)
* [Expensify Code of Conduct](CODE_OF_CONDUCT.md)
* [Contributor License Agreement](contributingGuides/CLA.md)
* [React StrictMode](contributingGuides/STRICT_MODE.md)

----

Expand Down
1 change: 1 addition & 0 deletions __mocks__/react-native-document-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const reactNativeDocumentPickerMock: ReactNativeDocumentPickerMock = {
doc: 'com.microsoft.word.doc',
docx: 'org.openxmlformats.wordprocessingml.document',
images: 'public.image',
json: 'public.json',
pdf: 'com.adobe.pdf',
plainText: 'public.plain-text',
ppt: 'com.microsoft.powerpoint.ppt',
Expand Down
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 1009002515
versionName "9.0.25-15"
versionCode 1009002700
versionName "9.0.27-0"
// 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
643 changes: 643 additions & 0 deletions assets/images/companyCards/emptystate__card-pos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions contributingGuides/STRICT_MODE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Usage of react concurrent mode and StrictMode
## Concurrent react
This App is rendered using react concurrent mode, which is the direction that React seems to be moving.

Concurrent mode enables a lot of new behaviours in react, most importantly renders can be interrupted by React, re-run or run more than once. This is supposed to make react more performant and webapps more responsive to user actions.

Further reading:
- [What is Concurrent React](https://react.dev/blog/2022/03/29/react-v18#what-is-concurrent-react)

## StrictMode
Because the previously described concurrent mode could potentially introduce new bugs in the code (related to parallel rendering) we are using `<StrictMode />`.
This is a recommendation from React team as per react official docs.

`<StrictMode>` is a component that wraps the whole App in (or parts of App) and it runs extra checks and extra behaviors only in dev. So in essence this is a developer tool.

### Temporarily disabling StrictMode for dev
Strict mode *by default always* wraps entire Expensify App component tree. This happens in `src/App.tsx`.

However, it might happen you want to temporarily disable `StrictMode` when developing, to verify that your code behaves properly.

To do that:
- go to `src/CONFIG.ts`
- set `USE_REACT_STRICT_MODE_IN_DEV` flag to `false`

_Important note_: this ☝️flag is strictly for developers. It does not affect production builds of React.
StrictMode is supposed to always wrap your App regardless of environment, and it will simply do nothing when run on production react build.
Only use this flag for local development and testing, but do not make it depending on `NODE_ENV` or any other env vars.

### Common StrictMode pitfalls
- every component will go through: `mount -> unmount -> mount` on first app render
- any code running inside `useEffect(() => {...}, [])` that would be expected to run once on initial render, will run twice, this might include initial api calls

#### Example: How StrictMode Affects AuthScreen
In AuthScreen, we have a typical pattern where certain logic is executed during mounting and unmounting, this is what happen after a refresh:
- Mounting: it runs `ReconnectApp`.
- Unmounting: AuthScreen cleans up data.
- Re-mounting Due to StrictMode: This behavior will cause `OpenApp` to be executed on the new mount.

Impact: This double execution could lead to unnecessary API calls or unexpected states.

Sources:
- [StrictMode docs](https://react.dev/reference/react/StrictMode)
- [StrictMode recommended usage](https://react.dev/reference/react/StrictMode)
- [Original PR introducing this feature](https://github.com/Expensify/App/pull/42592)
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@ To connect QuickBooks Desktop to Expensify, you must log into QuickBooks Desktop
4. Click **Connect to QuickBooks Desktop**.
5. Click Copy to copy the link, then paste the link into the computer where QuickBooks Desktop is running.

![QuickBooks Desktop Setup pop-up link, containing the URL to paste](https://help.expensify.com/assets/images/QBO_desktop_01.png){:width="100%"}
![QuickBooks Desktop Setup pop-up link, containing the URL to paste](https://help.expensify.com/assets/images/QBO_desktop_01.png){:width="100%"}

6. Select the version of QuickBooks Desktop that you currently have.

![The Web Connnector Pop-up to allow you to select the type of QuickBooks Desktop you have](https://help.expensify.com/assets/images/QBO_desktop_02.png){:width="100%"}
![The Web Connnector Pop-up to allow you to select the type of QuickBooks Desktop you have](https://help.expensify.com/assets/images/QBO_desktop_02.png){:width="100%"}

7. Download the Web Connector and go through the guided installation process.
8. Open the Web Connector.
9. Click on **Add an Application**.

![The Web Connnector Pop-up where you will need to click on Add an Application](https://help.expensify.com/assets/images/QBO_desktop_03.png){:width="100%"}
![The Web Connnector Pop-up where you will need to click on Add an Application](https://help.expensify.com/assets/images/QBO_desktop_03.png){:width="100%"}

{% include info.html %}
For this step, it is key to ensure that the correct company file is open in QuickBooks Desktop and that it is the only one open.
{% include end-info.html %}

10. In QuickBooks Desktop, select **"Yes, always allow access, even when QuickBooks is not running"** and click **Continue**.

![The QuickBooks Desktop pop-up, where you will need to select "Yes, always allow access, even when QuickBooks is not running"](https://help.expensify.com/assets/images/QBO_desktop_04.png){:width="100%"}
![The QuickBooks Desktop pop-up, where you will need to select "Yes, always allow access, even when QuickBooks is not running"](https://help.expensify.com/assets/images/QBO_desktop_04.png){:width="100%"}

11. Click **OK**, then click **Yes**.

![The QuickBooks Desktop pop-up, where you will need to click "Ok" then select "Yes"](https://help.expensify.com/assets/images/QBO_desktop_05.png){:width="100%"}
![The QuickBooks Desktop pop-up, where you will need to click "Ok" then select "Yes"](https://help.expensify.com/assets/images/QBO_desktop_05.png){:width="100%"}

12. Click **Copy** to copy the password.

![The Web Connector pop-up, where you will need to click "Copy"](https://help.expensify.com/assets/images/QBO_desktop_06.png){:width="100%"}
![The Web Connector pop-up, where you will need to click "Copy"](https://help.expensify.com/assets/images/QBO_desktop_06.png){:width="100%"}

13. Paste the password into the Password field of the Web Connector and press **Enter**.

![The Web Connector pop-up, where you will need to paste the password into the password field](https://help.expensify.com/assets/images/QBO_desktop_08.png){:width="100%"}
![The Web Connector pop-up, where you will need to paste the password into the password field](https://help.expensify.com/assets/images/QBO_desktop_08.png){:width="100%"}

14. Click **Yes** to save the password. The new connection now appears in the Web Connector.

![The Web Connector pop-up, where you will need to click "Yes"](https://help.expensify.com/assets/images/QBO_desktop_07.png){:width="100%"}
![The Web Connector pop-up, where you will need to click "Yes"](https://help.expensify.com/assets/images/QBO_desktop_07.png){:width="100%"}

# FAQ

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Workspace Admins can set a default report title for all reports created under a
3. Click the **Reports** tab on the left.
4. Scroll down to the Default Report Title section.
5. Configure the formula. You can use the example provided on the page as a guide or choose from more [report formula options](https://help.expensify.com/articles/expensify-classic/spending-insights/Custom-Templates).
- Some formulas will automatically update the report title as changes are made to the report. For example, any formula related to dates, total amounts, workspace name, would adjust the title before the report is submitted for approval. Changes will not retroactively update report titles for reports which have been Approved or Reimbursed.
- Some formulas will automatically update the report title as changes are made to the report. For example, any formula related to dates, total amounts, and workspace name would adjust the title before the report is submitted for approval. Note that changes to Report Field values reflected in the Report Title (i.e., `{field:Customer}`) will not be reflected in the title of Open reports until submission. Between submission and approval, changes will update the title immediately. Changes will **not** retroactively update report titles for reports that have been Approved or Reimbursed.
6. If desired, enable the Enforce Default Report Title toggle. This will prevent employees from editing the default title.

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ To create or update a travel policy,
2. **To add a new policy:** Click **Add new** under Employee or Non-employee in the left menu. Then under the Edit members section, select the group of employees that belong to this policy.

{% include info.html %}
The Company name in Expensify Travel is the domain of the Expensify workspace billing owner
A Legal Entity in Expensify Travel is the equivalent of an Expensify Workspace.
{% include end-info.html %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ To create or update a travel policy,
2. **To add a new policy:** Click **Add new** under Employee or Non-employee in the left menu. Then under the Edit members section, select the group of employees that belong to this policy.

{% include info.html %}
The Company name in Expensify Travel is the domain of the Expensify workspace billing owner
A Legal Entity in Expensify Travel is the equivalent of an Expensify Workspace.
{% include end-info.html %}

Expand Down
43 changes: 41 additions & 2 deletions docs/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ window.addEventListener('load', () => {
insertElementAfter(searchInput, searchLabel);
});

const FIXED_HEADER_HEIGHT = 80;

const tocbotOptions = {
// Where to render the table of contents.
tocSelector: '.article-toc',
Expand All @@ -188,14 +190,51 @@ const tocbotOptions = {
activeLinkClass: 'selected-article',

// Headings offset between the headings and the top of the document (requires scrollSmooth enabled)
headingsOffset: 80,
scrollSmoothOffset: -80,
headingsOffset: FIXED_HEADER_HEIGHT,
scrollSmoothOffset: -FIXED_HEADER_HEIGHT,
scrollSmooth: true,

// If there is a fixed article scroll container, set to calculate titles' offset
scrollContainer: 'content-area',

onClick: (e) => {
e.preventDefault();
const hashText = e.target.href.split('#').pop();
// Append hashText to the current URL without saving to history
const newUrl = `${window.location.pathname}#${hashText}`;
history.replaceState(null, '', newUrl);
},
};

// Define the media query string for the mobile breakpoint
const mobileBreakpoint = window.matchMedia('(max-width: 799px)');

// Function to update tocbot options and refresh
function updateTocbotOptions(headingsOffset, scrollSmoothOffset) {
tocbotOptions.headingsOffset = headingsOffset;
tocbotOptions.scrollSmoothOffset = scrollSmoothOffset;
window.tocbot.refresh({
...tocbotOptions,
});
}

function handleBreakpointChange() {
const isMobile = mobileBreakpoint.matches;
const headingsOffset = isMobile ? FIXED_HEADER_HEIGHT : 0;
const scrollSmoothOffset = isMobile ? -FIXED_HEADER_HEIGHT : 0;

// Update tocbot options only if there is a change in offsets
if (tocbotOptions.headingsOffset !== headingsOffset || tocbotOptions.scrollSmoothOffset !== scrollSmoothOffset) {
updateTocbotOptions(headingsOffset, scrollSmoothOffset);
}
}

// Add listener for changes to the media query status using addEventListener
mobileBreakpoint.addEventListener('change', handleBreakpointChange);

// Initial check
handleBreakpointChange();

function selectNewExpensify(newExpensifyTab, newExpensifyContent, expensifyClassicTab, expensifyClassicContent) {
newExpensifyTab.classList.add('active');
newExpensifyContent.classList.remove('hidden');
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>9.0.25</string>
<string>9.0.27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.25.15</string>
<string>9.0.27.0</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>9.0.25</string>
<string>9.0.27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.25.15</string>
<string>9.0.27.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>9.0.25</string>
<string>9.0.27</string>
<key>CFBundleVersion</key>
<string>9.0.25.15</string>
<string>9.0.27.0</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Loading

0 comments on commit 365c866

Please sign in to comment.