Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<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" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".MainApplication"
Expand Down
4 changes: 4 additions & 0 deletions ios/ExpensifyCash/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<string>Your camera is used to create chat attachments.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string></string>
<key>NSLocationAlwaysUsageDescription</key>
<string></string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your camera roll is used to store chat attachments.</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
6 changes: 6 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ platform :ios, '11.0'
target 'ExpensifyCash' do
config = use_native_modules!

permissions_path = '../node_modules/react-native-permissions/ios'

use_react_native!(:path => config["reactNativePath"])

pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

target 'ExpensifyCashTests' do
inherit! :complete
# Pods for testing
Expand Down
32 changes: 31 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ PODS:
- OpenSSL-Universal (1.0.2.20):
- OpenSSL-Universal/Static (= 1.0.2.20)
- OpenSSL-Universal/Static (1.0.2.20)
- Permission-LocationAccuracy (3.0.1):
- RNPermissions
- Permission-LocationAlways (3.0.1):
- RNPermissions
- Permission-LocationWhenInUse (3.0.1):
- RNPermissions
- PromisesObjC (1.2.11)
- RCTRequired (0.63.3)
- RCTTypeSafety (0.63.3):
Expand Down Expand Up @@ -326,6 +332,8 @@ PODS:
- React-Core
- react-native-document-picker (4.0.0):
- React-Core
- react-native-geolocation (2.0.2):
- React
- react-native-image-picker (2.3.4):
- React-Core
- react-native-netinfo (5.9.10):
Expand Down Expand Up @@ -419,6 +427,8 @@ PODS:
- RNFBApp
- RNGestureHandler (1.9.0):
- React-Core
- RNPermissions (3.0.1):
- React-Core
- RNReanimated (1.13.2):
- React-Core
- RNScreens (2.17.1):
Expand Down Expand Up @@ -457,6 +467,9 @@ DEPENDENCIES:
- FlipperKit/SKIOSNetworkPlugin (~> 0.54.0)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- Permission-LocationAccuracy (from `../node_modules/react-native-permissions/ios/LocationAccuracy`)
- Permission-LocationAlways (from `../node_modules/react-native-permissions/ios/LocationAlways`)
- Permission-LocationWhenInUse (from `../node_modules/react-native-permissions/ios/LocationWhenInUse`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`)
Expand All @@ -471,6 +484,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- "react-native-geolocation (from `../node_modules/@react-native-community/geolocation`)"
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-pdf (from `../node_modules/react-native-pdf`)
Expand All @@ -495,6 +509,7 @@ DEPENDENCIES:
- "RNFBApp (from `../node_modules/@react-native-firebase/app`)"
- "RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics`)"
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNPermissions (from `../node_modules/react-native-permissions`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
Expand Down Expand Up @@ -539,6 +554,12 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
Permission-LocationAccuracy:
:path: "../node_modules/react-native-permissions/ios/LocationAccuracy"
Permission-LocationAlways:
:path: "../node_modules/react-native-permissions/ios/LocationAlways"
Permission-LocationWhenInUse:
:path: "../node_modules/react-native-permissions/ios/LocationWhenInUse"
RCTRequired:
:path: "../node_modules/react-native/Libraries/RCTRequired"
RCTTypeSafety:
Expand All @@ -563,6 +584,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-config"
react-native-document-picker:
:path: "../node_modules/react-native-document-picker"
react-native-geolocation:
:path: "../node_modules/@react-native-community/geolocation"
react-native-image-picker:
:path: "../node_modules/react-native-image-picker"
react-native-netinfo:
Expand Down Expand Up @@ -611,6 +634,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-firebase/crashlytics"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNPermissions:
:path: "../node_modules/react-native-permissions"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
Expand Down Expand Up @@ -650,6 +675,9 @@ SPEC CHECKSUMS:
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
OpenSSL-Universal: ff34003318d5e1163e9529b08470708e389ffcdd
Permission-LocationAccuracy: e8adff9ede1b23b43b7054a4500113d515fc87a8
Permission-LocationAlways: 7f7f373d086af7a81b2f4f20d65d29266ca2043b
Permission-LocationWhenInUse: 3ae82a9feb5da4e94e386dba17c7dd3531af9feb
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
RCTRequired: 48884c74035a0b5b76dbb7a998bd93bcfc5f2047
RCTTypeSafety: edf4b618033c2f1c5b7bc3d90d8e085ed95ba2ab
Expand All @@ -663,6 +691,7 @@ SPEC CHECKSUMS:
React-jsinspector: 8e68ffbfe23880d3ee9bafa8be2777f60b25cbe2
react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed
react-native-document-picker: b3e78a8f7fef98b5cb069f20fc35797d55e68e28
react-native-geolocation: cbd9d6bd06bac411eed2671810f454d4908484a8
react-native-image-picker: 32d1ad2c0024ca36161ae0d5c2117e2d6c441f11
react-native-netinfo: 52cf0ee8342548a485e28f4b09e56b477567244d
react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f
Expand All @@ -687,13 +716,14 @@ SPEC CHECKSUMS:
RNFBApp: 7eacc7da7ab19f96c05e434017d44a9f09410da8
RNFBCrashlytics: 4870c14cf8833053b6b5648911abefe1923854d2
RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b
RNPermissions: eb94f9fdc0a8ecd02fcce0676d56ffb1395d41e1
RNReanimated: e03f7425cb7a38dcf1b644d680d1bfc91c3337ad
RNScreens: b6c9607e6fe47c1b6e2f1910d2acd46dd7ecea3a
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
urbanairship-react-native: dfb6dc22b2f41ccaadd636b73d51b448cd1b2bbc
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 41b806c7f131f87b716be1f1f9377532d6c9e43a
PODFILE CHECKSUM: c730d417ba39bd38d4b63c8529779f2eff43bf19

COCOAPODS: 1.10.0
37 changes: 21 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@babel/preset-flow": "^7.12.13",
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/cli": "4.13.1",
"@react-native-community/geolocation": "^2.0.2",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.10",
"@react-native-community/progress-bar-android": "^1.0.4",
Expand Down Expand Up @@ -70,6 +71,7 @@
"react-native-modal": "^11.5.6",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#bd59626781393c93226fb80cb45569408e97b67c",
"react-native-pdf": "^6.2.2",
"react-native-permissions": "^3.0.1",
"react-native-picker-select": "8.0.4",
"react-native-reanimated": "1.13.2",
"react-native-render-html": "^6.0.0-alpha.10",
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default {
// an international code
COUNTRY_CODE: 'countryCode',

// Saves the currency list obtained from the network
CURRENCY_LIST: 'currencyList',

// Contains all the users settings for the Settings page and sub pages
USER: 'user',

Expand Down
20 changes: 20 additions & 0 deletions src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,24 @@ function GetIOUReport(parameters) {
return Network.post(commandName, parameters);
}

/**
* @param {object} parameters
* @param {number} [parameters.latitude]
* @param {number} [parameters.longitude]
* @returns {Promise}
*/
function GetPreferredCurrency(parameters) {
const commandName = 'GetPreferredCurrency';
return Network.post(commandName, parameters);
}

/**
* @returns {Promise}
*/
function GetCurrencyList() {
return Mobile_GetConstants({data: ['currencyList']});
}

export {
getAuthToken,
Authenticate,
Expand Down Expand Up @@ -661,4 +679,6 @@ export {
User_SecondaryLogin_Send,
User_UploadAvatar,
reauthenticate,
GetPreferredCurrency,
GetCurrencyList,
};
1 change: 1 addition & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class AuthScreens extends React.Component {
// Fetch some data we need on initialization
NameValuePair.get(CONST.NVP.PRIORITY_MODE, ONYXKEYS.NVP_PRIORITY_MODE, 'default');
PersonalDetails.fetch();
PersonalDetails.setCurrencyPreferences();
User.fetch();
User.getBetas();
fetchAllReports(true, true);
Expand Down
27 changes: 27 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,32 @@ function isSearchStringMatch(searchValue, searchText) {
});
}

/**
* Returns the personal details for an array of logins
*
* @param {Object} currencyListObject
* @param {String} searchValue
* @param {Object} selectedCurrency
* @returns {Array}
*/
function getCurrencyListForSections(currencyListObject, searchValue) {
const currencyListKeys = _.keys(currencyListObject);
const currencyOptions = _.map(currencyListKeys, currencyCode => ({
text: `${currencyCode} - ${currencyListObject[currencyCode].symbol}`,
searchText: `${currencyCode} ${currencyListObject[currencyCode].symbol}`,
currencyCode,
}));

const filteredOptions = currencyOptions.filter(
currencyOption => isSearchStringMatch(searchValue, currencyOption.searchText),
);

return {
// currency options holds a section for those currencies which are not selected
currencyOptions: filteredOptions,
};
}

/**
* Build the options
*
Expand Down Expand Up @@ -432,4 +458,5 @@ export {
getSidebarOptions,
getHeaderMessage,
getPersonalDetailsForLogins,
getCurrencyListForSections,
};
Loading