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
1d43fae1
Commit
1d43fae1
authored
Mar 15, 2021
by
Fernando Arias
Committed by
Scott Hampton
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update package list logic for license compliance
* If we have 0 packages for a license then show empty string
parent
22a117e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
ee/app/assets/javascripts/vue_shared/license_compliance/components/license_issue_body.vue
...ared/license_compliance/components/license_issue_body.vue
+6
-1
ee/changelogs/unreleased/321051-license-compliance-ui-index-out-of-bounds.yml
...ased/321051-license-compliance-ui-index-out-of-bounds.yml
+5
-0
ee/spec/frontend/vue_shared/license_compliance/components/license_issue_body_spec.js
.../license_compliance/components/license_issue_body_spec.js
+20
-1
No files found.
ee/app/assets/javascripts/vue_shared/license_compliance/components/license_issue_body.vue
View file @
1d43fae1
...
...
@@ -14,6 +14,11 @@ export default {
required
:
true
,
},
},
computed
:
{
hasPackages
()
{
return
Boolean
(
this
.
issue
.
packages
.
length
);
},
},
methods
:
{
...
mapActions
(
LICENSE_MANAGEMENT
,
[
'
setLicenseInModal
'
])
},
};
</
script
>
...
...
@@ -21,6 +26,6 @@ export default {
<
template
>
<div
class=
"report-block-info license-item"
>
<gl-link
:href=
"issue.url"
target=
"_blank"
>
{{
issue
.
name
}}
</gl-link>
<license-packages
:packages=
"issue.packages"
class=
"text-secondary"
/>
<license-packages
v-if=
"hasPackages"
:packages=
"issue.packages"
class=
"text-secondary"
/>
</div>
</
template
>
ee/changelogs/unreleased/321051-license-compliance-ui-index-out-of-bounds.yml
0 → 100644
View file @
1d43fae1
---
title
:
Hide package list if license compliance has an entry with 0 packages
merge_request
:
55466
author
:
type
:
fixed
ee/spec/frontend/vue_shared/license_compliance/components/license_issue_body_spec.js
View file @
1d43fae1
...
...
@@ -14,7 +14,6 @@ describe('LicenseIssueBody', () => {
beforeEach
(()
=>
{
store
=
createStore
();
vm
=
mountComponentWithStore
(
Component
,
{
props
:
{
issue
},
store
});
});
afterEach
(()
=>
{
...
...
@@ -22,6 +21,10 @@ describe('LicenseIssueBody', () => {
});
describe
(
'
template
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponentWithStore
(
Component
,
{
props
:
{
issue
},
store
});
});
it
(
'
renders component container element with class `license-item`
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
license-item
'
)).
toBe
(
true
);
});
...
...
@@ -40,4 +43,20 @@ describe('LicenseIssueBody', () => {
expect
(
trimText
(
packagesEl
.
innerText
)).
toBe
(
'
Used by pg, puma, foo, and 2 more
'
);
});
});
describe
(
'
template without packages
'
,
()
=>
{
beforeEach
(()
=>
{
const
issueWithoutPackages
=
licenseReport
[
0
];
issueWithoutPackages
.
packages
=
[];
vm
=
mountComponentWithStore
(
Component
,
{
props
:
{
issue
:
issueWithoutPackages
},
store
});
});
it
(
'
does not render packages list
'
,
()
=>
{
const
packagesEl
=
vm
.
$el
.
querySelector
(
'
.license-packages
'
);
expect
(
packagesEl
).
toBeNull
();
vm
.
$destroy
();
});
});
});
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