-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Pre-release] Enable bulk invitations on onboarding step #394
Conversation
I'm thinking we can add a |
I'm currently stuck on this one, specifically with how to apply strong parameters. We have to accept nested attributes for each Invitation AND a Membership. I'm sure it's something small I'm missing, just having some trouble with this one.
|
Skip button added |
Taking a step back from it, we probably don't even need the new model. Will try to do something similar to |
I expect that users will pretty quickly want to be able to upload a CSV/XLSX of names and emails to invite, particularly if you are dealing with larger teams. |
@olbrich Seems like something we could potentially do with Action Models, will try to keep that in the back of my mind. |
Finding that it's hard to do this one without the existence of a model since Bullet Train fields rely on the existence of a form: <%= render 'shared/fields/email_field', form: invitation_form, method: :email, options: {autofocus: true} %> Still running into the strong_params issue, so I think I'll take a step back from this one for a bit to clear my head. |
Made a little more progress on this one. Now we can see if the Invitations and Memberships are valid or not, and it will redirect with an error saying "Please correct the errors below" if something's wrong. Will have to actually send the invitations next and work on the system tests. |
I have a bunch of hidden fields for now, but I plan on just moving this logic to the controller. |
@andrewculver @jagthedrummer The tests are now passing! This one is ready for review. |
invitation.membership.team = current_team | ||
|
||
# Role IDs don't get registered automatically because roles_ids is an array, so we handle that here. | ||
if available_roles.include?(params[:account_onboarding_invitation_list][:invitations_attributes][idx.to_s][:membership_attributes][:role_ids].downcase) |
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.
We could probably make the params call here shorter, will try to keep this one in the back of my mind.
layout "devise" | ||
|
||
before_action do | ||
@user = current_user |
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.
Thinking we might need to do something else for this
Joint PR:
See the joint PR bullet-train-co/bullet_train#835 for additional information.
Original PR description:
Currently looks like this, I definitely have a lot more work to do on it though.