[Admin] Introduce role creation#5831
Merged
MadelineCollier merged 2 commits intosolidusio:mainfrom Aug 27, 2024
Merged
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".
This was referenced Aug 19, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5831 +/- ##
==========================================
+ Coverage 89.08% 89.12% +0.04%
==========================================
Files 739 743 +4
Lines 17246 17317 +71
==========================================
+ Hits 15363 15434 +71
Misses 1883 1883 ☔ View full report in Codecov by Sentry. |
This includes the index, the new/create logic, and the singular or bulk deletion logic as well as the associated components and specs.
e3cb275 to
1fbe6d5
Compare
jarednorman
approved these changes
Aug 26, 2024
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 is basically just a repost of this PR: #5826 with a new base branch.
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: