From afc3ba65c520e5bd2864f8948e18a737c121a138 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Sun, 1 Nov 2020 23:00:31 -0500 Subject: [PATCH 01/37] Validation for id, envHealth, medEval --- .../FormikFields/PaperInputPicker/index.js | 17 +++-- .../FormikFields/YupValidation/index.js | 61 +++++++++++++++++ .../Forms/IdentificationForm/config/config.js | 54 +++++++++------ .../Forms/IdentificationForm/index.js | 26 ++++--- .../configs/envhealth.config.js | 67 ++++++++++++------- .../configs/medical-evaluation.config.js | 51 +++++++++----- .../Forms/SupplementaryForm/index.js | 31 ++++++--- 7 files changed, 223 insertions(+), 84 deletions(-) create mode 100644 components/FormikFields/YupValidation/index.js diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 3e045b191..65ec5fff7 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -46,7 +46,7 @@ const PaperInputPicker = ({ theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }} /> - {touched[formikKey] && errors[formikKey]} + {errors[formikKey]} )} @@ -62,7 +62,7 @@ const PaperInputPicker = ({ theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }} /> - {touched[formikKey] && errors[formikKey]} + {errors[formikKey]} )} @@ -97,6 +97,9 @@ const PaperInputPicker = ({ ))} + + {errors[formikKey]} + )} {fieldType === 'autofill' && ( @@ -108,6 +111,9 @@ const PaperInputPicker = ({ scrollViewScroll={scrollViewScroll} setScrollViewScroll={setScrollViewScroll} /> + + {errors[formikKey]} + )} {fieldType === 'geolocation' && ( @@ -134,6 +140,9 @@ const PaperInputPicker = ({ {location.longitude} + + {errors[formikKey]} + )} @@ -170,7 +179,7 @@ const PaperInputPicker = ({ theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }} /> - {touched[result] && errors[result]} + {errors[result]} ))} @@ -193,7 +202,7 @@ const PaperInputPicker = ({ theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }} /> - {touched[result] && errors[result]} + {errors[result]} ))} diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js new file mode 100644 index 000000000..fc706e578 --- /dev/null +++ b/components/FormikFields/YupValidation/index.js @@ -0,0 +1,61 @@ +import * as yup from 'yup'; + +export default function yupValidationPicker(fields) { + var validationSchema = yup.object().shape({}); + fields.map((result) => { + const { label, formikKey, fieldType, validation, options } = result; + if (validation) { + switch (fieldType) { + case 'input': + var resultSchema = {}; + resultSchema[formikKey] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + break; + case 'numberInput': + var resultSchema = {}; + resultSchema[formikKey] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + break; + case 'select': + var resultSchema = {}; + resultSchema[formikKey] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + break; + case 'autofill': + var resultSchema = {}; + resultSchema[formikKey] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + break; + case 'geolocation': + var resultSchema = {}; + resultSchema[formikKey] = yup.object().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + break; + case 'multiInputRow': + options.map((option) => { + var resultSchema = {}; + resultSchema[option] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + }) + break; + case 'multiInputRowNum': + options.map((option) => { + var resultSchema = {}; + resultSchema[option] = yup.string().label(label).required() + var resultObject = yup.object().shape(resultSchema); + validationSchema = validationSchema.concat(resultObject); + }) + break; + default: + break; + } + } + }) + return validationSchema; +} \ No newline at end of file diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 7b3ba1077..f3457b5d9 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -5,26 +5,27 @@ const configArray = [ label: I18n.t('identificationForm.demographics'), fieldType: 'header', formikKey: 'none_bi', - }, { label: I18n.t('global.fName'), formikKey: 'fname', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('global.lName'), formikKey: 'lname', value: '', - fieldType: 'input' - + fieldType: 'input', + validation: true }, { label: I18n.t('identificationForm.nickname'), formikKey: 'nickname', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('identificationForm.dob.label'), @@ -35,7 +36,8 @@ const configArray = [ I18n.t('identificationForm.dob.month'), I18n.t('identificationForm.dob.day'), I18n.t('identificationForm.dob.year') - ] + ], + validation: true }, { label: I18n.t('identificationForm.sex.label'), @@ -55,13 +57,15 @@ const configArray = [ label: I18n.t('identificationForm.sex.notSay'), value: 'prefer_not_to_say' } - ] + ], + validation: true }, { label: I18n.t('identificationForm.telephone'), formikKey: 'telephoneNumber', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: true }, // { // label: 'Demographic Information', @@ -91,14 +95,15 @@ const configArray = [ label: I18n.t('identificationForm.marriageStatus.widow'), value: 'widow' } - ] + ], + validation: true }, { label: I18n.t('identificationForm.occupation'), formikKey: 'occupation', value: '', - fieldType: 'input' - + fieldType: 'input', + validation: true }, { label: I18n.t('identificationForm.educationLevel.label'), @@ -130,26 +135,30 @@ const configArray = [ label: I18n.t('identificationForm.educationLevel.college'), value: 'college' }, - ] + ], + validation: true }, { label: I18n.t('identificationForm.location'), fieldType: 'header', formikKey: 'none_location', + validation: true }, { label: I18n.t('global.commName'), formikKey: 'communityname', value: '', fieldType: 'autofill', - parameter: 'Communities' + parameter: 'Communities', + validation: true }, { label: I18n.t('global.city'), formikKey: 'city', value: '', fieldType: 'autofill', - parameter: 'City' + parameter: 'City', + validation: true }, // { // label: "Province", @@ -160,25 +169,27 @@ const configArray = [ label: I18n.t('identificationForm.insurance'), fieldType: 'header', formikKey: 'none_insurance', - }, { label: I18n.t('identificationForm.insNumber'), formikKey: 'insuranceNumber', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: true }, { label: I18n.t('identificationForm.insProvider'), formikKey: 'insuranceProvider', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('identificationForm.clinicProvider'), formikKey: 'clinicProvider', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, // { // label: "Cedula Number", @@ -186,9 +197,11 @@ const configArray = [ // value: "" // }, { + label: I18n.t('identificationForm.location'), formikKey: 'location', value: {}, - fieldType: 'geolocation' + fieldType: 'geolocation', + validation: true }, // { // label: 'Latitude', @@ -205,8 +218,7 @@ const configArray = [ { label: I18n.t('identificationForm.household'), fieldType: 'header', - formikKey: 'none_household', - + formikKey: 'none_household' }, { label: I18n.t('identificationForm.household'), diff --git a/domains/DataCollection/Forms/IdentificationForm/index.js b/domains/DataCollection/Forms/IdentificationForm/index.js index 35a49b427..ef7fb2a52 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,11 +52,13 @@ const IdentificationForm = ({ const [inputs, setInputs] = useState({}); const [photoFile, setPhotoFile] = useState('State Photo String'); + const [validationSchema, setValidationSchema] = useState(); useEffect(() => { setInputs(configArray); }, [setInputs, configArray]); + return ( {(formikProps) => ( @@ -121,14 +129,14 @@ const IdentificationForm = ({ {formikProps.isSubmitting ? ( ) : ( - - // - )} + + // + )} )} diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js index fe4f4ead1..e6142a3cc 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js @@ -29,7 +29,8 @@ const configArray = { label: I18n.t('environmentalHealth.yearsLived.moreThan10'), value: 'moreThan10' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.yearsLived.house'), @@ -57,14 +58,15 @@ const configArray = { label: I18n.t('environmentalHealth.yearsLived.moreThan10'), value: 'moreThan10' } - ] - + ], + validation: true }, { label: I18n.t('environmentalHealth.biggestProblemComm'), formikKey: 'biggestproblemofcommunity', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('environmentalHealth.waterAccess.label'), @@ -96,7 +98,8 @@ const configArray = { label: I18n.t('environmentalHealth.waterAccess.never'), value: 'Never' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.typeOfWater.label'), @@ -116,7 +119,8 @@ const configArray = { label: I18n.t('environmentalHealth.typeOfWater.filtered'), value: 'filtered' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.bathroomAccess'), @@ -132,7 +136,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.latrineAccess'), @@ -148,7 +153,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.clinicAccess'), @@ -164,31 +170,36 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.medicalProblemsGo'), formikKey: 'medicalproblemswheredoyougo', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('environmentalHealth.dentalProblemsGo'), formikKey: 'dentalproblemswheredoyougo', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('environmentalHealth.timesPerWeekTrash'), formikKey: 'timesperweektrashcollected', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: true }, { label: I18n.t('environmentalHealth.trashBetweenPickups'), formikKey: 'wheretrashleftbetweenpickups', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('environmentalHealth.houseOwnership'), @@ -204,7 +215,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.floorCondition.label'), @@ -228,7 +240,8 @@ const configArray = { label: I18n.t('environmentalHealth.floorCondition.cementWorking'), value: 'cementWorking' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.roofCondition.label'), @@ -244,7 +257,8 @@ const configArray = { label: I18n.t('environmentalHealth.roofCondition.work'), value: 'working' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.typeStove.label'), @@ -264,7 +278,8 @@ const configArray = { label: I18n.t('environmentalHealth.typeStove.openFire'), value: 'openfire-noVentilation' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.houseMaterials.label'), @@ -288,7 +303,8 @@ const configArray = { label: I18n.t('environmentalHealth.houseMaterials.block'), value: 'block' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.electricityAccess.label'), @@ -308,7 +324,8 @@ const configArray = { label: I18n.t('environmentalHealth.electricityAccess.always'), value: 'always' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.foodSecurity'), @@ -328,7 +345,8 @@ const configArray = { label: I18n.t('global.notSure'), value: 'not_sure' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.govAssistance.label'), @@ -348,19 +366,22 @@ const configArray = { label: I18n.t('global.other'), value: 'other' } - ] + ], + validation: true }, { label: I18n.t('environmentalHealth.numberIndividualsHouse'), formikKey: 'numberofIndividualsLivingintheHouse', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: true }, { label: I18n.t('environmentalHealth.numberChildrenUnder5'), formikKey: 'numberofChildrenLivinginHouseUndertheAgeof5', value: '', - fieldType: 'numberInput' + fieldType: 'numberInput', + validation: true }, ] }; diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js index 628b2da92..d6090b8fb 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js @@ -18,7 +18,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.chronicDiabetes'), @@ -34,7 +35,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.chronicOther'), @@ -50,7 +52,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.doctor'), @@ -66,13 +69,15 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('global.notes'), formikKey: 'received_treatment_notes', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('evaluationMedical.statusOfHealth.label'), @@ -100,7 +105,8 @@ const configArray = { label: I18n.t('global.other'), value: 'other' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.partOfBody.label'), @@ -148,13 +154,15 @@ const configArray = { label: I18n.t('evaluationMedical.partOfBody.---'), value: '' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.partOfBodyDescription'), formikKey: 'part_of_body_description', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('evaluationMedical.duration.label'), @@ -178,7 +186,8 @@ const configArray = { label: I18n.t('evaluationMedical.duration.past5Years'), value: 'after_5_years' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.problemSuddenness.label'), @@ -198,7 +207,8 @@ const configArray = { label: I18n.t('evaluationMedical.problemSuddenness.gradually'), value: 'gradually' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.progressionOfCondition.label'), @@ -218,13 +228,15 @@ const configArray = { label: I18n.t('evaluationMedical.progressionOfCondition.constant'), value: 'constant' } - ] + ], + validation: true }, { label: I18n.t('global.notes'), formikKey: 'notes', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('evaluationMedical.generalHealthConsult'), @@ -240,7 +252,8 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.surgicalRequired'), @@ -256,13 +269,15 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.yourGuess'), formikKey: 'AssessmentandEvaluation_Surgical_Guess', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, { label: I18n.t('evaluationMedical.immediateFollowupRequired'), @@ -278,13 +293,15 @@ const configArray = { label: I18n.t('global.no'), value: 'No' } - ] + ], + validation: true }, { label: I18n.t('evaluationMedical.plan'), formikKey: 'planOfAction', value: '', - fieldType: 'input' + fieldType: 'input', + validation: true }, ] }; diff --git a/domains/DataCollection/Forms/SupplementaryForm/index.js b/domains/DataCollection/Forms/SupplementaryForm/index.js index a2937ee02..4f47de4aa 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) => ( @@ -89,14 +100,14 @@ const SupplementaryForm = ({ {formikProps.isSubmitting ? ( ) : ( - - )} + + )} )} From 0026f54616a38f40374a386fbffae0e08c25b1c9 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Sun, 1 Nov 2020 23:16:20 -0500 Subject: [PATCH 02/37] Fix most of linting issues --- .../FormikFields/PaperInputPicker/index.js | 2 +- .../FormikFields/YupValidation/index.js | 77 ++++++------------- .../Forms/IdentificationForm/index.js | 17 ++-- .../Forms/SupplementaryForm/index.js | 20 ++--- 4 files changed, 43 insertions(+), 73 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 65ec5fff7..391558aeb 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -20,7 +20,7 @@ const PaperInputPicker = ({ }) => { 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 }); diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index fc706e578..7ceb5548d 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -1,61 +1,32 @@ import * as yup from 'yup'; export default function yupValidationPicker(fields) { - var validationSchema = yup.object().shape({}); + let validationSchema = yup.object().shape({}); fields.map((result) => { - const { label, formikKey, fieldType, validation, options } = result; + const { + label, formikKey, fieldType, validation, options + } = result; if (validation) { - switch (fieldType) { - case 'input': - var resultSchema = {}; - resultSchema[formikKey] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - break; - case 'numberInput': - var resultSchema = {}; - resultSchema[formikKey] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - break; - case 'select': - var resultSchema = {}; - resultSchema[formikKey] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - break; - case 'autofill': - var resultSchema = {}; - resultSchema[formikKey] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - break; - case 'geolocation': - var resultSchema = {}; - resultSchema[formikKey] = yup.object().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - break; - case 'multiInputRow': - options.map((option) => { - var resultSchema = {}; - resultSchema[option] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - }) - break; - case 'multiInputRowNum': - options.map((option) => { - var resultSchema = {}; - resultSchema[option] = yup.string().label(label).required() - var resultObject = yup.object().shape(resultSchema); - validationSchema = validationSchema.concat(resultObject); - }) - break; - default: - break; + if (fieldType === 'input' || fieldType === 'numberInput' || fieldType === 'select' + || fieldType === ' autofill') { + const resultSchemaInput = {}; + resultSchemaInput[formikKey] = yup.string().label(label).required(); + const resultObjectInput = yup.object().shape(resultSchemaInput); + validationSchema = validationSchema.concat(resultObjectInput); + } else if (fieldType === 'geolocation') { + const resultSchemaGeo = {}; + resultSchemaGeo[formikKey] = yup.object().label(label).required(); + const resultObjectGeo = yup.object().shape(resultSchemaGeo); + validationSchema = validationSchema.concat(resultObjectGeo); + } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { + options.map((option) => { + const resultSchemaMultiInput = {}; + resultSchemaMultiInput[option] = yup.string().label(label).required(); + const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); + validationSchema = validationSchema.concat(resultObjectMultiInput); + }); } } - }) + }); return validationSchema; -} \ No newline at end of file +} diff --git a/domains/DataCollection/Forms/IdentificationForm/index.js b/domains/DataCollection/Forms/IdentificationForm/index.js index ef7fb2a52..2830f8eb9 100644 --- a/domains/DataCollection/Forms/IdentificationForm/index.js +++ b/domains/DataCollection/Forms/IdentificationForm/index.js @@ -58,7 +58,6 @@ const IdentificationForm = ({ setInputs(configArray); }, [setInputs, configArray]); - return ( ) : ( - - // - )} + + // + )} )} diff --git a/domains/DataCollection/Forms/SupplementaryForm/index.js b/domains/DataCollection/Forms/SupplementaryForm/index.js index 4f47de4aa..cb3c5b1c0 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/index.js +++ b/domains/DataCollection/Forms/SupplementaryForm/index.js @@ -33,11 +33,11 @@ const SupplementaryForm = ({ useEffect(() => { if (selectedForm === 'env') { setConfig(envConfig); - setValidationSchema(yupValidationPicker(envConfig['fields'])); + setValidationSchema(yupValidationPicker(envConfig.fields)); } if (selectedForm === 'med-eval') { setConfig(medConfig); - setValidationSchema(yupValidationPicker(medConfig['fields'])); + setValidationSchema(yupValidationPicker(medConfig.fields)); } if (selectedForm === 'custom') setConfig(customForm); }, [selectedForm, config]); @@ -100,14 +100,14 @@ const SupplementaryForm = ({ {formikProps.isSubmitting ? ( ) : ( - - )} + + )} )} From ac3e67d1a135c4a3eba5a5870813b6ffe8f0b3a3 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Tue, 3 Nov 2020 22:46:02 -0500 Subject: [PATCH 03/37] Update package-lock.json --- package-lock.json | 319 ++++++++++++++++++++++++++-------------------- 1 file changed, 181 insertions(+), 138 deletions(-) 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": { From 7831dacba4686a17285da297d22c3c3c87e256b8 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Wed, 4 Nov 2020 10:41:29 -0500 Subject: [PATCH 04/37] chore: change name of username --- modules/i18n/english/en.json | 4 ++-- modules/i18n/spanish/es.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/i18n/english/en.json b/modules/i18n/english/en.json index e490c790e..975db18ce 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", diff --git a/modules/i18n/spanish/es.json b/modules/i18n/spanish/es.json index 741b71110..2be5428d6 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", From c0e19022b2a5030de53abfaff3959454e14992b9 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Wed, 4 Nov 2020 12:18:24 -0500 Subject: [PATCH 05/37] chore(release): 8.2.0 --- CHANGELOG.md | 11 +++++++++++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f3fdf613..dfd8d4f34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ 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.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..7d65f229f 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.1.10", + "version": "8.2.0", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.1.10", + "buildNumber": "8.2.0", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080110, + "versionCode": 380080200, "package": "io.ionic.starter1270348" }, "packagerOpts": { diff --git a/package.json b/package.json index 6a906ba4d..da0067f9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.1.10", + "version": "8.2.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 554df3142b73efe16b99bf56f910f28c6e468737 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Wed, 4 Nov 2020 23:19:23 -0500 Subject: [PATCH 06/37] Move translations to PaperInputPicker --- .../FormikFields/PaperInputPicker/index.js | 27 ++-- .../Forms/IdentificationForm/config/config.js | 70 ++++----- .../Forms/IdentificationForm/index.js | 1 + .../configs/envhealth.config.js | 147 +++++++++--------- .../configs/medical-evaluation.config.js | 115 +++++++------- .../Forms/SupplementaryForm/index.js | 1 + 6 files changed, 184 insertions(+), 177 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 3e045b191..5e117e88c 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -15,8 +15,11 @@ 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 { @@ -33,12 +36,14 @@ const PaperInputPicker = ({ setLocation({ latitude, longitude, altitude }); }; + const translatedLabel = customForm ? label : I18n.t(label); + return ( <> {fieldType === 'input' && ( - {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,7 +96,7 @@ const PaperInputPicker = ({ mode="outlined" onPress={() => setFieldValue(formikKey, result.value)} > - {result.label} + {customForm ? result.label : I18n.t(result.label)} )} @@ -149,7 +154,7 @@ const PaperInputPicker = ({ )} {fieldType === 'header' && ( - {label} + {translatedLabel} @@ -157,12 +162,12 @@ const PaperInputPicker = ({ )} {fieldType === 'multiInputRow' && ( - {label} + {translatedLabel} {data.options.map((result) => ( - {label} + {translatedLabel} {data.options.map((result) => ( diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js index fe4f4ead1..a7a6c14c3 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js @@ -1,363 +1,362 @@ -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' } ] }, { - 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' } ] }, { - label: I18n.t('environmentalHealth.biggestProblemComm'), + label: 'environmentalHealth.biggestProblemComm', formikKey: 'biggestproblemofcommunity', value: '', fieldType: 'input' }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - label: I18n.t('environmentalHealth.medicalProblemsGo'), + label: 'environmentalHealth.medicalProblemsGo', formikKey: 'medicalproblemswheredoyougo', value: '', fieldType: 'input' }, { - label: I18n.t('environmentalHealth.dentalProblemsGo'), + label: 'environmentalHealth.dentalProblemsGo', formikKey: 'dentalproblemswheredoyougo', value: '', fieldType: 'input' }, { - label: I18n.t('environmentalHealth.timesPerWeekTrash'), + label: 'environmentalHealth.timesPerWeekTrash', formikKey: 'timesperweektrashcollected', value: '', fieldType: 'numberInput' }, { - label: I18n.t('environmentalHealth.trashBetweenPickups'), + label: 'environmentalHealth.trashBetweenPickups', formikKey: 'wheretrashleftbetweenpickups', value: '', fieldType: 'input' }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - label: I18n.t('environmentalHealth.numberIndividualsHouse'), + label: 'environmentalHealth.numberIndividualsHouse', formikKey: 'numberofIndividualsLivingintheHouse', value: '', fieldType: 'numberInput' }, { - label: I18n.t('environmentalHealth.numberChildrenUnder5'), + label: 'environmentalHealth.numberChildrenUnder5', formikKey: 'numberofChildrenLivinginHouseUndertheAgeof5', value: '', fieldType: 'numberInput' diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js index 628b2da92..87eb15f64 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js @@ -2,286 +2,287 @@ 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - label: I18n.t('global.notes'), + label: 'global.notes', formikKey: 'received_treatment_notes', value: '', fieldType: 'input' }, { - 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' } ] }, { - 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: '' } ] }, { - label: I18n.t('evaluationMedical.partOfBodyDescription'), + label: 'evaluationMedical.partOfBodyDescription', formikKey: 'part_of_body_description', value: '', fieldType: 'input' }, { - 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' } ] }, { - 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' } ] }, { - 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' } ] }, { - label: I18n.t('global.notes'), + label: 'global.notes', formikKey: 'notes', value: '', fieldType: 'input' }, { - 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' } ] }, { - 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' } ] }, { - label: I18n.t('evaluationMedical.yourGuess'), + label: 'evaluationMedical.yourGuess', formikKey: 'AssessmentandEvaluation_Surgical_Guess', value: '', fieldType: 'input' }, { - 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' } ] }, { - label: I18n.t('evaluationMedical.plan'), + label: 'evaluationMedical.plan', formikKey: 'planOfAction', value: '', fieldType: 'input' diff --git a/domains/DataCollection/Forms/SupplementaryForm/index.js b/domains/DataCollection/Forms/SupplementaryForm/index.js index a2937ee02..29ae378fa 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/index.js +++ b/domains/DataCollection/Forms/SupplementaryForm/index.js @@ -82,6 +82,7 @@ const SupplementaryForm = ({ ))} From 81cc6b3bb2704900502bf915b0284d34b7c12172 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Wed, 4 Nov 2020 23:21:25 -0500 Subject: [PATCH 07/37] Fix linting issues --- components/FormikFields/PaperInputPicker/index.js | 4 +++- .../DataCollection/Forms/IdentificationForm/config/config.js | 2 -- .../SupplementaryForm/configs/medical-evaluation.config.js | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 5e117e88c..b5461750b 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -96,7 +96,9 @@ const PaperInputPicker = ({ mode="outlined" onPress={() => setFieldValue(formikKey, result.value)} > - {customForm ? result.label : I18n.t(result.label)} + + {customForm ? result.label : I18n.t(result.label)} + )} diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 94ef47985..fc3a46b9d 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -1,5 +1,3 @@ -import I18n from '../../../../../modules/i18n'; - const configArray = [ { label: 'identificationForm.demographics', diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js index 87eb15f64..2496f0210 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js @@ -1,5 +1,3 @@ -import I18n from '../../../../../modules/i18n'; - const configArray = { class: 'EvaluationMedical', name: 'evaluationMedical.name', From 3690467c67d0ed8550f80559237457d218025925 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Thu, 5 Nov 2020 10:58:56 -0500 Subject: [PATCH 08/37] fix: problems with caching records on splash screen --- App.js | 10 +++---- components/FindResidents/index.js | 26 ++++++++++++------- components/MapView/index.js | 4 +-- components/ResidentIdSearchbar/index.js | 15 ++++++++++- .../Forms/IdentificationForm/config/config.js | 4 +-- domains/DataCollection/index.js | 3 +-- .../cached-resources/useCachedResources.js | 2 ++ 7 files changed, 43 insertions(+), 21 deletions(-) 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/components/FindResidents/index.js b/components/FindResidents/index.js index 4cc9372c1..e340a96ce 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,19 +22,25 @@ const FindResidents = ({ const [data, setData] = useState([]); const [query, setQuery] = useState(''); const [residents, setResidents] = useState([]); + const [loading, setLoading] = useState(false); useEffect(() => { - fetchData(); + fetchAsyncData(); }, []); - 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, @@ -54,6 +57,7 @@ const FindResidents = ({ setData(records); setResidents(records.slice()); } + setLoading(false); }; const filterList = () => data.filter( @@ -100,6 +104,7 @@ const FindResidents = ({ onChangeText={onChangeSearch} value={query} /> + )} @@ -113,6 +118,9 @@ const FindResidents = ({ ))} */} + {loading + && } + {!selectPerson && ( { }); }; - const retriveAsyncMarkers = async () => { + const retriveAsyncMarkers = () => { getData('residentData').then((residentData) => { if (residentData) { setMarkers(residentData); @@ -58,7 +58,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..044680a9e 100644 --- a/components/ResidentIdSearchbar/index.js +++ b/components/ResidentIdSearchbar/index.js @@ -5,6 +5,7 @@ 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,9 +19,20 @@ 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 = { @@ -71,6 +83,7 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = onChangeText={onChangeSearch} value={query} /> + {loading && } diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 02acf4f6a..5b6fce716 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -34,7 +34,7 @@ const configArray = [ 'identificationForm.dob.month', 'identificationForm.dob.day', 'identificationForm.dob.year' - ] + ], validation: true }, { @@ -195,7 +195,7 @@ const configArray = [ // value: "" // }, { - label: I18n.t('identificationForm.location'), + label: 'identificationForm.location', formikKey: 'location', value: {}, fieldType: 'geolocation', diff --git a/domains/DataCollection/index.js b/domains/DataCollection/index.js index 5ba8a426f..d0f2e2a13 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..a49005620 100644 --- a/modules/cached-resources/useCachedResources.js +++ b/modules/cached-resources/useCachedResources.js @@ -30,6 +30,8 @@ export default function useCachedResources() { if (org) { const residentData = await fetchResidentData(org); storeData(residentData, 'residentData'); + } else { + storeData([], 'residentData'); } }); } catch (e) { From 7dea875f4e2e8a6e2adb19b5712f993a93011cbf Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Thu, 5 Nov 2020 11:03:33 -0500 Subject: [PATCH 09/37] chore(release): 8.3.0 --- CHANGELOG.md | 7 +++++++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfd8d4f34..809863182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.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) diff --git a/app.json b/app.json index 7d65f229f..f1904644e 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.2.0", + "version": "8.3.0", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.2.0", + "buildNumber": "8.3.0", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080200, + "versionCode": 380080300, "package": "io.ionic.starter1270348" }, "packagerOpts": { diff --git a/package.json b/package.json index da0067f9e..8c5c6c0ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.2.0", + "version": "8.3.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 5997c57e46b1416e26df1f68a8f91064e6fc328b Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Thu, 5 Nov 2020 13:07:42 -0500 Subject: [PATCH 10/37] fix: caching records --- components/FindResidents/index.js | 13 ++++++------- components/ResidentIdSearchbar/index.js | 2 +- modules/cached-resources/useCachedResources.js | 6 ++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/components/FindResidents/index.js b/components/FindResidents/index.js index e340a96ce..ddcbd3482 100644 --- a/components/FindResidents/index.js +++ b/components/FindResidents/index.js @@ -26,7 +26,7 @@ const FindResidents = ({ useEffect(() => { fetchAsyncData(); - }, []); + }, [organization]); const fetchAsyncData = () => { setLoading(true); @@ -44,7 +44,7 @@ const FindResidents = ({ const queryParams = { skip: 0, offset: 0, - limit: 10000, + limit: 100000, parseColumn: 'surveyingOrganization', parseParam: organization, }; @@ -52,11 +52,10 @@ 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); }; diff --git a/components/ResidentIdSearchbar/index.js b/components/ResidentIdSearchbar/index.js index 044680a9e..b38ccc97e 100644 --- a/components/ResidentIdSearchbar/index.js +++ b/components/ResidentIdSearchbar/index.js @@ -38,7 +38,7 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = const queryParams = { skip: 0, offset: 0, - limit: 10000, + limit: 100000, parseColumn: 'surveyingOrganization', parseParam: surveyingOrganization, }; diff --git a/modules/cached-resources/useCachedResources.js b/modules/cached-resources/useCachedResources.js index a49005620..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,9 +29,7 @@ export default function useCachedResources() { await getData('organization').then(async (org) => { if (org) { const residentData = await fetchResidentData(org); - storeData(residentData, 'residentData'); - } else { - storeData([], 'residentData'); + storeData(residentData || [], 'residentData'); } }); } catch (e) { From 32a49f56c35610606c077dcde51c0f793d562588 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Thu, 5 Nov 2020 14:42:47 -0500 Subject: [PATCH 11/37] fix: add a flatlist --- components/ResidentIdSearchbar/index.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/components/ResidentIdSearchbar/index.js b/components/ResidentIdSearchbar/index.js index b38ccc97e..d2126ed55 100644 --- a/components/ResidentIdSearchbar/index.js +++ b/components/ResidentIdSearchbar/index.js @@ -1,5 +1,5 @@ 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'; @@ -75,6 +75,10 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = setQuery(''); }; + const renderItem = ({ item }) => ( + + ); + return ( {I18n.t('residentIdSearchbar.searchIndividual')} @@ -87,11 +91,19 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = {loading && } - {query !== '' && filterList(residents).map((listItem,) => ( + {/* {query !== '' && filterList(residents).map((listItem,) => ( - + - ))} + ))} */} + + {query !== '' && ( + item.objectId} + /> + )} {surveyee && surveyee.objectId && ( From e33bac28887310e082d30f1ce93edce2c1f8c216 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Thu, 5 Nov 2020 14:43:01 -0500 Subject: [PATCH 12/37] chore(release): 8.3.1 --- CHANGELOG.md | 8 ++++++++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 809863182..c0b60ed48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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.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) diff --git a/app.json b/app.json index f1904644e..fbedf0371 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.0", + "version": "8.3.1", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.0", + "buildNumber": "8.3.1", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080300, + "versionCode": 380080301, "package": "io.ionic.starter1270348" }, "packagerOpts": { diff --git a/package.json b/package.json index 8c5c6c0ae..f000a932e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.0", + "version": "8.3.1", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 298453f72d595067c639a2059a70d716ba2b496a Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Thu, 5 Nov 2020 22:33:08 -0500 Subject: [PATCH 13/37] Change output to show value on error instead of I18n key --- components/FormikFields/YupValidation/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index 7ceb5548d..862501b57 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -1,4 +1,5 @@ import * as yup from 'yup'; +import I18n from '../../../modules/i18n'; export default function yupValidationPicker(fields) { let validationSchema = yup.object().shape({}); @@ -10,18 +11,18 @@ export default function yupValidationPicker(fields) { if (fieldType === 'input' || fieldType === 'numberInput' || fieldType === 'select' || fieldType === ' autofill') { const resultSchemaInput = {}; - resultSchemaInput[formikKey] = yup.string().label(label).required(); + 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(label).required(); + 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.map((option) => { const resultSchemaMultiInput = {}; - resultSchemaMultiInput[option] = yup.string().label(label).required(); + resultSchemaMultiInput[option] = yup.string().label(I18n.t(label)).required(); const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); validationSchema = validationSchema.concat(resultObjectMultiInput); }); From 5d307b84131c08d3fd899005b2e7784b73ebdf66 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Thu, 5 Nov 2020 22:35:32 -0500 Subject: [PATCH 14/37] Fix linting --- components/ResidentIdSearchbar/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/ResidentIdSearchbar/index.js b/components/ResidentIdSearchbar/index.js index d2126ed55..ef59b3d01 100644 --- a/components/ResidentIdSearchbar/index.js +++ b/components/ResidentIdSearchbar/index.js @@ -93,7 +93,9 @@ const ResidentIdSearchbar = ({ surveyee, setSurveyee, surveyingOrganization }) = {/* {query !== '' && filterList(residents).map((listItem,) => ( - + ))} */} From f6dd83681a2013941345158d376a888ab0d8c8fc Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Thu, 5 Nov 2020 23:22:24 -0500 Subject: [PATCH 15/37] Fix for multi Inputs --- .../FormikFields/PaperInputPicker/index.js | 16 ++++++++-------- components/FormikFields/YupValidation/index.js | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 0458895f2..237a65635 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -176,17 +176,17 @@ const PaperInputPicker = ({ {translatedLabel} {data.options.map((result) => ( - + - {errors[result]} + {errors[customForm ? result : I18n.t(result)]} ))} @@ -198,18 +198,18 @@ const PaperInputPicker = ({ {translatedLabel} {data.options.map((result) => ( - + - {errors[result]} + {errors[customForm ? result : I18n.t(result)]} ))} diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index 7ceb5548d..502e0065c 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -1,5 +1,5 @@ import * as yup from 'yup'; - +import I18n from '../../../modules/i18n'; export default function yupValidationPicker(fields) { let validationSchema = yup.object().shape({}); fields.map((result) => { @@ -21,7 +21,7 @@ export default function yupValidationPicker(fields) { } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { options.map((option) => { const resultSchemaMultiInput = {}; - resultSchemaMultiInput[option] = yup.string().label(label).required(); + resultSchemaMultiInput[I18n.t(option)] = yup.string().label(label).required(); const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); validationSchema = validationSchema.concat(resultObjectMultiInput); }); From 093304d5e16996e81cd42b3def86ce57c317bf52 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Thu, 5 Nov 2020 23:51:13 -0500 Subject: [PATCH 16/37] Fix to ensure that keys for multiInputs do not get translated --- components/FormikFields/PaperInputPicker/index.js | 10 +++++----- components/FormikFields/YupValidation/index.js | 2 +- .../Forms/IdentificationForm/config/config.js | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 237a65635..3b2b1ee04 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -198,18 +198,18 @@ const PaperInputPicker = ({ {translatedLabel} {data.options.map((result) => ( - + - {errors[customForm ? result : I18n.t(result)]} + {errors[result['value']]} ))} diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index 0e0a4163d..28e3ded8d 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -22,7 +22,7 @@ export default function yupValidationPicker(fields) { } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { options.map((option) => { const resultSchemaMultiInput = {}; - resultSchemaMultiInput[I18n.t(option)] = yup.string().label(I18n.t(option)).required(); + resultSchemaMultiInput[option['value']] = yup.string().label(option['value']).required(); const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); validationSchema = validationSchema.concat(resultObjectMultiInput); }); diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 5b6fce716..4442bcb1a 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -31,9 +31,18 @@ const configArray = [ value: '', fieldType: 'multiInputRowNum', options: [ - 'identificationForm.dob.month', - 'identificationForm.dob.day', - 'identificationForm.dob.year' + { + label: 'identificationForm.dob.month', + value: 'Month' + }, + { + label: 'identificationForm.dob.day', + value: 'Day' + }, + { + label: 'identificationForm.dob.year', + value: 'Year' + } ], validation: true }, From 44ce50ded055e74878221ff4a4b81959852717f8 Mon Sep 17 00:00:00 2001 From: Joseph McCombs Date: Thu, 5 Nov 2020 23:53:54 -0500 Subject: [PATCH 17/37] Linting fixes --- components/FormikFields/PaperInputPicker/index.js | 10 +++++----- components/FormikFields/YupValidation/index.js | 2 +- .../Forms/IdentificationForm/config/config.js | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/index.js b/components/FormikFields/PaperInputPicker/index.js index 3b2b1ee04..4fd64a614 100644 --- a/components/FormikFields/PaperInputPicker/index.js +++ b/components/FormikFields/PaperInputPicker/index.js @@ -198,18 +198,18 @@ const PaperInputPicker = ({ {translatedLabel} {data.options.map((result) => ( - + - {errors[result['value']]} + {errors[result.value]} ))} diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index 28e3ded8d..2ff87ed68 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -22,7 +22,7 @@ export default function yupValidationPicker(fields) { } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { options.map((option) => { const resultSchemaMultiInput = {}; - resultSchemaMultiInput[option['value']] = yup.string().label(option['value']).required(); + resultSchemaMultiInput[option.value] = yup.string().label(option.value).required(); const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); validationSchema = validationSchema.concat(resultObjectMultiInput); }); diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 4442bcb1a..7b23154c6 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -32,16 +32,16 @@ const configArray = [ fieldType: 'multiInputRowNum', options: [ { - label: 'identificationForm.dob.month', - value: 'Month' + label: 'identificationForm.dob.month', + value: 'Month' }, { - label: 'identificationForm.dob.day', - value: 'Day' + label: 'identificationForm.dob.day', + value: 'Day' }, { - label: 'identificationForm.dob.year', - value: 'Year' + label: 'identificationForm.dob.year', + value: 'Year' } ], validation: true From 10b12a7e31369af41c998d68a730c9ee0576e74f Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Sat, 7 Nov 2020 13:13:02 -0500 Subject: [PATCH 18/37] fix: [Android] Tab bar renders above keyboard https://github.com/react-navigation/react-navigation/issues/6700#issuecomment-658893985 --- app.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.json b/app.json index fbedf0371..477bc9539 100644 --- a/app.json +++ b/app.json @@ -31,7 +31,8 @@ }, "android": { "versionCode": 380080301, - "package": "io.ionic.starter1270348" + "package": "io.ionic.starter1270348", + "softwareKeyboardLayoutMode": "pan" }, "packagerOpts": { "config": "metro.config.js", @@ -50,4 +51,4 @@ ] } } -} +} \ No newline at end of file From a772d6004b8c05dea0f6e021197c1006ba752fc2 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Sun, 8 Nov 2020 12:43:16 -0500 Subject: [PATCH 19/37] chore(release): 8.3.2 --- CHANGELOG.md | 7 +++++++ app.json | 8 ++++---- package.json | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b60ed48..77cee4689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.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) diff --git a/app.json b/app.json index 477bc9539..40e0d16cc 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.1", + "version": "8.3.2", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.1", + "buildNumber": "8.3.2", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080301, + "versionCode": 380080302, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, @@ -51,4 +51,4 @@ ] } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index f000a932e..18faf96c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.1", + "version": "8.3.2", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 1e10386fce5489c1d67f51a68788abbc6ff895b7 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:19:33 -0500 Subject: [PATCH 20/37] chore(release): 8.3.3 --- CHANGELOG.md | 2 ++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77cee4689..cd4057fd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.3.3](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.2...v8.3.3) (2020-11-09) + ### [8.3.2](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.1...v8.3.2) (2020-11-08) diff --git a/app.json b/app.json index 40e0d16cc..aadc39198 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.2", + "version": "8.3.3", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.2", + "buildNumber": "8.3.3", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080302, + "versionCode": 380080303, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, diff --git a/package.json b/package.json index 18faf96c6..82c4b0279 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.2", + "version": "8.3.3", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 15c8cf9d74ec40dc22883f50576e4beac1bbad39 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:20:03 -0500 Subject: [PATCH 21/37] Revert "chore(release): 8.3.3" This reverts commit 1e10386fce5489c1d67f51a68788abbc6ff895b7. --- CHANGELOG.md | 2 -- app.json | 6 +++--- package.json | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd4057fd0..77cee4689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,6 @@ 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.3.3](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.2...v8.3.3) (2020-11-09) - ### [8.3.2](https://github.com/hopetambala/puente-reactnative-collect/compare/v8.3.1...v8.3.2) (2020-11-08) diff --git a/app.json b/app.json index aadc39198..40e0d16cc 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.3", + "version": "8.3.2", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.3", + "buildNumber": "8.3.2", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080303, + "versionCode": 380080302, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, diff --git a/package.json b/package.json index 82c4b0279..18faf96c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.3", + "version": "8.3.2", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From d6b99c3c66c708c6d8ceae0f225ea3ed405ee06c Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:21:08 -0500 Subject: [PATCH 22/37] chore: readme --- .versionrc.js | 10 ++++++++++ README.md | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.versionrc.js b/.versionrc.js index a5505d40c..e8da2ea9e 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -15,5 +15,15 @@ module.exports = { filename: 'app.json', updater: require.resolve('standard-version-expo/ios'), } + ], + types: [ + { type: "feat", "section": "Features" }, + { type: "fix", "section": "Bug Fixes" }, + { type: "chore", "section": "Upkeep" }, + { type: "docs", "hidden": true }, + { type: "style", "hidden": true }, + { type: "refactor", "hidden": true }, + { type: "perf", "hidden": true }, + { type: "test", "hidden": true } ] }; \ No newline at end of file diff --git a/README.md b/README.md index 533bd4e20..a98214b78 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,4 @@ Here are some quick npm commands to get started: ## Standards -[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/expo-community/standard-version-expo) \ No newline at end of file +[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/expo-community/standard-version-expo) \ No newline at end of file From 295998b3fe16ec42650f06074593db808151d91f Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:24:43 -0500 Subject: [PATCH 23/37] fix: stuff --- .versionrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.versionrc.js b/.versionrc.js index e8da2ea9e..32a32af46 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -19,7 +19,7 @@ module.exports = { types: [ { type: "feat", "section": "Features" }, { type: "fix", "section": "Bug Fixes" }, - { type: "chore", "section": "Upkeep" }, + { type: "chore", section: "Upkeep" }, { type: "docs", "hidden": true }, { type: "style", "hidden": true }, { type: "refactor", "hidden": true }, From fc3d199d4d465238e56254f7a9d0fe812a4fd2ff Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:25:29 -0500 Subject: [PATCH 24/37] Revert "fix: stuff" This reverts commit 295998b3fe16ec42650f06074593db808151d91f. --- .versionrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.versionrc.js b/.versionrc.js index 32a32af46..e8da2ea9e 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -19,7 +19,7 @@ module.exports = { types: [ { type: "feat", "section": "Features" }, { type: "fix", "section": "Bug Fixes" }, - { type: "chore", section: "Upkeep" }, + { type: "chore", "section": "Upkeep" }, { type: "docs", "hidden": true }, { type: "style", "hidden": true }, { type: "refactor", "hidden": true }, From 867522cb04462e47d7c60e9d95bf2e6523aa1bc1 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:25:42 -0500 Subject: [PATCH 25/37] Revert "chore: readme" This reverts commit d6b99c3c66c708c6d8ceae0f225ea3ed405ee06c. --- .versionrc.js | 10 ---------- README.md | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.versionrc.js b/.versionrc.js index e8da2ea9e..a5505d40c 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -15,15 +15,5 @@ module.exports = { filename: 'app.json', updater: require.resolve('standard-version-expo/ios'), } - ], - types: [ - { type: "feat", "section": "Features" }, - { type: "fix", "section": "Bug Fixes" }, - { type: "chore", "section": "Upkeep" }, - { type: "docs", "hidden": true }, - { type: "style", "hidden": true }, - { type: "refactor", "hidden": true }, - { type: "perf", "hidden": true }, - { type: "test", "hidden": true } ] }; \ No newline at end of file diff --git a/README.md b/README.md index a98214b78..533bd4e20 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,4 @@ Here are some quick npm commands to get started: ## Standards -[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/expo-community/standard-version-expo) \ No newline at end of file +[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/expo-community/standard-version-expo) \ No newline at end of file From 25d1d1e3e5fa1eb5218ed51c9218bb8dab62438d Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:37:08 -0500 Subject: [PATCH 26/37] docs: add ability to have better messages --- .versionrc.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.versionrc.js b/.versionrc.js index a5505d40c..04e3d50a4 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: 'Other 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 From 58f73e71a2da77991516e632f31a08282a487cec Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:47:20 -0500 Subject: [PATCH 27/37] chore(release): 8.3.3 --- app.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.json b/app.json index 40e0d16cc..aadc39198 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.2", + "version": "8.3.3", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.2", + "buildNumber": "8.3.3", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080302, + "versionCode": 380080303, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, diff --git a/package.json b/package.json index 18faf96c6..82c4b0279 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.2", + "version": "8.3.3", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From 041ce470eee464106c4cb092d0051021971675a1 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 13:47:26 -0500 Subject: [PATCH 28/37] chore(release): 8.3.4 --- CHANGELOG.md | 18 ++++++++++++++++++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77cee4689..7c6b9f2e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ 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.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) diff --git a/app.json b/app.json index aadc39198..bb8a19243 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.3", + "version": "8.3.4", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.3", + "buildNumber": "8.3.4", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080303, + "versionCode": 380080304, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, diff --git a/package.json b/package.json index 82c4b0279..23e73b656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.3", + "version": "8.3.4", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From ff9eadadfc78d81034894782f6a8a54c71d6e528 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 15:22:17 -0500 Subject: [PATCH 29/37] chore: update changelog generation --- .versionrc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.versionrc.js b/.versionrc.js index 04e3d50a4..62dcb71ad 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -17,13 +17,13 @@ module.exports = { } ], types: [ - { type: 'chore', section: 'Other chores' }, - { type: 'ci', section: 'Pipeline changes' }, - { type: 'docs', section: 'Documentation changes' }, - { type: 'feat', section: 'New features' }, + { 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: 'refactor', section: 'Code Refactors' }, { type: 'release', hidden: true }, { type: 'style', hidden: true }, { type: 'test', hidden: true }, From 6e657604ab8e45ae0449fdec10a375cb9f9e70a5 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 21:57:50 -0500 Subject: [PATCH 30/37] chore: add in all required fields for ID --- .../Forms/IdentificationForm/config/config.js | 57 ++++++++----------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 7b23154c6..b07d28ec3 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -23,7 +23,7 @@ const configArray = [ formikKey: 'nickname', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'identificationForm.dob.label', @@ -44,7 +44,7 @@ const configArray = [ value: 'Year' } ], - validation: true + validation: false }, { label: 'identificationForm.sex.label', @@ -72,7 +72,7 @@ const configArray = [ formikKey: 'telephoneNumber', value: '', fieldType: 'numberInput', - validation: true + validation: false }, // { // label: 'Demographic Information', @@ -110,7 +110,7 @@ const configArray = [ formikKey: 'occupation', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'identificationForm.educationLevel.label', @@ -149,7 +149,7 @@ const configArray = [ label: 'identificationForm.location', fieldType: 'header', formikKey: 'none_location', - validation: true + validation: false }, { label: 'global.commName', @@ -157,7 +157,7 @@ const configArray = [ value: '', fieldType: 'autofill', parameter: 'Communities', - validation: true + validation: false }, { label: 'global.city', @@ -165,13 +165,15 @@ const configArray = [ value: '', fieldType: 'autofill', parameter: 'City', + validation: false + }, + { + label: "Province", + formikKey: 'province', + value: "", + fieldType: 'input', validation: true }, - // { - // label: "Province", - // formikKey: 'province', - // value: "" - // }, { label: 'identificationForm.insurance', fieldType: 'header', @@ -182,50 +184,39 @@ const configArray = [ formikKey: 'insuranceNumber', value: '', fieldType: 'numberInput', - validation: true + validation: false }, { label: 'identificationForm.insProvider', formikKey: 'insuranceProvider', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'identificationForm.clinicProvider', formikKey: 'clinicProvider', value: '', fieldType: 'input', - validation: true + validation: false + }, + { + label: "Cedula Number", + formikKey: 'cedulaNumber', + value: "", + fieldType: 'input', + validation: false }, - // { - // label: "Cedula Number", - // formikKey: 'cedulaNumber', - // value: "" - // }, { label: 'identificationForm.location', formikKey: 'location', value: {}, fieldType: 'geolocation', - validation: true + validation: false }, - // { - // label: 'Latitude', - // formikKey: 'latitude', - // value: 0, - // fieldType: 'geolocation' - // }, - // { - // label: 'Longitude', - // formikKey: 'longitude', - // value: 0, - // fieldType: 'geolocation' - // }, { label: 'identificationForm.household', fieldType: 'header', - formikKey: 'none_household' }, { label: 'identificationForm.household', From 19b731ee83273f223c7a4238b55ef862057f1bc1 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 22:11:07 -0500 Subject: [PATCH 31/37] chrore: fix inconsistent styling of dropdown --- .../FormikFields/PaperInputPicker/AutoFill/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/AutoFill/index.js b/components/FormikFields/PaperInputPicker/AutoFill/index.js index d9d960191..72b3113be 100644 --- a/components/FormikFields/PaperInputPicker/AutoFill/index.js +++ b/components/FormikFields/PaperInputPicker/AutoFill/index.js @@ -79,7 +79,7 @@ export default class AutoFill extends Component { }} renderItem={({ item }) => ( // you can change the view you want to show in suggestion from here - { + { this.setState({ query: item }); formikProps.setFieldValue(formikKey, item); }} @@ -94,8 +94,8 @@ export default class AutoFill extends Component { {fields.length > 0 ? ( {query} ) : ( - {placeholder} - )} + {placeholder} + )} ); @@ -104,19 +104,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, From a986b15a8e09259abf08edbc54d86e707a2a1e4b Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 22:11:34 -0500 Subject: [PATCH 32/37] fix: add missing identification form fields and their translations --- .../DataCollection/Forms/IdentificationForm/config/config.js | 4 ++-- modules/i18n/english/en.json | 2 ++ modules/i18n/spanish/es.json | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index b07d28ec3..b15df8802 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -168,7 +168,7 @@ const configArray = [ validation: false }, { - label: "Province", + label: "identificationForm.province", formikKey: 'province', value: "", fieldType: 'input', @@ -201,7 +201,7 @@ const configArray = [ validation: false }, { - label: "Cedula Number", + label: "identificationForm.cedulaNumber", formikKey: 'cedulaNumber', value: "", fieldType: 'input', diff --git a/modules/i18n/english/en.json b/modules/i18n/english/en.json index 975db18ce..b8423cb6a 100644 --- a/modules/i18n/english/en.json +++ b/modules/i18n/english/en.json @@ -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 2be5428d6..f99d644b9 100644 --- a/modules/i18n/spanish/es.json +++ b/modules/i18n/spanish/es.json @@ -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", From 31ac1fab7aeb36a0a0d6f92fae0ed4f3a69acf8c Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 22:23:31 -0500 Subject: [PATCH 33/37] chore: linting error with map() --- components/FormikFields/YupValidation/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/FormikFields/YupValidation/index.js b/components/FormikFields/YupValidation/index.js index 2ff87ed68..55a4ae4c1 100644 --- a/components/FormikFields/YupValidation/index.js +++ b/components/FormikFields/YupValidation/index.js @@ -3,7 +3,7 @@ import I18n from '../../../modules/i18n'; export default function yupValidationPicker(fields) { let validationSchema = yup.object().shape({}); - fields.map((result) => { + fields.forEach((result) => { const { label, formikKey, fieldType, validation, options } = result; @@ -20,7 +20,7 @@ export default function yupValidationPicker(fields) { const resultObjectGeo = yup.object().shape(resultSchemaGeo); validationSchema = validationSchema.concat(resultObjectGeo); } else if (fieldType === 'multiInputRow' || fieldType === 'multiInputRowNum') { - options.map((option) => { + options.forEach((option) => { const resultSchemaMultiInput = {}; resultSchemaMultiInput[option.value] = yup.string().label(option.value).required(); const resultObjectMultiInput = yup.object().shape(resultSchemaMultiInput); From ecce1fbb4dc96004f4f3b622cfd256c657415299 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 22:23:40 -0500 Subject: [PATCH 34/37] refactor: linting --- .../PaperInputPicker/AutoFill/index.js | 14 ++++++++------ .../Forms/IdentificationForm/config/config.js | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/components/FormikFields/PaperInputPicker/AutoFill/index.js b/components/FormikFields/PaperInputPicker/AutoFill/index.js index 72b3113be..39f513596 100644 --- a/components/FormikFields/PaperInputPicker/AutoFill/index.js +++ b/components/FormikFields/PaperInputPicker/AutoFill/index.js @@ -79,10 +79,12 @@ export default class AutoFill extends Component { }} renderItem={({ item }) => ( // 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} @@ -94,8 +96,8 @@ export default class AutoFill extends Component { {fields.length > 0 ? ( {query} ) : ( - {placeholder} - )} + {placeholder} + )} ); diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index b15df8802..0e0140e8b 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -168,9 +168,9 @@ const configArray = [ validation: false }, { - label: "identificationForm.province", + label: 'identificationForm.province', formikKey: 'province', - value: "", + value: '', fieldType: 'input', validation: true }, @@ -201,9 +201,9 @@ const configArray = [ validation: false }, { - label: "identificationForm.cedulaNumber", + label: 'identificationForm.cedulaNumber', formikKey: 'cedulaNumber', - value: "", + value: '', fieldType: 'input', validation: false }, From 1a728cf338e5231a46e7079fc7c973ad8ebbdc24 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Mon, 9 Nov 2020 23:44:53 -0500 Subject: [PATCH 35/37] chore(release): 8.4.0 --- CHANGELOG.md | 19 +++++++++++++++++++ app.json | 6 +++--- package.json | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6b9f2e8..fe3233a1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ 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) diff --git a/app.json b/app.json index bb8a19243..6997eb1f9 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "android", "web" ], - "version": "8.3.4", + "version": "8.4.0", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "myapp", @@ -23,14 +23,14 @@ ], "ios": { "supportsTablet": true, - "buildNumber": "8.3.4", + "buildNumber": "8.4.0", "bundleIdentifier": "io.ionic.starter1270348" }, "web": { "favicon": "./assets/images/favicon.png" }, "android": { - "versionCode": 380080304, + "versionCode": 380080400, "package": "io.ionic.starter1270348", "softwareKeyboardLayoutMode": "pan" }, diff --git a/package.json b/package.json index 23e73b656..ae91519ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "puente-reactnative", - "version": "8.3.4", + "version": "8.4.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", From bc0de14e977b31670f33b6db374657cd66cbd6be Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Tue, 10 Nov 2020 18:29:42 -0500 Subject: [PATCH 36/37] fix: remove validation on environmental health config --- .../configs/envhealth.config.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js index b47cc06f7..5d7c1a30b 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/envhealth.config.js @@ -29,7 +29,7 @@ const configArray = { value: 'moreThan10' } ], - validation: true + validation: false }, { label: 'environmentalHealth.yearsLived.house', @@ -58,14 +58,14 @@ const configArray = { value: 'moreThan10' } ], - validation: true + validation: false }, { label: 'environmentalHealth.biggestProblemComm', formikKey: 'biggestproblemofcommunity', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'environmentalHealth.waterAccess.label', @@ -98,7 +98,7 @@ const configArray = { value: 'Never' } ], - validation: true + validation: false }, { label: 'environmentalHealth.typeOfWater.label', @@ -119,7 +119,7 @@ const configArray = { value: 'filtered' } ], - validation: true + validation: false }, { label: 'environmentalHealth.bathroomAccess', @@ -136,7 +136,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'environmentalHealth.latrineAccess', @@ -153,7 +153,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'environmentalHealth.clinicAccess', @@ -170,35 +170,35 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'environmentalHealth.medicalProblemsGo', formikKey: 'medicalproblemswheredoyougo', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'environmentalHealth.dentalProblemsGo', formikKey: 'dentalproblemswheredoyougo', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'environmentalHealth.timesPerWeekTrash', formikKey: 'timesperweektrashcollected', value: '', fieldType: 'numberInput', - validation: true + validation: false }, { label: 'environmentalHealth.trashBetweenPickups', formikKey: 'wheretrashleftbetweenpickups', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'environmentalHealth.houseOwnership', @@ -215,7 +215,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'environmentalHealth.floorCondition.label', @@ -240,7 +240,7 @@ const configArray = { value: 'cementWorking' } ], - validation: true + validation: false }, { label: 'environmentalHealth.roofCondition.label', @@ -257,7 +257,7 @@ const configArray = { value: 'working' } ], - validation: true + validation: false }, { label: 'environmentalHealth.typeStove.label', @@ -278,7 +278,7 @@ const configArray = { value: 'openfire-noVentilation' } ], - validation: true + validation: false }, { label: 'environmentalHealth.houseMaterials.label', @@ -303,7 +303,7 @@ const configArray = { value: 'block' } ], - validation: true + validation: false }, { label: 'environmentalHealth.electricityAccess.label', @@ -324,7 +324,7 @@ const configArray = { value: 'always' } ], - validation: true + validation: false }, { label: 'environmentalHealth.foodSecurity', @@ -345,7 +345,7 @@ const configArray = { value: 'not_sure' } ], - validation: true + validation: false }, { label: 'environmentalHealth.govAssistance.label', @@ -366,21 +366,21 @@ const configArray = { value: 'other' } ], - validation: true + validation: false }, { label: 'environmentalHealth.numberIndividualsHouse', formikKey: 'numberofIndividualsLivingintheHouse', value: '', fieldType: 'numberInput', - validation: true + validation: false }, { label: 'environmentalHealth.numberChildrenUnder5', formikKey: 'numberofChildrenLivinginHouseUndertheAgeof5', value: '', fieldType: 'numberInput', - validation: true + validation: false }, ] }; From 192d2092bd55f8441b228ccf985a64fc463178ab Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Tue, 10 Nov 2020 20:11:54 -0500 Subject: [PATCH 37/37] chore: remove validation --- .../configs/medical-evaluation.config.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js index 6c38faf07..dc98f36b4 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/medical-evaluation.config.js @@ -18,7 +18,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.chronicDiabetes', @@ -35,7 +35,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.chronicOther', @@ -52,7 +52,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.doctor', @@ -69,14 +69,14 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'global.notes', formikKey: 'received_treatment_notes', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'evaluationMedical.statusOfHealth.label', @@ -105,7 +105,7 @@ const configArray = { value: 'other' } ], - validation: true + validation: false }, { label: 'evaluationMedical.partOfBody.label', @@ -154,14 +154,14 @@ const configArray = { value: '' } ], - validation: true + validation: false }, { label: 'evaluationMedical.partOfBodyDescription', formikKey: 'part_of_body_description', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'evaluationMedical.duration.label', @@ -186,7 +186,7 @@ const configArray = { value: 'after_5_years' } ], - validation: true + validation: false }, { label: 'evaluationMedical.problemSuddenness.label', @@ -207,7 +207,7 @@ const configArray = { value: 'gradually' } ], - validation: true + validation: false }, { label: 'evaluationMedical.progressionOfCondition.label', @@ -228,14 +228,14 @@ const configArray = { value: 'constant' } ], - validation: true + validation: false }, { label: 'global.notes', formikKey: 'notes', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'evaluationMedical.generalHealthConsult', @@ -252,7 +252,7 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.surgicalRequired', @@ -269,14 +269,14 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.yourGuess', formikKey: 'AssessmentandEvaluation_Surgical_Guess', value: '', fieldType: 'input', - validation: true + validation: false }, { label: 'evaluationMedical.immediateFollowupRequired', @@ -293,14 +293,14 @@ const configArray = { value: 'No' } ], - validation: true + validation: false }, { label: 'evaluationMedical.plan', formikKey: 'planOfAction', value: '', fieldType: 'input', - validation: true + validation: false }, ] };