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

No ref: Prep for API integration #302

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

7emansell
Copy link
Collaborator

@7emansell 7emansell commented Mar 6, 2025

Ticket:

no ticket, just starting point for these tickets: DR-3464, DR-3416, DR-3362

This PR does the following:

  • Fleshes out mock search and collection response to match schemas as of 3/7
  • Integrates search functionality from server component down to client filter components

Open Questions

  • See comments for areas that I think will need specific work (more than just plugging in data)

How has this been tested? How should a reviewer test this?

Accessibility concerns or updates

Checklist:

  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.
  • I have updated the CHANGELOG.md.

Copy link

vercel bot commented Mar 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
digital-collections ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 8:40pm

} from "@nypl/design-system-react-components";
import { useState } from "react";

type CollectionMetadataProps = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This and collectionsUUIDSchema will need to be updated once we have the list of all metadata fields being returned. this file has some initial formatting but this should definitely be abstracted out instead of hard set for each field

push(`${pathname}?${queryString}`);
};

let startValue = searchManager.filters.find((f) => f.filter === "dateStart")
Copy link
Collaborator Author

@7emansell 7emansell Mar 7, 2025

Choose a reason for hiding this comment

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

this mix of setting the filter to the value that's currently in searchManager on mount and then managing it with state seems to work fine but is a little confusing– there might well be another way to do this. This is the same pattern used in selectFilter and rightsFilter, so it'd need to be checked in all 3 places.

filters: searchParams.filters,
page: searchParams.page,
});
const searchResults =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

once the search endpoint is complete, my hope is that you can pretty much just uncomment this and then work out the bugs from there. Same on /collections/[slug]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this whole prefetching situation can be ignored for now but the response from the collections/:uuid/children endpoint should align with what's happening here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant