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
1826e08f
Commit
1826e08f
authored
Oct 10, 2019
by
mo khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove usage of feature flag
parent
5f6b6c8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
20 deletions
+4
-20
app/assets/javascripts/lib/feature_flag.js
app/assets/javascripts/lib/feature_flag.js
+0
-5
ee/app/assets/javascripts/vue_shared/license_management/mappers/v2.js
...s/javascripts/vue_shared/license_management/mappers/v2.js
+1
-1
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
...avascripts/vue_shared/license_management/report_mapper.js
+3
-9
ee/spec/javascripts/license_management/store/utils_spec.js
ee/spec/javascripts/license_management/store/utils_spec.js
+0
-5
No files found.
app/assets/javascripts/lib/feature_flag.js
deleted
100644 → 0
View file @
5f6b6c8f
export
default
class
{
static
isEnabled
(
featureName
)
{
return
gon
&&
gon
.
features
&&
gon
.
features
[
featureName
];
}
}
ee/app/assets/javascripts/vue_shared/license_management/mappers/v2.js
View file @
1826e08f
...
...
@@ -7,7 +7,7 @@ export default class V2 {
return
{
licenses
:
this
.
licenses
,
dependencies
:
report
.
dependencies
.
map
(
x
=>
this
.
mapFromDependency
(
x
)),
dependencies
:
report
.
dependencies
.
map
(
v2Dependency
=>
this
.
mapFromDependency
(
v2Dependency
)),
};
}
...
...
ee/app/assets/javascripts/vue_shared/license_management/report_mapper.js
View file @
1826e08f
import
V1
from
'
./mappers/v1
'
;
import
V2
from
'
./mappers/v2
'
;
import
FeatureFlag
from
'
~/lib/feature_flag
'
;
const
MAPPERS
=
{
'
1
'
:
V1
,
'
2
'
:
V2
};
export
default
class
ReportMapper
{
constructor
(
featureEnabled
=
FeatureFlag
.
isEnabled
(
'
licenseScanV2
'
)
)
{
this
.
featureEnabled
=
featureEnabled
;
constructor
()
{
this
.
mappers
=
{
'
1
'
:
V1
,
'
2
'
:
V2
}
;
}
mapFrom
(
reportArtifact
)
{
...
...
@@ -15,10 +12,7 @@ export default class ReportMapper {
}
mapperFor
(
majorVersion
)
{
if
(
this
.
featureEnabled
||
majorVersion
===
'
2
'
)
{
return
new
MAPPERS
[
majorVersion
]();
}
return
new
V1
();
return
new
this
.
mappers
[
majorVersion
]();
}
static
majorVersion
(
report
)
{
...
...
ee/spec/javascripts/license_management/store/utils_spec.js
View file @
1826e08f
...
...
@@ -17,11 +17,6 @@ import {
}
from
'
ee_spec/license_management/mock_data
'
;
describe
(
'
utils
'
,
()
=>
{
beforeEach
(()
=>
{
gon
.
features
=
gon
.
features
||
{};
gon
.
features
.
licenseScanV2
=
true
;
});
describe
(
'
parseLicenseReportMetrics
'
,
()
=>
{
it
(
'
should return empty result, if no parameters are given
'
,
()
=>
{
const
result
=
parseLicenseReportMetrics
();
...
...
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