Skip to content
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

Merged
merged 6 commits into from
Apr 10, 2019

Conversation

weixin-koh
Copy link
Collaborator

  • 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

@weixin-koh weixin-koh added type.Story A user story type.Enhancement An enhancement to an existing story priority.Medium Nice to have status.ReadyForReview The PR is ready for review labels Apr 9, 2019
@weixin-koh weixin-koh added this to the v1.4 milestone Apr 9, 2019
@weixin-koh weixin-koh self-assigned this Apr 9, 2019
@weixin-koh weixin-koh changed the title Implement Sort Command to sort Restaurants by Ratings Implement Sort Command to sort Restaurants by Ratings and fix selection of added/edited/deleted Reviews Apr 9, 2019
@weixin-koh weixin-koh added status.Ongoing The issue/PR is currently being worked on. note: remove this label before closing an issue. and removed status.ReadyForReview The PR is ready for review labels Apr 9, 2019
Predicate<Restaurant> predicateShowLimitedAsc = (r) ->
r.getSummary().getAvgRating() < ratingBorder;
model.updateFilteredRestaurantList(predicateShowLimitedAsc);
} else {
Copy link
Collaborator

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

Copy link
Collaborator Author

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
  ...
@weixin-koh weixin-koh merged commit 5cfcb42 into CS2103-AY1819S2-W17-1:master Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.Medium Nice to have status.Ongoing The issue/PR is currently being worked on. note: remove this label before closing an issue. type.Enhancement An enhancement to an existing story type.Story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants