Skip to content

Commit

Permalink
Change reference location in api object for agency name on search (#2229
Browse files Browse the repository at this point in the history
)

## Summary
Fixes #2172 

### Time to review: 5mins

## Changes proposed
I changed the render logic to pull agency name from the root of the
object as specified in the original issue. I chose to leave the agency
code lookup as a fallback. Open to removing that fall back if we think
that'd make more sense? Thoughts r.e. leaving agency code lookup as a
backup @acouch ?

## Context for reviewers
Make sure search results still have agency results where expected
locally.

## Additional information
<img width="804" alt="Screenshot 2024-09-26 at 11 55 14 AM"
src="https://github.com/user-attachments/assets/741c2bc8-f3ab-4558-9537-4542e9b33ffb">
  • Loading branch information
emilycnava authored Sep 27, 2024
1 parent bea90ec commit f9c11b3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions frontend/src/components/search/SearchResultsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ export default function SearchResultsListItem({
<div className="grid-col tablet:order-3 overflow-hidden font-body-xs">
<span className={metadataBorderClasses}>
<strong>{t("resultsListItem.summary.agency")}</strong>
{opportunity?.summary?.agency_name &&
opportunity?.summary?.agency_code &&
agencyNameLookup
? // Use same exact label we're using for the agency filter list
agencyNameLookup[opportunity?.summary?.agency_code]
: "--"}
{opportunity?.agency ||
(opportunity?.summary?.agency_name &&
opportunity?.summary?.agency_code &&
agencyNameLookup
? // Use same exact label we're using for the agency filter list
agencyNameLookup[opportunity?.summary?.agency_code]
: "--")}
</span>
<span className={metadataBorderClasses}>
<strong>{t("resultsListItem.opportunity_number")}</strong>
Expand Down

1 comment on commit f9c11b3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for ./frontend

St.
Category Percentage Covered / Total
🟢 Statements 88.47% 928/1049
🟡 Branches 73.49% 244/332
🟢 Functions 84.11% 180/214
🟢 Lines 88.75% 868/978

Test suite run success

188 tests passing in 59 suites.

Report generated by 🧪jest coverage report action from f9c11b3

Please sign in to comment.