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] Create new Adjustment Reasons #5811

Merged

Conversation

MadelineCollier
Copy link
Contributor

@MadelineCollier MadelineCollier commented Aug 7, 2024

Summary

This PR is for this issue but it doesn't have an issue ID yet as the issue is still in draft. The update functionality will follow in a second PR to keep things small and easy to review.

This PR migrates the creation of new adjustment reasons to 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 adjustment reasons 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:

Screen.Recording.2024-08-07.at.4.20.09.PM.mov

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 requested a review from a team as a code owner August 7, 2024 14:13
@MadelineCollier MadelineCollier changed the title Create adjustment reasons via new admin UI modal [Admin] Create new Adjustment Reasons Aug 7, 2024
@MadelineCollier
Copy link
Contributor Author

Not sure if the spec failures I am seeing here are related to my changes, but happy to fix if they are!

Locally my new specs pass:
Screenshot 2024-08-07 at 4 36 06 PM

Example spec failure from CI just now:

Screenshot 2024-08-07 at 4 36 23 PM

@kennyadsl
Copy link
Member

@MadelineCollier it seems like something related to Ransack, which released a new version recently. If you want to take a look, that would be great.

@MadelineCollier
Copy link
Contributor Author

@MadelineCollier it seems like something related to Ransack, which released a new version recently. If you want to take a look, that would be great.

I have opened a separate PR to address this issue:
#5812

@MadelineCollier MadelineCollier force-pushed the admin-new-adjustment-reason branch from c73925a to b5b0493 Compare August 8, 2024 13:11
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.80%. Comparing base (b3111b2) to head (b5b0493).

Files Patch % Lines
...ers/solidus_admin/adjustment_reasons_controller.rb 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5811      +/-   ##
==========================================
+ Coverage   88.78%   88.80%   +0.02%     
==========================================
  Files         731      732       +1     
  Lines       17057    17088      +31     
==========================================
+ Hits        15144    15175      +31     
  Misses       1913     1913              

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

@MadelineCollier MadelineCollier merged commit 3e8be72 into solidusio:main Aug 8, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants