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):
https://admin.dcbdev.lsphost.com/locations/5072f291-c199-541e-9247-3c6f5ec54adb - the record for the location with the relevant ID (Kansas City University)
https://admin.dcbdev.lsphost.com/patronRequests/0ae1995c-9645-41e9-952e-d6bc37e4a7ee the record for the patron request of said ID (Brain of the Firm)
Patterns and Technical Notes
URL structure is as above - e.g.
patronRequests/38664e55-7e9a-4524-a2ba-639badff431aThe dynamically generated pages structure is
[typeId].tsx- so[patronRequestId].tsx. Because of Next.js' file-system based routing, their parent folders provide thepatronRequestspart 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 thepatronRequestvariable within it should follow that form exactly.The parent folder should be
patronRequests.The type passed into
ServerPaginatedGridfromindex.tsxshould 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).