Skip to content

Commit

Permalink
(fix) O3-3398: Combine the translation for Create New Patient/ Edit P…
Browse files Browse the repository at this point in the history
…atient (#1186)

* Combined the translation for Create New Patient/ Edit Patient

* Use proper casing for translation value

* Fixup

---------

Co-authored-by: Dennis Kigen <[email protected]>
  • Loading branch information
vasharma05 and denniskigen authored Jun 11, 2024
1 parent d8ac74d commit 94f1df4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
<div>
<div className={styles.stickyColumn}>
<h4>
{inEditMode ? t('edit', 'Edit') : t('createNew', 'Create New')} {t('patient', 'Patient')}
{inEditMode
? t('editPatientDetails', 'Edit patient details')
: t('createNewPatient', 'Create new patient')}
</h4>
{showDummyData && <DummyDataInput setValues={props.setValues} />}
<p className={styles.label01}>{t('jumpTo', 'Jump to')}</p>
Expand All @@ -186,9 +188,9 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
status="active"
/>
) : inEditMode ? (
t('updatePatient', 'Update Patient')
t('updatePatient', 'Update patient')
) : (
t('registerPatient', 'Register Patient')
t('registerPatient', 'Register patient')
)}
</Button>
<Button className={styles.cancelButton} kind="tertiary" onClick={cancelRegistration}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@
}

.spinner {
&:global(.cds--inline-loading) {
min-height: 1rem;
}
min-height: 1rem;
width: max-content;
}

// Overriding styles for RTL support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe('Registering a new patient', () => {
});

await fillRequiredFields();
await user.click(await screen.findByText('Register Patient'));
await user.click(await screen.findByText(/Register Patient/i));
expect(mockedSavePatient).toHaveBeenCalledWith(
expect.objectContaining({
identifiers: [], //TODO when the identifer story is finished: { identifier: '', identifierType: '05a29f94-c0ed-11e2-94be-8c13b969e334', location: '' },
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('Registering a new patient', () => {
const givenNameInput = (await screen.findByLabelText('First Name')) as HTMLInputElement;

await user.type(givenNameInput, '5');
await user.click(screen.getByText('Register Patient'));
await user.click(screen.getByText(/Register Patient/i));

expect(mockedSavePatientForm).not.toHaveBeenCalled();
});
Expand All @@ -317,7 +317,7 @@ describe('Registering a new patient', () => {
const nationality = within(customSection).getByLabelText('Nationality');
await user.selectOptions(nationality, 'USA');

await user.click(screen.getByText('Register Patient'));
await user.click(screen.getByText(/Register Patient/i));

expect(mockedSavePatient).toHaveBeenCalled();

Expand Down Expand Up @@ -350,7 +350,7 @@ describe('Registering a new patient', () => {

mockedSaveEncounter.mockRejectedValue({ status: 400, responseBody: { error: { message: 'an error message' } } });

const registerPatientButton = screen.getByText('Register Patient');
const registerPatientButton = screen.getByText(/Register Patient/i);

await user.click(registerPatientButton);

Expand Down Expand Up @@ -415,7 +415,7 @@ describe('Updating an existing patient record', () => {
await user.type(givenNameInput, 'Eric');
await user.type(middleNameInput, 'Johnson');
await user.type(familyNameInput, 'Smith');
await user.click(screen.getByText('Update Patient'));
await user.click(screen.getByText(/Update patient/i));

expect(mockedSavePatient).toHaveBeenCalledWith(
false,
Expand Down
4 changes: 1 addition & 3 deletions packages/esm-patient-registration-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"configure": "Configure",
"configureIdentifiers": "Configure identifiers",
"contactSection": "Contact Details",
"createNew": "Create New",
"createNewPatient": "Create new patient",
"dateOfBirthLabelText": "Date of Birth",
"deathDateInputLabel": "Date of Death",
"deathdayNotInTheFuture": "Death day cannot be in the future",
Expand All @@ -27,7 +27,6 @@
"discardModalBody": "The changes you made to this patient's details have not been saved. Discard changes?",
"discardModalHeader": "Confirm Discard Changes",
"dobToggleLabelText": "Date of Birth Known?",
"edit": "Edit",
"editIdentifierTooltip": "Edit",
"editPatientDetails": "Edit patient details",
"editPatientDetailsBreadcrumb": "Edit patient details",
Expand Down Expand Up @@ -61,7 +60,6 @@
"obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
"optional": "optional",
"other": "Other",
"patient": "Patient",
"patientNameKnown": "Patient's Name is Known?",
"patientRegistrationBreadcrumb": "Patient Registration",
"registerPatient": "Register Patient",
Expand Down

0 comments on commit 94f1df4

Please sign in to comment.