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
127f29c4
Commit
127f29c4
authored
Oct 10, 2019
by
mo khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move increment operation to visitor
parent
229681b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
...avascripts/vue_shared/license_management/report_mapper.js
+9
-6
No files found.
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
View file @
127f29c4
...
@@ -16,12 +16,11 @@ class V2Report {
...
@@ -16,12 +16,11 @@ class V2Report {
};
};
}
}
combine
(
licenses
)
{
combine
(
licenses
,
visitor
)
{
return
licenses
.
reduce
(
return
licenses
.
reduce
(
(
memo
,
licenseId
)
=>
{
(
memo
,
licenseId
)
=>
{
const
license
=
this
.
licenseMap
[
licenseId
];
const
license
=
this
.
licenseMap
[
licenseId
];
this
.
incrementCountFor
(
license
.
name
);
visitor
(
license
);
if
(
memo
.
name
===
null
)
{
if
(
memo
.
name
===
null
)
{
return
{
return
{
name
:
license
.
name
,
name
:
license
.
name
,
...
@@ -35,13 +34,17 @@ class V2Report {
...
@@ -35,13 +34,17 @@ class V2Report {
}
}
incrementCountFor
(
licenseName
)
{
incrementCountFor
(
licenseName
)
{
const
l
egacyL
icense
=
this
.
licenses
.
find
(
license
=>
license
.
name
===
licenseName
);
const
license
=
this
.
licenses
.
find
(
license
=>
license
.
name
===
licenseName
);
if
(
l
egacyLicense
)
legacyL
icense
.
count
+=
1
;
if
(
l
icense
)
l
icense
.
count
+=
1
;
}
}
mapFromDependency
(
dependency
)
{
mapFromDependency
(
dependency
)
{
const
combinedLicense
=
this
.
combine
(
dependency
.
licenses
,
license
=>
{
this
.
incrementCountFor
(
license
.
name
);
});
return
{
return
{
license
:
this
.
combine
(
dependency
.
licenses
)
,
license
:
combinedLicense
,
dependency
:
{
dependency
:
{
name
:
dependency
.
name
,
name
:
dependency
.
name
,
url
:
dependency
.
url
,
url
:
dependency
.
url
,
...
...
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