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

[Admin] Add new migrations and validations in core to support new admin Spree::Role interface #5833

Merged

Conversation

MadelineCollier
Copy link
Contributor

@MadelineCollier MadelineCollier commented Aug 21, 2024

Summary

This PR is part of issue: #5823

  • Make Spree::Role names required
  • Add solidus_user_roles migrations to core
  • Add description to spree_roles table

These new migrations and validations are being added to support the example designs for the new roles admin interface:

Screenshot 2024-08-14 at 7 43 40 PM

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@MadelineCollier MadelineCollier changed the title add role columns validations [Draft] add role columns validations Aug 21, 2024
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Aug 21, 2024
@MadelineCollier MadelineCollier force-pushed the add-role-columns-validations branch from 560e327 to 45e4837 Compare August 28, 2024 14:44
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.14%. Comparing base (2c5869c) to head (1aa18ee).
Report is 23 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5833   +/-   ##
=======================================
  Coverage   89.14%   89.14%           
=======================================
  Files         744      744           
  Lines       17343    17343           
=======================================
  Hits        15460    15460           
  Misses       1883     1883           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

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

Added just a nit about using def change vs. def up / def down, but otherwise looks great! 🙌

@MadelineCollier MadelineCollier force-pushed the add-role-columns-validations branch from 45e4837 to 98addef Compare August 29, 2024 10:56
@MadelineCollier MadelineCollier marked this pull request as ready for review August 29, 2024 14:39
@MadelineCollier MadelineCollier requested a review from a team as a code owner August 29, 2024 14:39
@MadelineCollier MadelineCollier changed the title [Draft] add role columns validations [Admin] Add new migrations and validations core to support new admin Spree::Role interface Aug 29, 2024
@MadelineCollier MadelineCollier changed the title [Admin] Add new migrations and validations core to support new admin Spree::Role interface [Admin] Add new migrations and validations in core to support new admin Spree::Role interface Aug 29, 2024
It doesn't make a lot of sense to allow blank on this considering it is
the only defining feature of a Role currently.

Co-authored-by: benjamin wil <[email protected]>
@MadelineCollier MadelineCollier force-pushed the add-role-columns-validations branch from 98addef to 98dc7f6 Compare August 29, 2024 14:41
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Nice. Could we remove the unless check? It should not be necessary for Rails 7.0 and above.

These migrations originally come from `solidus_user_roles`. We intend to
migrate some of the functionality from that extension into `core`, and
this is the first step. With the table check, these migrations should be
safe to (re)run for any store which might already have
`solidus_user_roles` installed.
@MadelineCollier MadelineCollier force-pushed the add-role-columns-validations branch from 98dc7f6 to 1aa18ee Compare August 29, 2024 15:30
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Looking forward to this! Thanks for working on it 🍨

@MadelineCollier MadelineCollier merged commit 630f1ef into solidusio:main Aug 29, 2024
14 checks passed
MadelineCollier added a commit to MadelineCollier/solidus that referenced this pull request Sep 3, 2024
This is building off of the new migrations in
solidusio#5833

These originate from `solidus_user_roles`. We intend to migrate some of
the functionality from that extension into `core`, and this is the
(second) step.
MadelineCollier added a commit to MadelineCollier/solidus that referenced this pull request Sep 5, 2024
This is building off of the new migrations in
solidusio#5833

These originate from `solidus_user_roles`. We intend to migrate some of
the functionality from that extension into `core`, and this is the
(second) step.

Later commits also proved the need for an easier method of identifying
and categorizing permission sets more cleanly on the front-end, which is
why we added the category & privilege columns.

Co-authored-by: benjamin wil <[email protected]>
MadelineCollier added a commit to MadelineCollier/solidus that referenced this pull request Sep 5, 2024
This is building off of the new migrations in
solidusio#5833

These originate from `solidus_user_roles`. We intend to migrate some of
the functionality from that extension into `core`, and this is the
(second) step.

Later commits also proved the need for an easier method of identifying
and categorizing permission sets more cleanly on the front-end, which is
why we added the category & privilege columns.

Co-authored-by: benjamin wil <[email protected]>
MadelineCollier added a commit to MadelineCollier/solidus that referenced this pull request Sep 6, 2024
This is building off of the new migrations in
solidusio#5833

These originate from `solidus_user_roles`. We intend to migrate some of
the functionality from that extension into `core`, and this is the
(second) step.

Co-authored-by: benjamin wil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants