theodinproject
theodinproject copied to clipboard
Feature: Admin v2 - Invite new team members
Because:
- When someone new joins the team, I want to invite them to be an admin on the site, so they have access to everything they need.
- Relates to: https://github.com/TheOdinProject/top-meta/issues/291
This commit:
- Adds a team page where all team members will be displayed
- Adds Devise invitable for sending and accepting invitations
- Renames the
authenticate_admin_user!method used by active admin toauthenticate_active_admin_user!. It was overriding the authenticate admin devise method which devise invitable uses behind the scenes. - Adds a status enum to admin users
- Default will be "pending" after being invited
- After accepting an invite, it will change to "active"
- Deactivated will be implemented in a follow up PR to handle when people leave the team
This one can't be reviewed fully on review apps unfortunately. We don't have an email provider set up in that environment. Testing will have to be done locally with this one.
Acceptance criteria:
- Visit /admin_v2/sign_in and log in with [email protected] / password123
- Visit the team page
- Click the invite new member button
- Fill in the name and email and then submit
- The new team member should be in the list with a pending label
- View the invitation email and open the accept invitation in an incognito window - right click -> open link in incognito window
- Set a new password on the accept invitation screen and submit
- You should be signed into the admin v2 dashboard
- Visit the team page, the new team member should not be marked as pending