From 02684934adfdc5b76314d74971cd83a9bc974aca Mon Sep 17 00:00:00 2001 From: jourdiw Date: Tue, 17 Dec 2024 16:23:56 +0100 Subject: [PATCH] fix: remove isNativeKafka logic from license service --- .../gio-license/gio-license.service.spec.ts | 71 ------------------- .../lib/gio-license/gio-license.service.ts | 4 -- 2 files changed, 75 deletions(-) diff --git a/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.spec.ts b/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.spec.ts index 72f6e59e5..4b640efbf 100644 --- a/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.spec.ts +++ b/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.spec.ts @@ -187,31 +187,6 @@ describe('GioLicenseService', () => { req.flush(oemLicense); }); - it('should check if license is native kafka', done => { - const oemLicense: License = { - tier: '', - packs: ['not-native-kafka'], - features: [], - }; - - gioLicenseService - .isNativeKafka$() - .pipe( - tap(isNativeKafka => { - expect(isNativeKafka).toEqual(false); - done(); - }), - ) - .subscribe(); - - const req = httpTestingController.expectOne({ - method: 'GET', - url: `https://url.test:3000/license`, - }); - - req.flush(oemLicense); - }); - // Need a workaround to be able to use both it.each and done callback https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34617#issuecomment-497760008 // eslint-disable-next-line @typescript-eslint/no-explicit-any it.each([ @@ -498,50 +473,4 @@ describe('GioLicenseService', () => { req.flush(oemLicense); }); }); - - describe('With Native Kafka license', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, MatDialogModule], - providers: [ - { - provide: 'LicenseConfiguration', - useValue: OEM_LICENSE_CONFIGURATION_TESTING, - }, - ], - }); - - httpTestingController = TestBed.inject(HttpTestingController); - gioLicenseService = TestBed.inject(GioLicenseService); - }); - - afterEach(() => { - httpTestingController.verify(); - }); - - it('should check if license is native kafka', done => { - const nativeKafkaLicense: License = { - tier: '', - packs: ['native-kafka'], - features: [], - }; - - gioLicenseService - .isNativeKafka$() - .pipe( - tap(isNativeKafka => { - expect(isNativeKafka).toEqual(true); - done(); - }), - ) - .subscribe(); - - const req = httpTestingController.expectOne({ - method: 'GET', - url: `https://oem.test:3000/license`, - }); - - req.flush(nativeKafkaLicense); - }); - }); }); diff --git a/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.ts b/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.ts index 96ec34dcd..fcfe8c45a 100644 --- a/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.ts +++ b/projects/ui-particles-angular/src/lib/gio-license/gio-license.service.ts @@ -149,10 +149,6 @@ export class GioLicenseService { return this.getLicense$().pipe(map(license => license !== null && license.features.includes('oem-customization'))); } - public isNativeKafka$(): Observable { - return this.getLicense$().pipe(map(license => license !== null && license.packs.includes('native-kafka'))); - } - public openDialog(licenseOptions: LicenseOptions, event?: Event) { event?.stopPropagation(); event?.preventDefault();