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
18f6a39c
Commit
18f6a39c
authored
Oct 17, 2019
by
mo khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
parent
43c486b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
...avascripts/vue_shared/license_management/report_mapper.js
+11
-8
No files found.
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
View file @
18f6a39c
...
...
@@ -52,11 +52,9 @@ class V2Report {
}
static
createLicenseMap
(
licenses
)
{
const
reducer
=
(
memo
,
item
)
=>
{
memo
[
item
.
id
]
=
{
name
:
item
.
name
,
url
:
item
.
url
};
// eslint-disable-line no-param-reassign
return
memo
;
};
return
licenses
.
reduce
(
reducer
,
{});
const
identityMap
=
{};
licenses
.
forEach
(
item
=>
(
identityMap
[
item
.
id
]
=
{
name
:
item
.
name
,
url
:
item
.
url
}));
return
identityMap
;
}
}
...
...
@@ -71,7 +69,7 @@ export default class ReportMapper {
}
mapFrom
(
reportArtifact
)
{
const
majorVersion
=
ReportMapper
.
majorVersion
(
reportArtifact
);
const
majorVersion
=
ReportMapper
.
majorVersion
For
(
reportArtifact
);
return
this
.
mapperFor
(
majorVersion
)(
reportArtifact
);
}
...
...
@@ -79,7 +77,12 @@ export default class ReportMapper {
return
this
.
mappers
[
majorVersion
];
}
static
majorVersion
(
report
)
{
return
report
&&
report
.
version
?
report
.
version
.
split
(
'
.
'
)[
0
]
:
DEFAULT_VERSION
;
static
majorVersionFor
(
report
)
{
if
(
report
&&
report
.
version
)
{
const
[
majorVersion
]
=
report
.
version
.
split
(
'
.
'
);
return
majorVersion
;
}
return
DEFAULT_VERSION
;
}
}
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