From d610f9e6ff7389d4cfa0a09f70fbe43d230d398d Mon Sep 17 00:00:00 2001 From: AJAL ODORA JONATHAN <43242517+ODORA0@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:17:05 +0300 Subject: [PATCH] =?UTF-8?q?OHRI-2048=20Update=20package=20index.ts=20to=20?= =?UTF-8?q?syncronously=20load=20pages=20and=20exte=E2=80=A6=20(#1742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * OHRI-2048 Update package index.ts to syncronously load pages and extensions * Remove unused async import --- packages/esm-tb-app/src/index.ts | 74 +++++++++++++------------------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/packages/esm-tb-app/src/index.ts b/packages/esm-tb-app/src/index.ts index 6661e8508..a41ab50ad 100644 --- a/packages/esm-tb-app/src/index.ts +++ b/packages/esm-tb-app/src/index.ts @@ -1,4 +1,4 @@ -import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework'; +import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework'; import { createOHRIDashboardLink, OHRIHome, OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; import { @@ -11,6 +11,12 @@ import { tbCasesDashboardMeta, } from './dashboard.meta'; import { configSchema } from './config-schema'; +import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component'; +import ProgramManagementSummary from './views/program-management/maternal-health.component'; +import TbTreatmentFollowUpList from './views/treatment-and-follow-up/tb-treatment-follow-up.component'; +import TbContactTracingList from './views/tb-contact-listing/tb-contact-list.component'; +import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component'; +import TbHomePatientTabs from './views/dashboard/patient-list-tabs/tb-patient-list-tabs.component'; export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); @@ -33,68 +39,50 @@ export const tbPatientSummaryDashboardLink = getSyncLifecycle( createDashboardLink({ ...tbPatientSummaryDashboardMeta, moduleName }), options, ); -export const tbPatientSummaryList = getAsyncLifecycle( - () => import('./views/patient-summary/tb-patient-summary.component'), - { - featureName: 'hts-service-summary-list', - moduleName, - }, -); +export const tbPatientSummaryList = getSyncLifecycle(TBSummaryOverviewList, { + featureName: 'hts-service-summary-list', + moduleName, +}); export const tbProgramManagementDashboardLink = getSyncLifecycle( createDashboardLink({ ...tbProgramManagementDashboardMeta, moduleName }), options, ); -export const tbProgramManagementDashboard = getAsyncLifecycle( - () => import('./views/program-management/maternal-health.component'), - { - featureName: 'tb-program-management-summary', - moduleName, - }, -); +export const tbProgramManagementDashboard = getSyncLifecycle(ProgramManagementSummary, { + featureName: 'tb-program-management-summary', + moduleName, +}); export const tbTreatmentFollowUpDashboardLink = getSyncLifecycle( createDashboardLink({ ...tbTreatmentFollowUpDashboardMeta, moduleName }), options, ); -export const tbTreatmentFollowUpDashboard = getAsyncLifecycle( - () => import('./views/treatment-and-follow-up/tb-treatment-follow-up.component'), - { - featureName: 'tb-treatment-follow-up-summary', - moduleName, - }, -); +export const tbTreatmentFollowUpDashboard = getSyncLifecycle(TbTreatmentFollowUpList, { + featureName: 'tb-treatment-follow-up-summary', + moduleName, +}); export const tbContactListingDashboardLink = getSyncLifecycle( createDashboardLink({ ...tbContactListingDashboardMeta, moduleName }), options, ); -export const tbContactListingDashboard = getAsyncLifecycle( - () => import('./views/tb-contact-listing/tb-contact-list.component'), - { - featureName: 'tb-contact-listing-summary', - moduleName, - }, -); +export const tbContactListingDashboard = getSyncLifecycle(TbContactTracingList, { + featureName: 'tb-contact-listing-summary', + moduleName, +}); export const tbDashboardHeader = getSyncLifecycle(OHRIWelcomeSection, { featureName: 'tb-home-header', moduleName, }); -export const tbDashboardTiles = getAsyncLifecycle( - () => import('./views/dashboard/summary-tiles/tb-summary-tiles.component'), - { - featureName: 'tb-home-tiles', - moduleName, - }, -); -export const tbDashboardTabs = getAsyncLifecycle( - () => import('./views/dashboard/patient-list-tabs/tb-patient-list-tabs.component'), - { - featureName: 'tb-home-tabs', - moduleName, - }, -); +export const tbDashboardTiles = getSyncLifecycle(TbSummaryTiles, { + featureName: 'tb-home-tiles', + moduleName, +}); +export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, { + featureName: 'tb-home-tabs', + moduleName, +}); // OHRI HOME export const tbClinicalViewDashboardLink = getSyncLifecycle(