Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

New implementation for currency on native app #1887

Merged
merged 51 commits into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
551faf5
replacing old locaion api with new config api
mahmed0715 Feb 3, 2020
963f249
fake data for debug
mahmed0715 Feb 3, 2020
8ba410a
merge develop
mahmed0715 Feb 6, 2020
2408eb5
fallback the thirst party location api
mahmed0715 Feb 6, 2020
3d8936f
currecncy selector
mahmed0715 Feb 7, 2020
834b6a3
country flags shown
mahmed0715 Feb 7, 2020
315ced9
fixing crash
mahmed0715 Feb 7, 2020
1ef567b
working proto of currency selctor that effects in donation process
mahmed0715 Feb 7, 2020
1cd7411
featured currency
mahmed0715 Feb 7, 2020
6a593c5
updated based on user profile
mahmed0715 Feb 8, 2020
91b0d02
eslint
mahmed0715 Feb 8, 2020
0c9013c
Merge remote-tracking branch 'origin/develop' into feature/user-location
mahmed0715 Feb 8, 2020
38f0de7
remove debug code
mahmed0715 Feb 10, 2020
e1425fa
merge develop
mahmed0715 Feb 10, 2020
f5b4ae8
Merge branch 'develop' into feature/user-location
sagararyal Feb 10, 2020
f9f4db9
search on currency selector
mahmed0715 Feb 11, 2020
3e14fa3
Merge branch 'feature/user-location' of github.com:Plant-for-the-Plan…
mahmed0715 Feb 11, 2020
811c7d2
eslint
mahmed0715 Feb 11, 2020
a889d6c
ui updated
mahmed0715 Feb 13, 2020
1d5dae9
style changed - according to zeplin
ankitecd Feb 14, 2020
8ee233d
Merge branch 'develop' into feature/user-location
norbertschuler Feb 19, 2020
32cf43a
added country flag for currency
ankitecd Feb 22, 2020
c038b15
changed search clear button active state
ankitecd Feb 22, 2020
d1e7e46
added loader for waiting feedback on currency selection
ankitecd Mar 1, 2020
64e32ff
removed console log from updateUserProfile
ankitecd Mar 1, 2020
db46c71
Merge branch 'develop' into feature/user-location
ankitecd Mar 1, 2020
7db2a9a
added currency flag in side menu
ankitecd Mar 1, 2020
20ca4d3
removed border from search
ankitecd Mar 2, 2020
3428dd9
removed featured and all currency label while searching
ankitecd Mar 2, 2020
c15623f
Margin fixed
harshvitra1412 Mar 4, 2020
2d562d4
added new currency selector in donate trees
ankitecd Mar 4, 2020
930721a
Merge branch 'feature/user-location' of github.com:Plant-for-the-Plan…
ankitecd Mar 4, 2020
31930a2
fixed loader opacity issue
ankitecd Mar 4, 2020
2261045
ZIndex in ios
harshvitra1412 Mar 4, 2020
9db68e1
ESLint
harshvitra1412 Mar 4, 2020
c10e5e4
fixed global currency selection in currency modal in donate trees
ankitecd Mar 8, 2020
78738f6
removed console.log comments
ankitecd Mar 8, 2020
254ba63
Merge branch 'feature/user-location' of github.com:Plant-for-the-Plan…
ankitecd Mar 8, 2020
e4bda23
Merge branch 'develop' into feature/user-location
ankitecd Mar 8, 2020
5e50ab7
removed loader
ankitecd Mar 8, 2020
71d8e70
Merge branch 'develop' into feature/user-location
norbertschuler Mar 10, 2020
b9b81a9
added search translation
ankitecd Mar 10, 2020
4cdbcc3
Merge branch 'feature/user-location' of github.com:Plant-for-the-Plan…
ankitecd Mar 10, 2020
c455259
replace 'EUR' with context.currency
norbertschuler Mar 11, 2020
6395956
fixed wrong currencies
norbertschuler Mar 11, 2020
ba1104c
Merge branch 'develop' into feature/user-location
norbertschuler Mar 14, 2020
dc19dde
Merge branch 'develop' into feature/user-location
sagararyal Mar 18, 2020
111d7a6
sort currency by symbol
norbertschuler Mar 21, 2020
1582bd6
add bottom margin to better select last currency in the list
norbertschuler Mar 21, 2020
9bfbc39
eslint fixes
norbertschuler Mar 21, 2020
2a5c597
add back button instead of close button if search is active and remov…
norbertschuler Mar 21, 2020
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
2 changes: 1 addition & 1 deletion app/actions/apiRouting.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const routes = require('../server/routes/fos_js_routes.json');
import Routing from './router.min.js';
import { debug } from '../debug';
import { context } from '../config';
import { getCdnMediaUrl } from './fetchConfig';
import { getLocaleAsync } from './getLocale';
import { getCdnMediaUrl } from './fetchLocation';
Routing.setRoutingData(routes);

export const getApiRoute = async (routeName, params) => {
Expand Down
19 changes: 18 additions & 1 deletion app/actions/fetchLocation.js → app/actions/fetchConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { find } from 'lodash';
import { setCurrencyAction } from './globalCurrency';
// import { setCdnMedia } from '../reducers/configReducer';
let cdnMedia = {};
let currency = '';
export function fetchLocation() {
return dispatch => {
if (!getItemSync('preferredCurrency')) {
Expand All @@ -29,17 +30,33 @@ export function fetchLocation() {
}
};
}

export function getCurrency() {
return currency;
}

export function getCdnMediaUrl() {
return cdnMedia;
}
export function fetchConfig() {
return () => {
return dispatch => {
// if (!getItemSync('preferredCurrency')) {
getRequest('config_get')
.then(data => {
debug('Got config fetch data:', data.data);
cdnMedia = data.data.cdnMedia;

// fake data manipulation for debug purpose, please remove this when debug finishes
// data.data.currency = 'USD';
// debug code ends

if (data.data && data.data.currency) {
currency = data.data.currency;
supportedCurrency.includes(data.data.currency) &&
dispatch(setCurrencyAction(data.data.currency));
} else {
dispatch(fetchLocation());
}
// for now we are not storing those in redux, please uncomment this when you need these urls in your components
// dispatch(setCdnMedia(data.data.cdnMedia));
})
Expand Down
4 changes: 0 additions & 4 deletions app/actions/updateUserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ export function updateUserProfile(data, profileType, forcePromisify) {
return new Promise(function(resolve, reject) {
putAuthenticatedRequest(profileTypeToReq[profileType], data)
.then(res => {
debug(res.status);
debug(res);
debug(userProfileSchema);

if (res.data && res.data instanceof Object) {
if (res.data.merge) {
dispatch(
Expand Down
Loading