Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(translations): missing translations values (#1939)
Browse files Browse the repository at this point in the history
* fix(translations): missing translations values

* fix(tests): new translation tests
  • Loading branch information
martimfj committed Mar 23, 2020
1 parent 5c67b72 commit 79433a4
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/patients/allergies/Allergies.test.tsx
Expand Up @@ -127,7 +127,7 @@ describe('Allergies', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
'patient.allergies.successfullyAdded',
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/patients/diagnoses/Diagnoses.test.tsx
Expand Up @@ -128,7 +128,7 @@ describe('Diagnoses', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
'patient.diagnoses.successfullyAdded',
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/patients/new/NewPatient.test.tsx
Expand Up @@ -153,7 +153,7 @@ describe('New Patient', () => {
expect(history.location.pathname).toEqual(`/patients/${patient.id}`)
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
`patients.successfullyCreated ${patient.fullName}`,
)
})
Expand Down
Expand Up @@ -166,8 +166,9 @@ describe('Related Persons Tab', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'patient.relatedPersons.successfullyAdded',
'states.success',
'patients.successfullyAddedRelatedPerson',
'top-left',
)
})
})
Expand Down
Expand Up @@ -194,7 +194,7 @@ describe('New Appointment', () => {
expect(history.location.pathname).toEqual(`/appointments/${expectedNewAppointment.id}`)
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
`scheduling.appointment.successfullyCreated ${expectedNewAppointment.id}`,
)
})
Expand Down
Expand Up @@ -282,7 +282,7 @@ describe('View Appointment', () => {
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'states.success',
'scheduling.appointments.successfullyDeleted',
'scheduling.appointment.successfullyDeleted',
)
})
})
Expand Down
2 changes: 2 additions & 0 deletions src/locales/enUs/translations/actions/index.ts
Expand Up @@ -6,5 +6,7 @@ export default {
new: 'New',
list: 'List',
search: 'Search',
delete: 'Delete',
confirmDelete: 'Delete Confirmation',
},
}
1 change: 1 addition & 0 deletions src/locales/enUs/translations/patient/index.ts
Expand Up @@ -38,6 +38,7 @@ export default {
},
allergies: {
label: 'Allergies',
allergyName: 'Allergy Name',
new: 'Add Allergy',
error: {
nameRequired: 'Name is required.',
Expand Down
3 changes: 2 additions & 1 deletion src/locales/enUs/translations/patients/index.ts
Expand Up @@ -2,9 +2,10 @@ export default {
patients: {
label: 'Patients',
viewPatients: 'View Patients',
editPatient: 'Edit Patient',
viewPatient: 'View Patient',
newPatient: 'New Patient',
successfullyCreated: 'Successfully created patient',
successfullyAddedRelatedPerson: 'Successfully added the new related person',
successfullyAddedRelatedPerson: 'Successfully added a new related person',
},
}
4 changes: 4 additions & 0 deletions src/locales/enUs/translations/scheduling/index.ts
Expand Up @@ -5,6 +5,8 @@ export default {
label: 'Appointments',
new: 'New Appointment',
deleteAppointment: 'Delete Appointment',
viewAppointment: 'Appointment',
editAppointment: 'Edit Appointment',
},
appointment: {
startDate: 'Start Date',
Expand All @@ -26,6 +28,8 @@ export default {
},
reason: 'Reason',
patient: 'Patient',
successfullyDeleted: 'Appointment successfully deleted.',
deleteConfirmationMessage: 'Are you sure you want to delete this appointment?',
},
},
}
2 changes: 1 addition & 1 deletion src/patients/allergies/Allergies.tsx
Expand Up @@ -31,7 +31,7 @@ const Allergies = (props: AllergiesProps) => {
useAddBreadcrumbs(breadcrumbs)

const onAddAllergySuccess = () => {
Toast('success', t('Success!'), `${t('patient.allergies.successfullyAdded')}`)
Toast('success', t('states.success'), `${t('patient.allergies.successfullyAdded')}`)
}

const onAddAllergy = (allergy: Allergy) => {
Expand Down
4 changes: 2 additions & 2 deletions src/patients/allergies/NewAllergyModal.tsx
Expand Up @@ -50,9 +50,9 @@ const NewAllergyModal = (props: NewAllergyModalProps) => {
<form>
<TextInputWithLabelFormGroup
name="name"
label="Name"
label={t('patient.allergies.allergyName')}
isEditable
placeholder="Allergy"
placeholder={t('patient.allergies.allergyName')}
value={allergy.name}
onChange={onNameChange}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/patients/diagnoses/Diagnoses.tsx
Expand Up @@ -36,7 +36,7 @@ const Diagnoses = (props: Props) => {
}

const onAddDiagnosisSuccess = () => {
Toast('success', t('Success!'), t('patient.diagnoses.successfullyAdded'))
Toast('success', t('states.success'), t('patient.diagnoses.successfullyAdded'))
}

const onDiagnosisSave = (diagnosis: Diagnosis) => {
Expand Down
6 changes: 5 additions & 1 deletion src/patients/edit/EditPatient.tsx
Expand Up @@ -59,7 +59,11 @@ const EditPatient = () => {

const onSuccessfulSave = (updatedPatient: Patient) => {
history.push(`/patients/${updatedPatient.id}`)
Toast('success', t('Success!'), `${t('patients.successfullyUpdated')} ${patient.fullName}`)
Toast(
'success',
t('states.success'),
`${t('patients.successfullyUpdated')} ${patient.fullName}`,
)
}

const onSave = () => {
Expand Down
6 changes: 5 additions & 1 deletion src/patients/new/NewPatient.tsx
Expand Up @@ -33,7 +33,11 @@ const NewPatient = () => {

const onSuccessfulSave = (newPatient: Patient) => {
history.push(`/patients/${newPatient.id}`)
Toast('success', t('Success!'), `${t('patients.successfullyCreated')} ${newPatient.fullName}`)
Toast(
'success',
t('states.success'),
`${t('patients.successfullyCreated')} ${newPatient.fullName}`,
)
}

const onSave = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/patients/related-persons/RelatedPersonTab.tsx
Expand Up @@ -67,8 +67,7 @@ const RelatedPersonTab = (props: Props) => {
}

const onAddRelatedPersonSuccess = () => {
Toast('success', t('Success!'), t('patient.relatedPersons.successfullyAdded'))
Toast('success', t('Success!'), t('patients.successfullyAddedRelatedPerson'), 'top-left')
Toast('success', t('states.success'), t('patients.successfullyAddedRelatedPerson'), 'top-left')
}

const onRelatedPersonSave = (relatedPerson: RelatedPerson) => {
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/new/NewAppointment.tsx
Expand Up @@ -44,7 +44,7 @@ const NewAppointment = () => {
history.push(`/appointments/${newAppointment.id}`)
Toast(
'success',
t('Success!'),
t('states.success'),
`${t('scheduling.appointment.successfullyCreated')} ${newAppointment.id}`,
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/view/ViewAppointment.tsx
Expand Up @@ -31,7 +31,7 @@ const ViewAppointment = () => {

const onDeleteSuccess = () => {
history.push('/appointments')
Toast('success', t('states.success'), t('scheduling.appointments.successfullyDeleted'))
Toast('success', t('states.success'), t('scheduling.appointment.successfullyDeleted'))
}

const onDeleteConfirmationButtonClick = () => {
Expand Down

1 comment on commit 79433a4

@vercel
Copy link

@vercel vercel bot commented on 79433a4 Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.