Skip to content

Commit

Permalink
Pulled latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Jun 11, 2021
2 parents 80869c9 + 34612d7 commit e4bd83e
Show file tree
Hide file tree
Showing 61 changed files with 1,047 additions and 504 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/updateProtectedBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
echo "Cannot update main branch without specifying a source branch"
exit 1
# If updating staging, the head branch will always be main
# If updating production, the head branch will always be staging
# If updating staging, the source branch will always be main
# If updating production, the source branch will always be staging
- name: Set source branch
run: |
if [[ ${{ github.event.inputs.TARGET_BRANCH }} == 'staging' ]]; then
echo "HEAD_BRANCH=main" >> $GITHUB_ENV
echo "SOURCE_BRANCH=main" >> $GITHUB_ENV
elif [[ ${{ github.event.inputs.TARGET_BRANCH }} == 'production' ]]; then
echo "HEAD_BRANCH=staging" >> $GITHUB_ENV
echo "SOURCE_BRANCH=staging" >> $GITHUB_ENV
else
echo "HEAD_BRANCH=${{ github.event.inputs.SOURCE_BRANCH }}" >> $GITHUB_ENV
echo "SOURCE_BRANCH=${{ github.event.inputs.SOURCE_BRANCH }}" >> $GITHUB_ENV
fi
# Version: 2.3.4
Expand All @@ -48,18 +48,28 @@ jobs:
fetch-depth: 0
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Checkout head branch
run: git checkout ${{ env.HEAD_BRANCH }}
- name: Checkout source branch
run: git checkout ${{ env.SOURCE_BRANCH }}

- name: Set New Version
run: echo "NEW_VERSION=$(npm run print-version --silent)" >> $GITHUB_ENV

- name: Create temporary branch to resolve conflicts
if: ${{ contains(fromJSON('["staging", "production"]'), github.event.inputs.TARGET_BRANCH) }}
run: |
git config user.name ${{ github.actor }}
git checkout ${{ github.event.inputs.TARGET_BRANCH }}
git checkout -b update-${{ github.event.inputs.TARGET_BRANCH }}-from-${{ env.SOURCE_BRANCH }}
git merge -Xtheirs ${{ env.SOURCE_BRANCH }}
git push --set-upstream origin update-${{ github.event.inputs.TARGET_BRANCH }}-from-${{ env.SOURCE_BRANCH }}
echo "SOURCE_BRANCH=update-${{ github.event.inputs.TARGET_BRANCH }}-from-${{ env.SOURCE_BRANCH }}" >> $GITHUB_ENV
- name: Create Pull Request
id: createPullRequest
# Version: 2.4.3
uses: repo-sync/pull-request@65194d8015be7624d231796ddee1cd52a5023cb3
with:
source_branch: ${{ env.HEAD_BRANCH }}
source_branch: ${{ env.SOURCE_BRANCH }}
destination_branch: ${{ github.event.inputs.TARGET_BRANCH }}
github_token: ${{ secrets.OS_BOTIFY_TOKEN }}
pr_title: Update version to ${{ env.NEW_VERSION }} on ${{ github.event.inputs.TARGET_BRANCH }}
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [Debugging](#debugging)
* [Structure of the app](#structure-of-the-app)
* [Philosophy](#Philosophy)
* [Internationalization](#Internationalization)
* [Deploying](#deploying)

#### Additional Reading
Expand Down Expand Up @@ -236,6 +237,32 @@ This application is built with the following principles.

----

# Internationalization
This application is built with Internationalization (I18n) / Localization (L10n) support, so it's important to always
localize the following types of data when presented to the user (even accessibility texts that are not rendered):

- Texts: See [translate method](https://github.com/Expensify/Expensify.cash/blob/655ba416d552d5c88e57977a6e0165fb7eb7ab58/src/libs/translate.js#L15)
- Date/time: see [DateUtils](https://github.com/Expensify/Expensify.cash/blob/f579946fbfbdc62acc5bd281dc75cabb803d9af0/src/libs/DateUtils.js)
- Numbers and amounts: see [numberFormat](https://github.com/Expensify/Expensify.cash/tree/965f92fc2a5a2a0d01e6114bf5aa8755b9d9fd1a/src/libs/numberFormat)
- Phones: see [LocalPhoneNumber](https://github.com/Expensify/Expensify.cash/blob/bdfbafe18ee2d60f766c697744f23fad64b62cad/src/libs/LocalePhoneNumber.js#L51-L52)

In most cases, you will be needing to localize data used in a component, if that's the case, there's a HOC [withLocalize](https://github.com/Expensify/Expensify.cash/blob/37465dbd07da1feab8347835d82ed3d2302cde4c/src/components/withLocalize.js).
It will abstract most of the logic you need (mostly subscribe to the [PREFERRED_LOCALE](https://github.com/Expensify/Expensify.cash/blob/6cf1a56df670a11bf61aa67eeb64c1f87161dea1/src/ONYXKEYS.js#L88) Onyx key)
and is the preferred way of localizing things inside components.

Some pointers:

- All translations are stored in language files in [src/languages](https://github.com/Expensify/Expensify.cash/tree/b114bc86ff38e3feca764e75b3f5bf4f60fcd6fe/src/languages).
- We try to group translations by their pages/components
- A common rule of thumb is to move a common word/phrase to be shared when it's in 3 places
- Always prefer longer and more complex strings in the translation files. For example
if you need to generate the text `User has sent $20.00 to you on Oct 25th at 10:05am`, add just one
key to the translation file and use the arrow function version, like so:
`nameOfTheKey: ({amount, dateTime}) => "User has sent " + amount + " to you on " + dateTime,`.
This is because the order of the phrases might vary from one language to another.

----

# Deploying
## QA and deploy cycles
We utilize a CI/CD deployment system built using [GitHub Actions](https://github.com/features/actions) to ensure that new code is automatically deployed to our users as fast as possible. As part of this process, all code is first deployed to our staging environments, where it undergoes quality assurance (QA) testing before it is deployed to production. Typically, pull requests are deployed to staging immediately after they are merged.
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001006607
versionName "1.0.66-7"
versionCode 1001006803
versionName "1.0.68-3"
}
splits {
abi {
Expand Down
1 change: 0 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".MainApplication"
Expand Down
2 changes: 0 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
rootProject.name = 'ExpensifyCash'
include ':@react-native-community_geolocation'
project(':@react-native-community_geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/geolocation/android')
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':@react-native-community_async-storage'
Expand Down
3 changes: 3 additions & 0 deletions assets/images/bank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/example-check-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/paycheck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e4bd83e

Please sign in to comment.