Add user groups and automatically associate users to groups upon signup#20
Open
JustShah wants to merge 5 commits into
Open
Add user groups and automatically associate users to groups upon signup#20JustShah wants to merge 5 commits into
JustShah wants to merge 5 commits into
Conversation
This was referenced Apr 9, 2025
Closed
1052811 to
3808f85
Compare
|
@JustShah I removed this as it is not true |
|
@JustShah Add mechanism to add new users to default group |
3808f85 to
014dba4
Compare
448813f to
fb116e2
Compare
Added associations in Spree::User model for user groups to support grouping users for targeted pricing and management. Created Spree::UserGroup model with associations to users and stores to enable flexible user group management. Updated locale files to include translations for user groups. Added migrations to create spree_user_groups table and add user group references to users and stores.
- Added UserGroupsController to manage user groups. - Created views for user group management, including: - New user group form (`new.html.erb`) - User group edit form (`edit.html.erb`) - User group index view (`index.html.erb`) - Partial view for user group form fields. - Enhanced user management by allowing assignment of user groups to users in the user form. - Updated store form to include a selection for the default cart user group. - Added breadcrumb navigation for improved user experience in the admin panel. This feature allows administrators to create, edit, and manage user groups, facilitating better organization and access control for users within the Spree application.
- Created a new users sub-menu partial to manage user-related navigation, including links to users and user groups. These enhancements improve the organization of the admin interface, making it easier for administrators to manage user groups effectively.
- Updated UsersController to assign the default user group to new users if the current store has the `enforce_group_upon_signup` setting enabled. - Added a checkbox in the store settings form to allow administrators to enable or disable the `enforce_group_upon_signup` feature. - Included a new translation key for the `enforce_group_upon_signup` label in the English locale file. This feature ensures that all new users are automatically added to a specified user group, improving user management and organization within the Spree application.
eea994f to
07acd8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Should be applied together with a second PR for the user group assignment via API and a PR in Starter Frontend
User Groups Feature
This pull request introduces a comprehensive User Groups management system in Admin, aimed at enhancing user management and improving the organization of users within the application. The main changes include the ability to enforce default user group assignments upon signup, manage user groups, and improve the admin interface for managing users and their groups.
Included Issues:
#1
#6
Key Features:
Enforce User Group Assignment Upon Signup:
UsersControllerto assign a default user group to new users, based on the store's setting forenforce_group_upon_signup.User Groups Management in Spree Admin:
UserGroupsControllerto manage user groups within the admin panel.User Group Model and Core Associations:
Spree::UserGroupmodel with associations tousersandstoresto allow flexible user group management.spree_user_groupstable and reference user groups in theusersandstorestables.Benefits:
Visual Changes: