ANW-1831: Fix 404 console error for PUI resource show views
#3803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where, when viewing a resource's show page in the public interface (e.g., /repositories/4/resources/40), the browser console showed a 404 error:
XHR GET /repositories/4/resources/40/tree/node?node=/repositories/4/resources/40 [HTTP/2 404]ANW-1831
Problem
The _children_tree partial sets both root_node_uri and current_node_uri to the resource URI. When the tree loads:
Fix
Add an early return in
expandNode()when the row has theroot-rowclass:Why no new tests are included
The backend behavior is already covered by an existing controller spec, so the console error was expected before this small fix.