diff --git a/.versionrc.js b/.versionrc.js index a5505d40c..62dcb71ad 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -15,5 +15,17 @@ module.exports = { filename: 'app.json', updater: require.resolve('standard-version-expo/ios'), } - ] + ], + types: [ + { type: 'chore', section: 'Chores' }, + { type: 'ci', section: 'Pipeline Changes' }, + { type: 'docs', section: 'Documentation Changes' }, + { type: 'feat', section: 'New Features' }, + { type: 'fix', section: 'Bug fixes' }, + { type: 'perf', hidden: true }, + { type: 'refactor', section: 'Code Refactors' }, + { type: 'release', hidden: true }, + { type: 'style', hidden: true }, + { type: 'test', hidden: true }, + ], }; \ No newline at end of file diff --git a/App.js b/App.js index 0a1d18aa4..a43a76832 100644 --- a/App.js +++ b/App.js @@ -7,7 +7,7 @@ import { Provider as StoreProvider } from 'react-redux'; import MainNavigation from './components/MainNavigation'; import configureStore from './modules/state-management/configure-store'; -// import useCachedResources from './modules/cached-resources/useCachedResources'; +import useCachedResources from './modules/cached-resources/useCachedResources'; import { theme } from './modules/theme'; const store = configureStore(); @@ -17,11 +17,11 @@ if (Platform.OS === 'android') { } export default function App() { - // const isLoadingComplete = useCachedResources(); + const isLoadingComplete = useCachedResources(); - // if (!isLoadingComplete) { - // return null; - // } + if (!isLoadingComplete) { + return null; + } return ( diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f3fdf613..fe3233a1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,76 @@ 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. +## [8.4.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.4...v8.4.0) (2020-11-10) + + +### Bug fixes + +* add missing identification form fields and their translations ([a986b15](https://github.com/hopetambala/puente-reactnative-collect/commit/a986b15a8e09259abf08edbc54d86e707a2a1e4b)) + + +### Chores + +* add in all required fields for ID ([6e65760](https://github.com/hopetambala/puente-reactnative-collect/commit/6e657604ab8e45ae0449fdec10a375cb9f9e70a5)) +* linting error with map() ([31ac1fa](https://github.com/hopetambala/puente-reactnative-collect/commit/31ac1fab7aeb36a0a0d6f92fae0ed4f3a69acf8c)) +* update changelog generation ([ff9eada](https://github.com/hopetambala/puente-reactnative-collect/commit/ff9eadadfc78d81034894782f6a8a54c71d6e528)) + + +### Code Refactors + +* linting ([ecce1fb](https://github.com/hopetambala/puente-reactnative-collect/commit/ecce1fbb4dc96004f4f3b622cfd256c657415299)) + +### [8.3.4](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.3...v8.3.4) (2020-11-09) + + +### Bug fixes + +* stuff ([295998b](https://github.com/hopetambala/puente-reactnative-collect/commit/295998b3fe16ec42650f06074593db808151d91f)) + + +### Documentation changes + +* add ability to have better messages ([25d1d1e](https://github.com/hopetambala/puente-reactnative-collect/commit/25d1d1e3e5fa1eb5218ed51c9218bb8dab62438d)) + + +### Other chores + +* **release:** 8.3.3 ([58f73e7](https://github.com/hopetambala/puente-reactnative-collect/commit/58f73e71a2da77991516e632f31a08282a487cec)) +* readme ([d6b99c3](https://github.com/hopetambala/puente-reactnative-collect/commit/d6b99c3c66c708c6d8ceae0f225ea3ed405ee06c)) + +### [8.3.2](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.1...v8.3.2) (2020-11-08) + + +### Bug Fixes + +* [Android] Tab bar renders above keyboard ([10b12a7](https://github.com/hopetambala/puente-reactnative-collect/commit/10b12a7e31369af41c998d68a730c9ee0576e74f)), closes [/github.com/react-navigation/react-navigation/issues/6700#issuecomment-658893985](https://github.com/hopetambala//github.com/react-navigation/react-navigation/issues/6700/issues/issuecomment-658893985) + +### [8.3.1](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.0...v8.3.1) (2020-11-05) + + +### Bug Fixes + +* add a flatlist ([32a49f5](https://github.com/hopetambala/puente-reactnative-collect/commit/32a49f56c35610606c077dcde51c0f793d562588)) +* caching records ([5997c57](https://github.com/hopetambala/puente-reactnative-collect/commit/5997c57e46b1416e26df1f68a8f91064e6fc328b)) + +## [8.3.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.2.0...v8.3.0) (2020-11-05) + + +### Bug Fixes + +* problems with caching records on splash screen ([3690467](https://github.com/hopetambala/puente-reactnative-collect/commit/3690467c67d0ed8550f80559237457d218025925)) + +## [8.2.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.1.10...v8.2.0) (2020-11-04) + + +### Bug Fixes + +* ability to create roles ([ed40e28](https://github.com/hopetambala/puente-reactnative-collect/commit/ed40e2860afa14c43bbbbe57f4c995435b50fb8d)) +* missing translations ([1716a1f](https://github.com/hopetambala/puente-reactnative-collect/commit/1716a1f502de26b8f9bef338ec8079ce70284c11)) +* remove unused tests ([afcb5e9](https://github.com/hopetambala/puente-reactnative-collect/commit/afcb5e9913222864b75e1b8360476bc950319552)) +* spanish translation for household ([81d6801](https://github.com/hopetambala/puente-reactnative-collect/commit/81d68010d8e125038a1f0c9bc89ffc63a14c6510)) +* spanish translation on GDPR page ([cdafb81](https://github.com/hopetambala/puente-reactnative-collect/commit/cdafb81912ee78a01c2e30cb613cd54ab6eb6f2b)) + ### [8.1.10](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.1.9...v8.1.10) (2020-10-29) diff --git a/app.json b/app.json index b1ffd1b9e..6997eb1f9 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.1.10", + "version": "8.4.0", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,15 +23,16 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.1.10", + "buildNumber": "8.4.0", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080110, - "package": "io.ionic.starter1270348" + "versionCode": 380080400, + "package": "io.ionic.starter1270348", + "softwareKeyboardLayoutMode": "pan" }, "packagerOpts": { "config": "metro.config.js", diff --git a/components/FindResidents/index.js b/components/FindResidents/index.js index f3587d170..a8e21bf0c 100644 --- a/components/FindResidents/index.js +++ b/components/FindResidents/index.js @@ -1,12 +1,9 @@ import React, { useState, useEffect } from 'react'; -import { - View, FlatList -} from 'react-native'; +import { View, FlatList } from 'react-native'; +import { Headline, Searchbar, Button } from 'react-native-paper'; -import { - Headline, Searchbar -} from 'react-native-paper'; +import { Spinner } from 'native-base'; import { residentIDQuery } from '../../services/parse/crud'; @@ -25,23 +22,29 @@ const FindResidents = ({ const [data, setData] = useState([]); const [query, setQuery] = useState(''); const [residents, setResidents] = useState([]); + const [loading, setLoading] = useState(false); useEffect(() => { - fetchData(); - }, []); + fetchAsyncData(); + }, [organization]); - const fetchData = async () => { - await getData('residentData').then((residentData) => { + const fetchAsyncData = () => { + setLoading(true); + getData('residentData').then((residentData) => { if (residentData) { setData(residentData || []); setResidents(residentData.slice() || [].slice()); } + setLoading(false); }); + }; + const fetchData = async () => { + setLoading(true); const queryParams = { skip: 0, offset: 0, - limit: 10000, + limit: 100000, parseColumn: 'surveyingOrganization', parseParam: organization, }; @@ -49,11 +52,11 @@ const FindResidents = ({ let records = await residentIDQuery(queryParams); records = JSON.parse(JSON.stringify(records)); - if (data !== records) { - storeData(records, 'residentData'); - setData(records); - setResidents(records.slice()); - } + storeData(records, 'residentData'); + + setData(records); + setResidents(records.slice()); + setLoading(false); }; const filterList = () => data.filter( @@ -101,6 +104,7 @@ const FindResidents = ({ onChangeText={onChangeSearch} value={query} /> + )} @@ -113,6 +117,8 @@ const FindResidents = ({ /> ))} */} + {loading + && } {!selectPerson && ( @@ -123,6 +129,7 @@ const FindResidents = ({ /> )} + {selectPerson && ( ( // you can change the view you want to show in suggestion from here - { - this.setState({ query: item }); - formikProps.setFieldValue(formikKey, item); - }} + { + this.setState({ query: item }); + formikProps.setFieldValue(formikKey, item); + }} > {item} @@ -104,19 +106,20 @@ export default class AutoFill extends Component { const styles = StyleSheet.create({ container: { - backgroundColor: '#F5FCFF', + // backgroundColor: '#F5FCFF', flex: 1, padding: 16, - marginTop: 40, + // marginTop: 40, marginBottom: 40, }, autocompleteContainer: { backgroundColor: '#ffffff', - borderWidth: 0, + borderWidth: 0 }, descriptionContainer: { flex: 1, justifyContent: 'center', + borderRadius: 20 }, itemText: { fontSize: 15, diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 3e045b191..4fd64a614 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -15,12 +15,15 @@ import PaperButton from '../../Button'; import { theme, layout } from '../../../modules/theme'; import styles from './index.style'; +import I18n from '../../../modules/i18n'; + const PaperInputPicker = ({ - data, formikProps, scrollViewScroll, setScrollViewScroll, surveyingOrganization, ...rest + data, formikProps, scrollViewScroll, setScrollViewScroll, surveyingOrganization, + customForm, ...rest }) => { const { label, formikKey, fieldType } = data; const { - handleChange, handleBlur, touched, errors, setFieldValue, values + handleChange, handleBlur, errors, setFieldValue, values } = formikProps; const [location, setLocation] = React.useState({ latitude: 5, longitude: 10, altitude: 0 }); @@ -33,12 +36,14 @@ const PaperInputPicker = ({ setLocation({ latitude, longitude, altitude }); }; + const translatedLabel = customForm ? label : I18n.t(label); + return ( <> {fieldType === 'input' && ( - {touched[formikKey] && errors[formikKey]} + {errors[formikKey]} )} {fieldType === 'numberInput' && ( - {touched[formikKey] && errors[formikKey]} + {errors[formikKey]} )} {fieldType === 'select' && ( - {label} + {translatedLabel} {data.options.map((result) => ( @@ -80,7 +85,7 @@ const PaperInputPicker = ({ mode="contained" onPress={() => setFieldValue(formikKey, result.value)} > - {result.label} + {customForm ? result.label : I18n.t(result.label)} )} {/* non-selected value */} @@ -91,12 +96,17 @@ const PaperInputPicker = ({ mode="outlined" onPress={() => setFieldValue(formikKey, result.value)} > - {result.label} + + {customForm ? result.label : I18n.t(result.label)} + )} ))} + + {errors[formikKey]} + )} {fieldType === 'autofill' && ( @@ -108,6 +118,9 @@ const PaperInputPicker = ({ scrollViewScroll={scrollViewScroll} setScrollViewScroll={setScrollViewScroll} /> + + {errors[formikKey]} + )} {fieldType === 'geolocation' && ( @@ -134,6 +147,9 @@ const PaperInputPicker = ({ {location.longitude} + + {errors[formikKey]} + )} @@ -149,7 +165,7 @@ const PaperInputPicker = ({ )} {fieldType === 'header' && ( - {label} + {translatedLabel} @@ -157,20 +173,20 @@ const PaperInputPicker = ({ )} {fieldType === 'multiInputRow' && ( - {label} + {translatedLabel} {data.options.map((result) => ( - + - {touched[result] && errors[result]} + {errors[customForm ? result : I18n.t(result)]} ))} @@ -179,21 +195,21 @@ const PaperInputPicker = ({ )} {fieldType === 'multiInputRowNum' && ( - {label} + {translatedLabel} {data.options.map((result) => ( - + - {touched[result] && errors[result]} + {errors[result.value]} ))} diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js new file mode 100644 index 000000000..55a4ae4c1 --- /dev/null +++ b/components/FormikFields/YupValidation/index.js @@ -0,0 +1,33 @@ +import * as yup from 'yup'; +import I18n from '../../../modules/i18n'; + +export default function yupValidationPicker(fields) { + let validationSchema = yup.object().shape({}); + fields.forEach((result) => { + const { + label, formikKey, fieldType, validation, options + } = result; + if (validation) { + if (fieldType === 'input' || fieldType === 'numberInput' || fieldType === 'select' + || fieldType === ' autofill') { + const resultSchemaInput = {}; + resultSchemaInput[formikKey] = yup.string().label(I18n.t(label)).required(); + const resultObjectInput = yup.object().shape(resultSchemaInput); + validationSchema = validationSchema.concat(resultObjectInput); + } else if (fieldType === 'geolocation') { + const resultSchemaGeo = {}; + resultSchemaGeo[formikKey] = yup.object().label(I18n.t(label)).required(); + const resultObjectGeo = yup.object().shape(resultSchemaGeo); + validationSchema = validationSchema.concat(resultObjectGeo); + } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { + options.forEach((option) => { + const resultSchemaMultiInput = {}; + resultSchemaMultiInput[option.value] = yup.string().label(option.value).required(); + const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); + validationSchema = validationSchema.concat(resultObjectMultiInput); + }); + } + } + }); + return validationSchema; +} diff --git a/components/MapView/index.js b/components/MapView/index.js index a76f18990..90418201f 100644 --- a/components/MapView/index.js +++ b/components/MapView/index.js @@ -51,7 +51,7 @@ const Maps = ({ organization }) => { }); }; - const retriveAsyncMarkers = async () => { + const retriveAsyncMarkers = () => { getData('residentData').then((residentData) => { if (residentData) { setMarkers(residentData); @@ -59,7 +59,7 @@ const Maps = ({ organization }) => { }); }; - const retrieveMarkers = async () => { + const retrieveMarkers = () => { setLoading(true); const queryParams = { skip: 0, diff --git a/components/ResidentIdSearchbar/index.js b/components/ResidentIdSearchbar/index.js index abbf38837..ef59b3d01 100644 --- a/components/ResidentIdSearchbar/index.js +++ b/components/ResidentIdSearchbar/index.js @@ -1,10 +1,11 @@ import React, { useState, useEffect } from 'react'; -import { View } from 'react-native'; +import { View, FlatList } from 'react-native'; import { Headline, Button, Searchbar } from 'react-native-paper'; import { Spinner } from 'native-base'; import { residentIDQuery } from '../../services/parse/crud'; +import { getData } from '../../modules/async-storage'; import I18n from '../../modules/i18n'; import ResidentCard from '../FindResidents/Resident/ResidentCard'; @@ -18,15 +19,26 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = const [loading, setLoading] = useState(false); useEffect(() => { - fetchData(); + fetchAsyncData(); }, [surveyingOrganization]); + const fetchAsyncData = () => { + setLoading(true); + getData('residentData').then((residentData) => { + if (residentData) { + setData(residentData || []); + setResidents(residentData.slice() || [].slice()); + } + setLoading(false); + }); + }; + const fetchData = async () => { setLoading(true); const queryParams = { skip: 0, offset: 0, - limit: 10000, + limit: 100000, parseColumn: 'surveyingOrganization', parseParam: surveyingOrganization, }; @@ -63,6 +75,10 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = setQuery(''); }; + const renderItem = ({ item }) => ( + + ); + return ( {I18n.t('residentIdSearchbar.searchIndividual')} @@ -71,14 +87,25 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = onChangeText={onChangeSearch} value={query} /> + {loading && } - {query !== '' && filterList(residents).map((listItem,) => ( + {/* {query !== '' && filterList(residents).map((listItem,) => ( - + - ))} + ))} */} + + {query !== '' && ( + item.objectId} + /> + )} {surveyee && surveyee.objectId && ( diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 7b3ba1077..0e0140e8b 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -1,67 +1,78 @@ -import I18n from '../../../../../modules/i18n'; - const configArray = [ { - label: I18n.t('identificationForm.demographics'), + label: 'identificationForm.demographics', fieldType: 'header', formikKey: 'none_bi', - }, { - label: I18n.t('global.fName'), + label: 'global.fName', formikKey: 'fname', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { - label: I18n.t('global.lName'), + label: 'global.lName', formikKey: 'lname', value: '', - fieldType: 'input' - + fieldType: 'input', + validation: true }, { - label: I18n.t('identificationForm.nickname'), + label: 'identificationForm.nickname', formikKey: 'nickname', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('identificationForm.dob.label'), + label: 'identificationForm.dob.label', formikKey: 'dob', value: '', fieldType: 'multiInputRowNum', options: [ - I18n.t('identificationForm.dob.month'), - I18n.t('identificationForm.dob.day'), - I18n.t('identificationForm.dob.year') - ] + { + label: 'identificationForm.dob.month', + value: 'Month' + }, + { + label: 'identificationForm.dob.day', + value: 'Day' + }, + { + label: 'identificationForm.dob.year', + value: 'Year' + } + ], + validation: false }, { - label: I18n.t('identificationForm.sex.label'), + label: 'identificationForm.sex.label', formikKey: 'sex', value: '', fieldType: 'select', options: [ { - label: I18n.t('identificationForm.sex.male'), + label: 'identificationForm.sex.male', value: 'male' }, { - label: I18n.t('identificationForm.sex.female'), + label: 'identificationForm.sex.female', value: 'female' }, { - label: I18n.t('identificationForm.sex.notSay'), + label: 'identificationForm.sex.notSay', value: 'prefer_not_to_say' } - ] + ], + validation: true }, { - label: I18n.t('identificationForm.telephone'), + label: 'identificationForm.telephone', formikKey: 'telephoneNumber', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: false }, // { // label: 'Demographic Information', @@ -70,146 +81,145 @@ const configArray = [ // }, { - label: I18n.t('identificationForm.marriageStatus.label'), + label: 'identificationForm.marriageStatus.label', formikKey: 'marriageStatus', value: '', fieldType: 'select', options: [ { - label: I18n.t('identificationForm.marriageStatus.single'), + label: 'identificationForm.marriageStatus.single', value: 'single' }, { - label: I18n.t('identificationForm.marriageStatus.married'), + label: 'identificationForm.marriageStatus.married', value: 'married' }, { - label: I18n.t('identificationForm.marriageStatus.cohabitation'), + label: 'identificationForm.marriageStatus.cohabitation', value: 'free_union' }, { - label: I18n.t('identificationForm.marriageStatus.widow'), + label: 'identificationForm.marriageStatus.widow', value: 'widow' } - ] + ], + validation: true }, { - label: I18n.t('identificationForm.occupation'), + label: 'identificationForm.occupation', formikKey: 'occupation', value: '', - fieldType: 'input' - + fieldType: 'input', + validation: false }, { - label: I18n.t('identificationForm.educationLevel.label'), + label: 'identificationForm.educationLevel.label', formikKey: 'educationLevel', value: '', fieldType: 'select', options: [ { - label: I18n.t('identificationForm.educationLevel.lessPrim'), + label: 'identificationForm.educationLevel.lessPrim', value: 'lessThanprimary' }, { - label: I18n.t('identificationForm.educationLevel.prim'), + label: 'identificationForm.educationLevel.prim', value: 'primary' }, { - label: I18n.t('identificationForm.educationLevel.someHS'), + label: 'identificationForm.educationLevel.someHS', value: 'someHighSchool' }, { - label: I18n.t('identificationForm.educationLevel.hs'), + label: 'identificationForm.educationLevel.hs', value: 'highschool' }, { - label: I18n.t('identificationForm.educationLevel.someCollege'), + label: 'identificationForm.educationLevel.someCollege', value: 'someCollege' }, { - label: I18n.t('identificationForm.educationLevel.college'), + label: 'identificationForm.educationLevel.college', value: 'college' }, - ] + ], + validation: true }, { - label: I18n.t('identificationForm.location'), + label: 'identificationForm.location', fieldType: 'header', formikKey: 'none_location', + validation: false }, { - label: I18n.t('global.commName'), + label: 'global.commName', formikKey: 'communityname', value: '', fieldType: 'autofill', - parameter: 'Communities' + parameter: 'Communities', + validation: false }, { - label: I18n.t('global.city'), + label: 'global.city', formikKey: 'city', value: '', fieldType: 'autofill', - parameter: 'City' + parameter: 'City', + validation: false + }, + { + label: 'identificationForm.province', + formikKey: 'province', + value: '', + fieldType: 'input', + validation: true }, - // { - // label: "Province", - // formikKey: 'province', - // value: "" - // }, { - label: I18n.t('identificationForm.insurance'), + label: 'identificationForm.insurance', fieldType: 'header', formikKey: 'none_insurance', - }, { - label: I18n.t('identificationForm.insNumber'), + label: 'identificationForm.insNumber', formikKey: 'insuranceNumber', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: false }, { - label: I18n.t('identificationForm.insProvider'), + label: 'identificationForm.insProvider', formikKey: 'insuranceProvider', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('identificationForm.clinicProvider'), + label: 'identificationForm.clinicProvider', formikKey: 'clinicProvider', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, - // { - // label: "Cedula Number", - // formikKey: 'cedulaNumber', - // value: "" - // }, { + label: 'identificationForm.cedulaNumber', + formikKey: 'cedulaNumber', + value: '', + fieldType: 'input', + validation: false + }, + { + label: 'identificationForm.location', formikKey: 'location', value: {}, - fieldType: 'geolocation' + fieldType: 'geolocation', + validation: false }, - // { - // label: 'Latitude', - // formikKey: 'latitude', - // value: 0, - // fieldType: 'geolocation' - // }, - // { - // label: 'Longitude', - // formikKey: 'longitude', - // value: 0, - // fieldType: 'geolocation' - // }, { - label: I18n.t('identificationForm.household'), + label: 'identificationForm.household', fieldType: 'header', - formikKey: 'none_household', - }, { - label: I18n.t('identificationForm.household'), + label: 'identificationForm.household', formikKey: 'householdId', value: '', fieldType: 'household' diff --git a/domains/DataCollection/Forms/IdentificationForm/index.js b/domains/DataCollection/Forms/IdentificationForm/index.js index 35a49b427..a5c6955e4 100644 --- a/domains/DataCollection/Forms/IdentificationForm/index.js +++ b/domains/DataCollection/Forms/IdentificationForm/index.js @@ -21,6 +21,7 @@ import configArray from './config/config'; import I18n from '../../../../modules/i18n'; import PaperInputPicker from '../../../../components/FormikFields/PaperInputPicker'; +import yupValidationPicker from '../../../../components/FormikFields/YupValidation'; // const validationSchema = yup.object().shape({ // fname: yup @@ -42,6 +43,8 @@ const IdentificationForm = ({ backgroundPostPatient(); }, 10000); + setValidationSchema(yupValidationPicker(configArray)); + return () => { clearInterval(interval); }; @@ -49,6 +52,7 @@ const IdentificationForm = ({ const [inputs, setInputs] = useState({}); const [photoFile, setPhotoFile] = useState('State Photo String'); + const [validationSchema, setValidationSchema] = useState(); useEffect(() => { setInputs(configArray); @@ -102,7 +106,10 @@ const IdentificationForm = ({ } }); }} - // validationSchema={validationSchema} + validationSchema={validationSchema} + // only validate on submit, errors persist after fixing + validateOnBlur={false} + validateOnChange={false} > {(formikProps) => ( @@ -114,6 +121,7 @@ const IdentificationForm = ({ surveyingOrganization={surveyingOrganization} scrollViewScroll={scrollViewScroll} setScrollViewScroll={setScrollViewScroll} + customForm={false} // placeholder="Ana" /> diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js index fe4f4ead1..5d7c1a30b 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js @@ -1,366 +1,386 @@ -import I18n from '../../../../../modules/i18n'; - const configArray = { class: 'HistoryEnvironmentalHealth', - name: I18n.t('environmentalHealth.name'), + name: 'environmentalHealth.name', + customForm: false, fields: [{ - label: I18n.t('environmentalHealth.yearsLived.community'), + label: 'environmentalHealth.yearsLived.community', formikKey: 'yearsLivedinthecommunity', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.yearsLived.less1'), + label: 'environmentalHealth.yearsLived.less1', value: 'lessThan1' }, { - label: I18n.t('environmentalHealth.yearsLived.1_2'), + label: 'environmentalHealth.yearsLived.1_2', value: '1_2' }, { - label: I18n.t('environmentalHealth.yearsLived.3_4'), + label: 'environmentalHealth.yearsLived.3_4', value: '3_4' }, { - label: I18n.t('environmentalHealth.yearsLived.3_4'), + label: 'environmentalHealth.yearsLived.3_4', value: '5_10' }, { - label: I18n.t('environmentalHealth.yearsLived.moreThan10'), + label: 'environmentalHealth.yearsLived.moreThan10', value: 'moreThan10' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.yearsLived.house'), + label: 'environmentalHealth.yearsLived.house', formikKey: 'yearsLivedinThisHouse', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.yearsLived.less1'), + label: 'environmentalHealth.yearsLived.less1', value: 'lessThan1' }, { - label: I18n.t('environmentalHealth.yearsLived.1_2'), + label: 'environmentalHealth.yearsLived.1_2', value: '1_2' }, { - label: I18n.t('environmentalHealth.yearsLived.3_4'), + label: 'environmentalHealth.yearsLived.3_4', value: '3_4' }, { - label: I18n.t('environmentalHealth.yearsLived.3_4'), + label: 'environmentalHealth.yearsLived.3_4', value: '5_10' }, { - label: I18n.t('environmentalHealth.yearsLived.moreThan10'), + label: 'environmentalHealth.yearsLived.moreThan10', value: 'moreThan10' } - ] - + ], + validation: false }, { - label: I18n.t('environmentalHealth.biggestProblemComm'), + label: 'environmentalHealth.biggestProblemComm', formikKey: 'biggestproblemofcommunity', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('environmentalHealth.waterAccess.label'), + label: 'environmentalHealth.waterAccess.label', formikKey: 'waterAccess', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.waterAccess.everyday'), + label: 'environmentalHealth.waterAccess.everyday', value: 'everyday' }, { - label: I18n.t('environmentalHealth.waterAccess.4_6'), + label: 'environmentalHealth.waterAccess.4_6', value: '4-6AWeek' }, { - label: I18n.t('environmentalHealth.waterAccess.2_3'), + label: 'environmentalHealth.waterAccess.2_3', value: '2-3AWeek' }, { - label: I18n.t('environmentalHealth.waterAccess.1perWeek'), + label: 'environmentalHealth.waterAccess.1perWeek', value: '1AWeek' }, { - label: I18n.t('environmentalHealth.waterAccess.1perMonth'), + label: 'environmentalHealth.waterAccess.1perMonth', value: '1AMonth' }, { - label: I18n.t('environmentalHealth.waterAccess.never'), + label: 'environmentalHealth.waterAccess.never', value: 'Never' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.typeOfWater.label'), + label: 'environmentalHealth.typeOfWater.label', formikKey: 'typeofWaterdoyoudrink', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.typeOfWater.bottled'), + label: 'environmentalHealth.typeOfWater.bottled', value: 'bottled' }, { - label: I18n.t('environmentalHealth.typeOfWater.tap'), + label: 'environmentalHealth.typeOfWater.tap', value: 'tap' }, { - label: I18n.t('environmentalHealth.typeOfWater.filtered'), + label: 'environmentalHealth.typeOfWater.filtered', value: 'filtered' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.bathroomAccess'), + label: 'environmentalHealth.bathroomAccess', formikKey: 'bathroomAccess', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.latrineAccess'), + label: 'environmentalHealth.latrineAccess', formikKey: 'latrineAccess', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.clinicAccess'), + label: 'environmentalHealth.clinicAccess', formikKey: 'clinicAccess', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.medicalProblemsGo'), + label: 'environmentalHealth.medicalProblemsGo', formikKey: 'medicalproblemswheredoyougo', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('environmentalHealth.dentalProblemsGo'), + label: 'environmentalHealth.dentalProblemsGo', formikKey: 'dentalproblemswheredoyougo', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('environmentalHealth.timesPerWeekTrash'), + label: 'environmentalHealth.timesPerWeekTrash', formikKey: 'timesperweektrashcollected', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: false }, { - label: I18n.t('environmentalHealth.trashBetweenPickups'), + label: 'environmentalHealth.trashBetweenPickups', formikKey: 'wheretrashleftbetweenpickups', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('environmentalHealth.houseOwnership'), + label: 'environmentalHealth.houseOwnership', formikKey: 'houseownership', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.floorCondition.label'), + label: 'environmentalHealth.floorCondition.label', formikKey: 'conditionoFloorinyourhouse', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.floorCondition.dirtFloorPoor'), + label: 'environmentalHealth.floorCondition.dirtFloorPoor', value: 'dirtPoor' }, { - label: I18n.t('environmentalHealth.floorCondition.dirtFloorWork'), + label: 'environmentalHealth.floorCondition.dirtFloorWork', value: 'dirtWorking' }, { - label: I18n.t('environmentalHealth.floorCondition.cementPoor'), + label: 'environmentalHealth.floorCondition.cementPoor', value: 'cementPoor' }, { - label: I18n.t('environmentalHealth.floorCondition.cementWorking'), + label: 'environmentalHealth.floorCondition.cementWorking', value: 'cementWorking' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.roofCondition.label'), + label: 'environmentalHealth.roofCondition.label', formikKey: 'conditionoRoofinyourhouse', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.roofCondition.poor'), + label: 'environmentalHealth.roofCondition.poor', value: 'poor' }, { - label: I18n.t('environmentalHealth.roofCondition.work'), + label: 'environmentalHealth.roofCondition.work', value: 'working' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.typeStove.label'), + label: 'environmentalHealth.typeStove.label', formikKey: 'stoveType', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.typeStove.constructedVentilation'), + label: 'environmentalHealth.typeStove.constructedVentilation', value: 'cementStove-Ventilation' }, { - label: I18n.t('environmentalHealth.typeStove.stoveTop'), + label: 'environmentalHealth.typeStove.stoveTop', value: 'stoveTop' }, { - label: I18n.t('environmentalHealth.typeStove.openFire'), + label: 'environmentalHealth.typeStove.openFire', value: 'openfire-noVentilation' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.houseMaterials.label'), + label: 'environmentalHealth.houseMaterials.label', formikKey: 'houseMaterial', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.houseMaterials.zinc'), + label: 'environmentalHealth.houseMaterials.zinc', value: 'zinc' }, { - label: I18n.t('environmentalHealth.houseMaterials.wood'), + label: 'environmentalHealth.houseMaterials.wood', value: 'wood' }, { - label: I18n.t('environmentalHealth.houseMaterials.partBlock_partWood'), + label: 'environmentalHealth.houseMaterials.partBlock_partWood', value: 'partBlock_partWood' }, { - label: I18n.t('environmentalHealth.houseMaterials.block'), + label: 'environmentalHealth.houseMaterials.block', value: 'block' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.electricityAccess.label'), + label: 'environmentalHealth.electricityAccess.label', formikKey: 'electricityAccess', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.electricityAccess.never'), + label: 'environmentalHealth.electricityAccess.never', value: 'never' }, { - label: I18n.t('environmentalHealth.electricityAccess.sometimes'), + label: 'environmentalHealth.electricityAccess.sometimes', value: 'sometimes' }, { - label: I18n.t('environmentalHealth.electricityAccess.always'), + label: 'environmentalHealth.electricityAccess.always', value: 'always' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.foodSecurity'), + label: 'environmentalHealth.foodSecurity', formikKey: 'foodSecurity', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' }, { - label: I18n.t('global.notSure'), + label: 'global.notSure', value: 'not_sure' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.govAssistance.label'), + label: 'environmentalHealth.govAssistance.label', formikKey: 'govAssistance', value: '', fieldType: 'select', options: [ { - label: I18n.t('environmentalHealth.govAssistance.foodStamps'), + label: 'environmentalHealth.govAssistance.foodStamps', value: 'solidaridad' }, { - label: I18n.t('environmentalHealth.govAssistance.adultLiteracy'), + label: 'environmentalHealth.govAssistance.adultLiteracy', value: 'aprendiendo' }, { - label: I18n.t('global.other'), + label: 'global.other', value: 'other' } - ] + ], + validation: false }, { - label: I18n.t('environmentalHealth.numberIndividualsHouse'), + label: 'environmentalHealth.numberIndividualsHouse', formikKey: 'numberofIndividualsLivingintheHouse', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: false }, { - label: I18n.t('environmentalHealth.numberChildrenUnder5'), + label: 'environmentalHealth.numberChildrenUnder5', formikKey: 'numberofChildrenLivinginHouseUndertheAgeof5', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: false }, ] }; diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js index 628b2da92..dc98f36b4 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js @@ -1,290 +1,306 @@ -import I18n from '../../../../../modules/i18n'; - const configArray = { class: 'EvaluationMedical', - name: I18n.t('evaluationMedical.name'), + name: 'evaluationMedical.name', + customForm: false, fields: [ { - label: I18n.t('evaluationMedical.chronicHypertension'), + label: 'evaluationMedical.chronicHypertension', formikKey: 'chronic_condition_hypertension', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.chronicDiabetes'), + label: 'evaluationMedical.chronicDiabetes', formikKey: 'chronic_condition_diabetes', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.chronicOther'), + label: 'evaluationMedical.chronicOther', formikKey: 'chronic_condition_other', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.doctor'), + label: 'evaluationMedical.doctor', formikKey: 'seen_doctor', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('global.notes'), + label: 'global.notes', formikKey: 'received_treatment_notes', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('evaluationMedical.statusOfHealth.label'), + label: 'evaluationMedical.statusOfHealth.label', formikKey: 'received_treatment_description', value: '', fieldType: 'select', options: [ { - label: I18n.t('evaluationMedical.statusOfHealth.receivingNoSupport'), + label: 'evaluationMedical.statusOfHealth.receivingNoSupport', value: 'receiving_treatment_no_support_required' }, { - label: I18n.t('evaluationMedical.statusOfHealth.receivingSupport'), + label: 'evaluationMedical.statusOfHealth.receivingSupport', value: 'receiving_treatment_support_required' }, { - label: I18n.t('evaluationMedical.statusOfHealth.awaitingNoSupport'), + label: 'evaluationMedical.statusOfHealth.awaitingNoSupport', value: 'awaiting_treatment_support_required' }, { - label: I18n.t('evaluationMedical.statusOfHealth.noTreatmentSupport'), + label: 'evaluationMedical.statusOfHealth.noTreatmentSupport', value: 'no_treatment_support_required' }, { - label: I18n.t('global.other'), + label: 'global.other', value: 'other' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.partOfBody.label'), + label: 'evaluationMedical.partOfBody.label', formikKey: 'part_of_body', value: '', fieldType: 'select', options: [ { - label: I18n.t('evaluationMedical.partOfBody.bonesJoints'), + label: 'evaluationMedical.partOfBody.bonesJoints', value: 'bones_or_joints' }, { - label: I18n.t('evaluationMedical.partOfBody.eyes'), + label: 'evaluationMedical.partOfBody.eyes', value: 'eyes' }, { - label: I18n.t('evaluationMedical.partOfBody.earsNoseThroat'), + label: 'evaluationMedical.partOfBody.earsNoseThroat', value: 'ear_nose_throat' }, { - label: I18n.t('evaluationMedical.partOfBody.skin'), + label: 'evaluationMedical.partOfBody.skin', value: 'skin' }, { - label: I18n.t('evaluationMedical.partOfBody.headMental'), + label: 'evaluationMedical.partOfBody.headMental', value: 'head_mental_issue' }, { - label: I18n.t('evaluationMedical.partOfBody.stomachIntestines'), + label: 'evaluationMedical.partOfBody.stomachIntestines', value: 'stomach_intestines' }, { - label: I18n.t('evaluationMedical.partOfBody.bladderUrinary'), + label: 'evaluationMedical.partOfBody.bladderUrinary', value: 'bladder_urinary' }, { - label: I18n.t('evaluationMedical.partOfBody.reproductiveOrgans'), + label: 'evaluationMedical.partOfBody.reproductiveOrgans', value: 'reproductive_organs' }, { - label: I18n.t('evaluationMedical.partOfBody.nutritionIssues'), + label: 'evaluationMedical.partOfBody.nutritionIssues', value: 'nutrition' }, { - label: I18n.t('evaluationMedical.partOfBody.---'), + label: 'evaluationMedical.partOfBody.---', value: '' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.partOfBodyDescription'), + label: 'evaluationMedical.partOfBodyDescription', formikKey: 'part_of_body_description', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('evaluationMedical.duration.label'), + label: 'evaluationMedical.duration.label', formikKey: 'duration', value: '', fieldType: 'select', options: [ { - label: I18n.t('evaluationMedical.duration.lastMonth'), + label: 'evaluationMedical.duration.lastMonth', value: 'within_last_month' }, { - label: I18n.t('evaluationMedical.duration.lastYear'), + label: 'evaluationMedical.duration.lastYear', value: 'within_last_year' }, { - label: I18n.t('evaluationMedical.duration.last5Years'), + label: 'evaluationMedical.duration.last5Years', value: 'within_last_5_years' }, { - label: I18n.t('evaluationMedical.duration.past5Years'), + label: 'evaluationMedical.duration.past5Years', value: 'after_5_years' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.problemSuddenness.label'), + label: 'evaluationMedical.problemSuddenness.label', formikKey: 'trauma_induced', value: '', fieldType: 'select', options: [ { - label: I18n.t('evaluationMedical.problemSuddenness.suddenTrauma'), + label: 'evaluationMedical.problemSuddenness.suddenTrauma', value: 'suddenly_due_to_trauma' }, { - label: I18n.t('evaluationMedical.problemSuddenness.suddenNoTrauma'), + label: 'evaluationMedical.problemSuddenness.suddenNoTrauma', value: 'suddenly_but_not_due_to_trauma' }, { - label: I18n.t('evaluationMedical.problemSuddenness.gradually'), + label: 'evaluationMedical.problemSuddenness.gradually', value: 'gradually' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.progressionOfCondition.label'), + label: 'evaluationMedical.progressionOfCondition.label', formikKey: 'condition_progression', value: '', fieldType: 'select', options: [ { - label: I18n.t('evaluationMedical.progressionOfCondition.improving'), + label: 'evaluationMedical.progressionOfCondition.improving', value: 'improve' }, { - label: I18n.t('evaluationMedical.progressionOfCondition.worsening'), + label: 'evaluationMedical.progressionOfCondition.worsening', value: 'worsen' }, { - label: I18n.t('evaluationMedical.progressionOfCondition.constant'), + label: 'evaluationMedical.progressionOfCondition.constant', value: 'constant' } - ] + ], + validation: false }, { - label: I18n.t('global.notes'), + label: 'global.notes', formikKey: 'notes', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('evaluationMedical.generalHealthConsult'), + label: 'evaluationMedical.generalHealthConsult', formikKey: 'AssessmentandEvaluation', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.surgicalRequired'), + label: 'evaluationMedical.surgicalRequired', formikKey: 'AssessmentandEvaluation_Surgical', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.yourGuess'), + label: 'evaluationMedical.yourGuess', formikKey: 'AssessmentandEvaluation_Surgical_Guess', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, { - label: I18n.t('evaluationMedical.immediateFollowupRequired'), + label: 'evaluationMedical.immediateFollowupRequired', formikKey: 'immediate_follow_up', value: '', fieldType: 'select', options: [ { - label: I18n.t('global.yes'), + label: 'global.yes', value: 'Yes' }, { - label: I18n.t('global.no'), + label: 'global.no', value: 'No' } - ] + ], + validation: false }, { - label: I18n.t('evaluationMedical.plan'), + label: 'evaluationMedical.plan', formikKey: 'planOfAction', value: '', - fieldType: 'input' + fieldType: 'input', + validation: false }, ] }; diff --git a/domains/DataCollection/Forms/SupplementaryForm/index.js b/domains/DataCollection/Forms/SupplementaryForm/index.js index a2937ee02..42221c3e1 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/index.js +++ b/domains/DataCollection/Forms/SupplementaryForm/index.js @@ -15,6 +15,7 @@ import envConfig from './configs/envhealth.config'; import medConfig from './configs/medical-evaluation.config'; import I18n from '../../../../modules/i18n'; import PaperInputPicker from '../../../../components/FormikFields/PaperInputPicker'; +import yupValidationPicker from '../../../../components/FormikFields/YupValidation'; const SupplementaryForm = ({ navigation, selectedForm, setSelectedForm, surveyee, surveyingUser, surveyingOrganization, @@ -22,6 +23,7 @@ const SupplementaryForm = ({ }) => { const [config, setConfig] = useState({}); const [photoFile, setPhotoFile] = useState('State Photo String'); + const [validationSchema, setValidationSchema] = useState(); const toRoot = () => { navigation.navigate('Root'); @@ -29,8 +31,14 @@ const SupplementaryForm = ({ }; useEffect(() => { - if (selectedForm === 'env') setConfig(envConfig); - if (selectedForm === 'med-eval') setConfig(medConfig); + if (selectedForm === 'env') { + setConfig(envConfig); + setValidationSchema(yupValidationPicker(envConfig.fields)); + } + if (selectedForm === 'med-eval') { + setConfig(medConfig); + setValidationSchema(yupValidationPicker(medConfig.fields)); + } if (selectedForm === 'custom') setConfig(customForm); }, [selectedForm, config]); @@ -74,6 +82,9 @@ const SupplementaryForm = ({ }, 1000); }); }} + validationSchema={validationSchema} + // validateOnBlur={false} + // validateOnChange={false} > {(formikProps) => ( @@ -82,6 +93,7 @@ const SupplementaryForm = ({ ))} diff --git a/domains/DataCollection/index.js b/domains/DataCollection/index.js index 85a9532be..0a5823978 100644 --- a/domains/DataCollection/index.js +++ b/domains/DataCollection/index.js @@ -17,6 +17,7 @@ import FindResidents from '../../components/FindResidents'; import { deleteData, getData } from '../../modules/async-storage'; import { layout } from '../../modules/theme'; +import I18n from '../../modules/i18n'; import { customQueryService } from '../../services/parse/crud'; import { retrieveSignOutFunction } from '../../services/parse/auth'; @@ -27,8 +28,6 @@ import NewRecordSVG from '../../assets/icons/New-Record-icon.svg'; import styles from './index.styles'; -import I18n from '../../modules/i18n'; - const puenteForms = [ { tag: 'id', name: 'Resident ID' }, { tag: 'env', name: 'Environmental Health' }, diff --git a/modules/cached-resources/useCachedResources.js b/modules/cached-resources/useCachedResources.js index 43c7ab348..5b66bada7 100644 --- a/modules/cached-resources/useCachedResources.js +++ b/modules/cached-resources/useCachedResources.js @@ -8,7 +8,7 @@ const fetchResidentData = async (surveyingOrganization) => { const queryParams = { skip: 0, offset: 0, - limit: 10000, + limit: 100000, parseColumn: 'surveyingOrganization', parseParam: surveyingOrganization, }; @@ -29,7 +29,7 @@ export default function useCachedResources() { await getData('organization').then(async (org) => { if (org) { const residentData = await fetchResidentData(org); - storeData(residentData, 'residentData'); + storeData(residentData || [], 'residentData'); } }); } catch (e) { diff --git a/modules/i18n/english/en.json b/modules/i18n/english/en.json index e490c790e..b8423cb6a 100644 --- a/modules/i18n/english/en.json +++ b/modules/i18n/english/en.json @@ -28,10 +28,10 @@ "toSpanish": "Change Language to Spanish", "errorTerms": "Error, terms and service need to be agreed to.", "errorPassword": "Error, your passwords do not match.", - "usernameError":"Sign up attempt failed.\n\nYou might have attempted to sign up with a username (email/phone number) that has been previously registered with another account.\n\nPlease contact your supervisor if you believe this is an error." + "usernameError": "Sign up attempt failed.\n\nYou might have attempted to sign up with a username (email/phone number) that has been previously registered with another account.\n\nPlease contact your supervisor if you believe this is an error." }, "signIn": { - "username": "Username", + "username": "Email or Phone Number", "password": "Password", "showPassword": "Show Password", "login": "Log-In", @@ -110,7 +110,9 @@ "someCollege": "Some College", "college": "College" }, + "cedulaNumber": "License Number", "location": "Location", + "province": "Province", "insurance": "Insurance", "insNumber": "Insurance Number", "insProvider": "Insurance Provider", diff --git a/modules/i18n/spanish/es.json b/modules/i18n/spanish/es.json index 741b71110..f99d644b9 100644 --- a/modules/i18n/spanish/es.json +++ b/modules/i18n/spanish/es.json @@ -31,7 +31,7 @@ "usernameError": "Sign up attempt failed.\n\nYou might have attempted to sign up with a username (email/phone number) that has been previously registered with another account.\n\nPlease contact your supervisor if you believe this is an error." }, "signIn": { - "username": "Nombre de usuario", + "username": "Número de teléfono o Correo electronico ", "password": "Contraseña", "showPassword": "Mostrar contraseña", "login": "Iniciar sesión", @@ -112,9 +112,11 @@ "college": "Universidad terminada", "someCollege": "Alguna educación superior" }, + "cedulaNumber": "Número de cedula", "location": "Ubicación", + "province": "Provincia", "insurance": "Seguro", - "insNumber": "Numero de seguro", + "insNumber": "Número de seguro", "insProvider": "Proveedor de seguros", "clinicProvider": "Proveedor de la clínica", "latitude": "Latitud", diff --git a/package-lock.json b/package-lock.json index 61f334bf4..6d8ffec83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,9 +13,9 @@ } }, "@babel/compat-data": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz", - "integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==" + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz", + "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==" }, "@babel/core": { "version": "7.10.2", @@ -68,11 +68,11 @@ } }, "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -114,13 +114,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz", - "integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", "requires": { - "@babel/compat-data": "^7.12.1", + "@babel/compat-data": "^7.12.5", "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.12.0", + "browserslist": "^4.14.5", "semver": "^5.5.0" } }, @@ -199,11 +199,11 @@ } }, "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/helper-module-transforms": { @@ -254,14 +254,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz", - "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", "requires": { "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/helper-simple-access": { @@ -310,13 +310,13 @@ } }, "@babel/helpers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz", - "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/highlight": { @@ -330,9 +330,9 @@ } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==" + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==" }, "@babel/plugin-external-helpers": { "version": "7.12.1", @@ -426,9 +426,9 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz", - "integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz", + "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==", "requires": { "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-numeric-separator": "^7.10.4" @@ -850,9 +850,9 @@ } }, "@babel/plugin-transform-react-jsx": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.1.tgz", - "integrity": "sha512-RmKejwnT0T0QzQUzcbP5p1VWlpnP8QHtdhEtLG55ZDQnJNalbF3eeDyu3dnGKvGzFIQiBzFhBYTwvv435p9Xpw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.5.tgz", + "integrity": "sha512-2xkcPqqrYiOQgSlM/iwto1paPijjsDbUynN13tI6bosDz/jOW3CRzYguIE8wKX32h+msbBM22Dv5fwrFkUOZjQ==", "requires": { "@babel/helper-builder-react-jsx": "^7.10.4", "@babel/helper-builder-react-jsx-experimental": "^7.12.1", @@ -1080,9 +1080,9 @@ } }, "@babel/runtime": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", - "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -1107,16 +1107,16 @@ } }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -1138,9 +1138,9 @@ } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.5.tgz", + "integrity": "sha512-gyTcvz7JFa4V45C0Zklv//GmFOAal5fL23OWpBLqc4nZ4Yrz67s4kCNwSK1Gu0MXGTU8mRY3zJYtacLdKXlzig==", "requires": { "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.19", @@ -1424,13 +1424,21 @@ "dev": true }, "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } } }, "node-fetch": { @@ -2907,9 +2915,9 @@ } }, "@jest/types": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.1.tgz", - "integrity": "sha512-ywHavIKNpAVrStiRY5wiyehvcktpijpItvGiK72RAn5ctqmzvPk8OvKnvHeBqa1XdQr959CTWAJMqxI8BTibyg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", @@ -4016,9 +4024,9 @@ } }, "@react-navigation/core": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-5.13.1.tgz", - "integrity": "sha512-BkOqQyevlbcDFthZXGZ3AtIYGCwZHlY625PpXqH80Drh7WrnwZ2ExgGo8ULQGk2nyg4imr3T6lYR8dRkln+P2A==", + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-5.13.4.tgz", + "integrity": "sha512-9mFPAPWUQcT9bQ9vcW+vFuCNqT/WyA1qOY3vCaRel+XNRfkuJBTBcV/0Z0FNntzc/0PgJ93saENB/XQV8iiNRw==", "requires": { "@react-navigation/routers": "^5.5.1", "escape-string-regexp": "^4.0.0", @@ -4161,9 +4169,9 @@ } }, "@types/babel__core": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", - "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -4760,9 +4768,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "axios": { @@ -5159,14 +5167,14 @@ } }, "browserslist": { - "version": "4.14.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", - "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", + "version": "4.14.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", + "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==", "requires": { - "caniuse-lite": "^1.0.30001135", - "electron-to-chromium": "^1.3.571", - "escalade": "^3.1.0", - "node-releases": "^1.1.61" + "caniuse-lite": "^1.0.30001154", + "electron-to-chromium": "^1.3.585", + "escalade": "^3.1.1", + "node-releases": "^1.1.65" } }, "bser": { @@ -5243,6 +5251,15 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -5281,9 +5298,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001151", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz", - "integrity": "sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==" + "version": "1.0.30001154", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz", + "integrity": "sha512-y9DvdSti8NnYB9Be92ddMZQrcOe04kcQtcxtBx4NkB04+qZ+JUWotnXBJTmxlKudhxNTQ3RRknMwNU2YQl/Org==" }, "capture-exit": { "version": "2.0.0", @@ -6495,9 +6512,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.584", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.584.tgz", - "integrity": "sha512-NB3DzrTzJFhWkUp+nl2KtUtoFzrfGXTir2S+BU4tXGyXH9vlluPuFpE3pTKeH7+PY460tHLjKzh6K2+TWwW+Ww==" + "version": "1.3.587", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.587.tgz", + "integrity": "sha512-8XFNxzNj0R8HpTQslWAw6UWpGSuOKSP3srhyFHVbGUGb8vTHckZGCyWi+iQlaXJx5DNeTQTQLd6xN11WSckkmA==" }, "emoji-regex": { "version": "8.0.0", @@ -6902,9 +6919,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -8277,12 +8294,19 @@ }, "dependencies": { "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } } }, "universalify": { @@ -8298,9 +8322,9 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.0.tgz", + "integrity": "sha512-pKnaUh2TNvk+/egJdBw1h46LwyLx8BzEq+MGCf/RMCVfEHHsGOCWG00dqk91kUPPArIIwMBg9T/virxwzP03cA==", "optional": true }, "function-bind": { @@ -8324,6 +8348,16 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-pkg-repo": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", @@ -8830,9 +8864,9 @@ "dev": true }, "uglify-js": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.4.tgz", - "integrity": "sha512-FyYnoxVL1D6+jDGQpbK5jW6y/2JlVfRfEeQ67BPCUg5wfCjaKOpr2XeceE4QL+MkhxliLtf5EbrMDZgzpt2CNw==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz", + "integrity": "sha512-btvv/baMqe7HxP7zJSF7Uc16h1mSfuuSplT0/qdjxseesDU+yYzH33eHBH+eMdeRXwujXspaCTooWHQVVBh09w==", "dev": true, "optional": true } @@ -10552,11 +10586,11 @@ "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==" }, "jest-haste-map": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.1.tgz", - "integrity": "sha512-9kPafkv0nX6ta1PrshnkiyhhoQoFWncrU/uUBt3/AP1r78WSCU5iLceYRTwDvJl67H3RrXqSlSVDDa/AsUB7OQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/graceful-fs": "^4.1.2", "@types/node": "*", "anymatch": "^3.0.3", @@ -10564,9 +10598,9 @@ "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.5.0", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7" @@ -11806,9 +11840,9 @@ } }, "jest-serializer": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.5.0.tgz", - "integrity": "sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", "requires": { "@types/node": "*", "graceful-fs": "^4.2.4" @@ -11892,11 +11926,11 @@ } }, "jest-util": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.1.tgz", - "integrity": "sha512-xCLZUqVoqhquyPLuDXmH7ogceGctbW8SMyQVjD9o+1+NPWI7t0vO08udcFLVPLgKWcvc+zotaUv/RuaR6l8HIA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -11950,16 +11984,16 @@ } }, "jest-validate": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.1.tgz", - "integrity": "sha512-BEFpGbylKocnNPZULcnk+TGaz1oFZQH/wcaXlaXABbu0zBwkOGczuWgdLucUouuQqn7VadHZZeTvo8VSFDLMOA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-regex": { @@ -12008,11 +12042,11 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "pretty-format": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.1.tgz", - "integrity": "sha512-MeqqsP5PYcRBbGMvwzsyBdmAJ4EFX7pWFyl7x4+dMVg5pE0ZDdBIvEH2ergvIO+Gvwv1wh64YuOY9y5LuyY/GA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^17.0.1" @@ -12178,9 +12212,9 @@ } }, "jest-worker": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.1.tgz", - "integrity": "sha512-R5IE3qSGz+QynJx8y+ICEkdI2OJ3RJjRQVEyCcFAd3yVhQSEtquziPO29Mlzgn07LOVE8u8jhJ1FqcwegiXWOw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", "requires": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -13857,14 +13891,14 @@ } }, "node-releases": { - "version": "1.1.64", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz", - "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==" + "version": "1.1.65", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz", + "integrity": "sha512-YpzJOe2WFIW0V4ZkJQd/DGR/zdVwc/pI4Nl1CZrBO19FdRcSTmsuhdttw9rsTzzJLrNcSloLiBbEYx1C4f6gpA==" }, "node-stream-zip": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.11.3.tgz", - "integrity": "sha512-GY+9LxkQuIT3O7K8BTdHVGKFcBYBy2vAVcTBtkKpu+OlBef/NSb6VuIWSyLiVDfmLMkggHeRJZN0F3W0GWU/uw==" + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.11.5.tgz", + "integrity": "sha512-kfcYvscosV8X+ozqi+IugTpaNMdS4v0XZTOtxGP/luDLWXFhtpx22HZ2iU/aS0+Mv3AKgnkaDAGMTgSVOvJhFA==" }, "noop-fn": { "version": "1.0.0", @@ -14031,12 +14065,12 @@ } }, "object.assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", - "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "requires": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.0", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" } @@ -16362,9 +16396,9 @@ } }, "regenerate": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", - "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" }, "regenerate-unicode-properties": { "version": "8.2.0", @@ -17063,9 +17097,9 @@ "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" }, "slugify": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.5.tgz", - "integrity": "sha512-WpECLAgYaxHoEAJ8Q1Lo8HOs1ngn7LN7QjXgOLbmmfkcWvosyk4ZTXkTzKyhngK640USTZUlgoQJfED1kz5fnQ==", + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.6.tgz", + "integrity": "sha512-ZdJIgv9gdrYwhXqxsH9pv7nXxjUEyQ6nqhngRxoAAOlmMGA28FDq5O4/5US4G2/Nod7d1ovNcgURQJ7kHq50KQ==", "dev": true }, "snapdragon": { @@ -17491,9 +17525,9 @@ } }, "@expo/config": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/@expo/config/-/config-3.3.11.tgz", - "integrity": "sha512-+WrAc5pZbgUMGpBMwF/rBw5igngaouWIyFSVlmYbrp0wV2Y/T99uqgylPzNA/Ei14X+34ucZNj2IaLs9Z4Krew==", + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-3.3.13.tgz", + "integrity": "sha512-ZFkMQxtk6Zobfc+BPy60rAAuiXFd5ybV7QFF3A7tTy7e6T0/YmuiSMyTM6fqs2c0O47F8/1eoaefXWUl7ppz3w==", "dev": true, "requires": { "@babel/core": "7.9.0", @@ -17509,6 +17543,7 @@ "require-from-string": "^2.0.2", "resolve-from": "^5.0.0", "semver": "^7.1.3", + "slash": "^3.0.0", "slugify": "^1.3.4", "xcode": "^2.1.0", "xml2js": "^0.4.23" @@ -17612,13 +17647,21 @@ } }, "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } } }, "ms": { diff --git a/package.json b/package.json index 6a906ba4d..ae91519ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.1.10", + "version": "8.4.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start",