Skip to content

Commit

Permalink
(feat) Useful tweaks following the 4.0 upgrade (#768)
Browse files Browse the repository at this point in the history
* (feat) Useful tweaks following the 4.0 upgrade

These include:

- Removing an errant semi-colon from the form entry wrapper component.
- Fix mismatched style declaration in the Biometrics chart component.
- Tweak the modal copy in the Cancel Visit dialog component.
- Upgrade the `@carbon/charts-react` and `d3` version in the Test Results app.
- Alter the description property of the Test Results app package.json file.

* Bump @carbon/react and @carbon/charts-react
  • Loading branch information
denniskigen committed Aug 17, 2022
1 parent fc24fce commit 7527da5
Show file tree
Hide file tree
Showing 23 changed files with 84 additions and 61 deletions.
4 changes: 2 additions & 2 deletions packages/esm-generic-patient-widgets-app/package.json
Expand Up @@ -34,8 +34,8 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/charts-react": "^1.3.2",
"@carbon/react": "^1.8.0",
"@carbon/charts-react": "^1.5.2",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-allergies-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-attachments-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-banner-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-biometrics-app/package.json
Expand Up @@ -33,9 +33,9 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/charts-react": "^1.3.2",
"@carbon/charts-react": "^1.5.2",
"@carbon/grid": "^11.2.0",
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.4.4",
"lodash-es": "^4.17.15"
Expand Down
Expand Up @@ -96,7 +96,7 @@ const BiometricsChart: React.FC<BiometricsChartProps> = ({ patientBiometrics, co
<label className={styles.biometricLabel} htmlFor="biometrics-chart-radio-group">
{t('biometricDisplayed', 'Biometric displayed')}
</label>
<Tabs className={styles.verticalTabs} type="default">
<Tabs className={styles.verticalTabs}>
<TabList className={styles.tablist} aria-label="Biometrics tabs">
{[
{ id: 'weight', label: `Weight (${conceptUnits.get(config.concepts.weightUuid) ?? ''})` },
Expand All @@ -122,7 +122,7 @@ const BiometricsChart: React.FC<BiometricsChartProps> = ({ patientBiometrics, co
</TabList>
</Tabs>
</div>
<div className={styles.biometricChartArea}>
<div className={styles.biometricsChartArea}>
<LineChart data={chartData} options={chartOptions} />
</div>
</div>
Expand Down
Expand Up @@ -12,7 +12,7 @@

.biometricChartContainer {
display: flex;
margin: 0 spacing.$spacing-03;
margin: 0rem spacing.$spacing-05;
flex-direction: row;
justify-content: space-between;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-chart-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"lodash-es": "^4.17.15",
"uuid": "^8.3.2"
},
Expand Down
Expand Up @@ -36,7 +36,7 @@ const CancelVisitDialog: React.FC<CancelVisitDialogProps> = ({ patientUuid, clos
},
(error) => {
showNotification({
title: t('cancelVisitError', 'Error canceling active visit'),
title: t('cancelVisitError', 'Error cancelling active visit'),
kind: 'error',
critical: true,
description: error?.message,
Expand All @@ -55,7 +55,7 @@ const CancelVisitDialog: React.FC<CancelVisitDialogProps> = ({ patientUuid, clos
/>
<ModalBody>
<p className={styles.bodyShort02}>
{t('cancelVisitWarningMessage', 'Canceling this visit will delete all associated encounter(s)')}
{t('cancelVisitWarningMessage', 'Cancelling this visit will delete all associated encounters')}.
</p>
</ModalBody>
<ModalFooter>
Expand Down
Expand Up @@ -23,7 +23,7 @@ jest.mock('@openmrs/esm-framework', () => {
});

describe('Cancel visit', () => {
it('cancels an active visit and void all associated encounters', async () => {
it('cancels an active visit and voids all associated encounters', async () => {
const user = userEvent.setup();

mockUseVisit.mockReturnValue({ currentVisit: mockCurrentVisit, mutate: jest.fn() });
Expand All @@ -32,7 +32,7 @@ describe('Cancel visit', () => {
renderCancelVisitDialog();

expect(screen.getByRole('heading', { name: /Cancel active visit/i })).toBeInTheDocument();
expect(screen.getByText('Canceling this visit will delete all associated encounter(s)')).toBeInTheDocument();
expect(screen.getByText(/Cancelling this visit will delete all associated encounters/i)).toBeInTheDocument();

const cancelVisitButton = screen.getByRole('button', { name: /Cancel visit/i, exact: true });

Expand All @@ -51,7 +51,7 @@ describe('Cancel visit', () => {
});
});

it('displays an error message when canceling a visit fails', async () => {
it('displays an error message when cancelling a visit fails', async () => {
const user = userEvent.setup();

mockUseVisit.mockReturnValue({ currentVisit: mockCurrentVisit, mutate: jest.fn() });
Expand All @@ -60,7 +60,7 @@ describe('Cancel visit', () => {
renderCancelVisitDialog();

expect(screen.getByRole('heading', { name: /Cancel active visit/i })).toBeInTheDocument();
expect(screen.getByText('Canceling this visit will delete all associated encounter(s)')).toBeInTheDocument();
expect(screen.getByText(/Cancelling this visit will delete all associated encounters/i)).toBeInTheDocument();

const cancelVisitButton = screen.getByRole('button', { name: /Cancel visit/i, exact: true });

Expand All @@ -76,7 +76,7 @@ describe('Cancel visit', () => {
critical: true,
description: 'Internal server error',
kind: 'error',
title: 'Error canceling active visit',
title: 'Error cancelling active visit',
});
});
});
Expand Down
Expand Up @@ -63,6 +63,7 @@ const EndVisitDialog: React.FC<EndVisitDialogProps> = ({ patientUuid, closeModal
'endVisitWarningMessage',
'Ending this visit will not allow you to fill another encounter form for this patient',
)}
.
</p>
</ModalBody>
<ModalFooter>
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-chart-app/translations/en.json
Expand Up @@ -7,8 +7,8 @@
"cancel": "Cancel",
"cancelActiveVisit": "Cancel active visit",
"cancelVisit": "Cancel Visit",
"cancelVisitError": "Error canceling active visit",
"cancelVisitWarningMessage": "Canceling this visit will delete all associated encounter(s)",
"cancelVisitError": "Error cancelling active visit",
"cancelVisitWarningMessage": "Cancelling this visit will delete all associated encounters",
"checkFilters": "Check the filters above",
"close": "Close",
"confirm": "Confirm",
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-common-lib/package.json
Expand Up @@ -28,7 +28,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"lodash-es": "^4.17.15",
"uuid": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-conditions-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-forms-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-immunizations-app/package.json
Expand Up @@ -33,7 +33,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-medications-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-programs-app/package.json
Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/react": "^1.8.0",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"lodash-es": "^4.17.15"
Expand Down
Expand Up @@ -23,21 +23,24 @@ const ProgramActionButton: React.FC<ProgramActionButton> = ({ enrollment }) => {
if (enrollment.enrollmentStatus === 'eligible') {
return (
<Button
iconDescription="Enroll to program"
onClick={() => launchEnrollmentForm(t('enrollment', 'Enrollment'))}
renderIcon={(props) => <TaskAdd size={20} {...props} />}
kind="tertiary"
size="small"
size="sm"
>
{t('enroll', 'Enroll')}
</Button>
);
}

return (
<Button
iconDescription="Discontinue enrollment"
onClick={() => launchEnrollmentForm(t('discontinue', 'Discontinue'))}
renderIcon={(props) => <TaskAdd size={20} {...props} />}
kind="danger--ghost"
size="small"
size="sm"
>
{t('discontinue', 'Discontinue')}
</Button>
Expand Down
8 changes: 4 additions & 4 deletions packages/esm-patient-test-results-app/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "@openmrs/esm-patient-test-results-app",
"version": "4.0.0",
"license": "MPL-2.0",
"description": "Patient notes microfrontend for the OpenMRS SPA",
"description": "Patient test results microfrontend for the OpenMRS SPA",
"browser": "dist/openmrs-esm-patient-test-results-app.js",
"main": "src/index.ts",
"source": true,
Expand Down Expand Up @@ -34,10 +34,10 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/charts-react": "^1.3.2",
"@carbon/react": "^1.8.0",
"@carbon/charts-react": "^1.5.2",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.0.3",
"d3": "^7.6.1",
"lodash-es": "^4.17.15"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-patient-vitals-app/package.json
Expand Up @@ -34,8 +34,8 @@
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
},
"dependencies": {
"@carbon/charts-react": "^1.5.0",
"@carbon/react": "^1.8.0",
"@carbon/charts-react": "^1.5.2",
"@carbon/react": "^1.9.0",
"@openmrs/esm-patient-common-lib": "^4.0.0",
"d3": "^7.6.1",
"lodash-es": "^4.17.15"
Expand Down
Expand Up @@ -134,7 +134,7 @@ const VitalsChart: React.FC<VitalsChartProps> = ({ patientVitals, conceptUnits,
<label className={styles.vitalsSignLabel} htmlFor="vitals-chart-tab-group">
{t('vitalSignDisplayed', 'Vital sign displayed')}
</label>
<Tabs className={styles.verticalTabs} type="default">
<Tabs className={styles.verticalTabs}>
<TabList className={styles.tablist} aria-label="Vitals signs">
{vitalSigns.map(({ id, title, value }) => {
return (
Expand Down

0 comments on commit 7527da5

Please sign in to comment.