Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Chore) Refactor Service metrics extension slot #7

Merged
merged 5 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Card from '../../metrics-cards/card.component';
import styles from '../../metrics-cards/metrics-cards.scss';
import { ExtensionSlot } from '@openmrs/esm-framework';

export default function ServiceMetrics() {
function ServiceMetrics() {
const { t } = useTranslation();
const { isLoading, error } = useBillableServices();

Expand Down Expand Up @@ -40,3 +40,5 @@ export default function ServiceMetrics() {
</section>
);
}

export default React.memo(ServiceMetrics);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right. Remove the React.memo from here and you can use it in the logic for calculating the tile cards

6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ export const billingSummaryDashboardLink = getSyncLifecycle(
options,
);

export const billingServicesTiles = getSyncLifecycle(ServiceMetrics, {
featureName: 'billing-home-tiles',
moduleName,
});
// export const billingServicesTiles = getSyncLifecycle(ServiceMetrics, options);

export const billableServicesCardLink = getSyncLifecycle(BillableServicesCardLink, options);
export const billableServicesHome = getSyncLifecycle(BillableServiceHome, options);
export const billingCheckInForm = getSyncLifecycle(BillingCheckInForm, options);
export const serviceMetrics = getSyncLifecycle(ServiceMetrics, options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align this with what u have in the routes.json

export const billingForm = getSyncLifecycle(BillingForm, options);
export const billingPatientSummary = getSyncLifecycle(BillHistory, options);
export const requirePaymentModal = getSyncLifecycle(RequirePaymentModal, options);
Expand Down
2 changes: 1 addition & 1 deletion src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
{
"name": "billing-home-tiles-ext",
"slot": "billing-home-tiles-slot",
"component": "billingServicesTiles"
"component": "ServiceMetrics"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case in the index.ts doesn't match this one

}
]
}
Loading