-
-
Notifications
You must be signed in to change notification settings - Fork 25
Handle missing files & placeholder docs in the PackageTableView #2778
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
Conversation
Add isPlaceHolder_b to getDataPackage query When the index has minimal, placeholder info for a file after fetching a data package from Solr, fetch the full system metadata for that file instead. Issue #2760
Make inactivate method to consistently disable the button, remove href, set cursor to default, and add tooltip. Issue #2760
Set the error status code & message on the model immediately when a fetch fails Issue #2760
Set the same re-render listeners at the start of the render function so it applies to both the "edit" and "view" modes. Allows view to update when file is found or error message is set. Issue #2760
- better document "archived" option in QueryService - trim sysMeta response before checking first character in DataONEObject.parse - remove redundant code in DataPackageView. Prevent double setting a listener. Issue #2760
rushirajnenuji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @robyngit - thanks, this looks great! 🎉
One very minor thing I noticed that may be we can add in the upcoming releases -- the package table shows a nice tooltip with the downloads button disabled (This file does not exist...). May be we can add the same for the entities table? Right now, it shows Error if the download fails.
Thank you again @robyngit! 🚀
Also log a warning if there's an error in the renderMetadata try-catch block because it may capture unexpected errors (not just network errors) Issue #2760
|
Yes! Good catch @rushirajnenuji, thank you!! Added a commit that deactivates the download button in the entity table if a file doesn't exist. |
This PR updates MetacatUI to better handle upcoming changes to the indexer. Next week, the indexer will start creating placeholder documents for files that are referenced in resource maps but are not yet indexed or are missing from the repository. These changes make sure that the
DataPackageViewreflect these placeholder files correctly, and improve error handling and UI feedback for non-existent files.When the DataPackage collection fetches members from Solr it now includes the
isPlaceHolder_bfield in the query. When one or more documents are marked as placeholders, then the collection attempts to fetch their system metadata to get information for the UI. As long as the file exists, the table looks and behaves normally.If the file does not exist (404), then the UI indicates that the file is missing and inactivates the download button with a tooltip explaining why (in view mode) or shows an error with directions to replace or remove the file (in edit mode).
Additionally, the "download all" button is inactivated since BagIt returns an error for packages with missing files.
Other minor improvements:
DataPackage, avoid retrying member model fetches on certain HTTP status codes (e.g. 401, 404) and record error status and messages on models immediately.DataONEObject, addfileDoesNotExist()method to check for 404 status.DownloadButtonViewin a single method call (useful for external views likeDataItemView).DataPackageViewandDataItemViewFor testing:
This package contains a file that is a placeholder doc, where the file doesn't exist on metacat: https://dev.nceas.ucsb.edu/view/urn%3Auuid%3A243bc6ce-92dc-42d9-948e-c2e78da4b885 (ask Jing for permission to edit to test it in edit mode)