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 users admin store credits page #5887

Merged

Conversation

MadelineCollier
Copy link
Contributor

Summary

The full store credits flow is taking a bit longer than I originally expected so I am breaking off this piece in an effort to keep PRs small and easy to review.

This PR is for issue: #5824

This migrates the users/:id/store_credits page from the legacy soldius_backend to the new solidus_admin. Again there were no designs so I just tried my best to match to the existing components and layouts.

The edit, create, and invalidate flow will follow in subsequent PRs, but for now they exist as they did before, powered by the soldius_backend.

The attached video shows the functionality visually:

Store.Credits.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.

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

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

Project coverage is 89.33%. Comparing base (25a41bf) to head (9f24cce).
Report is 531 commits behind head on main.

Files with missing lines Patch % Lines
...lidus_admin/users/store_credits/index/component.rb 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5887      +/-   ##
==========================================
+ Coverage   89.32%   89.33%   +0.01%     
==========================================
  Files         759      760       +1     
  Lines       17682    17708      +26     
==========================================
+ Hits        15795    15820      +25     
- Misses       1887     1888       +1     

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

Spree::StoreCredit
end

def tabs
Copy link
Member

Choose a reason for hiding this comment

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

This could probably be extracted into a UserTabs module, so we do not have to add it to every user index component, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that early on, but had some issues when using a dynamic value for current (eg: current: action_name == "edit". It would work on initial load but then would sometimes be a bit strange/incorrect in its display during certain flows/partial page reload. Once I have the rest of the store credits stuff out of the way I'd be happy to take another crack at it though!

@MadelineCollier MadelineCollier merged commit 96505a8 into solidusio:main Oct 29, 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.

2 participants