-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(app-settings): limit app to group initial state #57533
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
| $serverData['systemGroups'] = $groups; | ||
|
|
||
| $this->initialState->provideInitialState('usersSettings', $serverData); | ||
|
|
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.
| $serverData['systemGroups'] = $groups; | |
| $this->initialState->provideInitialState('usersSettings', $serverData); | |
| $this->initialState->provideInitialState('usersSettings', $groups); | |
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.
I think it should probably rather be something like:
$this->initialState->provideInitialState('usersSettings', [ 'systemGroups' => $groups ]);This is due to the front end reading it as such:
https://github.com/nextcloud/server/blob/master/apps/settings/src/store/users.js#L35-L38
Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
| $groups = array_map(function (IGroup $group) { | ||
| return [ | ||
| 'id' => $group->getGID(), | ||
| 'name' => $group->getDisplayName(), | ||
| ]; | ||
| }, $this->groupManager->search('', 5)); |
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.
| $groups = array_map(function (IGroup $group) { | |
| return [ | |
| 'id' => $group->getGID(), | |
| 'name' => $group->getDisplayName(), | |
| ]; | |
| }, $this->groupManager->search('', 5)); | |
| $groups = array_map(static fn (IGroup $group): array => [ | |
| 'id' => $group->getGID(), | |
| 'name' => $group->getDisplayName(), | |
| ], $this->groupManager->search('', 5)); |
Summary
When you try to limit an app by a group, the dropdown is initially not filled with any groups. They only populate once you start typing the name of a group, which triggers a network request. This pull request provides the necessary initial state to the app list so that the groups are populated by default and you can quickly select one without searching.
TODO
Checklist
3. to review, feature component)stable32)