-
Notifications
You must be signed in to change notification settings - Fork 16
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
Look into adjusting the naming / data structure of the agency data in the opportunity response #2371
Comments
Looking into this |
a few notes on the current behavior frontend UIopportunity detail
search UI
filter behavior
Possible TodosSo, the todos from the frontend side seem to be:
|
@doug-s-nava - just following up on a few of your notes:
|
Overall, like the proposed change.
I would imagine we will have to do this at some point, as the facet / filter counts will have to come from the API. We haven't committed to including those yet. From a user perspective it would be nice to keep the filters outside of a suspense boundary, so when you visit the search page, the filters aren't loading like the results are. Maybe there is a way to still get those from the API and partial pre-render them since they won't be changing very often. |
@acouch Yeah, it's a good thought on what we would want to render while we pull down the list from the API. I think it would be safe enough to completely populate the easier ones optimisitically - status and funding instrument seem likely to be completely static, so we could pretty safely render those immediately, and just populate the others from the API? If we added a status or funding instrument, then we'd have to update a hardcoded list, but that seems like it'd be a rare occurance |
Technically if you wanted the left-hand filters, and we fully supported the hierarchy of agency data, you could always call search with no filters to get the full dataset and cache that to use on initial page load. Effectively, the facet counts == the possible filters when you don't filter anything. Agency is the only one that currently will change without a deliberate code change on the API side. The rest require adjusting an Enum in https://github.com/HHS/simpler-grants-gov/blob/main/api/src/constants/lookup_constants.py which affects both the API schemas and DB allowed values. |
Summary
Right now an opportunity returns the following relevant agency information in our API (fake data):
The agency data is stored across two parts of the API response, two fields in the top-level, and the rest in the summary object. The agency code, and name appear twice as well, and are not consistent with one another.
This is almost certainly going to be confusing for users of the API, and we should correct this issue.
--
Context on why it is this way:
agency
field is actually the agency code of the opportunityagency_name
is found by joining the agency field with the agency tableFrom prior investigation, the agency code is almost never different between the two levels, but there are a few specific cases where they are (not intentional as far as I can tell - likely just an old bug). The top-level values are better supported/accurate and we shouldn't keep the agency code / agency name of the inner summary object.
--
Recommendation:
As the only user of our API at this time is the front-end, we would just need to temporarily add another field at the top-level, and have them switch over.
This will make the request look like:
--
Note that the DB will continue to contain a few extra fields for now, we can clean that up later.
Acceptance criteria
The text was updated successfully, but these errors were encountered: