metacatui
metacatui copied to clipboard
When a metadata doc is opened in the editor with no resource map, check for broken resource map chains
When the editor is opened for an existing metadata doc with no resource map, we should check the system metadata to see if it obsoletes another metadata doc. If so, we can query for the resource map ID of the previous version and open that resource map in the editor, as if the chain were never broken.
An example of where this is useful:
- Someone opens the editor for an existing package, edits, and clicks Submit
- While the package is saving, the user leaves the page
- The resource map is never updated on the server, but the EML is
- The user opens the updated EML in the editor and sees that the rest of the package is missing because the resource map was never updated previously
- The improvement described above would grab the most recent resource map for that EML version chain and use that in the editor
See #558
The new ResourceMapResolver and VersionTracker classes will make this task a lot easier. If there IS an EML doc with a past resource map, do we always want to revert to that one? are there cases where that would be problematic? @mbjones @jeanetteclark