Skip to content

Commit 07ca794

Browse files
authored
Home page menu to have an option to access reports and dashboards (#1906)
* Home page menu to have an option to access reports and dashboards * c * update * move the component to pmtc so that we dont have to create a new esm * Update yarn.lock * Update package.json
1 parent 4306806 commit 07ca794

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ptrackerdashboardPath = `/openmrs/reportingui/reportsapp/home.page`;

packages/esm-ohri-pmtct-app/src/index.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { configSchema } from './config-schema';
1919
import rootComponent from './root.component';
2020
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';
21+
import ptrackerdashboardPath from './ptracker-reports/ptracker-report-app-menu-link.component';
2122

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

@@ -64,10 +65,13 @@ export const mchSummaryDashboardLink = getSyncLifecycle(
6465
options,
6566
);
6667

67-
export const mchSummaryDashboard = getAsyncLifecycle(() => import('./pmtct/patient-chart/mch-summary/mch-summary.component'), {
68-
featureName: 'mch-summary',
69-
moduleName,
70-
});
68+
export const mchSummaryDashboard = getAsyncLifecycle(
69+
() => import('./pmtct/patient-chart/mch-summary/mch-summary.component'),
70+
{
71+
featureName: 'mch-summary',
72+
moduleName,
73+
},
74+
);
7175

7276
export const maternalVisitsDashboardLink = getSyncLifecycle(
7377
createConditionalDashboardLink({ ...maternalVisitsDashboardMeta, moduleName }),
@@ -92,3 +96,5 @@ export const maternalChildDashboard = getSyncLifecycle(OHRIHome, {
9296
featureName: 'mother child health results dashboard',
9397
moduleName,
9498
});
99+
100+
export const ptrackerReportNavLink = getSyncLifecycle(ptrackerdashboardPath, options);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ConfigurableLink } from '@openmrs/esm-framework';
2+
import React from 'react';
3+
import { useTranslation } from 'react-i18next';
4+
import { ptrackerdashboardPath } from '../constants';
5+
6+
const PtrackerDashboardNavigation = () => {
7+
const { t } = useTranslation();
8+
9+
return <ConfigurableLink to={ptrackerdashboardPath}>{t('ptrackerReports', 'PTracker Reports')}</ConfigurableLink>;
10+
};
11+
12+
export default PtrackerDashboardNavigation;

packages/esm-ohri-pmtct-app/src/routes.json

+7
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
"name": "child-visits-summary-ext",
7878
"slot": "child-visits-summary-slot",
7979
"component": "childVisitsDashboard"
80+
},
81+
{
82+
"name": "version-two-link",
83+
"slot": "app-menu-slot",
84+
"component": "ptrackerReportNavLink",
85+
"online": true,
86+
"offline": true
8087
}
8188
]
8289
}

packages/esm-ohri-pmtct-app/translations/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"pTrackerId": "PTracker ID",
2121
"recentPregnancy": "Recent Pregnancy",
2222
"relationship": "Relationship",
23-
"totalDeliveries": "# Total deliveries"
23+
"totalDeliveries": "# Total deliveries",
24+
"ptrackerReports": "PTracker Reports"
2425
}

0 commit comments

Comments
 (0)