-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invites to join an Org require the user to accept the invite #1346
base: main
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this 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.
lib/nerves_hub/accounts.ex
Outdated
{: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"]}) |
There was a problem hiding this comment.
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
lib/nerves_hub_web/router.ex
Outdated
@@ -198,6 +198,7 @@ defmodule NervesHubWeb.Router do | |||
|
|||
get("/invite/:token", AccountController, :invite) | |||
post("/invite/:token", AccountController, :accept_invite) | |||
post("/invite_existing/:token", AccountController, :accept_invite_existing) |
There was a problem hiding this comment.
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.
Addressing #1337.
Hi, first time contributing to this repo. I wanted to validate the changes and style before writing tests.
Checklist: