Skip to content

Commit

Permalink
Merge branch 'develop' into feature/MARP-315-Open-REST-editor-detail-…
Browse files Browse the repository at this point in the history
…pages-from-within-AI-designer
  • Loading branch information
nntthuy-axonivy committed Aug 1, 2024
2 parents d0535ed + 3bf8097 commit 50872eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public ResponseEntity<Integer> syncInstallationCount(@PathVariable(ID) String ke
@GetMapping(BY_ID)
public ResponseEntity<ProductDetailModel> findProductDetails(@PathVariable(ID) String id) {
var productDetail = productService.fetchProductDetail(id);
return new ResponseEntity<>(detailModelAssembler.toModel(productDetail, null), HttpStatus.OK);
return new ResponseEntity<>(detailModelAssembler.toModel(productDetail), HttpStatus.OK);
}

@GetMapping(VERSIONS_BY_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.axonivy.market.constants.GitHubConstants.COMMON_IMAGES_FOLDER_NAME;

Expand Down Expand Up @@ -38,8 +41,13 @@ public enum NonStandardProduct {
private final String pathToImageFolder;
private final String pathToProductFolder;

public static NonStandardProduct findById(String id) {
private static final Map<String, NonStandardProduct> NON_STANDARD_PRODUCT_MAP;

static {
NON_STANDARD_PRODUCT_MAP = Arrays.stream(NonStandardProduct.values()).collect(Collectors.toMap(NonStandardProduct::getId, Function.identity()));
}

return Arrays.stream(NonStandardProduct.values()).filter(product -> id.equalsIgnoreCase(product.getId())).findAny().orElse(DEFAULT);
public static NonStandardProduct findById(String id) {
return NON_STANDARD_PRODUCT_MAP.getOrDefault(id,DEFAULT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class ProductComponent implements AfterViewInit, OnDestroy {
}

setupIntersectionObserver() {
const options = { root: null, rootMargin: '0px', threshold: 0.1 };
const options = { root: null, rootMargin: '10px', threshold: 0.1 };
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting && this.hasMore()) {
Expand Down

0 comments on commit 50872eb

Please sign in to comment.