Skip to content

Commit

Permalink
Feature: Create an activity when resending an invite email (#4680)
Browse files Browse the repository at this point in the history
<!-- Thank you for taking the time to contribute to The Odin Project. In
order to get this pull request (PR) merged in a reasonable amount of
time, you must complete this entire template. -->

## Because
<!-- Summarize the purpose or reasons for this PR, e.g. what problem it
solves or what benefit it provides. -->
When I resend an invite to an admin team member, I want an activity to
be created.

## Issue
<!--
If this PR closes an open issue in this repo, replace the XXXXX below
with the issue number, e.g. Closes #2013.

If this PR closes an open issue in another TOP repo, replace the #XXXXX
with the URL of the issue, e.g. Closes
https://github.com/TheOdinProject/curriculum/issues/XXXXX

If this PR does not close, but is related to another issue or PR, you
can link it as above without the 'Closes' keyword, e.g. 'Related to
#2013'.
-->
Closes #4663

## Pull Request Requirements
<!-- Replace the whitespace between the square brackets with an 'x',
e.g. [x]. After you create the PR, they will become checkboxes that you
can click on. -->
- [x] I have thoroughly read and understand [The Odin Project
Contributing
Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md)
- [x] The title of this PR follows the `keyword: brief description of
change` format, using one of the following keywords:
    - `Feature` - adds new or amends existing user-facing behavior
- `Chore` - changes that have no user-facing value, refactors,
dependency bumps, etc
    - `Fix` - bug fixes
-   [x] The `Because` section summarizes the reason for this PR
- [ ] The `This PR` section has a bullet point list describing the
changes in this PR
- [x] I have verified all tests and linters pass after making these
changes.
- [x] If this PR addresses an open issue, it is linked in the `Issue`
section
-   [ ] If applicable, this PR includes new or updated automated tests
  • Loading branch information
MikhailWahib authored Aug 1, 2024
1 parent 4cde66c commit ee0eb54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def create
if team_member.awaiting_activation?
team_member.invite!(current_admin_user)
redirect_to admin_v2_team_path, notice: "Invite sent to #{team_member.name}"
team_member.create_activity(key: 'admin_user.reinvited', owner: current_admin_user,
params: { name: team_member.name })
else
redirect_to admin_v2_team_path, alert: "#{team_member.name} has already accepted the invitation"
end
Expand Down
1 change: 1 addition & 0 deletions app/views/public_activity/admin_user/_reinvited.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= activity.owner.name %> re-invited <strong class="font-semibold"><%= activity.parameters.fetch('name') %></strong>

0 comments on commit ee0eb54

Please sign in to comment.