Skip to content

Commit

Permalink
Merge pull request #70 from hopetambala/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
joseph-mccombs authored Feb 20, 2021
2 parents 351ba11 + b75a5c5 commit 69f8b55
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [10.6.1](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.6.0...v10.6.1) (2021-02-19)


### New Features

* appVersion stored in async and added to all frm submissions ([649b58f](https://github.com/hopetambala/puente-reactnative-collect/commit/649b58ff135f9b024dffb99ced2bdb52672df3be))


### Bug fixes

* double submitting sup forms + move check index for resolve ([6557bc8](https://github.com/hopetambala/puente-reactnative-collect/commit/6557bc8547daa460988eb36d38496478b256ba43))
* limite resident surveys ([37701ec](https://github.com/hopetambala/puente-reactnative-collect/commit/37701ec8ff7d191827f7564631033afa4fe69eb1))

## [10.6.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.5.5...v10.6.0) (2021-02-17)


Expand Down
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"android",
"web"
],
"version": "10.6.0",
"version": "10.6.1",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
Expand All @@ -23,7 +23,7 @@
],
"ios": {
"supportsTablet": true,
"buildNumber": "10.6.0",
"buildNumber": "10.6.1",
"infoPlist": {
"NSLocationWhenInUseUsageDescription": "This app uses your location to geo-tag surveys accurately."
}
Expand All @@ -32,7 +32,7 @@
"favicon": "./assets/images/favicon.png"
},
"android": {
"versionCode": 380100600,
"versionCode": 380100601,
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
Expand Down
6 changes: 2 additions & 4 deletions modules/cached-resources/Post/Offline/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ function postForms(idForms, supForms) {
}
});
}
if (index === array.length - 1) {
resolve();
}
}, (error) => {
reject(error);
});
}
if (index === array.length - 1) resolve();
});
} else {
resolve(true);
Expand All @@ -64,11 +62,11 @@ function postSupForms(supForms) {
// supplementary forms not tied to an offline ID form
if (!supForm.parseParentClassID.includes('PatientID-')) {
postObjectsToClassWithRelation(supForm).then(() => {
if (index === array.length - 1) resolve();
}, (error) => {
reject(error);
});
}
if (index === array.length - 1) resolve();
});
} else {
resolve(true);
Expand Down
25 changes: 18 additions & 7 deletions modules/cached-resources/Post/post.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import _ from 'lodash';

import { postObjectsToClass, postObjectsToClassWithRelation } from '../../../services/parse/crud';
import {
getData,
Expand Down Expand Up @@ -79,20 +81,29 @@ function postOfflineForms() {
const householdsRelation = await getData('offlineHouseholdsRelation');

// post all offline data
// Deep copies needed to ensure no double submission when Parent objects' objectID
// changes from offline object ID like 'PatientId-xxxxxx' to Parse object ID
postHouseholds(households, householdsRelation, idForms, supForms).then(() => {
postHouseholdRelations(householdsRelation, idForms, supForms).then(async () => {
postForms(idForms, supForms).then(() => {
postSupForms(supForms).then(() => {
resolve(true);
const householdsRelationCopy1 = _.cloneDeep(householdsRelation);
const idFormsCopy1 = _.cloneDeep(idForms);
const supFormsCopy1 = _.cloneDeep(supForms);
postHouseholdRelations(householdsRelationCopy1, idFormsCopy1, supFormsCopy1)
.then(async () => {
const idFormsCopy2 = _.cloneDeep(idForms);
const supFormsCopy2 = _.cloneDeep(supForms);
postForms(idFormsCopy2, supFormsCopy2).then(() => {
const supFormsCopy3 = _.cloneDeep(supForms);
postSupForms(supFormsCopy3).then(() => {
resolve(true);
}, (error) => {
reject(error);
});
}, (error) => {
reject(error);
});
}, (error) => {
reject(error);
});
}, (error) => {
reject(error);
});
}, (error) => {
reject(error);
});
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puente-reactnative",
"version": "10.6.0",
"version": "10.6.1",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
Expand Down Expand Up @@ -40,6 +40,7 @@
"@react-native-async-storage/async-storage": "1.13.1",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "5.9.9",
"@react-native-community/viewpager": "3.3.0",
"@react-navigation/bottom-tabs": "5.5.1",
"@react-navigation/native": "5.5.0",
"@react-navigation/stack": "5.4.1",
Expand All @@ -58,6 +59,7 @@
"expo-web-browser": "8.3.1",
"formik": "2.1.5",
"i18n-js": "3.7.1",
"lodash": "^4.17.20",
"metro-config": "0.63.0",
"native-base": "2.13.8",
"parse": "2.14.0",
Expand All @@ -77,8 +79,7 @@
"react-redux": "7.2.0",
"redux": "4.0.5",
"redux-actions": "2.6.5",
"yup": "0.29.3",
"@react-native-community/viewpager": "3.3.0"
"yup": "0.29.3"
},
"devDependencies": {
"@babel/core": "7.10.2",
Expand Down

0 comments on commit 69f8b55

Please sign in to comment.