-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Adding group display name support in group backends #26750
Conversation
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @bartv2 and @macjohnny to be potential reviewers. |
Hmm, I'm surprised that it already works so far. That was easy. However adjusting all other pieces of the UI to accomodate for the display name will be more work. In this PR I'll focus mostly on backend support + share display name. |
Now I see that there is actually another mechanism to add new actions, the Do we want to keep doing this ? If yes I'd get rid of
|
I guess that depends on the number of conditional actions, or how the UI would look like. Taking the files as an example, each file might show a different set of actions: delete the file, rename the file, share the file... the UI would need to know what actions are available for the file before executing that action to show the corresponding button (if the delete action isn't supported, why would we need to show the button?) On the other hand, for this case we could have 2 types of group backends: read-only (such as LDAP) and read-write (the default one). If this is the case, using interfaces might be an option, but we MUST consider if all the possible backends would fit in any of those groups. |
Yeah, I know... Ok, I guess I'll just create a new action "has function to get group details (including display name" instead of a brand new interface. The trouble with "implementsAction" is that there is no interface to enforce method signatures, and also no way to document these functions. |
I wonder if a "command pattern" would fit here (for reference: https://en.wikipedia.org/wiki/Command_pattern). The conditional methods would return a Command object (according to the pattern, not a Symfony Command object) to be run by the manager, or null if it doesn't implement the method. So, instead of "backend, run this method" would be "backend, I want to run this, get me the method to do so". |
Hmm not sure, command pattern might sound like overkill. Command pattern is usually better for stuff like real actions, file actions, etc. But here most of the time it's not really an action, it's just reading data from the DB. |
I guess it's probably better to not invent new ways right now and have half the code use the new way and the half use the old way. I'll use the old way here with "implementsAction". |
Argh... now I ported everything to |
040c59a
to
9f169db
Compare
Fixed, added unit tests. I think this is ready for review @jvillafanez @DeepDiver1975 |
if (!in_array($gid, $groupIds)) { | ||
continue; | ||
} | ||
if (strtolower($gid) === strtolower($search) || strtolower($group->getDisplayName()) === strtolower($search)) { |
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.
convert $search to lowercase outside the loop
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.
when I touched this line I KNEW you would say that 😉
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.
looks like you've changed it in another place but not here 😄
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.
Oaaargghhhhhhhhhhhhhhh
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.
Indeed, I was so lazy that I searched for strtolower
and landed somewhere else... I'll fix all occurences then
9f169db
to
8d5e6a1
Compare
@jvillafanez fixed now. |
da66ebf
to
77accad
Compare
Fixed all the |
👍 |
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. |
A step forward for #7918
TODOs
@jvillafanez @DeepDiver1975