-
Notifications
You must be signed in to change notification settings - Fork 228
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
(refactor) O3-3806: Refactor Service queue entries api call using OpenMrs Fetch All #1383
base: main
Are you sure you want to change the base?
Conversation
@@ -57,7 +57,7 @@ function ClinicMetrics() { | |||
/> | |||
<MetricsCard | |||
label={t('patients', 'Patients')} | |||
value={initialSelectedItem ? totalCount ?? '--' : serviceCount} | |||
value={initialSelectedItem ? totalCount || '--' : serviceCount} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used or Operator here because useOpenMrsFetchAll returns NaN when there is no total count and nullish collasing operator doesn't recognize NaN as faulty value. So we see for a Brief moment NaN being displayed in the metrics card .
We can overcome this using OR operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm... but if totalCount
is 0, we will just get '--'
. I think we'll have to manually check for NaN (or isLoading
from useOpenMrsFetchAll
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, correct . I will make the corrections. Thanks.
Requirements
Summary
To use hooks already present in esm-core to fetch all the queue entries.
Related Issue
https://openmrs.atlassian.net/browse/O3-3806
OpenMRS.-.Google.Chrome.2024-11-20.22-32-36.webm