Skip to content

Commit

Permalink
handle feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tutn-axonivy committed Aug 30, 2024
1 parent bdd2f73 commit 6a94c9c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Product implements Serializable {
private int installationCount;
private Date newestPublishedDate;
private String newestReleaseVersion;
@DBRef(lazy = false)
@DBRef
private List<ProductModuleContent> productModuleContents;
private List<MavenArtifact> artifacts;
private Boolean synchronizedInstallationCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
import com.axonivy.market.entity.ProductModuleContent;

@Repository
public interface ProductModuleContentRepository extends MongoRepository<ProductModuleContent, String> {}
public interface ProductModuleContentRepository extends MongoRepository<ProductModuleContent, String> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.UUID;

import com.axonivy.market.criteria.ProductSearchCriteria;
import com.fasterxml.jackson.core.type.TypeReference;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -121,7 +122,7 @@ class ProductServiceImplTest extends BaseSetup {
ArgumentCaptor<Product> argumentCaptor = ArgumentCaptor.forClass(Product.class);

@Captor
ArgumentCaptor<List<ProductModuleContent>> argumentCaptorProductModuleContent = ArgumentCaptor.forClass((Class) List.class);
ArgumentCaptor<ArrayList<ProductModuleContent>> argumentCaptorProductModuleContent;

@Mock
private GHAxonIvyProductRepoService ghAxonIvyProductRepoService;
Expand Down Expand Up @@ -149,7 +150,7 @@ void testUpdateInstallationCountForProduct() {
when(productRepository.getProductById(product.getId())).thenReturn(product);
when(productRepository.increaseInstallationCount(product.getId())).thenReturn(31);
result = productService.updateInstallationCountForProduct(product.getId());
assertEquals(31,result);
assertEquals(31, result);
}

@Test
Expand Down Expand Up @@ -298,8 +299,8 @@ void testFindAllProductsWithKeyword() {
&& product.getType().equals(TypeOption.CONNECTORS.getCode()))
.toList()));
// Executes
result =
productService.findProducts(TypeOption.CONNECTORS.getOption(), SAMPLE_PRODUCT_NAME, language, false, PAGEABLE);
result = productService.findProducts(TypeOption.CONNECTORS.getOption(), SAMPLE_PRODUCT_NAME, language, false,
PAGEABLE);
assertTrue(result.hasContent());
assertEquals(SAMPLE_PRODUCT_NAME, result.getContent().get(0).getNames().get(Language.EN.getValue()));
}
Expand Down Expand Up @@ -478,8 +479,8 @@ void testRefineOrderedListOfProductsInCustomSort_ProductNotFound() {
List<String> orderedListOfProducts = List.of(SAMPLE_PRODUCT_ID);
when(productRepository.findById(SAMPLE_PRODUCT_ID)).thenReturn(Optional.empty());

InvalidParamException exception = assertThrows(InvalidParamException.class, () ->
productService.refineOrderedListOfProductsInCustomSort(orderedListOfProducts));
InvalidParamException exception = assertThrows(InvalidParamException.class,
() -> productService.refineOrderedListOfProductsInCustomSort(orderedListOfProducts));
assertEquals(ErrorCode.PRODUCT_NOT_FOUND.getCode(), exception.getCode());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CommonModule } from '@angular/common';
import {
Component,
ElementRef,
Expand All @@ -7,39 +8,38 @@ import {
signal
} from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ProductService } from '../product.service';
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import { MarkdownModule, MarkdownService } from 'ngx-markdown';
import { ProductDetail } from '../../../shared/models/product-detail.model';
import { ProductModuleContent } from '../../../shared/models/product-module-content.model';
import { Observable } from 'rxjs';
import { AuthService } from '../../../auth/auth.service';
import { LanguageService } from '../../../core/services/language/language.service';
import { ThemeService } from '../../../core/services/theme/theme.service';
import { CommonModule } from '@angular/common';
import { ProductDetailInformationTabComponent } from './product-detail-information-tab/product-detail-information-tab.component';
import { ProductDetailVersionActionComponent } from './product-detail-version-action/product-detail-version-action.component';
import { ProductDetailMavenContentComponent } from './product-detail-maven-content/product-detail-maven-content.component';
import { CommonDropdownComponent } from '../../../shared/components/common-dropdown/common-dropdown.component';
import {
PRODUCT_DETAIL_TABS,
VERSION
} from '../../../shared/constants/common.constant';
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { LanguageService } from '../../../core/services/language/language.service';
import { ItemDropdown } from '../../../shared/models/item-dropdown.model';
import { ProductDetail } from '../../../shared/models/product-detail.model';
import { ProductModuleContent } from '../../../shared/models/product-module-content.model';
import { HasValueTabPipe } from '../../../shared/pipes/has-value-tab.pipe';
import { ProductTypeIconPipe } from '../../../shared/pipes/icon.pipe';
import { MultilingualismPipe } from '../../../shared/pipes/multilingualism.pipe';
import { ProductDetailService } from './product-detail.service';
import { ProductDetailFeedbackComponent } from './product-detail-feedback/product-detail-feedback.component';
import { ProductFeedbackService } from './product-detail-feedback/product-feedbacks-panel/product-feedback.service';
import { ProductTypePipe } from '../../../shared/pipes/product-type.pipe';
import { AppModalService } from '../../../shared/services/app-modal.service';
import { AuthService } from '../../../auth/auth.service';
import { ProductStarRatingNumberComponent } from './product-star-rating-number/product-star-rating-number.component';
import { ProductInstallationCountActionComponent } from './product-installation-count-action/product-installation-count-action.component';
import { ProductTypeIconPipe } from '../../../shared/pipes/icon.pipe';
import { Observable } from 'rxjs';
import { ProductStarRatingService } from './product-detail-feedback/product-star-rating-panel/product-star-rating.service';
import { RoutingQueryParamService } from '../../../shared/services/routing.query.param.service';
import { CommonDropdownComponent } from '../../../shared/components/common-dropdown/common-dropdown.component';
import { CommonUtils } from '../../../shared/utils/common.utils';
import { ItemDropdown } from '../../../shared/models/item-dropdown.model';
import { ProductTypePipe } from '../../../shared/pipes/product-type.pipe';
import { HasValueTabPipe } from '../../../shared/pipes/has-value-tab.pipe';
import { ProductService } from '../product.service';
import { ProductDetailFeedbackComponent } from './product-detail-feedback/product-detail-feedback.component';
import { ProductFeedbackService } from './product-detail-feedback/product-feedbacks-panel/product-feedback.service';
import { ProductStarRatingService } from './product-detail-feedback/product-star-rating-panel/product-star-rating.service';
import { ProductDetailInformationTabComponent } from './product-detail-information-tab/product-detail-information-tab.component';
import { ProductDetailMavenContentComponent } from './product-detail-maven-content/product-detail-maven-content.component';
import { ProductDetailVersionActionComponent } from './product-detail-version-action/product-detail-version-action.component';
import { ProductDetailService } from './product-detail.service';
import { ProductInstallationCountActionComponent } from './product-installation-count-action/product-installation-count-action.component';
import { ProductStarRatingNumberComponent } from './product-star-rating-number/product-star-rating-number.component';

export interface DetailTab {
activeClass: string;
Expand Down

0 comments on commit 6a94c9c

Please sign in to comment.