Skip to content

Commit

Permalink
feat: add photo to surveyData, remove from vitals
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-mccombs committed Jul 29, 2021
1 parent bb426e0 commit 433b6d0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ const configArray = [
fieldType: 'geolocation',
validation: false
},
{
label: 'identificationForm.photoAssessment',
fieldType: 'photo',
formikKey: 'photoFile',
value: ''
},
{
label: 'identificationForm.household',
fieldType: 'header',
Expand Down
11 changes: 3 additions & 8 deletions domains/DataCollection/Forms/IdentificationForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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');
Expand All @@ -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];
});
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ const configArray = {
fieldType: 'input',
validation: false
},
{
label: 'vitals.photoAssessment',
fieldType: 'photo',
formikKey: 'envPhoto',
value: ''
}
]
};

Expand Down
6 changes: 3 additions & 3 deletions modules/i18n/english/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
"household": "Household",
"subcounty": "Sub-county",
"region": "Region",
"country": "Country"
"country": "Country",
"photoAssessment": "Photo Assessment"
},
"environmentalHealth": {
"name": "Environmental Health Form",
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions modules/i18n/kreyol/hk.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
"household": "Kay",
"subcounty": "Sub-county",
"region": "Rejyon an",
"country": "Peyi"
"country": "Peyi",
"photoAssessment": "Foto Evalyasyon"
},
"environmentalHealth": {
"name": "Istwa sante anvironmantal",
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions modules/i18n/spanish/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 433b6d0

Please sign in to comment.