DCB-848 Present datagrid records in separate page rather than overlay

DCB-848 Present datagrid records in separate page rather than overlay

Goal

It needs to be possible to signpost users to a specific datagrid record page with a dedicated URL. This isn’t possible with the current implementation as all details are presented as an overlay.

Examples

(correct at the time of writing - DB changes may alter this):

Patterns and Technical Notes

  • URL structure is as above - e.g. patronRequests/38664e55-7e9a-4524-a2ba-639badff431a

  • The dynamically generated pages structure is [typeId].tsx - so [patronRequestId].tsx. Because of Next.js' file-system based routing, their parent folders provide the patronRequests part of the URL (as an example) and so it is important to be careful if this ever needs to be changed.

    • Example (using PatronRequest)

      • Record / Details page (dynamically generated) should have the filename [patronRequest].tsx, and the patronRequest variable within it should follow that form exactly.

      • The parent folder should be patronRequests.

      • The type passed into ServerPaginatedGrid from index.tsx should match the name of the parent folder exactly (as it’s used to find the correct URL).

      • If we ever needed to change this, we would have to change it everywhere to make sure it works - and double-check the parent folder name has actually been changed (something strange happened with this not changing when it should have during development)

  • Queries are now split by category and alphabetically ordered in queries.ts .

    • Mutations have been separated from queries and put at the top.

    • The general pattern is that each category (apart from mappings) has

      • a query to fetch a page of records, and

      • a query to get a record by ID.

    • Host LMS also has a specialised query for the Host LMS selection menu used in mappings upload.

  • Breadcrumbs now check for UUIDs so they don’t attempt to translate them (which causes a mess).

References

Operated as a Community Resource by the Open Library Foundation