-
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
Add Sort feature #53
Add Sort feature #53
Conversation
List of projects displayed cannot be sorted in a specified order. Adding sort feature will make application more user friendly as it can display projects in orders required by users. Let's * add SortCommand and SortCommandParser * add other relevant Comparators for sorting * make necessary changes to existing files * add tests for SortCommand, SortCommandParser and Comparators
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
============================================
+ Coverage 72.52% 74.76% +2.24%
- Complexity 593 669 +76
============================================
Files 99 105 +6
Lines 1838 2021 +183
Branches 198 222 +24
============================================
+ Hits 1333 1511 +178
- Misses 433 435 +2
- Partials 72 75 +3 Continue to review full report at Codecov.
|
…into feature-issue-47
User Guide does not have a section for sort command. Updating user guide to include sort instructions would improve user guide. Let's update user guide to include sort instructions.
…nto feature-issue-47
Accidentally removed a character from User Guide. Let's fix the change.
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.
Have a few comments that might need to be addressed before merging. Should be ok to merge once those changes have been made :)
src/main/java/seedu/momentum/model/project/comparators/CreatedDateCompare.java
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/comparators/DeadlineCompare.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/comparators/DeadlineCompare.java
Outdated
Show resolved
Hide resolved
src/test/java/seedu/momentum/logic/commands/SortCommandTest.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/logic/parser/SortCommandParser.java
Outdated
Show resolved
Hide resolved
src/test/java/seedu/momentum/logic/parser/ProjectBookParserTest.java
Outdated
Show resolved
Hide resolved
* and returns a SortCommand object for execution. | ||
* @throws ParseException if the user does not conform to the expected format. | ||
*/ | ||
public SortCommand parse(String args) throws ParseException { |
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.
Just checking, what's the expected behaviour when there is a preamble?
For example, sort hello type/alpha order/dsc
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.
It should disregard the preamble.
I have added a test for this!
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.
I have changed the SortCommandParser to fail when there is a non-empty preamble for consistency as AddCommandParser and FindCommandParser does the same. I have added a test accordingly!
src/test/java/seedu/momentum/logic/commands/AddCommandIntegrationTest.java
Outdated
Show resolved
Hide resolved
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.
Just some things to take note, not too much of an issue though. Otherwise LGTM!
src/main/java/seedu/momentum/logic/parser/SortCommandParser.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/comparators/CreatedDateCompare.java
Show resolved
Hide resolved
src/test/java/seedu/momentum/logic/parser/SortCommandParserTest.java
Outdated
Show resolved
Hide resolved
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.
I think some minor changes has to be made.
src/main/java/seedu/momentum/model/project/UniqueProjectList.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/UniqueProjectList.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/UniqueProjectList.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/momentum/model/project/UniqueProjectList.java
Outdated
Show resolved
Hide resolved
resolve comments Name, Deadline, Date, DateTime, Time classes can inherit from Comparable interface to make them comparable. Some long methods can be abstracted further and more static variables can be declared to make code more readable. Let's * implement compareTo methods in these classes * update code to make it more readable
…into feature-issue-47
Wrong import order causes checkstyle error. Let's update import order.
Test for parsing empty arguments fails on Windows. Let's update SortCommandParserTest.
Test for parsing empty arguments fails on Windows. Let's update SortCommandParserTest.
compareTo methods have not been tested. Add tests to increase test code coverage. Let's add tests for compareTo methods.
List of projects displayed cannot be sorted in a specified order.
Adding sort feature will make application more user friendly as it
can display projects in orders required by users.
Let's
Closes #47, closes #48