Read GraphQL PackageLinks to render link to package details page
requested to merge 344257-don-t-display-package-details-page-for-packages-not-in-the-default-status-2 into master
What does this MR do and why?
This MR:
- Updates GraphQL query as follow-up to Add _links object to the Package GraphQL API (!101416 - merged)
- Updates component to render
router-link
only when_links.webPath
contains link to details page - fallback to rendering just the text if
_links.webPath
isnull
Screenshots or screen recordings
No visual changes
How to set up and validate locally
-
Follow instructions to publish a new packages
-
Visit package registry list page for groups & projects.
-
Should be able to click the link and view the package detail page
-
Now change package status to error. This updates the status for the last created package
Packages::Package.last.update!(status: "error")
-
Replace
app/graphql/types/packages/package_links_type.rb
Line14-16 withdef web_path return unless object.default? package_path(object) end
-
Confirm that the package is not clickable on the package registry list page.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #344257 (closed)
Edited by Rahul Chanila