-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MARP-1302 Fixing serveral issues for rating feature (#226)
- Loading branch information
1 parent
666e737
commit c7d0fb0
Showing
21 changed files
with
166 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
marketplace-service/src/main/java/com/axonivy/market/enums/FeedbackSortOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.axonivy.market.enums; | ||
|
||
import com.axonivy.market.exceptions.model.InvalidParamException; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.springframework.data.domain.Sort; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum FeedbackSortOption { | ||
NEWEST("newest", "updatedAt rating _id", | ||
List.of(Sort.Direction.DESC, Sort.Direction.DESC, Sort.Direction.ASC)), | ||
OLDEST("oldest", "updatedAt rating _id", | ||
List.of(Sort.Direction.ASC, Sort.Direction.DESC, Sort.Direction.ASC)), | ||
HIGHEST("highest", "rating updatedAt _id", | ||
List.of(Sort.Direction.DESC, Sort.Direction.DESC, Sort.Direction.ASC)), | ||
LOWEST("lowest", "rating updatedAt _id", | ||
List.of(Sort.Direction.ASC, Sort.Direction.DESC, Sort.Direction.ASC)); | ||
|
||
private final String option; | ||
private final String code; | ||
private final List<Sort.Direction> directions; | ||
|
||
public static FeedbackSortOption of(String option) { | ||
option = StringUtils.isBlank(option) ? option : option.trim(); | ||
for (var feedbackSortOption : values()) { | ||
if (StringUtils.equalsIgnoreCase(feedbackSortOption.option, option)) { | ||
return feedbackSortOption; | ||
} | ||
} | ||
throw new InvalidParamException(ErrorCode.FEEDBACK_SORT_INVALID, "FeedbackSortOption: " + option); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
.../product/product-detail/product-detail-feedback/product-detail-feedback.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...etail-feedback/product-feedbacks-panel/feedback-filter/feedback-filter.service.spec.ts.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.