Group invitations by email - #8106
Conversation
Coverage Report for CI Build 31271334815Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.02%) to 90.623%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions5 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
david-yz-liu
left a comment
There was a problem hiding this comment.
Nice work, @danielrafailov1. I left a few inline comments, but otherwise the changes look good. Please make an issue to record the bug you found with the timeout modal appearing underneath the group invite modal.
| invitations: Group invitations | ||
| invite: Invite student(s) | ||
| invite_instructions: Enter one or more student user names, separated by commas. | ||
| invite_instructions: Enter one or more student user names and/or emails, separated by commas. |
There was a problem hiding this comment.
Revise the "separated by commas" part
| end | ||
| if flash_allowance(:error, allowance_to(:invite_member?, @grouping)).value | ||
| to_invite = params[:invite_member].split(',') | ||
| to_invite = params[:invite_member].to_s.split(',').compact_blank |
There was a problem hiding this comment.
As I mentioned on Slack, please change this to split on whitespace as well as commas.
| if flash_allowance(:error, allowance_to(:invite_member?, @grouping)).value | ||
| to_invite = params[:invite_member].split(',') | ||
| to_invite = params[:invite_member].to_s.split(',').compact_blank | ||
| if to_invite.empty? |
There was a problem hiding this comment.
Move this check into Grouping#invite and have it return an error message if this case is encountered
| i = i.strip | ||
| invited_user = current_course.students.joins(:user).find_by('users.user_name': i) | ||
| if invited_user&.receives_invite_emails? | ||
| already_emailed = Set.new |
There was a problem hiding this comment.
Overall some of the logic here is being duplicated by Grouping#invite. I would modify that method to return a list of (unique) users that are successfully invited (in addition to the existing errors, and then just iterate over that list directly.
…e matching for emails
# Conflicts: # Changelog.md
64a89a2 to
6d88305
Compare
david-yz-liu
left a comment
There was a problem hiding this comment.
@danielrafailov1 this is great, please just update the screenshots of the modal with the updated instruction text.
david-yz-liu
left a comment
There was a problem hiding this comment.
Nice work, @danielrafailov!
Proposed Changes
Added new feature allowing group invitation by email.
Screenshots of changes
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
I added some comments in the code to make it easier for future developers and maintainers to understand the intentions behind some of my modifications. I can completely understand if you feel that any of the comments that I added are unnecessary and redundant and will remove them if need be. I also moved the inline styling that I had on the
invite_memberlabel to the MarkUs stylesheet. I can also understand if you think that this is unnecessary and will undo the change if need be. Lastly, I noticed a bug that I don't think I introduced. If you have the invite modal open, and MarkUs times out, the timeout message appears underneath the invite modal. Here is an image for illustration.