-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Users page lazy multiselect group dropdowns #25922
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
Conversation
|
@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @ringmaster, @DeepDiver1975 and @edozzo to be potential reviewers |
|
|
|
@PVince81 Could you add checkbox, stating that we could check if the feature works at the current state? |
|
Ok, seems to work for me, I will check if that changes things in performance switching between branches |
|
@mrow4a feel free to add your own test plan checkboxes |
|
@mrow4a I just pushed a commit to fix the remaining issues. Remaining issues:
|
|
|
When clicking on the pencil some space appears over the boxes making them move down. (both safari & chrome) |
|
|
|
Great @PVince81 !! Awesome job, and just first iteration! TEST: Old version: Your branch: Summary: |
the hardest thing ever in CSS (vertical centering) 😉 The reason I picked "no group" for the text is because it is already translated, having backports in mind. Regarding to shifting of dropdowns, I guess it might be possible to compensate using a negative margin. |
|
Second test with LDAP Users 50000 OLD - performance test cannot be performed - buffer gets full after 1 minute. Scripts executes after 3 minutes (180s) of clicking "continue". NEW - average for 5 measurements: 6.17s |
|
Pfff... now struggling to try and align multiselect's dropdown button exactly with the same styles as the label text. I wonder if I shouldn't simply have hacked multiselect to accept a callback to lazy-load the dropdown contents... |
|
Ok, I reloaded and it got reduced to 60s for LDAP with old solution. But anyways, it is huge difference and no script stop. Great job here! lets optimize it even more, but this needs more discussion. |
|
Really AWESOME!!
IMHO I think the backports only from 9.0 and up is needed |
|
Vince, when you are finished with polishing javascript and CSS, lets make more detailed performance tests in both cases with small number of groups and Enterprise Scale |
|
@PVince81 Do you do topX (e.g. top3) query to the database for the users in groups? I cannot spot it in the PR, and that might squeeze the performance even more. |
|
@mrow4a that's something for another time... First things first... |
|
you guys rock! |
|
omg this is so cool! |
|
I'm deeply unhappy with the current solution because it requires a lot of CSS hacking. Instead of hacking around jquery.multiselect, I want to give a try at an alternative solution: beating the shit out of jquery.multiselect itself to make it eat an array of groups instead of DOM elements. This is technically possible. Then instead of hacking around with pencil icons we could just keep the current styles exactly as they are with the dropdown button, with the difference that the expensive stuff is only done when the dropdown opens. I'll submit a separate PR for this. |
|
@SergioBertolinSG fixed #25922 (comment) now. The problem was that the dropdown was based only on existing groups. Needed to add logic to add pending groups too if one was selected. |
|
Deselecting a new added group, closing the dropdown and opening it again makes new group to disappear from list. (not happening in master) |
I think this is acceptable because the group doesn't really exist at this point. If the admin deselected it here it is likely that it was a mistake or the admin didn't want to create this new group anyway. |
|
Yes, but it is a change of behaviour not needed, just adds some annoyance by removing them from the list. If it is too complex to change, don't bother, keep it this way. |
Yes, that's my worry... The reason it worked before was because every list inside the page has a full list of all groups as select/option elements. In the case of the top element, when you created a new group it would simply append a new "option" element in the existing list. This PR gets rid of the select/option DOM elements and recreates the selection list from scratch every time the user opens the dropdown. This is why the new group gets lost on deselection. To avoid losing it, we'd need to store it in a new location and also merge it into the list. |
|
@PVince81 after 5 times clicking button "continue" with script being freezed I stoped. With this modification, you are again building some nasty DOM element like discussed previously: You just reversed to the problem again. |
|
@mrow4a this can't be, I didn't change the internal logic. |
|
@mrow4a please delete the branch, git fetch, then check it out again. Since I force pushed / rebased, maybe you got mixed changes ? I just tried on Firefox locally and the spinner only hangs one second like before. |
|
Sorry, again problem with emptying the comment. OK. I think I just wrongly pulled your branch, I will verify it now |
|
OK, I verified it again! IT WORKS as previously. |
|
@PVince81 OK. Works fine then 👍 |
|
Thanks. Now if someone could review the code and give a second thumbs up we can merge and backport this. |
|
When you create user and add him to the group, the groups you selected, after creation are still there being checked. Should it not refresh the label and stuff there? |
|
@mrow4a no, it's by design, see master. Makes it possible to create several users in a row with the same groups. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |








Instead of pre-rendering all multiselects with lots of group entries,
the current groups are now displayed as simple labels.
Behind the labels there is a pencil icon like for other fields.
When clicking the pencil icon, the dropdown will be spawned and will
open itself.
Upon closing of the dropdown, the label comes back with the updated
selection and the dropdown is destroyed.
The whole purpose of this is to solve the performance issue with hundreds of groups which would slow down the page to a crawl and even cause script timeout issues on Firefox.
@mrow4a @cdamken please try it out
Would backport to 9.1 if it's a viable alternative to solve performance issues.
CC @butonic @DeepDiver1975