Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
412acd19
Commit
412acd19
authored
Oct 08, 2021
by
Jonas Wälter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix detail page of NuGet package with missing metadata
Changelog: fixed
parent
3b9aa8e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
10 deletions
+52
-10
app/assets/javascripts/packages_and_registries/package_registry/components/details/metadata/nuget.vue
...es/package_registry/components/details/metadata/nuget.vue
+13
-2
app/graphql/types/packages/nuget/metadatum_type.rb
app/graphql/types/packages/nuget/metadatum_type.rb
+3
-3
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+3
-3
spec/frontend/packages_and_registries/package_registry/components/details/metadata/nuget_spec.js
...ackage_registry/components/details/metadata/nuget_spec.js
+27
-2
spec/graphql/types/packages/nuget/metadatum_type_spec.rb
spec/graphql/types/packages/nuget/metadatum_type_spec.rb
+6
-0
No files found.
app/assets/javascripts/packages_and_registries/package_registry/components/details/metadata/nuget.vue
View file @
412acd19
...
...
@@ -24,7 +24,13 @@ export default {
<
template
>
<div>
<details-row
icon=
"project"
padding=
"gl-p-4"
dashed
data-testid=
"nuget-source"
>
<details-row
v-if=
"packageEntity.metadata.projectUrl"
icon=
"project"
padding=
"gl-p-4"
dashed
data-testid=
"nuget-source"
>
<gl-sprintf
:message=
"$options.i18n.sourceText"
>
<template
#link
>
<gl-link
:href=
"packageEntity.metadata.projectUrl"
target=
"_blank"
>
{{
...
...
@@ -33,7 +39,12 @@ export default {
</
template
>
</gl-sprintf>
</details-row>
<details-row
icon=
"license"
padding=
"gl-p-4"
data-testid=
"nuget-license"
>
<details-row
v-if=
"packageEntity.metadata.licenseUrl"
icon=
"license"
padding=
"gl-p-4"
data-testid=
"nuget-license"
>
<gl-sprintf
:message=
"$options.i18n.licenseText"
>
<
template
#link
>
<gl-link
:href=
"packageEntity.metadata.licenseUrl"
target=
"_blank"
>
{{
...
...
app/graphql/types/packages/nuget/metadatum_type.rb
View file @
412acd19
...
...
@@ -10,9 +10,9 @@ module Types
authorize
:read_package
field
:id
,
::
Types
::
GlobalIDType
[
::
Packages
::
Nuget
::
Metadatum
],
null:
false
,
description:
'ID of the metadatum.'
field
:license_url
,
GraphQL
::
Types
::
String
,
null:
fals
e
,
description:
'License URL of the Nuget package.'
field
:project_url
,
GraphQL
::
Types
::
String
,
null:
fals
e
,
description:
'Project URL of the Nuget package.'
field
:icon_url
,
GraphQL
::
Types
::
String
,
null:
fals
e
,
description:
'Icon URL of the Nuget package.'
field
:license_url
,
GraphQL
::
Types
::
String
,
null:
tru
e
,
description:
'License URL of the Nuget package.'
field
:project_url
,
GraphQL
::
Types
::
String
,
null:
tru
e
,
description:
'Project URL of the Nuget package.'
field
:icon_url
,
GraphQL
::
Types
::
String
,
null:
tru
e
,
description:
'Icon URL of the Nuget package.'
end
end
end
...
...
doc/api/graphql/reference/index.md
View file @
412acd19
...
...
@@ -11982,10 +11982,10 @@ Nuget metadata.
| Name | Type | Description |
| ---- | ---- | ----------- |
|
<a
id=
"nugetmetadataiconurl"
></a>
`iconUrl`
|
[
`String
!
`
](
#string
)
| Icon URL of the Nuget package. |
|
<a
id=
"nugetmetadataiconurl"
></a>
`iconUrl`
|
[
`String`
](
#string
)
| Icon URL of the Nuget package. |
|
<a
id=
"nugetmetadataid"
></a>
`id`
|
[
`PackagesNugetMetadatumID!`
](
#packagesnugetmetadatumid
)
| ID of the metadatum. |
|
<a
id=
"nugetmetadatalicenseurl"
></a>
`licenseUrl`
|
[
`String
!
`
](
#string
)
| License URL of the Nuget package. |
|
<a
id=
"nugetmetadataprojecturl"
></a>
`projectUrl`
|
[
`String
!
`
](
#string
)
| Project URL of the Nuget package. |
|
<a
id=
"nugetmetadatalicenseurl"
></a>
`licenseUrl`
|
[
`String`
](
#string
)
| License URL of the Nuget package. |
|
<a
id=
"nugetmetadataprojecturl"
></a>
`projectUrl`
|
[
`String`
](
#string
)
| Project URL of the Nuget package. |
### `OncallParticipantType`
...
...
spec/frontend/packages_and_registries/package_registry/components/details/metadata/nuget_spec.js
View file @
412acd19
...
...
@@ -9,9 +9,8 @@ import { PACKAGE_TYPE_NUGET } from '~/packages_and_registries/package_registry/c
import
DetailsRow
from
'
~/vue_shared/components/registry/details_row.vue
'
;
const
nugetPackage
=
{
packageType
:
PACKAGE_TYPE_NUGET
,
metadata
:
nugetMetadata
()
};
describe
(
'
Nuget Metadata
'
,
()
=>
{
let
nugetPackage
=
{
packageType
:
PACKAGE_TYPE_NUGET
,
metadata
:
nugetMetadata
()
};
let
wrapper
;
const
mountComponent
=
()
=>
{
...
...
@@ -52,4 +51,30 @@ describe('Nuget Metadata', () => {
expect
(
element
.
props
(
'
icon
'
)).
toBe
(
icon
);
expect
(
findElementLink
(
element
).
attributes
(
'
href
'
)).
toBe
(
nugetPackage
.
metadata
[
link
]);
});
describe
(
'
without source
'
,
()
=>
{
beforeAll
(()
=>
{
nugetPackage
=
{
packageType
:
PACKAGE_TYPE_NUGET
,
metadata
:
{
iconUrl
:
'
iconUrl
'
,
licenseUrl
:
'
licenseUrl
'
},
};
});
it
(
'
does not show additional metadata
'
,
()
=>
{
expect
(
findNugetSource
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
without license
'
,
()
=>
{
beforeAll
(()
=>
{
nugetPackage
=
{
packageType
:
PACKAGE_TYPE_NUGET
,
metadata
:
{
iconUrl
:
'
iconUrl
'
,
projectUrl
:
'
projectUrl
'
},
};
});
it
(
'
does not show additional metadata
'
,
()
=>
{
expect
(
findNugetLicense
().
exists
()).
toBe
(
false
);
});
});
});
spec/graphql/types/packages/nuget/metadatum_type_spec.rb
View file @
412acd19
...
...
@@ -10,4 +10,10 @@ RSpec.describe GitlabSchema.types['NugetMetadata'] do
expect
(
described_class
).
to
include_graphql_fields
(
*
expected_fields
)
end
%w[projectUrl licenseUrl iconUrl]
.
each
do
|
optional_field
|
it
"
#{
optional_field
}
can be null"
do
expect
(
described_class
.
fields
[
optional_field
].
type
).
to
be_nullable
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment