-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Sort Command to sort Restaurants by Ratings and fix selection of added/edited/deleted Reviews #148
Implement Sort Command to sort Restaurants by Ratings and fix selection of added/edited/deleted Reviews #148
Conversation
weixin-koh
commented
Apr 9, 2019
- Allows Sorting of Restaurants by Ratings As a user I can view restaurants ranked by ratings #50
- Performs sort on the Restaurant list in the versionedFoodDiary, so it is undo-able
- Restaurants can be sorted in ascending or descending order
- Sorted list can be filtered to get Restaurants with the top x number of ratings
…ts sorted according to rating, allow limit tag to filter the top few Restaurants by ratings
Predicate<Restaurant> predicateShowLimitedAsc = (r) -> | ||
r.getSummary().getAvgRating() < ratingBorder; | ||
model.updateFilteredRestaurantList(predicateShowLimitedAsc); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a few nested if else here, is there a way to change the logic flow so that it is better structured?
https://nus-cs2103-ay1819s2.github.io/cs2103-website/se-book-adapted/chapters/codeQuality.html#avoid-deep-nesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right! I'll change modify them in my next PR. Thanks for the tip!
…into sortByRatings * 'master' of https://github.com/cs2103-ay1819s2-w17-1/main: (65 commits) updated styling: updated documentation fixed bugs removed name in status bar Added the default review commands to the userguide, as well as a edit default review command (coming in v2.0) checkstyle fixes removed duplicated check removed file prefix as it is not used updated regex lowered event timeout time changed UI diagram updated UserGuide updated developer guide updated docs removed unused static var modified AddDefaultReviewParserTest to take into account new Review constructor, modified the command's .equals to not take into account the timestamp when comparing commands implemented unit test for AddDefaultReviewCommand modified AddDefaultReviewCommand, its constructor now takes in the review itself rather than just the index. modularised AddDefaultReviewCommandParser included coverage made test to display browser with kfc website ...