diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.spec.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.spec.ts index 007a5ae21..fbe69c34e 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.spec.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.spec.ts @@ -90,6 +90,10 @@ describe('ProductDetailComponent', () => { ); }); + it('version should display in number', () => { + expect(component.selectedVersion).toEqual('10.0.0'); + }); + it('should get corresponding version from cookie', () => { const targetVersion = '1.0'; const productId = 'Portal'; diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts index 3592068d0..8ddac3b4d 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts @@ -126,6 +126,10 @@ export class ProductDetailComponent { this.productDetailService.productNames.set(productDetail.names); localStorage.removeItem(STORAGE_ITEM); this.installationCount = productDetail.installationCount; + this.selectedVersion = this.productModuleContent().tag; + if (this.selectedVersion.startsWith('v')) { + this.selectedVersion = this.selectedVersion.substring(1); + } }); this.productFeedbackService.initFeedbacks(); this.productStarRatingService.fetchData();