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

Add FilterCommand #109

Merged
merged 17 commits into from
Oct 26, 2023
Merged

Conversation

ivanleekk
Copy link

closes #28

@ivanleekk ivanleekk added this to the v1.3 milestone Oct 23, 2023
@netlify
Copy link

netlify bot commented Oct 23, 2023

Deploy Preview for shiny-daffodil-45f25f ready!

Name Link
🔨 Latest commit ffa2dbb
🔍 Latest deploy log https://app.netlify.com/sites/shiny-daffodil-45f25f/deploys/653a033bc42fb700083e85a0
😎 Deploy Preview https://deploy-preview-109--shiny-daffodil-45f25f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #109 (ffa2dbb) into master (0565aa0) will increase coverage by 0.24%.
The diff coverage is 68.84%.

@@             Coverage Diff              @@
##             master     #109      +/-   ##
============================================
+ Coverage     68.92%   69.17%   +0.24%     
- Complexity      509      541      +32     
============================================
  Files            85       88       +3     
  Lines          1802     1930     +128     
  Branches        179      209      +30     
============================================
+ Hits           1242     1335      +93     
- Misses          505      529      +24     
- Partials         55       66      +11     
Files Coverage Δ
.../seedu/staffsnap/logic/commands/FilterCommand.java 100.00% <100.00%> (ø)
...va/seedu/staffsnap/logic/commands/SortCommand.java 100.00% <ø> (ø)
.../seedu/staffsnap/logic/commands/StatusCommand.java 69.56% <ø> (ø)
...n/java/seedu/staffsnap/logic/parser/CliSyntax.java 91.66% <100.00%> (+2.77%) ⬆️
...du/staffsnap/logic/parser/StatusCommandParser.java 100.00% <100.00%> (+18.18%) ⬆️
.../java/seedu/staffsnap/commons/util/StringUtil.java 91.30% <83.33%> (-3.44%) ⬇️
...du/staffsnap/logic/parser/ApplicantBookParser.java 71.42% <50.00%> (+3.78%) ⬆️
...eedu/staffsnap/logic/parser/SortCommandParser.java 66.66% <0.00%> (ø)
...du/staffsnap/logic/parser/FilterCommandParser.java 81.81% <81.81%> (ø)
.../java/seedu/staffsnap/logic/parser/ParserUtil.java 86.25% <25.00%> (-6.81%) ⬇️
... and 2 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link

@CelestineTan03 CelestineTan03 left a comment

Choose a reason for hiding this comment

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

Amazing implementation of the filter function 💯 Just a few minor changes needed 😄

If you would like to take a look, this is where I refer to for the javadoc coding conventions https://se-education.org/guides/conventions/java/intermediate.html#comments 😊

}

/**
* Checks if the applicant exists.

Choose a reason for hiding this comment

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

Since the method is comparing between two filter predicates, I think it will be more accurate to state that it checks whether two filter predicates are the same 😸


/**
* Checks if the applicant exists.
* @param other Other applicant.

Choose a reason for hiding this comment

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

Perhaps the param other should refer to other filter command and not other applicant since we are comparing the predicate of 2 filter commands 🐶

Copy link
Author

Choose a reason for hiding this comment

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

my bad must have copied the javadoc from another equals command and forgot to change it🤦‍♂️

}

FilterCommand otherFilterCommand = (FilterCommand) other;
System.out.println("predicate = " + predicate);

Choose a reason for hiding this comment

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

Is this intended? I think it will be better to remove it if it isn't needed 😄

/**
* Parses input arguments and creates a new FilterCommand object
*/

Choose a reason for hiding this comment

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

For better coding standard, there should be no blank line between the documentation block and the method/class 😃


/**
* Parses a {@code String status} into a {@code Status}.
* @param status String representation of Status

Choose a reason for hiding this comment

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

To improve coding standard, can add an empty line between javadoc description and parameter section 👍


<puml src="diagrams/FilterCommandActivityDiagram.puml" alt="FilterCommandActivityDiagram" />

### Design considerations

Choose a reason for hiding this comment

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

Goodjob considering the possible alternatives and weighing the pros and cons of each alternative 💯


1. _{ more test cases …​ }_

### Saving data

1. Dealing with missing/corrupted data files

1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_
1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_

Choose a reason for hiding this comment

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

Thanks for helping to improve the readability of our developer guide by breaking lines that are too long and ensuring consistency throughout the doc 🥳

/**
* Returns true if the {@code sentence} contains the {@code word}.
* Ignores case, but a full word match is required.
* <br>examples:<pre>

Choose a reason for hiding this comment

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

Perhaps it is better to remove the html tags from the javadoc? 😄

Copy link
Author

Choose a reason for hiding this comment

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

i think that the html tags are there to allow the javadoc to be rendered specifically like in this style below. Normally I won't do this, but am following the convention used in this file from #containsWordIgnoreCase

image

Choose a reason for hiding this comment

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

Ohhh ok nicee 👍

* containsWordIgnoreCase("ABc def", "DEF") == true
* containsWordIgnoreCase("ABc def", "AB") == false //not a full word match
* </pre>
* @param sentence cannot be null

Choose a reason for hiding this comment

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

I feel that it will be better to describe what the param is instead of what the param cannot be 😸

Copy link
Author

Choose a reason for hiding this comment

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

mhmm agreed, will change

}

/**
* @param applicant the input argument

Choose a reason for hiding this comment

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

I feel that "the input argument" doesn't seem to add much value here, perhaps better to change to "the applicant to be tested"? 🤔

@ivanleekk
Copy link
Author

Thank you for the thorough review Celestine! I hope I've addressed all your comments 🤠

Copy link

@CelestineTan03 CelestineTan03 left a comment

Choose a reason for hiding this comment

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

Lgtm! 😄

@ivanleekk ivanleekk merged commit 7e31d01 into AY2324S1-CS2103T-W08-1:master Oct 26, 2023
9 checks passed
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.

Filter applicants by descriptor criteria
2 participants