-
Notifications
You must be signed in to change notification settings - Fork 248
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
O3-2684: remove hard coded queue entry statuses #1568
Conversation
Size Change: -88 B (0%) Total Size: 10.3 MB ℹ️ View Unchanged
|
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.
It is consistent with your other changes, but would be good to get someone more familiar with this to weigh in. @ibacher or @denniskigen ?
default: | ||
return ''; | ||
if (queueEntry?.status) { | ||
return `${queueEntry.status} - ${queueEntry.service}`; |
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.
Is the -
here necessary? We kind of want to end up in a state where it's possible to display "Waiting for xxx", "Attending xxx", etc.
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.
My other thought here is that it would be a good idea to run this through the translation system:
return `${t(queueEntry.status)} ${t(queueEntry.service)}`
This allows implementations to customize the text if they don't want to customize the concept.
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.
It should also be null-safe I realise. eg. we should prepare for the possibility that queueEntry.service could be null.
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.
Thanks @ibacher and @mseaton ! I have added the translate function, and also checked that queueEntry.service is not null.
@ibacher , the reason I added the '-' (hyphen) here is to be consistent with the other change we made to the service-queue:
https://github.com/openmrs/openmrs-esm-patient-management/blob/main/packages/esm-service-queues-app/src/helpers/functions.ts#L20
If there is a clearer pattern for displaying statuses, I am happy to update the code in both places so the queue statuses will be displayed in a consistent way. Please let me know. Thanks!
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.
It's an interesting point about the hyphen, @ibacher , but as @cioan pointed out we are making this consistent with another change we already made, and although I can see the desire to support the display strings of status + service to represent a phrase, I don't think we we to mandate this, if that makes any sense?
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.
Looks good to me, thanks @cioan . Will also add @CynthiaKamau as a reviewer.
Thanks @cioan for this, could you share a screenshot of how this appears now? I have something like |
Sure @CynthiaKamau , here how it looks on the PIH test server now after we customized the queue entry statuses: |
Thank you @CynthiaKamau ! |
@mseaton , you were correct, there was another place, the visit header where the queue statuses were hard coded. Thanks!