Skip to content

Conversation

@beltranaceves
Copy link

@beltranaceves beltranaceves commented Jun 23, 2024

Addressing #1337.

Hi, first time contributing to this repo. I wanted to validate the changes and style before writing tests.

Checklist:

  1. When inviting existing users, they are not automatically added to the org until they accept the invite.
  2. Invites for existing users cannot be accepted if the user is not logged in.
  3. Invites for existing users cannot be accepted if the logged in user is not the recipient.
  4. Invites for new users cannot be accepted if a user is logged in.
  5. Show pending invites on login.
  6. Invites list view.
  7. Cleaned up temp changes.
  8. Broken test are fixed.
  9. New test have been writen.

@beltranaceves
Copy link
Author

I was tempted to add a route for logged in users that lists pending received invites, accessible from the user dropdown menu. But it seems that issues and PRs are fairly atomic, so I kept it pretty barebones

Copy link
Collaborator

@joshk joshk left a comment

Choose a reason for hiding this comment

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

Thanks for jumping into this issue! Its great to have new people onboard.

You are on the right track. I have a few suggestions which should clear up the UX of the feature:

  • My suggestion would be to have a new banner in the Orgs list (/) with a message like "You have x pending invites to Organizations".
  • When you click the message, or link by the message ("View pending invites"), you would then be taken to a page which lists all pending invites.
  • This list would include the Organization name, who invited you (I have this in another PR which I'm just finishing), when they invited you, and two buttons, accept and decline.

Let me know if there is anything I can help with.

Comment on lines 445 to 450
{:error, :not_found} -> invite(params, org)
{:ok, user} -> add_org_user(org, user, %{role: params["role"]})
{:error, :not_found} ->
invite(params, org)

{:ok, _user} ->
invite(params, org)
# add_org_user(org, user, %{role: params["role"]})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this can be simplified to always invite, and not having to search for the user


get("/invite/:token", AccountController, :invite)
post("/invite/:token", AccountController, :accept_invite)
post("/invite_existing/:token", AccountController, :accept_invite_existing)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should all be possible without another route.

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.

2 participants