Skip to content
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

Advanced invite flow #307

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Advanced invite flow #307

wants to merge 7 commits into from

Conversation

zuuring
Copy link
Member

@zuuring zuuring commented Apr 24, 2024

Notes

This adds a new feature to the /create-invite flow which prompts the inviter to select 3 main questions:

  1. Is this a Thesis employee or contractor?
  2. Which discipline(s) will this person be working with?
  3. Which project(s) will this person be working with?

After those interactions are complete, an invite is generated with 7 days expiry and 2 uses (in-order to count invites on join) to the channel with project-discipline matching.

Still WIP

Screenshots

Screenshot 2024-04-24 at 16 36 53 Screenshot 2024-04-24 at 16 21 45

To-do

  • Setup initial role / channel selection based off user input
  • Map invite join to necessary roles
  • Get contractor flow, channel selections.
  • Test across channel, edge cases

### Notes
This adds a new feature to the `/create-invite` flow which prompts the inviter to select 3 main questions:
1. Is this a Thesis employee or contractor?
2. Which discipline(s) will this person be working with?
3. Which project(s) will this person be working with?

After those interactions are complete, an invite is generated with 7 days expiry and 1 use to the channel with `project-discipline` matching.

Still WIP

### To-do
This is still not working as intended, just some exploratory code on getting role assignment to work for project + discpline cases rather than audit channels. Based off invite counter this one is not so clear cut.

Also we must have invite uses always be greater than 1, or else invite count gets wiped as soon as member join, preventing us from checking which invite code was used.
Seems like those 🔒 emojis need to be removed in order to get correct role mapping, working as it should.
This commit resolves an issue where the old invites were not loading properly, now will be stored on runtime and the list updated anytime the invite command is run, so we can store it in cache before invite is claimed.
Get working with base role assignment if on questions you select "no"
@zuuring
Copy link
Member Author

zuuring commented Apr 29, 2024

@Shadowfiend Added an update here with the contractor flow. For now if you hit No on the first "Is this a Thesis employee or contractor?", we generate an invite with Thesis base role.

For determining the secondary question "What channels should they have access to?" We have to decide if we want to follow rolemapping for additional roles that follow channel name i.e #access-channel grants the Access channel role. This way that flow can follow the same as we assign project/discipline roles.

This commit swaps things around to resolve a bug happening when invite codes are not stored, this now makes sure the invite codes are stored when creating a new invite, so uses can be counted forwards.
@zuuring zuuring marked this pull request as ready for review April 30, 2024 07:32
@zuuring
Copy link
Member Author

zuuring commented Apr 30, 2024

Calling this one ready for review, although just need to remove the loggers since there are quite a few of them for testing :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant