Skip to content

Conversation

@robyngit
Copy link
Member

@robyngit robyngit commented Dec 3, 2025

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 DataPackageView reflect 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_b field 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:

  • in DataPackage, avoid retrying member model fetches on certain HTTP status codes (e.g. 401, 404) and record error status and messages on models immediately.
  • in DataONEObject, add fileDoesNotExist() method to check for 404 status.
  • Standardized inactive behaviour of DownloadButtonView in a single method call (useful for external views like DataItemView).
  • Fixed duplicate listener and rendering issues in DataPackageView and DataItemView

For 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)

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
@robyngit robyngit changed the title Feature 2760 placeholder docs Handle missing files & placeholder docs in the PackageTableView Dec 3, 2025
@robyngit robyngit marked this pull request as ready for review December 3, 2025 21:15
Copy link
Member

@rushirajnenuji rushirajnenuji left a 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
@robyngit
Copy link
Member Author

robyngit commented Dec 9, 2025

Yes! Good catch @rushirajnenuji, thank you!! Added a commit that deactivates the download button in the entity table if a file doesn't exist.

@robyngit robyngit merged commit 0e8d282 into develop Dec 9, 2025
@github-project-automation github-project-automation bot moved this to Done in MetacatUI Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The package landing page can handle the solr place-holder doc of an object

3 participants