Skip to content

Conversation

@elzody
Copy link
Contributor

@elzody elzody commented Jan 13, 2026

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

  • Write a proper test to make sure the dropdown is filled with some groups

Checklist

@elzody elzody self-assigned this Jan 13, 2026
@elzody elzody requested a review from a team as a code owner January 13, 2026 19:56
@elzody elzody added the 2. developing Work in progress label Jan 13, 2026
@elzody elzody requested review from ArtificialOwl, icewind1991 and salmart-dev and removed request for a team January 13, 2026 19:56
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Jan 13, 2026
@elzody elzody requested a review from leftybournes January 13, 2026 19:56
@elzody elzody moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Office team Jan 13, 2026
@elzody elzody changed the title Fix/limit app to group initial state fix(app-settings): limit app to group initial state Jan 13, 2026
Comment on lines 106 to 109
$serverData['systemGroups'] = $groups;

$this->initialState->provideInitialState('usersSettings', $serverData);

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$serverData['systemGroups'] = $groups;
$this->initialState->provideInitialState('usersSettings', $serverData);
$this->initialState->provideInitialState('usersSettings', $groups);

Copy link
Contributor Author

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

@elzody elzody added the bug label Jan 13, 2026
Comment on lines +99 to +104
$groups = array_map(function (IGroup $group) {
return [
'id' => $group->getGID(),
'name' => $group->getDisplayName(),
];
}, $this->groupManager->search('', 5));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress bug

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

4 participants