[Admin] Introduce role creation#5826
Closed
MadelineCollier wants to merge 2 commits intomainfrom
Closed
Conversation
Now instead of a top level Users component, the main landing page is "Users and Roles" (with the users page being the pre-selected tab, so the only visual change is a new page header and a new tab component to swap between "Users" and "Roles".
493ed2d to
ae88c75
Compare
This includes the index, the new/create logic, and the singular or bulk deletion logic as well as the associated components and specs.
ae88c75 to
12963d8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5826 +/- ##
==========================================
+ Coverage 89.03% 89.08% +0.04%
==========================================
Files 737 741 +4
Lines 17188 17259 +71
==========================================
+ Hits 15304 15375 +71
Misses 1884 1884 ☔ View full report in Codecov by Sentry. |
This was referenced Aug 15, 2024
Contributor
Author
|
Closing in favour of #5831 which has the correct base branch |
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.
This PR is for #5823. The update/edit functionality will follow in a second PR to keep things small and easy to review. Currently this is just the index, new, create, and delete methods.
This PR creates a new role management page in the new admin interface, following the existing pattern used for tax categories and refund reasons.
The form is rendered via a modal dialog on the roles list by leveraging Turbo frames. Successful creation leads to a turbo stream page refresh, which updates the existing list preserving the query params and the scroll position, for a consistent UX.
The attached video shows the functionality visually:
New tab nesting, scoping, and role creation:
Screen.Recording.2024-08-14.at.7.05.11.PM.mov
Deletion:
Screen.Recording.2024-08-14.at.7.08.38.PM.mov
Additional Questions
This is the first piece for the new [Admin][Settings] Introduce role creation and modification capability ticket.
Example designs:

Spree::Rolecurrently lacks:I am assuming that to support the example designs, I will be adding those attributes to the
Spree::Rolemodel in a future PR, but I am unsure whether that should go insolidus_adminor whether that should be added tocore.Additionally, the example designs seem to differentiate between "custom" and "standard" roles. Will we be creating new stock roles with default permissions sets and adding them to core/db/default/spree/roles.rb? If so, what will those default roles and permissions be?
Summary
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: