From 8b8d661ec4589564d1e0a9fce25a62bbc295f634 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 08:37:57 -0700 Subject: [PATCH 1/5] Fix language selector --- src/libs/OptionsListUtils.js | 2 +- src/libs/actions/App.js | 10 +++++++++- src/pages/settings/PreferencesPage.js | 20 +++++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index e8a349daa112..8a6f3ddb620d 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -162,7 +162,7 @@ Onyx.connect({ Onyx.connect({ key: ONYXKEYS.PREFERRED_LOCALE, - callback: val => preferredLocale = val || 'en', + callback: val => preferredLocale = val || CONST.DEFAULT_LOCALE, }); /** diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 66c52a79a360..197759834a63 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -8,7 +8,15 @@ function setCurrentURL(url) { Onyx.set(ONYXKEYS.CURRENT_URL, url); } +/** + * @param {String} locale + */ +function setLocale(locale) { + console.log('RORY_DEBUG setting locale to:', locale); + Onyx.set(ONYXKEYS.PREFERRED_LOCALE, locale); +} + export { - // eslint-disable-next-line import/prefer-default-export setCurrentURL, + setLocale, }; diff --git a/src/pages/settings/PreferencesPage.js b/src/pages/settings/PreferencesPage.js index 933c16df82a7..f1691c4e0c9d 100755 --- a/src/pages/settings/PreferencesPage.js +++ b/src/pages/settings/PreferencesPage.js @@ -1,6 +1,7 @@ +import _ from 'underscore'; import React from 'react'; import {View} from 'react-native'; -import Onyx, {withOnyx} from 'react-native-onyx'; +import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; @@ -12,6 +13,7 @@ import Text from '../../components/Text'; import NameValuePair from '../../libs/actions/NameValuePair'; import CONST from '../../CONST'; import {setExpensifyNewsStatus} from '../../libs/actions/User'; +import {setLocale} from '../../libs/actions/App'; import ScreenWrapper from '../../components/ScreenWrapper'; import Switch from '../../components/Switch'; import Picker from '../../components/Picker'; @@ -28,15 +30,16 @@ const propTypes = { expensifyNewsStatus: PropTypes.bool, }), - ...withLocalizePropTypes, + /** Indicates which locale the user currently has selected */ + preferredLocale: PropTypes.string, - // Indicates which locale the user currently has selected - preferredLocale: PropTypes.string.isRequired, + ...withLocalizePropTypes, }; const defaultProps = { priorityMode: CONST.PRIORITY_MODE.DEFAULT, user: {}, + preferredLocale: CONST.DEFAULT_LOCALE, }; const PreferencesPage = ({ @@ -112,7 +115,11 @@ const PreferencesPage = ({ Onyx.merge(ONYXKEYS.PREFERRED_LOCALE, locale)} + onChange={(locale) => { + if (locale !== preferredLocale) { + setLocale(locale); + } + }} items={Object.values(localesToLanguages)} value={preferredLocale} /> @@ -136,5 +143,8 @@ export default compose( user: { key: ONYXKEYS.USER, }, + preferredLocale: { + key: ONYXKEYS.PREFERRED_LOCALE, + }, }), )(PreferencesPage); From a12ef944435a1c2cbe82e87f6dd69ee6390cb4e3 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 09:02:14 -0700 Subject: [PATCH 2/5] Fix JS style --- src/libs/actions/App.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 197759834a63..397690b7daee 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -12,7 +12,6 @@ function setCurrentURL(url) { * @param {String} locale */ function setLocale(locale) { - console.log('RORY_DEBUG setting locale to:', locale); Onyx.set(ONYXKEYS.PREFERRED_LOCALE, locale); } From 79ff2f7ccd921414ebc072e4926de343dc3695e5 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 09:04:44 -0700 Subject: [PATCH 3/5] Remove unused import --- src/pages/settings/PreferencesPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/settings/PreferencesPage.js b/src/pages/settings/PreferencesPage.js index f1691c4e0c9d..2896f1bdd68c 100755 --- a/src/pages/settings/PreferencesPage.js +++ b/src/pages/settings/PreferencesPage.js @@ -1,4 +1,3 @@ -import _ from 'underscore'; import React from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; From 266a2a812a702b1500fc26287830aaa5cee4af1b Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 12:37:11 -0700 Subject: [PATCH 4/5] Fix StagingDeployCash isAutomatedPullRequest check --- .github/actions/checkDeployBlockers/index.js | 1 + .../createOrUpdateStagingDeploy.js | 6 +++--- .../actions/createOrUpdateStagingDeploy/index.js | 7 ++++--- .../actions/getMergeCommitForPullRequest/index.js | 1 + .github/actions/getReleaseBody/index.js | 1 + .github/actions/isPullRequestMergeable/index.js | 1 + .github/actions/isStagingDeployLocked/index.js | 1 + .../actions/markPullRequestsAsDeployed/index.js | 1 + .github/actions/reopenIssueWithComment/index.js | 1 + .github/actions/triggerWorkflowAndWait/index.js | 1 + .github/libs/GithubUtils.js | 1 + tests/unit/createOrUpdateStagingDeployTest.js | 14 +++++++------- 12 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/actions/checkDeployBlockers/index.js b/.github/actions/checkDeployBlockers/index.js index 12c95c8c76f1..b109be49c626 100644 --- a/.github/actions/checkDeployBlockers/index.js +++ b/.github/actions/checkDeployBlockers/index.js @@ -291,6 +291,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js index 75b890934476..9ea8c688b53d 100644 --- a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js +++ b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js @@ -80,9 +80,9 @@ const run = function () { console.log('Parsed the following data from the current StagingDeployCash:', currentStagingDeployCashData); currentStagingDeployCashIssueNumber = currentStagingDeployCashData.number; - const newDeployBlockers = _.map(deployBlockerResponse.data, ({url}) => ({ - url, - number: GithubUtils.getIssueOrPullRequestNumberFromURL(url), + const newDeployBlockers = _.map(deployBlockerResponse.data, ({html_url}) => ({ + url: html_url, + number: GithubUtils.getIssueOrPullRequestNumberFromURL(html_url), isResolved: false, })); diff --git a/.github/actions/createOrUpdateStagingDeploy/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index 4bc71ff41a46..85c791c418c6 100644 --- a/.github/actions/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/createOrUpdateStagingDeploy/index.js @@ -90,9 +90,9 @@ const run = function () { console.log('Parsed the following data from the current StagingDeployCash:', currentStagingDeployCashData); currentStagingDeployCashIssueNumber = currentStagingDeployCashData.number; - const newDeployBlockers = _.map(deployBlockerResponse.data, ({url}) => ({ - url, - number: GithubUtils.getIssueOrPullRequestNumberFromURL(url), + const newDeployBlockers = _.map(deployBlockerResponse.data, ({html_url}) => ({ + url: html_url, + number: GithubUtils.getIssueOrPullRequestNumberFromURL(html_url), isResolved: false, })); @@ -413,6 +413,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/getMergeCommitForPullRequest/index.js b/.github/actions/getMergeCommitForPullRequest/index.js index cbb10320c6a2..6543b49dd7ba 100644 --- a/.github/actions/getMergeCommitForPullRequest/index.js +++ b/.github/actions/getMergeCommitForPullRequest/index.js @@ -319,6 +319,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/getReleaseBody/index.js b/.github/actions/getReleaseBody/index.js index 4321be9b8293..dfcf37b35c43 100644 --- a/.github/actions/getReleaseBody/index.js +++ b/.github/actions/getReleaseBody/index.js @@ -262,6 +262,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/isPullRequestMergeable/index.js b/.github/actions/isPullRequestMergeable/index.js index c1c4c59e8bd9..4b23532cdede 100644 --- a/.github/actions/isPullRequestMergeable/index.js +++ b/.github/actions/isPullRequestMergeable/index.js @@ -265,6 +265,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/isStagingDeployLocked/index.js b/.github/actions/isStagingDeployLocked/index.js index 1808c24b2b7f..41e2bd607145 100644 --- a/.github/actions/isStagingDeployLocked/index.js +++ b/.github/actions/isStagingDeployLocked/index.js @@ -241,6 +241,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 9ce5a031d0d7..5b71719b6e1f 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -315,6 +315,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/reopenIssueWithComment/index.js b/.github/actions/reopenIssueWithComment/index.js index 9e09931d78b3..5ac3d3f1a473 100644 --- a/.github/actions/reopenIssueWithComment/index.js +++ b/.github/actions/reopenIssueWithComment/index.js @@ -254,6 +254,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/triggerWorkflowAndWait/index.js b/.github/actions/triggerWorkflowAndWait/index.js index 559a754eff75..f7b68e5dca7e 100644 --- a/.github/actions/triggerWorkflowAndWait/index.js +++ b/.github/actions/triggerWorkflowAndWait/index.js @@ -405,6 +405,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index 025a9c9281b2..f57a0576762f 100644 --- a/.github/libs/GithubUtils.js +++ b/.github/libs/GithubUtils.js @@ -203,6 +203,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index fce7a09a9775..e9bd461c5f82 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -144,19 +144,19 @@ describe('createOrUpdateStagingDeployCash', () => { const currentOpenDeployBlockers = [ { - url: 'https://github.com/Expensify/Expensify.cash/pull/6', + html_url: 'https://github.com/Expensify/Expensify.cash/pull/6', number: 6, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/9', + html_url: 'https://github.com/Expensify/Expensify.cash/issues/9', number: 9, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/10', + html_url: 'https://github.com/Expensify/Expensify.cash/issues/10', number: 10, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], @@ -196,13 +196,13 @@ describe('createOrUpdateStagingDeployCash', () => { data: [ ...currentOpenDeployBlockers, { - url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New number: 11, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New number: 12, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], @@ -246,13 +246,13 @@ describe('createOrUpdateStagingDeployCash', () => { data: [ ...currentOpenDeployBlockers, { - url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New number: 11, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New number: 12, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], From a7317b53775d6a90ef8a55503ccb5baa119ff3a8 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Thu, 17 Jun 2021 19:54:46 +0000 Subject: [PATCH 5/5] Update version to 1.0.70-7 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 0b25d4bfdf89..1b88329cd34b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001007006 - versionName "1.0.70-6" + versionCode 1001007007 + versionName "1.0.70-7" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index eb88392ed51f..a8b113230485 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.70.6 + 1.0.70.7 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 72d5cd2666b4..9bcd23f2af28 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.70.6 + 1.0.70.7 diff --git a/package-lock.json b/package-lock.json index 5d6cf3f669f0..6a96408db36e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.70-6", + "version": "1.0.70-7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 96cd3622c6b7..a5984b25d7f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.70-6", + "version": "1.0.70-7", "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.",