Skip to content

Commit

Permalink
Home page menu to have an option to access reports and dashboards (#1906
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
lucyjemutai authored Jul 18, 2024
1 parent 4306806 commit 07ca794
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/esm-ohri-pmtct-app/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ptrackerdashboardPath = `/openmrs/reportingui/reportsapp/home.page`;
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
@@ -0,0 +1,12 @@
import { ConfigurableLink } from '@openmrs/esm-framework';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { ptrackerdashboardPath } from '../constants';

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

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"
}

0 comments on commit 07ca794

Please sign in to comment.