Fix detail page of NuGet package with missing metadata
What does this MR do and why?
There's a ~bug on the detail page of a NuGet package (<base URL>/<group>/<project>/-/packages/<package id>
). If optional metadata (license_url
, project_url
or icon_url
) is missing in the package, the page is not loaded:
This bug is fixed by this MR: The corresponding fields are set to be optional in the GraphQL type Types::Packages::Nuget::MetadatumType
and the additional metadata rows are only dislayed if the field exists.
/cc @bufferoverflow
Screenshots
Detail page of a NuGet package without projectUrl
(source):
Before | After |
---|---|
How to set up and validate locally
- Create a NuGet package without
<projectUrl>
tag in the.nuspec
file. - Publish NuGet package to package registry of a project (http://localhost:3000/help/user/packages/nuget_repository/index.md#publish-a-nuget-package)
- Visit
Packages & Registries > Package Registry
page of project. - Click on the uploaded NuGet package to view the detail 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.