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
229681b7
Commit
229681b7
authored
Oct 10, 2019
by
mo khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename class to better match intention
parent
229c2efc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
...avascripts/vue_shared/license_management/report_mapper.js
+11
-6
No files found.
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
View file @
229681b7
import
{
byLicenseNameComparator
}
from
'
./store/utils
'
;
class
V2ToV1Mapper
{
mapFrom
(
report
)
{
this
.
licenseMap
=
V2ToV1Mapper
.
createLicenseMap
(
report
.
licenses
);
this
.
licenses
=
report
.
licenses
.
sort
(
byLicenseNameComparator
).
map
(
V2ToV1Mapper
.
mapFromLicense
);
class
V2Report
{
constructor
(
report
)
{
this
.
report
=
report
;
this
.
licenseMap
=
V2Report
.
createLicenseMap
(
report
.
licenses
);
this
.
licenses
=
report
.
licenses
.
sort
(
byLicenseNameComparator
).
map
(
V2Report
.
mapFromLicense
);
}
toV1Schema
()
{
return
{
licenses
:
this
.
licenses
,
dependencies
:
report
.
dependencies
.
map
(
v2Dependency
=>
this
.
mapFromDependency
(
v2Dependency
)),
dependencies
:
this
.
report
.
dependencies
.
map
(
v2Dependency
=>
this
.
mapFromDependency
(
v2Dependency
),
),
};
}
...
...
@@ -63,7 +68,7 @@ export default class ReportMapper {
constructor
()
{
this
.
mappers
=
{
'
1
'
:
report
=>
report
,
'
2
'
:
report
=>
new
V2
ToV1Mapper
().
mapFrom
(
report
),
'
2
'
:
report
=>
new
V2
Report
(
report
).
toV1Schema
(
),
};
}
...
...
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