Skip to content

Commit

Permalink
Merge pull request #3 from codethechange/fix-buttons
Browse files Browse the repository at this point in the history
style(new and update patients): fixing up some of the text for buttons
  • Loading branch information
cpondoc authored Dec 18, 2020
2 parents 8a9e598 + b4f5668 commit dc5f62d
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_HOSPITALRUN_API=http://localhost:5984
REACT_APP_HOSPITALRUN_API=http://localhost:5984
4 changes: 2 additions & 2 deletions src/__tests__/imagings/requests/NewImagingRequest.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('New Imaging Request', () => {
const wrapper = await setup()
const saveButton = wrapper.find(Button).at(0)
expect(saveButton).toBeDefined()
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('imagings.requests.create')
})

it('should render a cancel button', async () => {
Expand Down Expand Up @@ -205,7 +205,7 @@ describe('New Imaging Request', () => {

const saveButton = wrapper.find(Button).at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('imagings.requests.create')
await act(async () => {
await onClick()
})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/labs/ViewLab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('View Lab', () => {
])

const buttons = wrapper.find(Button)
expect(buttons.at(0).text().trim()).toEqual('actions.update')
expect(buttons.at(0).text().trim()).toEqual('labs.requests.update')

expect(buttons.at(1).text().trim()).toEqual('labs.requests.complete')

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/labs/requests/NewLabRequest.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('New Lab Request', () => {
const { wrapper } = await setup()
const saveButton = wrapper.find(Button).at(0)
expect(saveButton).toBeDefined()
expect(saveButton.text().trim()).toEqual('labs.requests.save')
expect(saveButton.text().trim()).toEqual('labs.requests.new')
})

it('should render a cancel button', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/medications/ViewMedication.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ describe('View Medication', () => {
])

const buttons = wrapper.find(Button)
expect(buttons.at(0).text().trim()).toEqual('actions.update')
expect(buttons.at(0).text().trim()).toEqual('medications.requests.update')

expect(buttons.at(1).text().trim()).toEqual('medications.requests.cancel')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('New Medication Request', () => {
const { wrapper } = await setup()
const saveButton = wrapper.find(Button).at(0)
expect(saveButton).toBeDefined()
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('medications.requests.new')
})

it('should render a cancel button', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/patients/edit/EditPatient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('Edit Patient', () => {

const saveButton = wrapper.find('.btn-save').at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('patients.updatePatient')

await act(async () => {
await onClick()
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/patients/new/NewPatient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('New Patient', () => {

const saveButton = wrapper.find('.btn-save').at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('patients.createPatient')

await act(async () => {
await onClick()
Expand All @@ -112,7 +112,7 @@ describe('New Patient', () => {

const saveButton = wrapper.find('.btn-save').at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('patients.createPatient')

act(() => {
onClick()
Expand All @@ -139,7 +139,7 @@ describe('New Patient', () => {

const saveButton = wrapper.find('.btn-save').at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('patients.createPatient')

await act(async () => {
await onClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('Edit Appointment', () => {

const saveButton = wrapper.find(Button).at(0)
const onClick = saveButton.prop('onClick') as any
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('scheduling.appointments.updateAppointment')

await act(async () => {
await onClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('New Appointment', () => {
wrapper.update()

const saveButton = wrapper.find(Button).at(0)
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('scheduling.appointments.createAppointment')
const onClick = saveButton.prop('onClick') as any

await act(async () => {
Expand Down Expand Up @@ -151,9 +151,8 @@ describe('New Appointment', () => {
})

wrapper.update()

const saveButton = wrapper.find(Button).at(0)
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('scheduling.appointments.createAppointment')
const onClick = saveButton.prop('onClick') as any

await act(async () => {
Expand Down Expand Up @@ -236,9 +235,8 @@ describe('New Appointment', () => {
})

wrapper.update()

const saveButton = wrapper.find(Button).at(0)
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('scheduling.appointments.createAppointment')
const onClick = saveButton.prop('onClick') as any

await act(async () => {
Expand Down Expand Up @@ -274,7 +272,7 @@ describe('New Appointment', () => {
})
wrapper.update()
const saveButton = wrapper.find(Button).at(0)
expect(saveButton.text().trim()).toEqual('actions.save')
expect(saveButton.text().trim()).toEqual('scheduling.appointments.createAppointment')
const onClick = saveButton.prop('onClick') as any

await act(async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/imagings/requests/NewImagingRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const NewImagingRequest = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg mt-3">
<Button className="mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('imagings.requests.create')}
</Button>
<Button color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/incidents/report/ReportIncident.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const ReportIncident = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg mt-3">
<Button className="mr-2" color="success" onClick={onSave}>
{t('incidents.actions.report')}
{t('incidents.reports.new')}
</Button>
<Button color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/labs/ViewLab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const ViewLab = () => {

buttons.push(
<Button className="mr-2" color="success" onClick={onUpdate} key="actions.update">
{t('actions.update')}
{t('labs.requests.update')}
</Button>,
)

Expand Down
3 changes: 1 addition & 2 deletions src/labs/requests/NewLabRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ const NewLabRequest = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg mt-3">
<Button className="mr-2" color="success" onClick={onSave}>
{t('labs.requests.save')}
{t('labs.requests.new')}
</Button>

<Button color="danger" onClick={onCancel}>
{t('actions.cancel')}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/medications/ViewMedication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const ViewMedication = () => {

buttons.push(
<Button className="mr-2" color="success" onClick={onUpdate} key="actions.update">
{t('actions.update')}
{t('medications.requests.update')}
</Button>,
)

Expand Down
2 changes: 1 addition & 1 deletion src/medications/requests/NewMedicationRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const NewMedicationRequest = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg mt-3">
<Button className="mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('medications.requests.new')}
</Button>
<Button color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/patients/edit/EditPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const EditPatient = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg">
<Button className="btn-save mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('patients.updatePatient')}
</Button>
<Button className="btn-cancel" color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/patients/new/NewPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const NewPatient = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg mt-3">
<Button className="btn-save mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('patients.createPatient')}
</Button>
<Button className="btn-cancel" color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/edit/EditAppointment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const EditAppointment = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg">
<Button className="mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('scheduling.appointments.updateAppointment')}
</Button>
<Button color="danger" onClick={onCancel}>
{t('actions.cancel')}
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/new/NewAppointment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const NewAppointment = () => {
<div className="row float-right">
<div className="btn-group btn-group-lg">
<Button className="mr-2" color="success" onClick={onSave}>
{t('actions.save')}
{t('scheduling.appointments.createAppointment')}
</Button>
<Button color="danger" onClick={onCancelClick}>
{t('actions.cancel')}
Expand Down
1 change: 1 addition & 0 deletions src/shared/locales/enUs/translations/imagings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
label: 'Imaging Requests',
new: 'New Imaging Request',
view: 'View Imaging',
create: 'Request Imaging',
cancel: 'Cancel Imaging',
complete: 'Complete Imaging',
error: {
Expand Down
1 change: 1 addition & 0 deletions src/shared/locales/enUs/translations/labs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
view: 'View Lab',
cancel: 'Cancel Lab',
complete: 'Complete Lab',
update: 'Update Lab',
error: {
unableToRequest: 'Unable to create new lab request.',
unableToComplete: 'Unable to complete lab request.',
Expand Down
1 change: 1 addition & 0 deletions src/shared/locales/enUs/translations/medications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
view: 'View Medication',
cancel: 'Cancel Medication',
complete: 'Complete Medication',
update: 'Update Medication',
error: {
unableToRequest: 'Unable to create Medication request.',
unableToComplete: 'Unable to complete Medication request.',
Expand Down
2 changes: 2 additions & 0 deletions src/shared/locales/enUs/translations/patients/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default {
viewPatients: 'View Patients',
noPatients: "There are no patients yet, let's add the first one!",
viewPatient: 'View Patient',
createPatient: 'Create Patient',
newPatient: 'New Patient',
editPatient: 'Edit Patient',
updatePatient: 'Update Patient',
successfullyCreated: 'Successfully created patient',
successfullyAddedNote: 'Successfully added the new note',
successfullyAddedRelatedPerson: 'Successfully added a new related person',
Expand Down
2 changes: 2 additions & 0 deletions src/shared/locales/enUs/translations/scheduling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default {
new: 'New Appointment',
schedule: 'Appointment Schedule',
editAppointment: 'Edit Appointment',
createAppointment: 'Schedule Appointment',
deleteAppointment: 'Delete Appointment',
viewAppointment: 'View Appointment',
updateAppointment: 'Update Appointment',
},
appointment: {
startDate: 'Start Date',
Expand Down

0 comments on commit dc5f62d

Please sign in to comment.