papermark icon indicating copy to clipboard operation
papermark copied to clipboard

feat: Add invite link functionality to team

Open ShreyasLakhani opened this issue 1 year ago • 16 comments

Summary: This PR introduces the ability for teams to invite members using a unique share link, secured by UUIDs. Previously, team invitations were sent individually via email. This update enhances the invitation process. #1049

  1. Added a new inviteLink field to the Team table in the database

    • Type: UUID
    • Generated automatically when a new team is created
    • Can be reset by team administrators
  2. Implemented functionality to generate and reset the invite link

  3. Created API endpoints for:

    • Retrieving the current invite link
    • Resetting the invite link
    • Joining a team using the invite link
  4. Updated the UI to display and manage the team invite link

  • The invite link is unique to each team

  • Team administrators can reset the link if needed

  • The existing functionality to invite users individually by email is preserved

  • Thoroughly tested the invite link functionality using Postman:

    • Verified the generation of a valid invite link
    • Tested the reset functionality for the invite link
    • Confirmed successful team joining process using the invite link

https://github.com/user-attachments/assets/25b4753d-ee0f-432c-8a0f-479ca9a2048f

ShreyasLakhani avatar Oct 20 '24 08:10 ShreyasLakhani

@ShreyasLakhani is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 20 '24 08:10 vercel[bot]

@mfts I migration folder I change code because of veriable conflict. Initially I used "shareLink " in prisma but in code I used "inviteLink" . So i changed all name and use single name "inviteLink".

Let me know, if any error occur.

ShreyasLakhani avatar Oct 20 '24 08:10 ShreyasLakhani

/assign

AndrewHamal avatar Oct 20 '24 18:10 AndrewHamal

The /assign command can only be used on issues, not on pull requests.

oss-gg[bot] avatar Oct 20 '24 18:10 oss-gg[bot]

/assign

pikachusensei avatar Oct 20 '24 18:10 pikachusensei

The /assign command can only be used on issues, not on pull requests.

oss-gg[bot] avatar Oct 20 '24 18:10 oss-gg[bot]

@mfts if anything missing or not done please tell me. I didn't understand "please add the invite by link as a separate dialog / modal" and also I try to solve "One thing I didn't see is how the user actually signs up using the invite link. I think that part is missing or I missed it in the review somehow" this.

ShreyasLakhani avatar Oct 22 '24 06:10 ShreyasLakhani

@mfts can you please review my changes before end of hacktoberfest.

ShreyasLakhani avatar Oct 26 '24 07:10 ShreyasLakhani

@ShreyasLakhani will review your PR tomorrow.

and don't worry will award before end of hacktoberfest :)

mfts avatar Oct 26 '24 10:10 mfts

@mfts Brother, I respect your time but You said that you will review. still no update on it and hacktoberfest and oss.gg is about to end.

I request to review or proceed award.

ShreyasLakhani avatar Oct 30 '24 16:10 ShreyasLakhani

@ShreyasLakhani great progress, I mentioned the change requests inline.

I'm happy to award you 50% of the points now for the work already done. would love to push this over the line with your help.

/award 375

mfts avatar Oct 31 '24 07:10 mfts

Awarding ShreyasLakhani: 375 points 🕹️ Well done! Check out your new contribution on oss.gg/ShreyasLakhani

oss-gg[bot] avatar Oct 31 '24 07:10 oss-gg[bot]

@mfts Look at the changes I made.

  1. create new file for invite-link modal (components/teams/invite-link-modal.tsx)
  2. add accept and reject button along with error handling and build regular functions (pages/teams/invite/[code]/index.tsx)
  3. use swr instead of useEffect (components/teams/add-team-member-modal.tsx)
  4. removed uuid package

ShreyasLakhani avatar Oct 31 '24 10:10 ShreyasLakhani

/award 375

Thanks @ShreyasLakhani awarding the second half. will review tomorrow and then hopefully can merge it in

mfts avatar Oct 31 '24 12:10 mfts

Awarding ShreyasLakhani: 375 points 🕹️ Well done! Check out your new contribution on oss.gg/ShreyasLakhani

oss-gg[bot] avatar Oct 31 '24 12:10 oss-gg[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
papermark ❌ Failed (Inspect) Dec 5, 2024 9:31am

vercel[bot] avatar Dec 05 '24 09:12 vercel[bot]