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
unify count filters and introduce display name attribute detection #11837
Conversation
@@ -151,8 +151,10 @@ var LdapWizard = { | |||
ajaxRequests: {}, | |||
|
|||
ajax: function(param, fnOnSuccess, fnOnError, reqID) { | |||
if(reqID !== undefined) { | |||
if(typeof reqID !== 'undefined') { |
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.
You can also use _.isUndefined(reqID)
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.
ty
Soooo much code for detectors. I hope that one day we'll be able to refactor these JS classes and make them a bit easier to understand. |
} else if (this.target === 'Group') { | ||
LdapWizard.countGroups(doneCallback); | ||
} | ||
var beforeUpdateCountDone = $.Deferred(); |
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.
You could make beforeUpdateCount
create the $.Deferred()
instead of here.
This way you only need to write $.when(this.beforeUpdateCount()).done(...)
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.
It would make it more readable.
I'm not sure how to test this with openLDAP ? Should I try and create users that have "cn" as display name and see whether it's detected on this branch ? |
@PVince81 one way is to manually set the display name to something unexisting, and trigger a count action again ("Test Filter" button on User filter in experienced mode, or by changing the user list filter). Displayname should be found correctly again. To test for cn, create a users which is not of inetOrgPerson objectclass to avoid display name and configure the user list filter to only find them. |
@PVince81 thanks for reviewing and your suggestions! |
🚀 Test PASSed. 🚀 |
@PVince81 satisfied? others: More testers or reviewers? 💐 |
cc @MorrisJobke |
The display name is detected successfully. But I don't know how to properly review this. I would give this a thumbs up, but I can't decide on the quality of the code. 👍 |
As discussed with @blizzz via IRC I'll review this (in exchange for 🍻) ;-) |
/** | ||
* called after detectors have run | ||
* @callback runDetectorsCallback | ||
*/ |
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.
Seems somewhat lonely and without context to me that comment.
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.
That's how JS doc works :) This defines the runDetectorsCallback used in the following method.
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.
Okay. Good to know. Black magic that is. ;-)
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.
Best currency that is! |
@@ -1168,6 +1170,18 @@ private function getFilterPartForSearch($search, $searchAttributes, $fallbackAtt | |||
} | |||
|
|||
/** | |||
* returns the filter used for counting users | |||
*/ |
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.
* @return string
Works, but I wonder why it shows "0 users" found instead of my user count at the setup? - The users are shown correctly on the users page. Recorded video of setup at https://s3.owncloud.com/owncloud/public.php?service=files&t=0a1b1a586e577884c49e25fa6710762f If I access the page after the setup the correct numbers of users (7) is shown, but not before. This is kinda confusing. |
Hm, maybe it could make sense to trigger as user count instead of a group one in that case. |
…red from only 2 places. more reliable structure and flow, saves requests
…ching entries but limit it to 1 in order to make it faster
Needed adjustments for current master and got a fix when paging size is set to 0. @MorrisJobke @LukasReschke @PVince81 like to revisit? |
I actually don't really like to do it. But I'll do it anyways - you know the deal ;-) |
yeah, yes you break it anyway and even expect 🍻 for it. But that's 👌 |
Rest works - port should get fixed though, might also exist on master. 👍 |
@LukasReschke yes, port field needs to be addressed on master, but a different issue (and the same without this PR). Thx for your thumb! |
…n with xp'ed mode (would be a regression otherwise)
The inspection completed: 16 new issues, 5 updated code elements |
@blizzz This will most likely not work properly. Solution is to create a new branch, cherry-pick the commits to it, and create a new PR to have CI run over it. |
Checkout the branch and then directly create a new branch (no cherry-picking needed) just clone the branch ;) |
I will take care of this. |
Placeholder PR is in #12388 |
From #12388 (comment) |
Now I need one more thumb :) Since, after @MorrisJobke 's one there were more changes, adapting to master. 🐫 |
@blizzz I know ... but I need time to recover from all the issues that rain on me 🌈 |
That's also the reason why I assigned it to myself ;) |
I tested this. The user count on the filter page is updated correct. (I dropped the user name for one user and it got updated) 👍 as it works as expected (login for ldap users work and the login for the one without displayname doesn't work) |
unify count filters and introduce display name attribute detection
Thanks @MorrisJobke ! 🌟 @karlitschek backport? It fixes #11328 but also adds required functionality and thus it's a big PR. @jnfrmarks rated it with high severity. |
Backport is fine in this case. |
Detecting display name attribute is new. There are not so small changes to the LDAP wizard code. I think we tested it good, but the amount of changes makes it potentially risky imho. |
This fixes #11328 and introduces some bigger changes.
While testing i have seen some disbehaviour in the wizard which however is also present in master. Those I will investigated independtly from this PR.
Call for comments, tests and reviews @craigpg @jnfrmarks @PVince81 @Xenopathic @butonic