Commit 1826e08f authored by mo khan's avatar mo khan

Remove usage of feature flag

parent 5f6b6c8f
export default class {
static isEnabled(featureName) {
return gon && gon.features && gon.features[featureName];
}
}
......@@ -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)),
};
}
......
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) {
......
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment