-
Notifications
You must be signed in to change notification settings - Fork 97
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
Display Invitation Link #247
Comments
Yeah that one has been bothering me for a while, and your solution makes a lot of sense ! All that would be needed is to build that link in the frontend directly, since it's the same domain to accept and create invitations. It would solve the email problem in a quite elegant way, and all you'd have to do is share the invite link with the other user 😄 |
OK. I made those changes at it worked pretty much as planned. I'll try to submit a PR tomorrow for this bit. Any suggestions for what tests you want? All it does is add a URL field the the invite list payload. I can try and dig around and find any tests that might be checking those payload. The UI is identical except just before the email address of the person I include FontAwesome link icon that is a hyperlink to the invitation. Is that good for you or were you thinking of something else? I could also put the link at the end of the row, but there are already a couple of things going on there including the "delete" Just let me know. |
This is awesome! Do you have a screenshot of what you're describing ? Your change seems fine, I'd just suggest copying the invite URL to the clipboard when the user clicks the link icon. We already have a CopyToClipboard component that we use for copying API tokens. I would suggest updating the Regarding tests, if you haven't changed the payload returned by the backend, I'd just leave it as is, otherwise if you feel like adding a jest test for that endpoint, you're welcome to do so, I have no specific guidelines. I know the project lacks testing, that's certain. |
This adds the invitation URL to the server response for invitations and it then leverages that URL on the client. The hope here is to address issue getmeli#247 and ideally just make it easier to use Meli without having to have a working email server to send out invites. Design note: I very deliberately pass a URL back from the server instead of just the bare token. The reason is that if I pass back a bare token then the UI will have to formulate the URL which means duplicating that logic both client and server side which I have a visceral dislike for (very bad code smell, IMHO). This way, only the server needs to know how to construct the URLs and it can unilaterally change the scheme if it wants with _zero_ impact on the client. Hypermedia for the win.
I understand from #224 and various other tickets that there are issues with mailing out links and making sure you are authenticated before accepting the invitation. But another useful and related feature would be to display the link on the "Staff" page. This would eliminate the need to even have a mail server because the admin could add a person and then send them the link directly (e.g., via a Teams channel or something).
In one of the issues, they mention that if you don't have a mail server it will print the email or invite to stdout. I didn't see that.
Is there a reason not to display the invite link on that screen? It appears that the URL for the invite is a simple template involving the token. The token is stored in the database. But when a query is made for invitations, the payload doesn't include the link. Since only "admins or owners" can get a list of invites, why not return the url (or at least the token) in the serialized payload? Then, you could just include it here in the UI.
I'm trying to figure out if this was done deliberately or whether you would accept a PR for this functionality (since it seems like just a few lines of non-breaking changes to implement).
The text was updated successfully, but these errors were encountered: