diff --git a/marketplace-ui/src/app/core/interceptors/api.interceptor.ts b/marketplace-ui/src/app/core/interceptors/api.interceptor.ts index 44cc28a4..e59b5e72 100644 --- a/marketplace-ui/src/app/core/interceptors/api.interceptor.ts +++ b/marketplace-ui/src/app/core/interceptors/api.interceptor.ts @@ -7,10 +7,7 @@ import { environment } from '../../../environments/environment'; import { inject } from '@angular/core'; import { catchError, EMPTY, finalize } from 'rxjs'; import { Router } from '@angular/router'; -import { - ERROR_CODES, - ERROR_PAGE_PATH -} from '../../shared/constants/common.constant'; +import { ERROR_CODES, ERROR_PAGE_PATH } from '../../shared/constants/common.constant'; import { LoadingService } from '../services/loading/loading.service'; export const REQUEST_BY = 'X-Requested-By'; diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.spec.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.spec.ts index d326b086..817f6cfb 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.spec.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.spec.ts @@ -62,26 +62,20 @@ describe('ProductFeedbackService', () => { it('should initialize feedbacks', () => { const mockResponse = { - _embedded: { - feedbacks: [{ content: 'Great product!', rating: 5, productId: '123' }] - }, + _embedded: { feedbacks: [{ content: 'Great product!', rating: 5, productId: '123' }] }, page: { totalPages: 2, totalElements: 5 } }; productDetailService.productId.and.returnValue('123'); service.fetchFeedbacks(); - const req = httpMock.expectOne( - 'api/feedback/product/123?page=0&size=8&sort=newest' - ); + const req = httpMock.expectOne( 'api/feedback/product/123?page=0&size=8&sort=newest' ); expect(req.request.method).toBe('GET'); req.flush(mockResponse); expect(service.totalPages()).toBe(2); expect(service.totalElements()).toBe(5); - expect(service.feedbacks()).toEqual([ - { content: 'Great product!', rating: 5, productId: '123' } - ]); + expect(service.feedbacks()).toEqual([{ content: 'Great product!', rating: 5, productId: '123' }]); }); it('should load more feedbacks', () => { @@ -94,24 +88,14 @@ describe('ProductFeedbackService', () => { productDetailService.productId.and.returnValue('123'); service.fetchFeedbacks(); - const initReq = httpMock.expectOne( - 'api/feedback/product/123?page=0&size=8&sort=newest' - ); - initReq.flush({ - _embedded: { feedbacks: initialFeedback }, - page: { totalPages: 2, totalElements: 5 } - }); + const initReq = httpMock.expectOne( 'api/feedback/product/123?page=0&size=8&sort=newest' ); + initReq.flush({ _embedded: { feedbacks: initialFeedback }, page: { totalPages: 2, totalElements: 5 } }); service.loadMoreFeedbacks(); - const loadMoreReq = httpMock.expectOne( - 'api/feedback/product/123?page=1&size=8&sort=newest' - ); + const loadMoreReq = httpMock.expectOne( 'api/feedback/product/123?page=1&size=8&sort=newest' ); loadMoreReq.flush({ _embedded: { feedbacks: additionalFeedback } }); - expect(service.feedbacks()).toEqual([ - ...initialFeedback, - ...additionalFeedback - ]); + expect(service.feedbacks()).toEqual([...initialFeedback, ...additionalFeedback]); }); it('should change sort and fetch feedbacks', () => { diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.ts index de118fb2..a3182eac 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-feedback/product-feedbacks-panel/product-feedback.service.ts @@ -100,9 +100,7 @@ export class ProductFeedbackService { return this.http .get(requestURL, { params: requestParams, - context: new HttpContext() - .set(SkipLoading, true) - .set(ForwardingError, true) + context: new HttpContext().set(SkipLoading, true).set(ForwardingError, true) }) .pipe( tap(response => { diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-information-tab/product-detail-information-tab.component.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail-information-tab/product-detail-information-tab.component.ts index 9cfc2a0e..6c7a8da6 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-information-tab/product-detail-information-tab.component.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-information-tab/product-detail-information-tab.component.ts @@ -47,8 +47,7 @@ export class ProductDetailInformationTabComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): void { let version = ''; const changedSelectedVersion = changes[SELECTED_VERSION]; - if ( - changedSelectedVersion && + if ( changedSelectedVersion && changedSelectedVersion.currentValue === changedSelectedVersion.previousValue ) { @@ -98,8 +97,7 @@ export class ProductDetailInformationTabComponent implements OnChanges { // To ensure the function always returns a boolean, you can explicitly coerce the result into a boolean using the !! operator or default it to false // Adding !! in case of changedProduct is undefined, it will return false instead of returning undefined isProductChanged(changedProduct: SimpleChange) { - return !!( - changedProduct?.previousValue && + return !!( changedProduct?.previousValue && Object.keys(changedProduct.previousValue).length > 0 && changedProduct.currentValue !== changedProduct.previousValue ); diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html index 361814c9..aecd97f8 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.html @@ -131,17 +131,12 @@ (click)="onUpdateInstallationCountForDesigner()" onClick="function installInDesigner(event) { const selectedItemElement = document.querySelector('.install-designer-dropdown'); if (selectedItemElement) { -<<<<<<< HEAD - const metaDataJsonUrl = selectedItemElement.getAttribute('metaDataJsonUrl'); - install(metaDataJsonUrl); -======= const metaDataJsonUrl = selectedItemElement.getAttribute('metaDataJsonUrl'); try { install(metaDataJsonUrl); } catch (error) { event.stopImmediatePropagation(); } ->>>>>>> develop } } installInDesigner(event);" [ngClass]="themeService.isDarkMode() ? 'btn-light' : 'btn-primary'"> diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.spec.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.spec.ts index f7f156a7..f0a81ac4 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.spec.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail-version-action/product-detail-version-action.component.spec.ts @@ -15,7 +15,9 @@ import { ProductDetailActionType } from '../../../../shared/enums/product-detail import { MATOMO_TRACKING_ENVIRONMENT } from '../../../../shared/constants/matomo.constant'; class MockElementRef implements ElementRef { - nativeElement = { contains: jasmine.createSpy('contains') }; + nativeElement = { + contains: jasmine.createSpy('contains') + }; } describe('ProductDetailVersionActionComponent', () => {