-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(settings): Initialize group display names from store #55871
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?
fix(settings): Initialize group display names from store #55871
Conversation
6dd16fe to
4775a36
Compare
|
This PR should be against the master branch and then backported |
When editing a user, if groups have display names different from their
IDs (e.g., long group names that get hashed), the group selector was
showing the group ID instead of the display name after page reload.
This happened because the `data()` function initialized `userGroups`
with `{ id, name: id }`, setting both fields to the group ID. The fix
adds a `created()` lifecycle hook that looks up the actual group names
from the Vuex store.
Fixes nextcloud#55785
Signed-off-by: Claude <[email protected]>
Co-Authored-By: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Add Cypress E2E test to verify that group display names are shown correctly in the user editor, even when the group ID differs from the display name (e.g., when long group names get hashed). The test creates a group with a very long name to trigger Nextcloud's ID hashing behavior, assigns a user to that group, then verifies that after a page reload the display name is shown instead of the hash ID. Related to nextcloud#55785 Signed-off-by: Claude <[email protected]> Co-Authored-By: Nikolaus Demmel <[email protected]> Signed-off-by: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Signed-off-by: Nikolaus Demmel <[email protected]>
Replace crypto-random-string import with Nextcloud's built-in randomString utility to match the pattern used in other Cypress tests. Also add missing testIsolation flag and cleanup hook to follow test conventions used throughout the codebase. Signed-off-by: Nikolaus Demmel <[email protected]>
|
/backport to stable32 |
c0dfbc6 to
469f4e6
Compare
|
The Cypress tests fail with Same for performance tests: Is there anything I can / should do? |
|
No, someone with access needs to create a copy of this PR to have the CI running and if that is green then this PR can be merged. |
|
Hello there, 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! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
I think that #56524 (using the computed properties) is a bit cleaner. |
|
Happy new year everyone! Friendly ping on this fix. Could we please get this PR approved / merged, or alternatively #56524 merged (and backported)? Thanks! |
Summary
Fixes #55785
When editing a user, if groups have display names different from their IDs (e.g., long group names that get hashed), the group selector was showing the group ID instead of the display name after page reload.
Root Cause
The
data()function inUserRowMixin.jsinitializeduserGroupswith{ id, name: id }, setting both theidandnamefields to the group ID. While this works fine when the group ID and display name are the same, it breaks when they differ (e.g., when long group names get hashed).Solution
Added a
created()lifecycle hook that looks up the actual group names from the Vuex store ($store.state.users.groups) and initializesuserGroupswith the correct display names.Notes