diff --git a/domains/DataCollection/Forms/IdentificationForm/config/config.js b/domains/DataCollection/Forms/IdentificationForm/config/config.js index 3a0215bcd..2e4834b3e 100644 --- a/domains/DataCollection/Forms/IdentificationForm/config/config.js +++ b/domains/DataCollection/Forms/IdentificationForm/config/config.js @@ -210,6 +210,12 @@ const configArray = [ fieldType: 'geolocation', validation: false }, + { + label: 'identificationForm.photoAssessment', + fieldType: 'photo', + formikKey: 'photoFile', + value: '' + }, { label: 'identificationForm.household', fieldType: 'header', diff --git a/domains/DataCollection/Forms/IdentificationForm/index.js b/domains/DataCollection/Forms/IdentificationForm/index.js index 08b234678..aa85d250e 100644 --- a/domains/DataCollection/Forms/IdentificationForm/index.js +++ b/domains/DataCollection/Forms/IdentificationForm/index.js @@ -28,7 +28,6 @@ const IdentificationForm = ({ }, []); const [inputs, setInputs] = useState({}); - const [photoFile, setPhotoFile] = useState('State Photo String'); const [validationSchema, setValidationSchema] = useState(); const [submitting, setSubmitting] = useState(false); @@ -43,7 +42,7 @@ const IdentificationForm = ({ initialValues={{}} onSubmit={async (values,) => { setSubmitting(true); - setPhotoFile('Submitted Photo String'); + const photoFile = values.photoFile; const formObject = values; const user = await getData('currentUser'); @@ -60,10 +59,7 @@ const IdentificationForm = ({ formObject.searchIndex = `${values.fname || ''} ${values.lname || ''}`; - // const photo = values.picture - // need to prune 'picture' key if using photofile - - const valuesToPrune = ['Month', 'Day', 'Year', 'location']; + const valuesToPrune = ['Month', 'Day', 'Year', 'location', 'photoFile']; valuesToPrune.forEach((value) => { delete formObject[value]; }); @@ -77,10 +73,9 @@ const IdentificationForm = ({ const postParams = { parseClass: 'SurveyData', parseUser: user.objectId, - photoFile, + photoFile: photoFile, localObject: formObject }; - postIdentificationForm(postParams).then((surveyee) => { setSurveyee(surveyee); submitAction(); diff --git a/domains/DataCollection/Forms/SupplementaryForm/configs/vitals.config.js b/domains/DataCollection/Forms/SupplementaryForm/configs/vitals.config.js index d88594619..1406aa4ad 100644 --- a/domains/DataCollection/Forms/SupplementaryForm/configs/vitals.config.js +++ b/domains/DataCollection/Forms/SupplementaryForm/configs/vitals.config.js @@ -114,12 +114,6 @@ const configArray = { fieldType: 'input', validation: false }, - { - label: 'vitals.photoAssessment', - fieldType: 'photo', - formikKey: 'envPhoto', - value: '' - } ] }; diff --git a/modules/i18n/english/en.json b/modules/i18n/english/en.json index 944e7bf55..a7aec817f 100644 --- a/modules/i18n/english/en.json +++ b/modules/i18n/english/en.json @@ -132,7 +132,8 @@ "household": "Household", "subcounty": "Sub-county", "region": "Region", - "country": "Country" + "country": "Country", + "photoAssessment": "Photo Assessment" }, "environmentalHealth": { "name": "Environmental Health Form", @@ -289,8 +290,7 @@ "hemoglobinLevels": "Hemoglobin Levels (Hb)", "hemoglobinA1c": "Hemoglobin A1c (HbA1c)", "gdL": "g/dL", - "pain": "Pain", - "photoAssessment": "Photo Assessment" + "pain": "Pain" }, "supplementaryForms": { "attachResident": "Attach a Community Resident" diff --git a/modules/i18n/kreyol/hk.json b/modules/i18n/kreyol/hk.json index 619b84979..44f964658 100644 --- a/modules/i18n/kreyol/hk.json +++ b/modules/i18n/kreyol/hk.json @@ -132,7 +132,8 @@ "household": "Kay", "subcounty": "Sub-county", "region": "Rejyon an", - "country": "Peyi" + "country": "Peyi", + "photoAssessment": "Foto Evalyasyon" }, "environmentalHealth": { "name": "Istwa sante anvironmantal", @@ -289,8 +290,7 @@ "hemoglobinLevels": "Nivo emoglobin", "hemoglobinA1c": "Emoglobin A1c (HbA1c)", "gdL": "g/dL", - "pain": "Doulè", - "photoAssessment": "Foto Evalyasyon" + "pain": "Doulè" }, "supplementaryForms": { "attachResident": "Tache yon rezidan nan kominote a" diff --git a/modules/i18n/spanish/es.json b/modules/i18n/spanish/es.json index f54f1fb24..7e87bd808 100644 --- a/modules/i18n/spanish/es.json +++ b/modules/i18n/spanish/es.json @@ -132,7 +132,8 @@ "household": "Casa", "subcounty": "Sub-condado", "region": "Región", - "country": "País" + "country": "País", + "photoAssessment": "Evaluación de fotos" }, "environmentalHealth": { "name": "Formulario de salud ambiental", @@ -289,8 +290,7 @@ "hemoglobinLevels": "Niveles de hemoglobina", "hemoglobinA1c": "Hemoglobina de A1c", "gdL": "g/dL", - "pain": "Nivel de dolor", - "photoAssessment": "Evaluación de fotos" + "pain": "Nivel de dolor" }, "supplementaryForms": { "attachResident": "Adjuntar una residente de la comunidad"