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

Sort person command #116

Merged
merged 23 commits into from
Oct 26, 2020

Conversation

siqiang-ng
Copy link

Fixes #114

@siqiang-ng siqiang-ng added this to the v1.3 milestone Oct 25, 2020
Copy link

@yeo-kexin yeo-kexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some areas that may need to be edited?

@@ -157,6 +157,23 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa
## **Implementation**

### Implemented features
#### Contact features
**SortContact feature**
The `sort` command (class SortContactCommand) is a SortContact feature which allows a user to sort the current person list in alphabetical order permanently. Contacts that are being added to the list later will not be sorted and added to the end of the list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this part is a bit confusing especially the command and features part?
(also what is the definition of feature vs command? because I've always interpreted feature as the whole aspect (e.g. contacts, tags, tasks...), and commands to be like what you can do with those features but maybe I'm wrong?)

also, i think the command name is normally named after the command word? so this could be kind of confusing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm if like this, then we might have to change all to command only

@@ -157,6 +157,23 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa
## **Implementation**

### Implemented features
#### Contact features
**SortContact feature**
The `sort` command (class SortContactCommand) is a SortContact feature which allows a user to sort the current person list in alphabetical order permanently. Contacts that are being added to the list later will not be sorted and added to the end of the list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be able to go back to chronological order? else, it feels like this should be our default setting since there's no other option

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No apparently I tried to think of ways to do it but we could not because of the fact that UI get the Filtered List instead of the Sorted List, unless we implement the undo feature?

import seedu.address.model.Model;
import seedu.address.model.person.PersonNameComparator;

public class SortContactCommand extends Command {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously raised, but maybe it should be SortCommand? or we change everything to fit e.g. AddContact...

@@ -194,7 +194,7 @@ private CommandResult executeCommand(String commandText) throws CommandException
handleExit();
}

if (commandResult.isTagList()) { // TODO: Remove this in v1.3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha wait why did we need to remove this in the first place? i remember it was related to some hack thing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove the comment only

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha sorry let me rephrase, why was that comment there in the first place?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh erm I was really confused w the implementation initially, because I think this is not a good long-term solution but I guess for now, we should just proceed

Copy link

@akgrenSoar akgrenSoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@yeo-kexin yeo-kexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov-io
Copy link

Codecov Report

Merging #116 into master will increase coverage by 0.12%.
The diff coverage is 85.18%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #116      +/-   ##
============================================
+ Coverage     69.96%   70.08%   +0.12%     
- Complexity      503      513      +10     
============================================
  Files            84       86       +2     
  Lines          1538     1558      +20     
  Branches        164      166       +2     
============================================
+ Hits           1076     1092      +16     
- Misses          427      430       +3     
- Partials         35       36       +1     
Impacted Files Coverage Δ Complexity Δ
...java/seedu/address/logic/commands/ExitCommand.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
...ess/logic/commands/tagcommands/TagFindCommand.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
src/main/java/seedu/address/ui/MainWindow.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...rc/main/java/seedu/address/model/ModelManager.java 91.25% <87.50%> (-0.54%) 33.00 <2.00> (+2.00) ⬇️
...rc/main/java/seedu/address/logic/LogicManager.java 73.91% <100.00%> (+1.18%) 5.00 <1.00> (+1.00)
...va/seedu/address/logic/commands/CommandResult.java 100.00% <100.00%> (ø) 18.00 <4.00> (+2.00)
...java/seedu/address/logic/commands/HelpCommand.java 100.00% <100.00%> (ø) 2.00 <1.00> (ø)
...ss/logic/commands/contactcommands/ListCommand.java 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
...ss/logic/commands/contactcommands/SortCommand.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d69d2f8...5bcd4e0. Read the comment docs.

@yeo-kexin yeo-kexin merged commit 6cf3cb4 into AY2021S1-CS2103T-T17-4:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a user with many contacts, I want to sort the contacts by name
4 participants