Skip to content

Conversation

@theskumar
Copy link
Member

@theskumar theskumar commented Dec 18, 2024

Fixes #4131

  • Rename to "switch user"
  • Can switch from the user menu
  • Switch to choices.js from Select2
  • Update the hijacked view, shows an alert at the top

Screenshot 2024-12-18 at 9  22 59@2x
Screenshot 2024-12-18 at 9  23 31@2x
Screenshot 2024-12-18 at 9  23 53@2x
Screenshot 2024-12-18 at 9  24 19@2x

@theskumar theskumar self-assigned this Dec 18, 2024
@frjo frjo added Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Patch Mini change, used in release drafter labels Dec 18, 2024
@frjo
Copy link
Member

frjo commented Dec 18, 2024

This looks and works really nicely! Will be a pleasure to use when we get it deployed.

I have one issue. The function get_become_user_choices() is slow. I think get_role_names() takes up most of the time.

With 4000 users it takes around three (3) seconds. I think OTF has even more users. This should not be used in production but even test data can have a lot of users.

Possible to speed it up a bit, showing the role in the list is useful so good if we can keep that. Maybe caching the list would work?

@theskumar
Copy link
Member Author

I have one issue. The function get_become_user_choices() is slow. I think get_role_names() takes up most of the time.

With 4000 users it takes around three (3) seconds. I think OTF has even more users. This should not be used in production but even test data can have a lot of users.

Will look into it.

@wes-otf
Copy link
Contributor

wes-otf commented Dec 18, 2024

This is super slick! I really like the banner as opposed to the pop up window that you need to dismiss every time you reload the page. Nice improvement!

@theskumar
Copy link
Member Author

theskumar commented Dec 20, 2024

@frjo Updated the query to fetch the groups. It should always come down to 2 queries now. That said, if we face issue in the test site, we can switch to fetching the options as you type, via a search api.

@theskumar
Copy link
Member Author

The new implementation of user.is_* checks will improve the performance overall at multiple places.

@theskumar theskumar force-pushed the enchancement/hijack-interface branch 2 times, most recently from 33c3b69 to 8487108 Compare December 20, 2024 09:23
@theskumar theskumar requested a review from frjo December 20, 2024 09:26
- Rename to "switch user"
- Can switch from the user menu
- Switch to choices.js from Select2
- Update the hijacked view, so an alert at the top
@theskumar theskumar force-pushed the enchancement/hijack-interface branch from 8487108 to 9bf14fb Compare December 20, 2024 10:31
Copy link
Member

@frjo frjo left a comment

Choose a reason for hiding this comment

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

Now the load time is more or less instant and works equally well in other respects.

@frjo frjo added Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels Jan 2, 2025
@wes-otf
Copy link
Contributor

wes-otf commented Jan 2, 2025

@frjo has this been deployed to test?

@frjo
Copy link
Member

frjo commented Jan 2, 2025

Nope, forgot to push. Deploying now.

@wes-otf wes-otf added Status: Tested - approved for live ✅ and removed Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels Jan 3, 2025
@frjo frjo merged commit 923a8aa into main Jan 3, 2025
7 checks passed
@theskumar theskumar deleted the enchancement/hijack-interface branch March 11, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Tested - approved for live ✅ Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Patch Mini change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the "Become" functionality to the user menu

3 participants