From 3cad0fb3750f1337f1f4ce75f9b69ae785015019 Mon Sep 17 00:00:00 2001 From: Martim Date: Sun, 22 Mar 2020 19:21:30 -0300 Subject: [PATCH 1/2] fix(translations): missing translations values --- src/locales/enUs/translations/actions/index.ts | 2 ++ src/locales/enUs/translations/patient/index.ts | 1 + src/locales/enUs/translations/patients/index.ts | 3 ++- src/locales/enUs/translations/scheduling/index.ts | 4 ++++ src/patients/allergies/Allergies.tsx | 2 +- src/patients/allergies/NewAllergyModal.tsx | 4 ++-- src/patients/diagnoses/Diagnoses.tsx | 2 +- src/patients/edit/EditPatient.tsx | 6 +++++- src/patients/new/NewPatient.tsx | 6 +++++- src/patients/related-persons/RelatedPersonTab.tsx | 3 +-- src/scheduling/appointments/new/NewAppointment.tsx | 2 +- src/scheduling/appointments/view/ViewAppointment.tsx | 2 +- 12 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/locales/enUs/translations/actions/index.ts b/src/locales/enUs/translations/actions/index.ts index e34e7424fd..be640fd1aa 100644 --- a/src/locales/enUs/translations/actions/index.ts +++ b/src/locales/enUs/translations/actions/index.ts @@ -6,5 +6,7 @@ export default { new: 'New', list: 'List', search: 'Search', + delete: 'Delete', + confirmDelete: 'Delete Confirmation', }, } diff --git a/src/locales/enUs/translations/patient/index.ts b/src/locales/enUs/translations/patient/index.ts index a0444d9a0f..c04efe8379 100644 --- a/src/locales/enUs/translations/patient/index.ts +++ b/src/locales/enUs/translations/patient/index.ts @@ -38,6 +38,7 @@ export default { }, allergies: { label: 'Allergies', + allergyName: 'Allergy Name', new: 'Add Allergy', error: { nameRequired: 'Name is required.', diff --git a/src/locales/enUs/translations/patients/index.ts b/src/locales/enUs/translations/patients/index.ts index 1efd79c4ad..3f5874f4f5 100644 --- a/src/locales/enUs/translations/patients/index.ts +++ b/src/locales/enUs/translations/patients/index.ts @@ -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', }, } diff --git a/src/locales/enUs/translations/scheduling/index.ts b/src/locales/enUs/translations/scheduling/index.ts index 20320eb4b3..aaf7a1cf3f 100644 --- a/src/locales/enUs/translations/scheduling/index.ts +++ b/src/locales/enUs/translations/scheduling/index.ts @@ -5,6 +5,8 @@ export default { label: 'Appointments', new: 'New Appointment', deleteAppointment: 'Delete Appointment', + viewAppointment: 'Appointment', + editAppointment: 'Edit Appointment', }, appointment: { startDate: 'Start Date', @@ -26,6 +28,8 @@ export default { }, reason: 'Reason', patient: 'Patient', + successfullyDeleted: 'Appointment successfully deleted.', + deleteConfirmationMessage: 'Are you sure you want to delete this appointment?', }, }, } diff --git a/src/patients/allergies/Allergies.tsx b/src/patients/allergies/Allergies.tsx index 1857592eaf..074554a48a 100644 --- a/src/patients/allergies/Allergies.tsx +++ b/src/patients/allergies/Allergies.tsx @@ -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) => { diff --git a/src/patients/allergies/NewAllergyModal.tsx b/src/patients/allergies/NewAllergyModal.tsx index 531f9e4207..2b38cf67c9 100644 --- a/src/patients/allergies/NewAllergyModal.tsx +++ b/src/patients/allergies/NewAllergyModal.tsx @@ -50,9 +50,9 @@ const NewAllergyModal = (props: NewAllergyModalProps) => {
diff --git a/src/patients/diagnoses/Diagnoses.tsx b/src/patients/diagnoses/Diagnoses.tsx index ae520fff89..1256edaaef 100644 --- a/src/patients/diagnoses/Diagnoses.tsx +++ b/src/patients/diagnoses/Diagnoses.tsx @@ -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) => { diff --git a/src/patients/edit/EditPatient.tsx b/src/patients/edit/EditPatient.tsx index 8c4e207b7b..89e9bbce82 100644 --- a/src/patients/edit/EditPatient.tsx +++ b/src/patients/edit/EditPatient.tsx @@ -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 = () => { diff --git a/src/patients/new/NewPatient.tsx b/src/patients/new/NewPatient.tsx index 8b21cfadfb..70cc1de882 100644 --- a/src/patients/new/NewPatient.tsx +++ b/src/patients/new/NewPatient.tsx @@ -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 = () => { diff --git a/src/patients/related-persons/RelatedPersonTab.tsx b/src/patients/related-persons/RelatedPersonTab.tsx index cc98d479f6..7e8aad4d9b 100644 --- a/src/patients/related-persons/RelatedPersonTab.tsx +++ b/src/patients/related-persons/RelatedPersonTab.tsx @@ -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) => { diff --git a/src/scheduling/appointments/new/NewAppointment.tsx b/src/scheduling/appointments/new/NewAppointment.tsx index bde5a108d5..6f8f560bd3 100644 --- a/src/scheduling/appointments/new/NewAppointment.tsx +++ b/src/scheduling/appointments/new/NewAppointment.tsx @@ -44,7 +44,7 @@ const NewAppointment = () => { history.push(`/appointments/${newAppointment.id}`) Toast( 'success', - t('Success!'), + t('states.success'), `${t('scheduling.appointment.successfullyCreated')} ${newAppointment.id}`, ) } diff --git a/src/scheduling/appointments/view/ViewAppointment.tsx b/src/scheduling/appointments/view/ViewAppointment.tsx index a262c8ddaa..ed09b28cd7 100644 --- a/src/scheduling/appointments/view/ViewAppointment.tsx +++ b/src/scheduling/appointments/view/ViewAppointment.tsx @@ -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 = () => { From c4ec085982d1651f2d914a3599d872c7a75166ea Mon Sep 17 00:00:00 2001 From: Martim Date: Sun, 22 Mar 2020 20:10:52 -0300 Subject: [PATCH 2/2] fix(tests): new translation tests --- src/__tests__/patients/allergies/Allergies.test.tsx | 2 +- src/__tests__/patients/diagnoses/Diagnoses.test.tsx | 2 +- src/__tests__/patients/new/NewPatient.test.tsx | 2 +- .../patients/related-persons/RelatedPersons.test.tsx | 5 +++-- .../scheduling/appointments/new/NewAppointment.test.tsx | 2 +- .../scheduling/appointments/view/ViewAppointment.test.tsx | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/__tests__/patients/allergies/Allergies.test.tsx b/src/__tests__/patients/allergies/Allergies.test.tsx index 6f1a1029ec..554135c6f4 100644 --- a/src/__tests__/patients/allergies/Allergies.test.tsx +++ b/src/__tests__/patients/allergies/Allergies.test.tsx @@ -127,7 +127,7 @@ describe('Allergies', () => { expect(mockedComponents.Toast).toHaveBeenCalledWith( 'success', - 'Success!', + 'states.success', 'patient.allergies.successfullyAdded', ) }) diff --git a/src/__tests__/patients/diagnoses/Diagnoses.test.tsx b/src/__tests__/patients/diagnoses/Diagnoses.test.tsx index 07db29610a..832833835e 100644 --- a/src/__tests__/patients/diagnoses/Diagnoses.test.tsx +++ b/src/__tests__/patients/diagnoses/Diagnoses.test.tsx @@ -128,7 +128,7 @@ describe('Diagnoses', () => { expect(mockedComponents.Toast).toHaveBeenCalledWith( 'success', - 'Success!', + 'states.success', 'patient.diagnoses.successfullyAdded', ) }) diff --git a/src/__tests__/patients/new/NewPatient.test.tsx b/src/__tests__/patients/new/NewPatient.test.tsx index 6a346cb0e8..44db300b88 100644 --- a/src/__tests__/patients/new/NewPatient.test.tsx +++ b/src/__tests__/patients/new/NewPatient.test.tsx @@ -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}`, ) }) diff --git a/src/__tests__/patients/related-persons/RelatedPersons.test.tsx b/src/__tests__/patients/related-persons/RelatedPersons.test.tsx index 44948957e5..3db5108198 100644 --- a/src/__tests__/patients/related-persons/RelatedPersons.test.tsx +++ b/src/__tests__/patients/related-persons/RelatedPersons.test.tsx @@ -166,8 +166,9 @@ describe('Related Persons Tab', () => { expect(mockedComponents.Toast).toHaveBeenCalledWith( 'success', - 'Success!', - 'patient.relatedPersons.successfullyAdded', + 'states.success', + 'patients.successfullyAddedRelatedPerson', + 'top-left', ) }) }) diff --git a/src/__tests__/scheduling/appointments/new/NewAppointment.test.tsx b/src/__tests__/scheduling/appointments/new/NewAppointment.test.tsx index c2a6982eaf..74efecf25b 100644 --- a/src/__tests__/scheduling/appointments/new/NewAppointment.test.tsx +++ b/src/__tests__/scheduling/appointments/new/NewAppointment.test.tsx @@ -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}`, ) }) diff --git a/src/__tests__/scheduling/appointments/view/ViewAppointment.test.tsx b/src/__tests__/scheduling/appointments/view/ViewAppointment.test.tsx index 7a976a11d0..d3b7f63abd 100644 --- a/src/__tests__/scheduling/appointments/view/ViewAppointment.test.tsx +++ b/src/__tests__/scheduling/appointments/view/ViewAppointment.test.tsx @@ -282,7 +282,7 @@ describe('View Appointment', () => { expect(mockedComponents.Toast).toHaveBeenCalledWith( 'success', 'states.success', - 'scheduling.appointments.successfullyDeleted', + 'scheduling.appointment.successfullyDeleted', ) }) })