solidusio-contrib / solidus_sale_prices

Completely based on spree_sale_prices
BSD 3-Clause "New" or "Revised" License
10 stars 30 forks source link

Refactor admin interface for sale prices #25

Closed mtylty closed 5 years ago

mtylty commented 5 years ago

This changes the whole admin structure for sale prices. The old interface was cumbersome and not styled following Solidus guidelines.

With the new interface the admin has a more "traditional" approach with a list of sale prices and a list of variant prices. The admin user can select one or more variant prices that need to be overridden to add a new sale price that will only affect selected country, currency and price of the given variant prices.

Complex js interactions are gone in favor of a more traditional REST interface that mimicks the Solidus admin interface.

Another big improvement is the fact that now everything is handled through prices. Before this sale prices could only be managed on a variant-level via the admin and it feels wrong because you could be interested in having a particular variant price (i.e. a valid price in Italy) on sale but not the price for the same variant on the default price (i.e. price in the US). With this change this is now possible.

This change also removes the resource controller dependency in favor of a standard controller that inherits from Spree::BaseController.

Some screenshots of the final result:

Schermata 2019-08-08 alle 17 31 13 Schermata 2019-08-08 alle 17 31 26
mtylty commented 5 years ago

I got carried away and also added support for CircleCI because TravisCI wasn't working that well. Specs are now refactored to run in a way similar to solidus_auth_devise.