TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.59k stars 2.06k forks source link

Feature: Admin V2 - Deactivate team members #4594

Closed KevinMulhern closed 3 weeks ago

KevinMulhern commented 3 weeks ago

Because:

This commit:

KevinMulhern commented 3 weeks ago

Is there a better icon we can use for the "Deactivate" option? needs to be from Heroicons to keep our icons consistent

KevinMulhern commented 3 weeks ago

Note: This can only be tested locally, we can't send emails on review apps.

Steps for QA

  1. Log into admin v2 - admin@odin.com, password123
  2. Invite a new team member
  3. Accept the invite and log into the new team members account in an incognito window
  4. Back on first admin account, click the ellipsis menu on the new team member
  5. Click the "Deactivate" option
  6. The admin should be moved to a "Deactivated" section at the bottom of the team page

As the deactivated admin...

  1. Refresh the incognito window - you should be signed out
  2. Try to sign in again - you should be redirected back to the sign in page with a notice informing the admin they've been deactivated
zachmmeyer commented 3 weeks ago

@KevinMulhern could you please post what the admin v2 url should look like so I know what to append to the deployment? I have to dig it up from an old PR and I'm here not often enough to remember.

I tried \admin, \adminv2, and \v2.

Asartea commented 3 weeks ago

@zachmmeyer admin_v2/

Thought: should we add links to admin and admin v2 to the sidebar when in a development environment?

zachmmeyer commented 3 weeks ago

@Asartea Thank you! That definitely seems to be it. I don't think it's entirely necessary to add it in to the code or anything, it just should be part of the AC for testing purposes. That way anyone can come in and test it.

zachmmeyer commented 3 weeks ago

@KevinMulhern I'm getting a 500 when inviting a new team member. image I haven't tried anything weird with the input strings yet.

zachmmeyer commented 3 weeks ago

~~As for the icon, of which I can't see yet, I think the user-minus icon would be appropriate. image Not sure what's being used currently.~~

I should have looked at the source files.

Asartea commented 3 weeks ago

Are you running this locally or on the review app? If its the review app this is probably because it doesn't have an email provider, so trying to send an email causes the server to freak out.

zachmmeyer commented 3 weeks ago

I'm using the deployment link from GitHub.

KevinMulhern commented 3 weeks ago

Hey @zachmmeyer, sorry, I'll make sure to include the path in all the PR's that come after.

The 500 is likely coming from the invitation email that needs to be sent. We don't have emails set up on review apps currently, this one needs to be tested locally I'm afraid.

zachmmeyer commented 3 weeks ago

@KevinMulhern I'm going to give running this locally a shot (been a real long time) but I won't be upset if someone else reviews this before I do.

KevinMulhern commented 3 weeks ago

No worries Zach, thanks anyway!

Asartea commented 3 weeks ago
  1. Log into admin v2 - admin@odin.com, password123 ✅
  2. Invite a new team member ✅
  3. Accept the invite and log into the new team members account in an incognito window ✅
  4. Back on first admin account, click the ellipsis menu on the new team member image
  5. Click the "Deactivate" option image
  6. The admin should be moved to a "Deactivated" section at the bottom of the team page image
  7. Refresh the incognito window - you should be signed out ✅
  8. Try to sign in again - you should be redirected back to the sign in page with a notice informing the admin they've been deactivated image

Note: I already got this notice when I refreshed: not sure if this was intentional, but seems fine to me