-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: [DHIS-11419] display assigned users on events in enrollment overview page #3453
Changes from 2 commits
d10cc18
7487a3a
7f25607
d1b77bc
23c694e
d2b89e9
f64a7d7
6764efb
b5ee351
30b53e6
91c56e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ const valueConvertersForType = { | |
[dataElementTypes.FILE_RESOURCE]: convertResourceForDisplay, | ||
[dataElementTypes.IMAGE]: convertResourceForDisplay, | ||
[dataElementTypes.ORGANISATION_UNIT]: (rawValue: Object) => rawValue.name, | ||
[dataElementTypes.ASSIGNEE]: (rawValue: Object) => `${rawValue.name} (${rawValue.username})`, | ||
[dataElementTypes.ASSIGNEE]: (rawValue: Object) => `${rawValue.name || rawValue.displayName} (${rawValue.username})`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: There is an edge case where This happens because only the Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @simonadomnisoru! Implemented the fix so that it won't come up as an issue during testing. I tried undoing the change I did on this line, but that didn't work. Seems like removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To undo the change, you can add a converter for
This ensures that when the assignedUser value reaches the |
||
[dataElementTypes.NUMBER_RANGE]: convertNumberRangeForDisplay, | ||
[dataElementTypes.STATUS]: convertStatusForDisplay, | ||
}; | ||
|
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.
Do you know the reason why
useProgramMetadata
is retrieving data from the api instead of using the IndexedDB cache? If not, can you change it to useuseIndexedDBQuery
?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.
I'm not sure, but it could perhaps be related to translations, i.e.
displayName
needs to come from the server?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.
We have a ticket to fix the displayName cache problem. Great if you change this one to use
useIndexedDBQuery
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.
@JoakimSM
programStageDataElements
in IndexedDB doesn't contain the dataelement subvalues likevalueType
andoptionSet
. Do you think we can solve that with local data as well?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.
If I understand you correctly, there is a separate store/table for data elements. Should be retrieved from there.
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.
Changed the metadata source in this case from the server to IndexedDB. The code got rather complicated the way I did it though. Got any suggestions for making it less complicated?
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.
I don't think it looks too bad. But, what is the advantage of using your custom
useQueryStyleEvaluation
instead ofuseIndexedDBQuery
like we do inuseProgramFromIndexedDB
?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 just how the caching is done. I think
useIndexedDBQuery
generally uses time to determine when to clear out a cache entry, which in this case doesn't feel very natural to me.useQueryStyleEvaluation
does the caching likeuseMemo
would.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 would be beneficial to have one approach for this and currently that is
useIndexedDBQuery
. If we don't like the approach there, we can look into what we don't like and change it for all queries to IndexedDB. But let's start by usinguseIndexedDBQuery
.