Skip to content

Commit

Permalink
move the component to pmtc so that we dont have to create a new esm
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyjemutai committed Jul 17, 2024
1 parent 6e0a60a commit eee9444
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 137 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"start:form-render": "openmrs develop --backend https://openmrs-dev.globalhealthapp.net --sources packages/esm-form-render-app",
"start:tb": "openmrs develop --backend https://openmrs-dev.globalhealthapp.net --sources packages/esm-tb-app",
"start:opd": "openmrs develop --backend https://openmrs-dev.globalhealthapp.net --sources packages/esm-opd-app",
"start:ptracker": "openmrs develop --backend https://ohri-namibia-demo.globalhealthapp.net --sources packages/esm-ptracker-report-app",
"prettier": "prettier --fix --config prettier.config.js --write \"packages/**/*.{ts,tsx}\"",
"prepare": "husky install",
"test": "jest --config jest.config.js --verbose false --passWithNoTests",
Expand Down
14 changes: 10 additions & 4 deletions packages/esm-ohri-pmtct-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { configSchema } from './config-schema';
import rootComponent from './root.component';
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';
import ptrackerdashboardPath from './ptracker-reports/ptracker-report-app-menu-link.component';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

Expand Down Expand Up @@ -64,10 +65,13 @@ export const mchSummaryDashboardLink = getSyncLifecycle(
options,
);

export const mchSummaryDashboard = getAsyncLifecycle(() => import('./pmtct/patient-chart/mch-summary/mch-summary.component'), {
featureName: 'mch-summary',
moduleName,
});
export const mchSummaryDashboard = getAsyncLifecycle(
() => import('./pmtct/patient-chart/mch-summary/mch-summary.component'),
{
featureName: 'mch-summary',
moduleName,
},
);

export const maternalVisitsDashboardLink = getSyncLifecycle(
createConditionalDashboardLink({ ...maternalVisitsDashboardMeta, moduleName }),
Expand All @@ -92,3 +96,5 @@ export const maternalChildDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'mother child health results dashboard',
moduleName,
});

export const ptrackerReportNavLink = getSyncLifecycle(ptrackerdashboardPath, options);
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ConfigurableLink } from '@openmrs/esm-framework';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { ptrackerdashboardPath } from './constants';
import { ptrackerdashboardPath } from '../constants';

const PtrackerDashboardNavigation = () => {
const { t } = useTranslation();

return <ConfigurableLink to={ptrackerdashboardPath}>{t('ptrackerReports', 'Ptracker Reports')}</ConfigurableLink>;
return <ConfigurableLink to={ptrackerdashboardPath}>{t('ptrackerReports', 'PTracker Reports')}</ConfigurableLink>;
};

export default PtrackerDashboardNavigation;
7 changes: 7 additions & 0 deletions packages/esm-ohri-pmtct-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
"name": "child-visits-summary-ext",
"slot": "child-visits-summary-slot",
"component": "childVisitsDashboard"
},
{
"name": "version-two-link",
"slot": "app-menu-slot",
"component": "ptrackerReportNavLink",
"online": true,
"offline": true
}
]
}
3 changes: 2 additions & 1 deletion packages/esm-ohri-pmtct-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"pTrackerId": "PTracker ID",
"recentPregnancy": "Recent Pregnancy",
"relationship": "Relationship",
"totalDeliveries": "# Total deliveries"
"totalDeliveries": "# Total deliveries",
"ptrackerReports": "PTracker Reports"
}
55 changes: 0 additions & 55 deletions packages/esm-ptracker-report-app/package.json

This file was deleted.

14 changes: 0 additions & 14 deletions packages/esm-ptracker-report-app/src/index.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/esm-ptracker-report-app/src/root.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions packages/esm-ptracker-report-app/src/routes.json

This file was deleted.

5 changes: 0 additions & 5 deletions packages/esm-ptracker-report-app/translations/en.json

This file was deleted.

5 changes: 0 additions & 5 deletions packages/esm-ptracker-report-app/tsconfig.json

This file was deleted.

15 changes: 0 additions & 15 deletions packages/esm-ptracker-report-app/webpack.config.js

This file was deleted.

0 comments on commit eee9444

Please sign in to comment.