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

Email Command #57

Merged
merged 6 commits into from
Mar 16, 2021
Merged

Conversation

samleewy
Copy link

Resolves #15 - get all emails command via emails

To all:

  1. Let me know if the command emails is suitable, i was considering list_emails, but seems to be too long and emails might be faster to type.

  2. This command also incorporates the copy to clipboard feature when they click on the result textarea/textbox. It will also copy when the user clicks for other commands, not sure if it'll be disruptive to the user in the future. If so, perhaps we can change it to double click? or other kind of available actions in javaFX. Think it's okay if we don't want this "copy to clipboard" feature as well since there's the default copy alr.

Let me know what y'all think! 📈

@codecov-io
Copy link

Codecov Report

Merging #57 (42ecb1f) into master (b732c2f) will decrease coverage by 0.38%.
The diff coverage is 53.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #57      +/-   ##
============================================
- Coverage     70.80%   70.41%   -0.39%     
- Complexity      397      400       +3     
============================================
  Files            74       75       +1     
  Lines          1298     1315      +17     
  Branches        129      130       +1     
============================================
+ Hits            919      926       +7     
- Misses          337      346       +9     
- Partials         42       43       +1     
Impacted Files Coverage Δ Complexity Δ
.../seedu/address/logic/parser/AddressBookParser.java 88.88% <0.00%> (-11.12%) 12.00 <0.00> (ø)
src/main/java/seedu/address/ui/ResultDisplay.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ava/seedu/address/logic/commands/EmailCommand.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
src/main/java/seedu/address/ui/MainWindow.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)

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 f529834...42ecb1f. Read the comment docs.

StringBuilder concatenatedEmails = new StringBuilder();
List<Student> studentList = model.getFilteredStudentList();

for (Student stu : studentList) {
Copy link
Member

@chwoozy chwoozy Mar 16, 2021

Choose a reason for hiding this comment

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

I think maybe we can use student instead of stu to improve readability

}

// third layer: check final message returned to user
String intendedMessage = Arrays.stream(emails).reduce("", (acc, el) -> acc + el + ";");
Copy link
Member

Choose a reason for hiding this comment

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

Possibly change the use of `acc' and 'el' here too

Copy link
Member

@chwoozy chwoozy left a comment

Choose a reason for hiding this comment

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

Some small changes for readibility. Otherwise, LGTM! 🥇

Copy link

@enhao25 enhao25 left a comment

Choose a reason for hiding this comment

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

Yeap looks good! I would agree with choon wei that using student instead of stu would be better in this case. Other than that, looks good.

Copy link

@enhao25 enhao25 left a comment

Choose a reason for hiding this comment

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

LGTM

@samleewy
Copy link
Author

Made changes mentioned by @YungWeezy @enhao25, merged! 🎉

@samleewy samleewy merged commit 417cbe5 into AY2021S2-CS2103T-T11-1:master Mar 16, 2021
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.

Get all email addresses
4 participants