Skip to content
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

[Issue 2554] clean up fetcher frontend data fetcher pattern #2567

Merged

Conversation

doug-s-nava
Copy link
Collaborator

Summary

Fixes #2554

Time to review: 15 mins

Changes proposed

This change removes the services/search/searchfetcher directory, and moves any necessary related functionality into the /api classes. For more discussion on reasoning and expectations, refer to the ticket

Note that for ease of code change management this is currently branched off of dschrashun/2448-v1-search-endpoint
which has not been merged to main yet. If this PR is approved before feature/frontend-opensearch is approved for merging to main, this will merge into freature/frontend-opensearch. This seems fine as the change isn't urgent but could be rebased off main if we want to get it in.

Context for reviewers

Test steps

  1. VERIFY all search operations work as expected
  2. VERIFY opportunity detail pages load as expected

Additional information

Follow up todos:

  • refactor opportunity detail page to properly use suspense skeletons
  • figure out a way to properly mock API interactions and allow for page level testing without mocking suspense (try upgrading to next 15 / react 19?)

@doug-s-nava doug-s-nava force-pushed the dschrashun/2554-cleanup-fetcher branch from a76248a to a0bcdf8 Compare October 25, 2024 14:16
@github-actions github-actions bot removed the ci/cd label Oct 25, 2024
@doug-s-nava doug-s-nava marked this pull request as ready for review October 25, 2024 14:17
Copy link
Contributor

@emilycnava emilycnava left a comment

Choose a reason for hiding this comment

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

Haven't run locally yet, but scanned over code and it mostly tracks, albeit it looks like you're referencing a file that's not defined?

@@ -0,0 +1,10 @@
import SearchOpportunityAPI from "src/app/api/SearchOpportunityAPI";

import OpportunityListingAPI from "./OpportunityListingAPI";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I"m just not seeing it, but not seeing this file present in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that file should be there, but the relative path needs to get cleaned up. You don't see /simpler-grants-gov/frontend/src/app/api/OpportunityListingAPI.ts? It should be there on main as well

Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥

Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥

Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥

Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥

Copy link
Collaborator

@acouch acouch left a comment

Choose a reason for hiding this comment

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

Huge improvement!

[nit]: The src/services/search/searchfetcher folder has only one file in it which could be moved to the src/services/search folder.

@doug-s-nava doug-s-nava merged commit c4d5662 into feature/frontend-opensearch Oct 28, 2024
11 checks passed
@doug-s-nava doug-s-nava deleted the dschrashun/2554-cleanup-fetcher branch October 28, 2024 17:54
doug-s-nava added a commit that referenced this pull request Oct 30, 2024
* removes the "services/search/searchfetcher" directory and existing "fetcher" pattern
* moves any necessary related functionality into the "/api" classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants