Group invitations by email - #8106
Conversation
Coverage Report for CI Build 31139572789Coverage increased (+0.02%) to 90.621%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. 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
| <p><%= t('groups.members.invite_instructions') %></p> | ||
| <label for='invite_member'><%= User.human_attribute_name(:user_name).pluralize %></label> | ||
| <%= text_field_tag 'invite_member', nil, required: true, autocomplete: 'off' %> | ||
|
|
| 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
Proposed Changes
(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)
Added new feature allowing group invitation by email.
Screenshots of your changes (if applicable)
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.