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

Update: User Registration Redirect Path #1290

Conversation

Gabe-Torres
Copy link
Contributor

🔗 Issue

#1227

✍️ Description

This update utilizes Devise's after_update_path_for method to handle user redirection after updating their registration.

If the user is part of the staff roster, associated with a valid organization, and authorized to access the organization's dashboard, they will be redirected to their staff dashboard.

If the user is an adopter or fosterer and authorized to access the adopter/foster dashboard, they will be redirected there.

If neither condition is met, the user will be redirected to the root path.

Adds: Controller tests for user registration updates: Test case for adopter/fosterer user redirection.
Test case for staff user redirection.

📷 Screenshots/Demos

(https://jam.dev/c/62b85dbb-12bc-4248-b63d-936d9f562b16)

@kasugaijin
Copy link
Collaborator

@Gabe-Torres how's this going? Let me know if you have any questions or would like to re-assign!

@Gabe-Torres
Copy link
Contributor Author

Hey @kasugaijin! Going well. Happy new year! I can still complete this ticket. Did you get a chance to look at my video above? I have the issue solved but was wondering if there's a different way to go about it using devise that you know of? I can merge the most recent main and get it ready for closing if everything looks good 👍

@kasugaijin
Copy link
Collaborator

@Gabe-Torres let me take a look tomorrow!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests look good

@@ -56,6 +56,19 @@ def account_update_params
:avatar)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I think this is a lot easier to read!

kasugaijin
kasugaijin previously approved these changes Jan 16, 2025
@kasugaijin kasugaijin dismissed their stale review January 16, 2025 20:39

Just noticed there is a failed test

@kasugaijin
Copy link
Collaborator

Just one test likely needs updating RegistrationTest#test_: when uploading avatar should direct to home index path with valid upload. [test/system/registration_test.rb:32]:

@Gabe-Torres
Copy link
Contributor Author

Just one test likely needs updating RegistrationTest#test_: when uploading avatar should direct to home index path with valid upload. [test/system/registration_test.rb:32]:

I'll get that test updated and merge the most recent main! 👍🏽

@Gabe-Torres Gabe-Torres force-pushed the 1227-Edit-User-Registration-Redirect-Path branch from 9e94986 to 4b6dd0f Compare January 16, 2025 23:49
@Gabe-Torres
Copy link
Contributor Author

Gabe-Torres commented Jan 16, 2025

hmmm... WELL everything was passing, rebased main into my branch and it all looked good to go.. but I wanted to clean up the history and failed big it seems

I wanted to avoid making another branch like the previous issues I've taken. Not quite sure what happen, I'll wait for some feedback before I proceed

@kasugaijin
Copy link
Collaborator

Doh!

@Gabe-Torres
Copy link
Contributor Author

Don't think I broke anything in the process but the branch might be lost 😅

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

Successfully merging this pull request may close these issues.

2 participants