Skip to content

Commit

Permalink
Merge pull request #3531 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
  • Loading branch information
OSBotify authored Jun 10, 2021
2 parents 4fa064e + faa4d75 commit ab9b642
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 47 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:

- name: Save correct NEW_VERSION to env
run: |
if [[ -z ${{ github.event.inputs.NEW_VERSION }} ]]; then
if [ -z ${{ github.event.inputs.NEW_VERSION }} ]; then
echo "NEW_VERSION=${{ needs.createNewVersion.outputs.NEW_VERSION }}" >> $GITHUB_ENV
echo "New version is ${{ env.NEW_VERSION }}"
else
Expand Down Expand Up @@ -120,6 +120,9 @@ jobs:
echo "::set-output name=SHOULD_AUTOMERGE::false"
fi
- name: Push changes to CP branch
run: git push

- name: Create Pull Request
id: createPullRequest
# Version: 2.4.3
Expand Down
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
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 1001006605
versionName "1.0.66-5"
versionCode 1001006613
versionName "1.0.66-13"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion ios/ExpensifyCash/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.66.5</string>
<string>1.0.66.13</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/ExpensifyCashTests/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>1.0.66.5</string>
<string>1.0.66.13</string>
</dict>
</plist>
32 changes: 16 additions & 16 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PODS:
- Airship (14.2.0):
- Airship/Automation (= 14.2.0)
- Airship/Core (= 14.2.0)
- Airship/ExtendedActions (= 14.2.0)
- Airship/MessageCenter (= 14.2.0)
- Airship/Automation (14.2.0):
- Airship (14.3.0):
- Airship/Automation (= 14.3.0)
- Airship/Core (= 14.3.0)
- Airship/ExtendedActions (= 14.3.0)
- Airship/MessageCenter (= 14.3.0)
- Airship/Automation (14.3.0):
- Airship/Core
- Airship/Core (14.2.0)
- Airship/ExtendedActions (14.2.0):
- Airship/Core (14.3.0)
- Airship/ExtendedActions (14.3.0):
- Airship/Core
- Airship/MessageCenter (14.2.0):
- Airship/MessageCenter (14.3.0):
- Airship/Core
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.5)
Expand Down Expand Up @@ -494,8 +494,8 @@ PODS:
- React-Core
- RNSVG (12.1.0):
- React
- urbanairship-react-native (10.0.0):
- Airship (= 14.2.0)
- urbanairship-react-native (11.0.1):
- Airship (= 14.3.0)
- React-Core
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -728,12 +728,12 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Airship: 02ad73780f9eed21870e36b0aaab327acda6a102
Airship: 7609d263d3a207f112d6db066af5852b80af6819
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cde416483dac037923206447da6e1454df403714
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53
FBReactNativeSpec: 884d4cc2b011759361797a4035c47e10099393b5
FBReactNativeSpec: 825b0f0851f5cc5c6268a920286281f62fc96c37
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
FirebaseAnalytics: 3bb096873ee0d7fa4b6c70f5e9166b6da413cc7f
FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec
Expand All @@ -747,7 +747,7 @@ SPEC CHECKSUMS:
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
Expand Down Expand Up @@ -808,7 +808,7 @@ SPEC CHECKSUMS:
RNReanimated: b8c8004b43446e3c2709fe64b2b41072f87428ad
RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
urbanairship-react-native: dfb6dc22b2f41ccaadd636b73d51b448cd1b2bbc
urbanairship-react-native: d415a12e67ba93bf3ce914df9a310b66a88a5cc3
Yoga: a7de31c64fe738607e7a3803e3f591a4b1df7393
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
8 changes: 4 additions & 4 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": "expensify.cash",
"version": "1.0.66-5",
"version": "1.0.66-13",
"author": "Expensify, Inc.",
"homepage": "https://expensify.cash",
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -97,7 +97,7 @@
"rn-fetch-blob": "^0.12.0",
"save": "^2.4.0",
"underscore": "^1.10.2",
"urbanairship-react-native": "^10.0.0"
"urbanairship-react-native": "^11.0.1"
},
"devDependencies": {
"@actions/core": "^1.2.6",
Expand Down
2 changes: 2 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ const CONST = {
WARNING: 'warning',
DURATION: 2000,
},

DEFAULT_LOCALE: 'en',
};

export default CONST;
3 changes: 2 additions & 1 deletion src/components/withLocalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {translate} from '../libs/translate';
import DateUtils from '../libs/DateUtils';
import {toLocalPhone, fromLocalPhone} from '../libs/LocalePhoneNumber';
import numberFormat from '../libs/numberFormat';
import CONST from '../CONST';

const withLocalizePropTypes = {
/** Returns translated string for given locale and phrase */
Expand Down Expand Up @@ -66,7 +67,7 @@ function withLocalizeHOC(WrappedComponent) {
]),
};
WithLocalize.defaultProps = {
preferredLocale: 'en',
preferredLocale: CONST.DEFAULT_LOCALE,
forwardedRef: undefined,
};
return React.forwardRef((props, ref) => (
Expand Down
3 changes: 2 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default {
addAttachment: 'Add Attachment',
writeSomething: 'Write something...',
youAppearToBeOffline: 'You appear to be offline.',
fileUploadFailed: 'Upload Failed. File is not supported.',
},
reportActionContextMenu: {
copyToClipboard: 'Copy to Clipboard',
Expand Down Expand Up @@ -220,7 +221,7 @@ export default {
phrase2: 'terms of service',
phrase3: 'and',
phrase4: 'privacy policy',
phrase5: '. Money transmission is provided by Expensify Payments LLC (NMLS ID:2017010) pursuant to its',
phrase5: 'Money transmission is provided by Expensify Payments LLC (NMLS ID:2017010) pursuant to its',
phrase6: 'licenses',
},
passwordForm: {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default {
phrase2: 'términos de servicio',
phrase3: 'y',
phrase4: 'política de privacidad',
phrase5: '. El envío de dinero es brindado por Expensify Payments LLC (NMLS ID:2017010) de conformidad con sus',
phrase5: 'El envío de dinero es brindado por Expensify Payments LLC (NMLS ID:2017010) de conformidad con sus',
phrase6: 'licencias',
},
passwordForm: {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Onyx.connect({
// Merge the persisted requests with the requests in memory then clear out the queue as we only need to load
// this once when the app initializes
networkRequestQueue = [...networkRequestQueue, ...persistedRequests];
Onyx.set(ONYXKEYS.NETWORK_REQUEST_QUEUE, []);
didLoadPersistedRequests = true;
Onyx.set(ONYXKEYS.NETWORK_REQUEST_QUEUE, []);
},
});

Expand Down
24 changes: 23 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import Log from '../Log';
import {isReportMessageAttachment, sortReportsByLastVisited} from '../reportUtils';
import Timers from '../Timers';
import {dangerouslyGetReportActionsMaxSequenceNumber, isReportMissingActions} from './ReportActions';
import Growl from '../Growl';
import {translate} from '../translate';

let currentUserEmail;
let currentUserAccountID;
Expand Down Expand Up @@ -57,6 +59,16 @@ Onyx.connect({
},
});

let translateLocal = (phrase, variables) => translate(CONST.DEFAULT_LOCALE, phrase, variables);
Onyx.connect({
key: ONYXKEYS.PREFERRED_LOCALE,
callback: (preferredLocale) => {
if (preferredLocale) {
translateLocal = (phrase, variables) => translate(preferredLocale, phrase, variables);
}
},
});

const typingWatchTimers = {};

/**
Expand Down Expand Up @@ -1043,7 +1055,17 @@ function addAction(reportID, text, file) {
// the same way report actions can.
persist: !isAttachment,
})
.then(({reportAction}) => updateReportWithNewAction(reportID, reportAction));
.then((response) => {
if (response.jsonCode === 408) {
Growl.show(translateLocal('reportActionCompose.fileUploadFailed'), CONST.GROWL.ERROR);
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {
[optimisticReportActionID]: null,
});
console.error(response.message);
return;
}
updateReportWithNewAction(reportID, response.reportAction);
});
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/libs/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Str from 'expensify-common/lib/str';
import Log from './Log';
import Config from '../CONFIG';
import translations from '../languages/translations';
import CONST from '../CONST';

/**
* Return translated string for given locale and phrase
Expand All @@ -12,7 +13,8 @@ import translations from '../languages/translations';
* @param {Object} [variables]
* @returns {String}
*/
function translate(locale = 'en', phrase, variables = {}) {
// eslint-disable-next-line no-undef
function translate(locale = CONST.DEFAULT_LOCALE, phrase, variables = {}) {
const localeLanguage = locale.substring(0, 2);
const fullLocale = lodashGet(translations, locale, {});
const language = lodashGet(translations, localeLanguage, {});
Expand Down
2 changes: 2 additions & 0 deletions src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class NewChatPage extends Component {
props.reports,
props.personalDetails,
'',
false,
props.betas,
);

Expand Down Expand Up @@ -153,6 +154,7 @@ class NewChatPage extends Component {
this.props.reports,
this.props.personalDetails,
searchValue,
false,
this.props.betas,
);
this.setState({
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class ReportActionItemMessageEdit extends React.Component {
* @param {String} newDraft
*/
updateDraft(newDraft) {
this.textInput.setNativeProps({text: newDraft});
const trimmedNewDraft = newDraft.trim();
this.setState({draft: trimmedNewDraft});
this.debouncedSaveDraft(trimmedNewDraft);
Expand Down Expand Up @@ -113,6 +114,7 @@ class ReportActionItemMessageEdit extends React.Component {
<View style={[styles.chatItemComposeBox, styles.flexRow, styles.chatItemComposeBoxColor]}>
<TextInputFocusable
multiline
ref={el => this.textInput = el}
onChangeText={this.updateDraft} // Debounced saveDraftComment
onKeyPress={this.triggerSaveOrCancel}
defaultValue={this.props.draftMessage}
Expand Down
Loading

0 comments on commit ab9b642

Please sign in to comment.