Skip to content

Group invitations by email - #8106

Open
danielrafailov1 wants to merge 14 commits into
MarkUsProject:masterfrom
danielrafailov1:group-invitations-by-email
Open

Group invitations by email#8106
danielrafailov1 wants to merge 14 commits into
MarkUsProject:masterfrom
danielrafailov1:group-invitations-by-email

Conversation

@danielrafailov1

@danielrafailov1 danielrafailov1 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.

  • Can add multiple students to a group using a mix of both emails (case insensitive) and usernames (case sensitive) in a list separated by commas
  • Changed the text field to a text area to give the user more space to enter usernames and emails
Screenshots of your changes (if applicable) Screenshot 2026-08-03 at 4 57 40 PM

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
📖 Documentation update (change that updates documentation) X
🔧 Internal (change that only affects developers or continuous integration)

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:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

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_member label 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.

Screenshot 2026-08-03 at 10 52 07 PM

@coveralls

coveralls commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31139572789

Coverage increased (+0.02%) to 90.621%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 101 of 101 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 51725
Covered Lines: 47892
Line Coverage: 92.59%
Relevant Branches: 2491
Covered Branches: 1239
Branch Coverage: 49.74%
Branches in Coverage %: Yes
Coverage Strength: 129.66 hits per line

💛 - Coveralls

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread config/locales/views/groups/en.yml Outdated
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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' %>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Keep this blank line

Comment thread app/controllers/groups_controller.rb Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As I mentioned on Slack, please change this to split on whitespace as well as commas.

Comment thread app/controllers/groups_controller.rb Outdated
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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move this check into Grouping#invite and have it return an error message if this case is encountered

Comment thread app/controllers/groups_controller.rb Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@danielrafailov1
danielrafailov1 force-pushed the group-invitations-by-email branch from 64a89a2 to 6d88305 Compare August 7, 2026 01:55
@danielrafailov1
danielrafailov1 requested review from david-yz-liu and removed request for david-yz-liu August 7, 2026 03:20
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.

3 participants