From 143799e35430b47698e03d09a7a726acf5264fd0 Mon Sep 17 00:00:00 2001 From: Dinh Nguyen <127725498+ntqdinh-axonivy@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:00:36 +0700 Subject: [PATCH] bugfix/MARP-969-Version-is-not-display-in-information-tab-when-initiate-details-page --- .../product/product-detail/product-detail.component.spec.ts | 4 ++++ .../product/product-detail/product-detail.component.ts | 4 ++++ 2 files changed, 8 insertions(+) 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();