Skip to content
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

feat(settings): Allow to sort groups in the account management alphabetically #44465

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Mar 25, 2024

Summary

We can do this purely in the frontend - but when enforced from the backend using the existing system config, we need to follow the requirement. We then show a warning about the configuration.

Screenshots

what screenshot
Groups sorted alphabetically Screenshot 2024-03-25 at 23-43-45 Settings - Users - Nextcloud
Sorting by name Screenshot 2024-03-25 at 23-43-37 Settings - Users - Nextcloud
Sorting by member count Screenshot 2024-03-25 at 23-43-25 Settings - Users - Nextcloud
When enforced by name without member count available Screenshot 2024-03-25 at 23-43-03 Settings - Users - Nextcloud

Checklist

@susnux susnux added this to the Nextcloud 29 milestone Mar 25, 2024
@susnux susnux requested review from Pytal, a team, szaimen and emoral435 and removed request for a team March 25, 2024 22:52
Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

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

Looks fantastic, just a small comment :)

apps/settings/src/store/users.js Outdated Show resolved Hide resolved
@Altahrim Altahrim mentioned this pull request Mar 26, 2024
@susnux susnux force-pushed the feat/allow-to-sort-groups-abc branch from 8762af1 to 3fecd1f Compare March 26, 2024 12:49
@susnux susnux requested a review from emoral435 March 26, 2024 12:50
@susnux susnux force-pushed the feat/allow-to-sort-groups-abc branch from 3fecd1f to 7652713 Compare March 26, 2024 12:51
Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

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

Sweet!

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

Was this tested with LDAP backend? I think LDAP backend disabled user counts in some cases (always?).

apps/settings/lib/Controller/UsersController.php Outdated Show resolved Hide resolved
@susnux
Copy link
Contributor Author

susnux commented Mar 26, 2024

Was this tested with LDAP backend?

I did not change the backend logic, I do not touch the group fetching, but simply add an option for front end sorting.
I just use the existing flag to overwrite the front end sorting to keep current behavior.

So yes works the same with LDAP as before.

@susnux susnux force-pushed the feat/allow-to-sort-groups-abc branch from 7652713 to 97b2bb8 Compare March 26, 2024 15:58
@susnux susnux requested a review from come-nc March 26, 2024 16:10
Copy link
Member

@Pytal Pytal left a comment

Choose a reason for hiding this comment

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

Nice!

apps/settings/lib/Controller/UsersController.php Outdated Show resolved Hide resolved
apps/settings/lib/Controller/UsersController.php Outdated Show resolved Hide resolved
$serverData['sortGroups'] = $sortGroupsBy;
$serverData['sortGroups'] = $forceSortGroupByName
? \OC\Group\MetaData::SORT_GROUPNAME
: (int)$this->config->getAppValue('core', 'group.sortBy', (string)\OC\Group\MetaData::SORT_USERCOUNT);

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
susnux added 2 commits March 27, 2024 12:04
…etically

We can do this purly in the frontend - but when enforced from the backend using the existing system config,
we need to follow the requirement. We then show a warning about the configuration.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the feat/allow-to-sort-groups-abc branch from 183d0db to 82be5e0 Compare March 27, 2024 11:06
@susnux susnux merged commit 9afcec7 into master Mar 27, 2024
165 of 167 checks passed
@susnux susnux deleted the feat/allow-to-sort-groups-abc branch March 27, 2024 11:46
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

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

Successfully merging this pull request may close these issues.

Feature Request : Sorting groups
4 participants