Skip to content

Commit

Permalink
OHRI-2048 Update package index.ts to syncronously load pages and exte… (
Browse files Browse the repository at this point in the history
UCSF-IGHS#1742)

* OHRI-2048 Update package index.ts to syncronously load pages and extensions

* Remove unused async import
  • Loading branch information
ODORA0 authored Jan 10, 2024
1 parent 567ee49 commit d610f9e
Showing 1 changed file with 31 additions and 43 deletions.
74 changes: 31 additions & 43 deletions packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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');

Expand All @@ -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(
Expand Down

0 comments on commit d610f9e

Please sign in to comment.