-
Notifications
You must be signed in to change notification settings - Fork 43
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
PIMS-1741 Lookup Context #2469
PIMS-1741 Lookup Context #2469
Conversation
🚀 Deployment Information The Express API Image has been built with the tag: |
Code Climate has analyzed commit 28c639f and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 95.4% (50% is the threshold). This pull request will bring the total coverage in the repository to 94.5%. View more on Code Climate. |
The context seems to work well. I think one thing that might be desirable to include in this is some functions for retrieving a lookup item by it's numeric id. There would be some upfront cost in collecting objects into a feasible format for this (probably organized into objects of form [primarykey]: { ...restOfRow } ), but past that initial cost we would then be able to retrieve anything in O(1) time. This would keep things super speedy when we go to use these in the tables. EDIT: Went ahead and made a commit for this functionality. Let me know what you think. |
@GrahamS-Quartech I like the way that works. Good idea. EDIT: Ok, think it's working now! |
🎯 Summary
PIMS-1741
Goal is to add a lookup context to the frontend that would reduce the number of joins needed in other database calls.
Lookup context matches this interface:
This PR only adds the context for use. Will continue this ticket with a second PR that starts to swap out the joins for context usage.
Changes
Testing
If you navigate to /dev, there's a log that should print the context to the console.
🔰 Checklist