Read GraphQL PackageLinks to render link on package versions page
What does this MR do and why?
Follow-up to !102366 (merged), this MR adds similar behaviour to versions tab on the package registry details page.
- Updates versions nodes GraphQL query to request for
_links.webPath
- 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
- Also removes unused event method in package_list_row.vue from Read GraphQL PackageLinks to render link to pac... (!102366 - merged)
Screenshots or screen recordings
No visual changes
Reference:
How to set up and validate locally
-
rails c
- Open the rails console -
p = Project.find(1)
- Find one of your GDK projects. Project id can be found on the project home page -
FactoryBot.create_list(:npm_package, 25, project: p, name: p.name)
- Creates 25 npm packages -
Add this line if above fails during the creation of files
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end
-
Visit package registry list page for groups & projects.
-
Should be able to click the link and view the package detail page.
-
Visit the
other versions
tab. Should be able to click on each package and visit 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")
-
Confirm that the package is not clickable on the package registry list page.
-
Confirm that the package is not clickable on the versions tab in package registry details 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)