Compare commits

...

299 Commits

Author SHA1 Message Date
Pau Perez
e83a3ff76d Revert "Enable request queuing tracking in Datadog"
This reverts commit 91e5276140.
2021-01-12 10:56:11 +01:00
Pau Perez
6e689c4607 Update all locales with the latest Transifex translations 2021-01-08 16:18:31 +01:00
Pau Pérez Fabregat
9cf71c703d Merge pull request #6615 from Matt-Yorkley/money
Money!
2021-01-08 13:24:14 +01:00
Pau Pérez Fabregat
b51d8c573a Merge pull request #6614 from Matt-Yorkley/api-errors
API Bugnag errors
2021-01-08 12:59:11 +01:00
Pau Pérez Fabregat
47774b3b2e Merge pull request #6628 from openfoodfoundation/dependabot/bundler/rubocop-1.8.0
Bump rubocop from 1.7.0 to 1.8.0
2021-01-08 12:57:14 +01:00
Pau Pérez Fabregat
3927f56ed4 Merge pull request #6444 from openfoodfoundation/dependabot/bundler/kaminari-1.2.1
[Security] Bump kaminari from 0.17.0 to 1.2.1
2021-01-08 12:47:59 +01:00
Pau Pérez Fabregat
bd83443595 Merge pull request #6611 from jibees/6196-fix-text-wrapping-on-oc
6196 fix text wrapping on oc
2021-01-08 11:48:41 +01:00
Pau Pérez Fabregat
27e83392bf Merge pull request #6536 from coopdevs/enable-new-customer-balance-to-core-team
Enable new customer balance for the beta testers
2021-01-08 11:24:23 +01:00
dependabot[bot]
11ce9b943f Bump rubocop from 1.7.0 to 1.8.0
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.7.0...v1.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-08 05:39:09 +00:00
Andy Brett
d78e8acee7 Merge pull request #6619 from luisramos0/remove_oj
Remove unused dependency
2021-01-07 12:43:09 -08:00
Andy Brett
3073a9b588 Merge pull request #6618 from luisramos0/byebug
Upgrade pry
2021-01-07 12:41:43 -08:00
Andy Brett
0bb92e04b5 Merge pull request #6621 from openfoodfoundation/dependabot/bundler/bugsnag-6.19.0
Bump bugsnag from 6.18.0 to 6.19.0
2021-01-07 12:35:51 -08:00
Pau Pérez Fabregat
ca84e3eafb Merge pull request #6610 from openfoodfoundation/dependabot/bundler/stripe-5.29.0
Bump stripe from 5.28.0 to 5.29.0
2021-01-07 16:58:02 +01:00
Matt-Yorkley
d27900d5fb Merge pull request #6525 from openfoodfoundation/transifex
Transifex
2021-01-07 16:54:22 +01:00
Pau Pérez Fabregat
7f3c4f2433 Merge pull request #6551 from coopdevs/track-request-queuing
Track request queuing in Datadog
2021-01-07 16:34:42 +01:00
dependabot[bot]
0fdf398dd0 Bump bugsnag from 6.18.0 to 6.19.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.18.0 to 6.19.0.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.18.0...v6.19.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-07 05:42:58 +00:00
Luis Ramos
ea29c62c5e Remove unused dependency 2021-01-06 22:50:55 +00:00
Luis Ramos
18b84fc850 Upgrade pry 2021-01-06 22:41:20 +00:00
Matt-Yorkley
a8d07a7e80 Merge pull request #6602 from openfoodfoundation/dependabot/bundler/awesome_nested_set-3.3.1
Bump awesome_nested_set from 3.2.1 to 3.3.1
2021-01-06 21:43:12 +01:00
Matt-Yorkley
cc88611b15 Update Spree::Money to use Monetize#parse instead of Money#parse
This method was removed from the money gem without replacement. It's now provided by the monetize gem.
2021-01-06 19:20:19 +00:00
Matt-Yorkley
3387bf5821 Switch from direct dependency on money gem to monetize gem
This change is actually made around Spree 2.0, but we missed it. The `monetize` gem also installs the `money` gem.
2021-01-06 19:17:00 +00:00
Matt-Yorkley
45e4d86631 Merge money_decorator.rb with money.rb
The #rounded method was left out, as it appears to be dead code.
2021-01-06 19:17:00 +00:00
dependabot-preview[bot]
47f59a5d0a [Security] Bump kaminari from 0.17.0 to 1.2.1
Bumps [kaminari](https://github.com/kaminari/kaminari) from 0.17.0 to 1.2.1. **This update includes security fixes.**
- [Release notes](https://github.com/kaminari/kaminari/releases)
- [Changelog](https://github.com/kaminari/kaminari/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kaminari/kaminari/compare/v0.17.0...v1.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-06 19:09:53 +00:00
Matt-Yorkley
0fbf3d6cd9 Merge pull request #6555 from filipefurtad0/tax_rates_spec
Extends spec coverage of Tax Rates settings - CRUD operations
2021-01-06 19:16:14 +01:00
Matt-Yorkley
019f4dfa24 Merge pull request #6605 from PauloVilarinho/refactor-pagination-data
Refactor pagination data
2021-01-06 19:06:23 +01:00
Matt-Yorkley
7beba3debf Merge pull request #6609 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.9.1
Bump rubocop-rails from 2.5.2 to 2.9.1
2021-01-06 17:46:50 +01:00
filipefurtad0
3c123bb947 Simplified the delete test-case
Using :xpath may compromise the stability of the test, and make it break upon slight changes to the page.
2021-01-06 16:23:46 +00:00
filipefurtad0
fc062a04a4 Updated the assertion/error to consider PR #6545 2021-01-06 16:23:46 +00:00
filipefurtad0
7f658d4c46 Removed the "_id" ending from objects
Renamed objects ":zone_id" and ":tax_category_id" into ":zone" and ":tax_category," as these are full objects and not just ids.
2021-01-06 16:23:46 +00:00
filipefurtad0
8a453abd26 Adding "frozen_string_literal" back to the file
Mistakenly removed the line "# frozen_string_literal: true". This commit adds it back in.
2021-01-06 16:23:46 +00:00
filipefurtad0
3edf5fd6d9 Extends spec coverage of Tax Rates settings - CRUD operations 2021-01-06 16:23:46 +00:00
Andy Brett
381d5a5e37 Merge pull request #6599 from openfoodfoundation/dependabot/bundler/capybara-3.32.2
Bump capybara from 3.15.1 to 3.32.2
2021-01-06 07:40:39 -08:00
Matt-Yorkley
c482173394 Delete dead code
This AMS injection method is no longer referenced anywhere in the codebase
2021-01-06 13:20:31 +00:00
Matt-Yorkley
b842bfbc3d Explicitly notify Bugsnag on errors during API response processing
These errors are currently not being sent :/
2021-01-06 12:59:19 +00:00
Jean-Baptiste Bellet
39fc80172e move css property 2021-01-06 09:49:12 +01:00
Jean-Baptiste Bellet
1b4906d55a adjust margin according to old design 2021-01-06 09:17:11 +01:00
Jean-Baptiste Bellet
6e6be09740 use display flex to align 2021-01-06 09:16:38 +01:00
Jean-Baptiste Bellet
3a8b63b371 remove height constraint 2021-01-06 09:16:19 +01:00
dependabot[bot]
491dc387d7 Bump stripe from 5.28.0 to 5.29.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.28.0 to 5.29.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.28.0...v5.29.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-06 05:31:08 +00:00
dependabot[bot]
02c63519c7 Bump rubocop-rails from 2.5.2 to 2.9.1
Bumps [rubocop-rails](https://github.com/rubocop-hq/rubocop-rails) from 2.5.2 to 2.9.1.
- [Release notes](https://github.com/rubocop-hq/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-rails/compare/v2.5.2...v2.9.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-06 05:28:02 +00:00
Andy Brett
e58cd8a043 overwrite existing field value 2021-01-05 16:01:04 -08:00
Andy Brett
67bf6bb5fc Merge pull request #6604 from openfoodfoundation/dependabot/bundler/webdrivers-4.4.2
Bump webdrivers from 4.2.0 to 4.4.2
2021-01-05 14:55:03 -08:00
Matt-Yorkley
540aa913a3 Tidy up Api::OrderController#index 2021-01-05 21:08:02 +00:00
Matt-Yorkley
fe0a0395d8 Remove DEFAULT_PAGE constants 2021-01-05 19:07:46 +00:00
Matt-Yorkley
4bb2653306 Tidy up pagination in Api::ProductsController#overridable and Angular PagedFetcher service
Refactors away some unnecessary mess and unblocks the last remaining issue in upgrading the Kaminari gem (deprecated calls to #num_pages method)
2021-01-05 18:57:08 +00:00
Matt-Yorkley
47f9a3f08a Add guard clause and remove conditionals
Sometimes the objects are not paginated. In this case we need to avoid trying to render pagination data, as it will throw an error. This guard clause also means we can remove messy conditionals from several controllers.
2021-01-05 18:51:24 +00:00
Paulo Vilarinho
f53089c16c fix products controller spec erros 2021-01-05 15:11:26 -03:00
dependabot[bot]
811480c8e0 Bump awesome_nested_set from 3.2.1 to 3.3.1
Bumps [awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set) from 3.2.1 to 3.3.1.
- [Release notes](https://github.com/collectiveidea/awesome_nested_set/releases)
- [Changelog](https://github.com/collectiveidea/awesome_nested_set/blob/master/CHANGELOG)
- [Commits](https://github.com/collectiveidea/awesome_nested_set/compare/v3.2.1...v3.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 16:56:21 +00:00
Pau Pérez Fabregat
dae065324d Merge pull request #6600 from openfoodfoundation/dependabot/bundler/shoulda-matchers-4.4.1
Bump shoulda-matchers from 4.0.1 to 4.4.1
2021-01-05 17:54:47 +01:00
Pau Pérez Fabregat
a14750933c Merge pull request #6592 from openfoodfoundation/dependabot/bundler/rubocop-1.7.0
Bump rubocop from 0.81.0 to 1.7.0
2021-01-05 17:54:22 +01:00
Pau Pérez Fabregat
20fd85786c Merge pull request #6603 from openfoodfoundation/dependabot/bundler/rack-mini-profiler-2.3.0
Bump rack-mini-profiler from 2.0.2 to 2.3.0
2021-01-05 16:48:56 +01:00
Paulo Vilarinho
c99b250a5f refactor pagination data removing default_per_page parameter 2021-01-05 12:18:47 -03:00
Paulo Vilarinho
4d217c9e9d refactor render paginated products 2021-01-05 12:04:59 -03:00
Paulo Vilarinho
9a62ba8ed5 remove hound errors 2021-01-05 11:59:49 -03:00
Paulo Vilarinho
81c3c1cf32 remove default page 2021-01-05 11:57:54 -03:00
Paulo Vilarinho
330d42ea98 change inclue position to start of class 2021-01-05 11:48:02 -03:00
dependabot[bot]
381880d281 Bump webdrivers from 4.2.0 to 4.4.2
Bumps [webdrivers](https://github.com/titusfortner/webdrivers) from 4.2.0 to 4.4.2.
- [Release notes](https://github.com/titusfortner/webdrivers/releases)
- [Changelog](https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/titusfortner/webdrivers/compare/v4.2.0...v4.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 12:07:15 +00:00
dependabot[bot]
87c9ec32e6 Bump shoulda-matchers from 4.0.1 to 4.4.1
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 4.0.1 to 4.4.1.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v4.0.1...v4.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 12:04:57 +00:00
dependabot[bot]
ba867e53d0 Bump rack-mini-profiler from 2.0.2 to 2.3.0
Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.0.2 to 2.3.0.
- [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases)
- [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.0.2...v2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 12:01:20 +00:00
Paulo Vilarinho
efd4b97f5c fix depracation warnings from kaminary 2021-01-05 00:33:29 -03:00
Paulo Vilarinho
ccac16c5b2 fix orders controllers specs errors 2021-01-05 00:07:38 -03:00
Paulo Vilarinho
ab586f58b1 apply pagination data concern to bulk line items controller 2021-01-04 20:22:58 -03:00
Paulo Vilarinho
3f324537a5 apply pagination data concern to exchange products controller 2021-01-04 20:22:43 -03:00
Paulo Vilarinho
1c5f6e7222 apply pagination data concern to orders controller 2021-01-04 20:22:14 -03:00
Paulo Vilarinho
9bb7096be1 apply pagination data concern to products_controller 2021-01-04 20:21:39 -03:00
Paulo Vilarinho
0f00107de1 add pagination data concern 2021-01-04 20:21:24 -03:00
Andy Brett
2085e183d4 Merge pull request #6601 from openfoodfoundation/dependabot/bundler/spring-2.1.1
Bump spring from 2.0.2 to 2.1.1
2021-01-04 12:37:59 -08:00
dependabot[bot]
5460fc9152 Bump rubocop from 0.81.0 to 1.7.0
Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.81.0 to 1.7.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.81.0...v1.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 20:14:06 +00:00
dependabot[bot]
7ee8385902 Bump capybara from 3.15.1 to 3.32.2
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.15.1 to 3.32.2.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.15.1...3.32.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 20:14:05 +00:00
Andy Brett
a749bb602a Merge pull request #6589 from openfoodfoundation/dependabot/bundler/ffaker-2.16.0
Bump ffaker from 2.11.0 to 2.16.0
2021-01-04 12:13:06 -08:00
Andy Brett
749c7f4193 Merge pull request #6585 from openfoodfoundation/dependabot/bundler/fuubar-2.5.1
Bump fuubar from 2.5.0 to 2.5.1
2021-01-04 12:11:52 -08:00
dependabot[bot]
343d8d2686 Bump spring from 2.0.2 to 2.1.1
Bumps [spring](https://github.com/rails/spring) from 2.0.2 to 2.1.1.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v2.0.2...v2.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 18:58:40 +00:00
Andy Brett
59c981e14d Merge pull request #6591 from openfoodfoundation/dependabot/bundler/test-prof-0.11.3
Bump test-prof from 0.7.5 to 0.11.3
2021-01-04 10:55:47 -08:00
dependabot[bot]
b8f7ef27a6 Bump fuubar from 2.5.0 to 2.5.1
Bumps [fuubar](https://github.com/thekompanee/fuubar) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/thekompanee/fuubar/releases)
- [Changelog](https://github.com/thekompanee/fuubar/blob/master/CHANGELOG.md)
- [Commits](https://github.com/thekompanee/fuubar/compare/releases/v2.5.0...releases/2.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 18:34:00 +00:00
dependabot[bot]
22d2b078e8 Bump ffaker from 2.11.0 to 2.16.0
Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.11.0 to 2.16.0.
- [Release notes](https://github.com/ffaker/ffaker/releases)
- [Changelog](https://github.com/ffaker/ffaker/blob/master/Changelog.md)
- [Commits](https://github.com/ffaker/ffaker/commits/v2.16.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 17:53:45 +00:00
Pau Pérez Fabregat
bfbad0ae81 Merge pull request #6560 from openfoodfoundation/dependabot/bundler/unicorn-5.8.0
Bump unicorn from 5.7.0 to 5.8.0
2021-01-04 18:07:54 +01:00
dependabot[bot]
b49a773bca Bump test-prof from 0.7.5 to 0.11.3
Bumps [test-prof](https://github.com/test-prof/test-prof) from 0.7.5 to 0.11.3.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v0.7.5...v0.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 17:07:30 +00:00
Pau Pérez Fabregat
ca7548e8f4 Merge pull request #6573 from openfoodfoundation/dependabot/bundler/test-unit-3.3.9
Bump test-unit from 3.3.7 to 3.3.9
2021-01-04 18:06:07 +01:00
Pau Pérez Fabregat
258b25b453 Merge pull request #6596 from openfoodfoundation/dependabot/bundler/simplecov-0.18.5
Bump simplecov from 0.17.1 to 0.18.5
2021-01-04 18:05:03 +01:00
Pau Pérez Fabregat
1d28e7add3 Merge pull request #6588 from openfoodfoundation/dependabot/bundler/pry-byebug-3.8.0
Bump pry-byebug from 3.7.0 to 3.8.0
2021-01-04 18:02:17 +01:00
dependabot[bot]
b84820ad93 Bump simplecov from 0.17.1 to 0.18.5
Bumps [simplecov](https://github.com/simplecov-ruby/simplecov) from 0.17.1 to 0.18.5.
- [Release notes](https://github.com/simplecov-ruby/simplecov/releases)
- [Changelog](https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md)
- [Commits](https://github.com/simplecov-ruby/simplecov/compare/v0.17.1...v0.18.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-03 10:38:35 +00:00
Andy Brett
8452f174a1 Merge pull request #6575 from PauloVilarinho/remove-choose-currency-from-admin-general-settings
remove choose currency from admin general settings
2021-01-02 21:25:47 -08:00
dependabot[bot]
cf485266fe Bump pry-byebug from 3.7.0 to 3.8.0
Bumps [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/deivid-rodriguez/pry-byebug/releases)
- [Changelog](https://github.com/deivid-rodriguez/pry-byebug/blob/master/CHANGELOG.md)
- [Commits](https://github.com/deivid-rodriguez/pry-byebug/compare/v3.7.0...v3.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-02 23:12:57 +00:00
Andy Brett
180a49b501 Merge pull request #6590 from openfoodfoundation/dependabot/bundler/byebug-11.1.3
Bump byebug from 11.0.1 to 11.1.3
2021-01-02 15:11:38 -08:00
Andy Brett
115d3d0bfe Merge pull request #6587 from andrewpbrett/comment-out-oc-spec
Comment out flaky spec for complex order cycle updating
2021-01-02 15:03:20 -08:00
Paulo Vilarinho
4839b7bd63 remove choose currency from admin general settings 2021-01-02 15:00:15 -08:00
Andy Brett
3d8c7cc9f0 Merge pull request #6522 from arku/feat/stripe-credit-card-removal
Extract Stripe credit card deletion logic to a service object
2021-01-02 14:56:00 -08:00
Andy Brett
1e9b2b34f7 Merge pull request #6545 from PauloVilarinho/add-internationalization-to-included_price_validation
adds translation key to the included in price validation
2021-01-02 14:55:16 -08:00
Andy Brett
042b4faf1e comment out flaky spec 2021-01-02 14:53:55 -08:00
Andy Brett
97f1c586e1 Merge pull request #6595 from arku/chore/jsonp-format-handler-removal
Remove jsonp request handling logic
2021-01-02 14:51:30 -08:00
Arun Kumar Mohan
322e1496a9 Remove jsonp request handling logic 2021-01-02 02:17:30 -05:00
Andy Brett
51ee21e294 Merge pull request #6556 from Matt-Yorkley/adjustments-eligible
[Adjustments] Delete dead code #eligible_for_originator?
2021-01-01 20:48:27 -08:00
Andy Brett
9ddf3c4e5d Merge pull request #6562 from romale/patch-11
Added translation key "en.spree.actions.cancel"
2021-01-01 20:48:04 -08:00
Andy Brett
fabde59671 Merge pull request #6564 from romale/patch-12
Added translation keys "en.description" "en.display" "en.tags"
2021-01-01 20:47:14 -08:00
Andy Brett
d0888415e2 Merge pull request #6594 from Matt-Yorkley/credit-card-spec-expired
Ensure credit card is not out of date in credit card spec
2021-01-01 17:29:31 -08:00
Matt-Yorkley
f6d0d43622 Ensure credit card is not out of date in credit card spec
This just blew up on New Years Eve 🙈
2021-01-01 11:54:14 +00:00
dependabot[bot]
c9f2c63e1e Bump byebug from 11.0.1 to 11.1.3
Bumps [byebug](https://github.com/deivid-rodriguez/byebug) from 11.0.1 to 11.1.3.
- [Release notes](https://github.com/deivid-rodriguez/byebug/releases)
- [Changelog](https://github.com/deivid-rodriguez/byebug/blob/master/CHANGELOG.md)
- [Commits](https://github.com/deivid-rodriguez/byebug/compare/v11.0.1...v11.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-01 06:08:33 +00:00
Andy Brett
e71908fbdd Merge pull request #6566 from openfoodfoundation/dependabot/bundler/rspec-rails-4.0.2
Bump rspec-rails from 4.0.1 to 4.0.2
2020-12-31 13:10:21 -08:00
Andy Brett
17782a5577 Merge pull request #6570 from romale/patch-13
Added translation key "en.description"
2020-12-31 13:08:42 -08:00
Andy Brett
549bba0c4f Merge pull request #6583 from PauloVilarinho/remove-xml-format
remove xml format
2020-12-31 13:08:05 -08:00
Matt-Yorkley
74228242c0 Merge pull request #6576 from andrewpbrett/flaky-tag-spec
Comment out flaky tag rules spec
2020-12-31 16:59:46 +01:00
Matt-Yorkley
e88972b989 Merge pull request #6441 from luisramos0/ruby24
Bump to ruby 2.4.4
2020-12-31 15:31:45 +01:00
Paulo Vilarinho
106c42fe84 remove xml format 2020-12-30 16:06:50 -03:00
Andy Brett
fc4634cd67 comment out flaky spec 2020-12-29 19:22:09 -08:00
dependabot[bot]
3199842ecc Bump test-unit from 3.3.7 to 3.3.9
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.3.7 to 3.3.9.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.3.7...3.3.9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-29 05:52:23 +00:00
romale
aa44615dd0 Missing translation key "en.description" 2020-12-28 19:04:03 +03:00
dependabot[bot]
cb8d2e95d8 Bump rspec-rails from 4.0.1 to 4.0.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v4.0.1...v4.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-28 06:41:44 +00:00
romale
00e61f0a99 Missing translation keys "en.description" "en.display" "en.tags" 2020-12-26 23:22:19 +03:00
Transifex-Openfoodnetwork
b9c41b4379 Updating translations for config/locales/ru.yml 2020-12-26 01:31:07 +11:00
romale
28f03947df Added translation key "en.spree.actions.cancel" 2020-12-25 14:39:11 +03:00
dependabot[bot]
4e3f4cb52e Bump unicorn from 5.7.0 to 5.8.0
Bumps [unicorn](https://yhbt.net/unicorn/) from 5.7.0 to 5.8.0.

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-25 05:43:50 +00:00
Matt-Yorkley
70f7d76723 Delete dead code #eligible_for_originator?
This check is used only by Spree::Promotion objects, which are not used in OFN. There are no objects which can be originators of an adjustment that respond to #eligible? in this way, so the method always returns true.
2020-12-23 08:29:12 +00:00
Andy Brett
ec4d171993 Merge pull request #6542 from openfoodfoundation/dependabot/bundler/paranoia-2.4.3
Bump paranoia from 2.4.2 to 2.4.3
2020-12-22 20:27:10 -08:00
Andy Brett
17faa7334e Merge pull request #6538 from openfoodfoundation/dependabot/bundler/redcarpet-3.5.1
Bump redcarpet from 3.5.0 to 3.5.1
2020-12-22 19:32:59 -08:00
Andy Brett
fdf997847d Merge pull request #6553 from openfoodfoundation/dependabot/bundler/webmock-3.11.0
Bump webmock from 3.10.0 to 3.11.0
2020-12-22 19:27:29 -08:00
Andy Brett
b4e47217ef Merge pull request #6523 from arku/fix/credit-card-clone-destroyer
Handle nil stripe customer in credit card clone removal logic
2020-12-21 14:27:16 -08:00
Transifex-Openfoodnetwork
d2ba4c8111 Updating translations for config/locales/pt_BR.yml 2020-12-22 01:31:45 +11:00
Transifex-Openfoodnetwork
100d7275a6 Updating translations for config/locales/pt_BR.yml 2020-12-22 01:28:39 +11:00
Transifex-Openfoodnetwork
5a16fd7075 Updating translations for config/locales/tr.yml 2020-12-21 23:34:02 +11:00
Transifex-Openfoodnetwork
c3661cece9 Updating translations for config/locales/tr.yml 2020-12-21 23:33:59 +11:00
dependabot[bot]
554a55ecc9 Bump webmock from 3.10.0 to 3.11.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.10.0...v3.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 06:27:09 +00:00
Transifex-Openfoodnetwork
89f1d11e62 Updating translations for config/locales/en_US.yml 2020-12-19 05:14:00 +11:00
Pau Pérez Fabregat
9a199ae02c Merge pull request #6540 from PauloVilarinho/add-internationalization-to-payment-method-clean-name
Add internationalization to payment method clean name
2020-12-18 18:06:19 +01:00
Pau Perez
91e5276140 Enable request queuing tracking in Datadog
Request queuing is critical to understand whether our app servers are
able to cope with all the traffic or requests pile up in Nginx queues.
I find the article
https://www.speedshop.co/2015/07/29/scaling-ruby-apps-to-1000-rpm.html
incredibly enlightening on this topic. Thanks @nateberkopec ❤️.

This requires
https://github.com/openfoodfoundation/ofn-install/pull/689.
2020-12-18 17:33:11 +01:00
Transifex-Openfoodnetwork
1d08e30b45 Updating translations for config/locales/ru.yml 2020-12-18 20:16:57 +11:00
Andy Brett
ebe71429db Merge pull request #6541 from mkllnk/fix-subscription-script
Fix typo in subs test script
2020-12-17 17:10:05 -08:00
Andy Brett
2d636c8272 Merge pull request #6546 from andrewpbrett/sca-backend
Fix #6543
2020-12-17 14:00:36 -08:00
Andy Brett
13d6d2c978 separate conditionals 🤦 2020-12-17 13:23:14 -08:00
Paulo Vilarinho
747b747e2d adds translation key to the included in price validation 2020-12-17 18:04:55 -03:00
Matt-Yorkley
1269e5f2e9 Merge pull request #6533 from andrewpbrett/sca-backend
Patch #6469: use `purchase` to charge offline for Stripe Connect
2020-12-17 17:17:14 +01:00
Paulo Vilarinho
85663d15d1 Fix dynamic constant assignment issues 2020-12-17 10:14:54 -03:00
Paulo Vilarinho
92649ca97c Refactor payment method clean name method 2020-12-17 10:06:41 -03:00
Transifex-Openfoodnetwork
128a2ada5c Updating translations for config/locales/nb.yml 2020-12-17 20:47:05 +11:00
Transifex-Openfoodnetwork
0615c6ff3d Updating translations for config/locales/nb.yml 2020-12-17 20:43:59 +11:00
Transifex-Openfoodnetwork
10eea3b9e0 Updating translations for config/locales/en_NZ.yml 2020-12-17 20:39:39 +11:00
dependabot[bot]
3d7a069b6b Bump paranoia from 2.4.2 to 2.4.3
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/v2.4.2...2.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-17 05:42:57 +00:00
Maikel Linke
f0db7a22cc Fix typo in subs test script 2020-12-17 16:08:59 +11:00
Paulo Vilarinho
6225c83abb Add internationalization of payment method clean name
The clean name payment method now uses the internationalization string
2020-12-17 00:35:57 -03:00
Paulo Vilarinho
50955d735c Add tests for internationalization of payment method clean name
The clean name payment method tests now uses the internationalization string
2020-12-17 00:34:21 -03:00
Andy Brett
7fc9cc9f31 test that purchase is called by SCA and Connect providers 2020-12-16 11:09:15 -08:00
Pau Perez
6f8967f002 Enable new customer balance for the core team
This enables the use of the new customer balance implementation to
whatever users we specify in the BETA_TESTERS env var through
ofn-install.

This var is meant to contain the user emails that will log in such as
personal accounts (I have an account with admin access to my hub) or
superadmin accounts used by the core team. This way can gather early
feedback ourselves while not releasing the new logic to users.
2020-12-16 11:09:54 +01:00
dependabot[bot]
e2df5ebe5b Bump redcarpet from 3.5.0 to 3.5.1
Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/vmg/redcarpet/releases)
- [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmg/redcarpet/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-16 05:47:50 +00:00
Andy Brett
934f4f278e add spec to subscription confirm job 2020-12-15 12:24:38 -08:00
Andy Brett
484576d1ac add unit test for stripe connect 2020-12-15 10:30:05 -08:00
Andy Brett
cb29d05069 use purchase to charge offline for Stripe Connect 2020-12-14 11:54:03 -08:00
Pau Pérez Fabregat
c79baead84 Merge pull request #6524 from ankis17/DatePickerTranslation
Fixed Translation for DatePicker
2020-12-14 16:41:51 +01:00
Pau Pérez Fabregat
f26507b897 Merge pull request #6454 from arku/fix/signup-route
Remove /signup routes
2020-12-14 16:38:23 +01:00
Pau Pérez Fabregat
d4fc3f2118 Merge pull request #6516 from coopdevs/per-user-feature-toggles
Refactor FeatureToggle to toggle depending on user
2020-12-14 16:03:05 +01:00
Pau Pérez Fabregat
fa812364ff Merge pull request #6453 from andrewpbrett/fix-void-payment-error
fix #5829 (Voiding an initial payment (i.e. a full refund) after partially refunding the order is not possible with Stripe-SCA)
2020-12-14 09:48:41 +01:00
Pau Pérez Fabregat
9f517e1931 Merge pull request #6455 from arku/fix/tabs
Fix tab toggle
2020-12-14 09:34:05 +01:00
Luis Ramos
997b9b9a2e Merge pull request #6526 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.21
Bump combine_pdf from 1.0.16 to 1.0.21
2020-12-13 22:40:55 +00:00
Transifex-Openfoodnetwork
21efb4f3c6 Updating translations for config/locales/en_GB.yml 2020-12-14 07:19:09 +11:00
Arun Kumar Mohan
020df3619f Add tests for Stripe::CreditCardRemover 2020-12-12 21:39:21 -05:00
Arun Kumar Mohan
f02f2c540c Handle nil stripe customer in credit card clone removal logic 2020-12-12 21:31:06 -05:00
dependabot[bot]
6f763e1216 Bump combine_pdf from 1.0.16 to 1.0.21
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.16 to 1.0.21.
- [Release notes](https://github.com/boazsegev/combine_pdf/releases)
- [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.16...v1.0.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-12 21:17:26 +00:00
Andy Brett
92aeab2ec3 Merge pull request #6490 from openfoodfoundation/dependabot/bundler/capybara-3.15.1
Bump capybara from 2.18.0 to 3.15.1
2020-12-12 13:16:04 -08:00
Luis Ramos
b76261c61c Adapt preferable to work with new BigDecimal version
BigDecimal raises exception if called with nil or empty values
2020-12-12 18:50:57 +00:00
Andy Brett
94d10a45a7 Merge pull request #6486 from openfoodfoundation/dependabot/bundler/factory_bot_rails-5.2.0
Bump factory_bot_rails from 4.10.0 to 5.2.0
2020-12-12 08:58:53 -08:00
Transifex-Openfoodnetwork
18f642546d Updating translations for config/locales/it.yml 2020-12-12 20:58:50 +11:00
Transifex-Openfoodnetwork
2afcdf9261 Updating translations for config/locales/it.yml 2020-12-12 20:55:35 +11:00
Ankita Satyavarapu
377febd8d7 Fixed Translation for DatePicker 2020-12-11 22:52:22 -05:00
Arun Kumar Mohan
1edebade78 Extract Stripe credit card deletion logic to a service object 2020-12-11 19:52:59 -05:00
Luis Ramos
1ea775cffb Keep factory bot v4 behaviour
In v5 the default value is true, that means that all parent objects (for example the order od a line item) will be built using the same strategy as the object (build or create), in v4 and now with this config, the parent is always created

We can revert this and use the default value but that will require some adaptions, quite a lot of specs are broken with that behaviour activated
2020-12-12 00:23:24 +00:00
Luis Ramos
367622cea8 Capybara v3 is not cleaning up the html into text so the permissions that are inside html li elements are not matched with the matcher have_table_row when there are multiple permissions. So, in this case, we need to do the work ourselves: looking up the correct row and then asserting the permissions are the ones required 2020-12-12 00:07:33 +00:00
Luis Ramos
ada25fa2b2 Improve stripe spec
I am not sure why this was passing without these stubbed requests for
the second order, but now they were correctly failing. This commit fixes
the spec.
2020-12-11 23:15:08 +00:00
Luis Ramos
480dfdf961 Handle redirect case
For some reason the process is now working correctly, the authorization step succeeds and a redirect link is stored in the payment with state pending. The payment state is correctly left at pending. Here we add a check for the redirect path sent by stripe and fail the authorization if there is one (it means the payment would need an extra auth step only available in the frontoffice now and probably through email to customer at some point in the future). For some reason the flash with the authorization failure message is not showing up for the user
2020-12-11 23:14:23 +00:00
Andy Brett
a745fceb53 Merge pull request #6469 from andrewpbrett/sca-backend
Allow SCA cards to be setup and charged offline for subscriptions
2020-12-11 14:23:12 -08:00
Pau Perez
182f0f66b6 Refactor FeatureToggle to toggle depending on user
This enables showing features to individual users only, which enables us
to deploy features that are not yet released to gather feedback from
product and testing, while no users have access to it.
2020-12-11 09:13:07 +01:00
Luis Ramos
62715a8060 Adapt matcher to capybara v3 2020-12-11 00:21:46 +00:00
Luis Ramos
26165cc08d Adapt matcher to capybara v3 2020-12-11 00:20:58 +00:00
Luis Ramos
f19946af8d Remove unnecessary test step that is breaking in capybara v3 2020-12-11 00:16:31 +00:00
Luis Ramos
c92e8de51f Adapt matchers to capybara v3 2020-12-11 00:13:46 +00:00
Luis Ramos
ed4a7bd361 Adapt matchers to capybara v3 2020-12-11 00:09:34 +00:00
Luis Ramos
6d37a15488 Adapt matchers to capybara v3 2020-12-11 00:02:22 +00:00
Luis Ramos
79c538fad9 Fix syntax for nil property 2020-12-10 23:44:24 +00:00
Luis Ramos
b287d67f6b Adapt matchers to capybara v3 2020-12-10 23:36:40 +00:00
Luis Ramos
5ae955c27f Adapt matchers to capybara v3 2020-12-10 23:35:34 +00:00
Luis Ramos
fd5adab0d5 Adapt matchers to capybara v3 2020-12-10 23:27:56 +00:00
Luis Ramos
773f733c8e Adapt matchers to capybara v3 2020-12-10 23:05:15 +00:00
Luis Ramos
80e59a920e Adpat matcher to capybara v3 2020-12-10 23:01:01 +00:00
Luis Ramos
b58fddf098 Adapt matcher to capybara v3 2020-12-10 22:59:37 +00:00
Luis Ramos
bcf7cc1013 Replace ignore with transient according to changes in factory bot v5 2020-12-10 22:16:17 +00:00
Andy Brett
3b7313f7e3 add spec for deleting the default card 2020-12-10 12:31:58 -08:00
Andy Brett
3daccb6420 update specs with new method signature 2020-12-10 12:17:55 -08:00
Andy Brett
655512adab add missing require statements 2020-12-10 12:17:42 -08:00
Andy Brett
f50577b489 refactor cloner to use ivars 2020-12-10 11:42:28 -08:00
Andy Brett
a1f6fe5522 remove unused method now that we use autopaging 2020-12-10 11:22:14 -08:00
Andy Brett
8c747e4812 refactor destroy_clones to separate class 2020-12-10 11:22:02 -08:00
Andy Brett
4c25edd91c refactor find_cloned_card to separate class 2020-12-10 11:04:27 -08:00
Andy Brett
0ac248f03a refactor offline payment methods 2020-12-10 10:26:38 -08:00
Andy Brett
13b95f41bb use built-in auto_paging_each with stripe 2020-12-10 08:19:41 -08:00
Andy Brett
50e87a023b rename method to validate! since it can raise an error 2020-12-10 07:45:07 -08:00
Pau Pérez Fabregat
b4b4d38d3b Merge pull request #6509 from mkllnk/image-tweaks
Image code tweaks
2020-12-10 12:50:18 +01:00
Pau Pérez Fabregat
3bf58b5b7c Merge pull request #6503 from openfoodfoundation/dependabot/bundler/delayed_job_active_record-4.1.5
Bump delayed_job_active_record from 4.1.4 to 4.1.5
2020-12-10 12:33:41 +01:00
Maikel Linke
3f6288d5c7 Load rake task under test for all its specs
If you ran only the second spec without the first, the rake file wasn't
loaded and the test failed.
2020-12-10 15:35:05 +11:00
Maikel Linke
6bf041aa74 Reduce complexity 2020-12-10 15:33:34 +11:00
Maikel Linke
e6c411684f Don't fail on missing images when resizing
The changed code obtains the image dimensions when you first upload an
image. Unfortunately it's also triggered when thumbnails are refreshed.
That doesn't change the size of the original image though.
2020-12-10 15:32:43 +11:00
Luis Ramos
465d2d2f1c Remove unused dependency 2020-12-09 18:35:44 -08:00
Maikel Linke
edf9dd7921 Update translations from Transifex 2020-12-10 13:34:05 +11:00
Maikel
5ca10d5cd1 Merge pull request #6465 from openfoodfoundation/transifex
Transifex
2020-12-10 13:29:12 +11:00
Maikel
33d220e777 Merge pull request #6291 from luisramos0/subs_tasks
Add tasks to help manually test subscriptions
2020-12-10 12:55:59 +11:00
Luis Ramos
9728b088f9 Fix syntax for nil properties 2020-12-09 23:38:16 +00:00
dependabot[bot]
c033fe70e7 Bump delayed_job_active_record from 4.1.4 to 4.1.5
Bumps [delayed_job_active_record](https://github.com/collectiveidea/delayed_job_active_record) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/collectiveidea/delayed_job_active_record/releases)
- [Commits](https://github.com/collectiveidea/delayed_job_active_record/compare/v4.1.4...v4.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-09 23:28:46 +00:00
Luis Ramos
c17998774e Adapt factories to factory_bot_rails v5 syntax 2020-12-09 23:09:33 +00:00
Andy Brett
de786982dd bump karma coffee preprocessor 2020-12-09 12:31:36 -08:00
dependabot[bot]
9b6702946c Bump moment from 2.28.0 to 2.29.1
Bumps [moment](https://github.com/moment/moment) from 2.28.0 to 2.29.1.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.28.0...2.29.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-09 11:40:06 -08:00
Transifex-Openfoodnetwork
7c6621a49b Updating translations for config/locales/en_FR.yml 2020-12-10 00:36:39 +11:00
Transifex-Openfoodnetwork
134c63f353 Updating translations for config/locales/en_FR.yml 2020-12-10 00:33:37 +11:00
Transifex-Openfoodnetwork
1d64230d4b Updating translations for config/locales/fr.yml 2020-12-10 00:31:44 +11:00
Transifex-Openfoodnetwork
8f796de35b Updating translations for config/locales/ar.yml 2020-12-10 00:03:43 +11:00
Transifex-Openfoodnetwork
b4a43e0554 Updating translations for config/locales/ar.yml 2020-12-10 00:00:34 +11:00
dependabot[bot]
f2c37ef64d Bump karma-chrome-launcher from 2.2.0 to 3.1.0
Bumps [karma-chrome-launcher](https://github.com/karma-runner/karma-chrome-launcher) from 2.2.0 to 3.1.0.
- [Release notes](https://github.com/karma-runner/karma-chrome-launcher/releases)
- [Changelog](https://github.com/karma-runner/karma-chrome-launcher/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma-chrome-launcher/compare/v2.2.0...v3.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 17:58:00 -08:00
dependabot[bot]
f45d348dd7 Bump ddtrace from 0.42.0 to 0.43.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.42.0 to 0.43.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.42.0...v0.43.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 17:56:37 -08:00
dependabot-preview[bot]
351d694c13 Bump haml from 5.2.0 to 5.2.1
Bumps [haml](https://github.com/haml/haml) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/haml/haml/releases)
- [Changelog](https://github.com/haml/haml/blob/main/CHANGELOG.md)
- [Commits](https://github.com/haml/haml/compare/v5.2.0...5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-08 17:53:03 -08:00
Andy Brett
22ef9a0fef fix long line 2020-12-08 14:37:16 -08:00
Andy Brett
7a03882314 re-refactor cart_service 2020-12-08 14:37:16 -08:00
Andy Brett
b713bd7aa7 spec updates 2020-12-08 14:37:16 -08:00
Andy Brett
c70ea44091 show specific error message when add-to-cart fails 2020-12-08 14:37:16 -08:00
Luis Ramos
7a27741cf5 Remove unnecessary capybara version control in Gemfile 2020-12-08 22:15:54 +00:00
dependabot[bot]
2a3176f7f5 Bump capybara from 2.18.0 to 3.15.1
Bumps [capybara](https://github.com/teamcapybara/capybara) from 2.18.0 to 3.15.1.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/2.18.0...3.15.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 21:24:15 +00:00
dependabot[bot]
5c65f9bf55 Bump factory_bot_rails from 4.10.0 to 5.2.0
Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 4.10.0 to 5.2.0.
- [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases)
- [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/master/NEWS.md)
- [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v4.10.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 20:24:41 +00:00
Luis Ramos
0824f12472 Merge pull request #6472 from luisramos0/depen
Fix dependabot config
2020-12-08 20:02:26 +00:00
Luis Ramos
ab6f6c463a Fix problem in dependabot config, yarn is not a valid package-ecosystem, we can try npm 2020-12-08 20:00:19 +00:00
Luis Ramos
e2181960bc Merge pull request #6450 from openfoodfoundation/dependabot/bundler/knapsack-1.20.0
Bump knapsack from 1.19.0 to 1.20.0
2020-12-08 19:39:13 +00:00
Luis Ramos
e8ba16cb3e Merge pull request #6457 from openfoodfoundation/dependabot/bundler/spring-2.0.2
Bump spring from 1.7.2 to 2.0.2
2020-12-08 19:38:55 +00:00
Luis Ramos
c233052ec6 Merge pull request #6438 from luisramos0/devise4
Upgrade to devise 4.7
2020-12-08 17:19:13 +00:00
Andy Brett
d55343da1a only return gateway payment info if set on customer 2020-12-08 07:52:42 -08:00
Andy Brett
eddf8da107 update subscription spec with new method name 2020-12-08 07:52:42 -08:00
Andy Brett
3a8203094a refactor to remove boolean flag param 2020-12-08 07:52:42 -08:00
Andy Brett
f1d439870e use a named argument for offline param 2020-12-08 07:52:42 -08:00
Andy Brett
103366ea97 add request limits to credit card cloner 2020-12-08 07:52:42 -08:00
Andy Brett
9c544ef2f4 remove cloned cards after removing the platform card 2020-12-08 07:52:42 -08:00
Andy Brett
bc3fd8c50c remove unused method 2020-12-08 07:52:42 -08:00
Andy Brett
277d7f44b7 refactor api customers controller; resolve merge conflict 2020-12-08 07:52:42 -08:00
Andy Brett
a466886a32 fix rubocop warnings 2020-12-08 07:52:42 -08:00
Andy Brett
3d47ad7e33 add stubs for stripe requests 2020-12-08 07:52:42 -08:00
Andy Brett
fea7576ac1 update CreditCardCloner to find existing clone 2020-12-08 07:52:42 -08:00
Andy Brett
13ab25ac45 separate method for charging offline 2020-12-08 07:52:41 -08:00
Andy Brett
cad8a018f9 put SetupIntent on the connected Stripe account 2020-12-08 07:52:41 -08:00
Andy Brett
215d1bbe20 create js setup intent when authing shop 2020-12-08 07:52:41 -08:00
Andy Brett
b517d2f0c7 guard against a stripe customer already being deleted 2020-12-08 07:52:41 -08:00
Andy Brett
cc00f24569 add spec for clearing authorizations to credit_card_controller_spec 2020-12-08 07:46:10 -08:00
Andy Brett
d0098e190f close #4175 2020-12-08 07:46:10 -08:00
Andy Brett
1f8b4e05bb allow charges in subscriptions spec 2020-12-08 07:46:10 -08:00
Andy Brett
f875e406a8 update karma specs for setting default card 2020-12-08 07:46:10 -08:00
Andy Brett
3b44c8e7e2 update UI after changing default card 2020-12-08 07:46:10 -08:00
Andy Brett
6fdcd6218d add remove_shop_authorizations method to controller 2020-12-08 07:46:10 -08:00
Andy Brett
c60dcc75cd confirm changes to default card 2020-12-08 07:46:10 -08:00
Andy Brett
4cdc1993b8 add more specific copy on cc authorization 2020-12-08 07:46:10 -08:00
Andy Brett
747345ece9 only show authorized shops if there is a default card 2020-12-08 07:46:10 -08:00
Maikel Linke
84730577da Fail with better message when giving wrong OC id
The script was failing with:

  NoMethodError: undefined method `update!' for nil:NilClass

Now it's failing with:

  ActiveRecord::RecordNotFound: Couldn't find OrderCycle with id=1
2020-12-08 11:48:34 +11:00
Maikel Linke
906dbffb29 Fail loudly when task doesn't work 2020-12-08 11:43:21 +11:00
Maikel Linke
aa8df639c4 Style to avoid indent changes with context changes
When the indent of arguments is aligned with the method brackets, it
needs to be changed when the method changes. Putting all arguments on
their own line makes diffs of method changes or argument changes
clearer. See the next commit.
2020-12-08 11:38:50 +11:00
Maikel Linke
70d1888cc2 Ease reading of times 2020-12-08 11:36:15 +11:00
Maikel Linke
feb0ad452d Safeguard production env from test script 2020-12-08 11:33:37 +11:00
Andy Brett
e866e983f6 add spec for partially refunded SCA orders 2020-12-07 14:51:47 -08:00
Transifex-Openfoodnetwork
33916cfff3 Updating translations for config/locales/nb.yml 2020-12-08 08:21:50 +11:00
Transifex-Openfoodnetwork
9333a6385e Updating translations for config/locales/nb.yml 2020-12-08 08:00:43 +11:00
Transifex-Openfoodnetwork
c37bd8e911 Updating translations for config/locales/nb.yml 2020-12-08 07:40:37 +11:00
Andy Brett
96462325d2 fix #5829 2020-12-04 18:13:43 -08:00
dependabot-preview[bot]
567e489716 Bump spring from 1.7.2 to 2.0.2
Bumps [spring](https://github.com/rails/spring) from 1.7.2 to 2.0.2.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v1.7.2...v2.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-04 19:14:16 +00:00
Arun Kumar Mohan
868a19df6e Fix tab toggle 2020-12-03 21:03:44 -05:00
Arun Kumar Mohan
81b03906f9 Remove /signup routes 2020-12-03 20:43:28 -05:00
Luis Ramos
acddb496b7 Remove spree_i18n dependency 2020-12-03 15:34:46 -08:00
dependabot-preview[bot]
d29773d297 [Security] Bump jquery-rails from 3.1.5 to 4.4.0
Bumps [jquery-rails](https://github.com/rails/jquery-rails) from 3.1.5 to 4.4.0. **This update includes a security fix.**
- [Release notes](https://github.com/rails/jquery-rails/releases)
- [Changelog](https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/jquery-rails/compare/v3.1.5...v4.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-03 15:33:41 -08:00
Luis Ramos
0f27f57cbb Use new Admin::ResourceController 2020-12-03 15:32:20 -08:00
Luis Ramos
1d327a61a6 Fix rubocop issue and adapt rubocop exceptions 2020-12-03 15:32:20 -08:00
Luis Ramos
0fb9f44dda Make all controllers use new Admin::ResourceController 2020-12-03 15:32:20 -08:00
Luis Ramos
c63d99dd20 Remove Spree namespace from controller 2020-12-03 15:32:20 -08:00
Luis Ramos
99fd99cd33 Move spree admin resource controller to admin resource controller 2020-12-03 15:32:20 -08:00
Luis Ramos
1d075bbc90 Remove empty resource controller 2020-12-03 15:32:20 -08:00
Luis Ramos
6e08fccbbe Merge resource_controller url helpers with parent version 2020-12-03 15:32:20 -08:00
Luis Ramos
fc4cf6a9a7 Merge resource_controller model_class method with parent version 2020-12-03 15:32:20 -08:00
dependabot-preview[bot]
abc58f5bb4 Bump acts_as_list from 0.3.0 to 0.9.19
Bumps [acts_as_list](https://github.com/brendon/acts_as_list) from 0.3.0 to 0.9.19.
- [Release notes](https://github.com/brendon/acts_as_list/releases)
- [Changelog](https://github.com/brendon/acts_as_list/blob/master/CHANGELOG.md)
- [Commits](https://github.com/brendon/acts_as_list/compare/0.3.0...v0.9.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-03 15:30:24 -08:00
Matt-Yorkley
0ceba7c0a8 Update orders closing message 2020-12-03 15:29:14 -08:00
Luis Ramos
f71de8123a Dont show 'closing in' message when oc closes in more than 3 months 2020-12-03 15:29:14 -08:00
Luis Ramos
a51d01efac Merge pull request #6452 from luisramos0/dep
Move dependabot file to correct location
2020-12-03 21:35:49 +00:00
Luis Ramos
7a35fabb22 Move dependendabot config file to .github 2020-12-03 21:32:57 +00:00
dependabot-preview[bot]
67ee8c3500 Bump knapsack from 1.19.0 to 1.20.0
Bumps [knapsack](https://github.com/ArturT/knapsack) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/ArturT/knapsack/releases)
- [Changelog](https://github.com/ArturT/knapsack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ArturT/knapsack/compare/v1.19.0...v1.20.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-03 19:14:05 +00:00
Luis Ramos
5b00868c6f Allow mutable strings in some specs 2020-12-03 06:38:24 -08:00
Luis Ramos
bfd4adbcee Adapt code to work with frozen strings 2020-12-03 06:38:24 -08:00
Luis Ramos
611de912a8 Switch frozen_string_literal to false so that price code keeps working 2020-12-03 06:38:24 -08:00
Luis Ramos
2b8f0abe49 Try some mass auto-correct adding frozen-string-literal to all specs 2020-12-03 06:38:24 -08:00
Luis Ramos
de19efca64 Fix rubocop issue and add missing exceptions to manual_todo to get a green rubocop run 2020-12-03 06:38:24 -08:00
Luis Ramos
6c9e12b4ea Update rubocop exceptions file after bye bye spree 2020-12-03 06:38:24 -08:00
Luis Ramos
3162cf9abf Add gem to make tests work with devise callbacks
This is noted in the devise 4.1 release notes: https://github.com/heartcombo/devise/blob/master/CHANGELOG.md#410
2020-12-01 17:19:07 +00:00
Luis Ramos
9abdcd88e5 Move confirmable config together with other devise configs in user model 2020-12-01 17:06:39 +00:00
Luis Ramos
ca1a4db299 Bump to ruby 2.4.4 2020-12-01 15:16:39 +00:00
Luis Ramos
bd6b1dbfed Upgrade to devise 4.7 2020-12-01 11:59:41 +00:00
Transifex-Openfoodnetwork
ea148d7f51 Updating translations for config/locales/en_US.yml 2020-12-01 00:15:59 +11:00
Transifex-Openfoodnetwork
a5761707d5 Updating translations for config/locales/en_US.yml 2020-12-01 00:12:50 +11:00
Andy Brett
cd94b23277 fix rubocop styles 2020-11-20 10:35:02 -08:00
Andy Brett
4e155641fc fix nil error if no proxy orders found 2020-11-20 10:32:48 -08:00
Luis Ramos
5d93180081 Move subs tasks into subs:test namespace 2020-11-10 22:03:36 +00:00
Luis Ramos
fdfc0b330f Remove some duplicated code 2020-11-10 22:03:36 +00:00
Luis Ramos
63d62d7ce4 Improve subs task by making it handle open and close times of the Order Cycle being tested 2020-11-10 22:03:36 +00:00
Luis Ramos
51451292bd Add task to closse OC and confirm orders 2020-11-10 22:03:36 +00:00
Luis Ramos
2bb22fb7f4 Add task to reset Orders inside a specific Order Cycle by repeating the
placement job
2020-11-10 22:03:36 +00:00
Luis Ramos
5289a5b381 Add namespace to all sample data factories
These factories are not used in testing and this way we avoid collisions on the root namespace as it was happening already with OrderFactory
2020-11-10 22:03:36 +00:00
565 changed files with 3226 additions and 2244 deletions

View File

@@ -7,7 +7,7 @@ updates:
interval: "daily"
open-pull-requests-limit: 10
- package-ecosystem: "yarn"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"

View File

@@ -66,8 +66,9 @@ Layout/LineLength:
- app/models/spree/image.rb
- app/models/spree/order.rb
- app/models/spree/payment_method.rb
- app/models/spree/product_decorator.rb
- app/models/spree/product.rb
- app/models/spree/user.rb
- app/models/spree/variant.rb
- app/models/subscription.rb
- app/models/variant_override.rb
- app/models/variant_override_set.rb
@@ -336,6 +337,7 @@ Metrics/AbcSize:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscription_line_items_controller.rb
- app/controllers/admin/subscriptions_controller.rb
@@ -356,13 +358,13 @@ Metrics/AbcSize:
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/resource_controller.rb
- app/controllers/spree/admin/search_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/spree/user_passwords_controller.rb
- app/controllers/spree/user_registrations_controller.rb
- app/controllers/spree/users_controller.rb
@@ -399,11 +401,12 @@ Metrics/AbcSize:
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product_decorator.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/product_serializer.rb
- app/serializers/api/variant_serializer.rb
@@ -530,7 +533,7 @@ Metrics/CyclomaticComplexity:
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/product_decorator.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/zone.rb
- app/models/variant_override_set.rb
@@ -550,39 +553,6 @@ Metrics/CyclomaticComplexity:
Metrics/PerceivedComplexity:
Max: 7
Exclude:
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/orders_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment_method.rb
- app/models/spree/payment.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/product_decorator.rb
- app/models/spree/return_authorization.rb
- app/models/spree/zone.rb
- app/models/variant_override_set.rb
- app/services/cart_service.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/spree/localized_number.rb
- spec/models/product_importer_spec.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
@@ -595,7 +565,10 @@ Metrics/PerceivedComplexity:
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order.rb
- app/models/spree/product_decorator.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/zone.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
@@ -618,6 +591,7 @@ Metrics/MethodLength:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/manager_invitations_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
@@ -632,13 +606,13 @@ Metrics/MethodLength:
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/resource_controller.rb
- app/controllers/spree/admin/tax_categories_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/user_confirmations_controller.rb
@@ -670,11 +644,13 @@ Metrics/MethodLength:
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/store.rb
- app/models/spree/product.rb
- app/models/spree/product_decorator.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/admin/order_cycle_serializer.rb
- app/serializers/api/cached_enterprise_serializer.rb
@@ -732,6 +708,7 @@ Metrics/ClassLength:
Exclude:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
@@ -741,7 +718,6 @@ Metrics/ClassLength:
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/resource_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/models/enterprise.rb
@@ -755,8 +731,10 @@ Metrics/ClassLength:
- app/models/spree/line_item.rb
- app/models/spree/order.rb
- app/models/spree/payment.rb
- app/models/spree/product.rb
- app/models/spree/shipment.rb
- app/models/spree/user.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/serializers/api/enterprise_shopfront_serializer.rb

View File

@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 1400`
# on 2020-10-30 17:18:53 +0000 using RuboCop version 0.81.0.
# on 2020-11-05 11:27:59 +0000 using RuboCop version 0.81.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -27,13 +27,6 @@ Lint/UselessAccessModifier:
- 'app/services/mail_configuration.rb'
- 'lib/open_food_network/feature_toggle.rb'
# Offense count: 2
Lint/UselessAssignment:
Exclude:
- 'spec/**/*'
- 'app/models/spree/taxon.rb'
- 'lib/spree/core/controller_helpers/common.rb'
# Offense count: 10
Naming/AccessorMethodName:
Exclude:
@@ -60,7 +53,7 @@ Naming/MemoizedInstanceVariableName:
- 'app/mailers/producer_mailer.rb'
- 'lib/open_food_network/address_finder.rb'
# Offense count: 24
# Offense count: 25
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# ForbiddenPrefixes: is_, has_, have_
@@ -72,6 +65,7 @@ Naming/PredicateName:
- 'app/models/enterprise.rb'
- 'app/models/enterprise_relationship.rb'
- 'app/models/order_cycle.rb'
- 'app/models/spree/ability.rb'
- 'app/models/spree/adjustment.rb'
- 'app/models/spree/credit_card.rb'
- 'app/models/spree/line_item.rb'
@@ -125,7 +119,7 @@ Rails/Delegate:
- 'app/models/spree/line_item.rb'
- 'engines/order_management/app/services/order_management/reports/bulk_coop/renderers/html_renderer.rb'
# Offense count: 16
# Offense count: 15
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
@@ -139,7 +133,6 @@ Rails/FilePath:
- 'spec/factories/product_factory.rb'
- 'spec/features/admin/enterprises/images_spec.rb'
- 'spec/models/content_configuration_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/serializers/api/admin/enterprise_serializer_spec.rb'
- 'spec/support/downloads_helper.rb'
@@ -163,7 +156,7 @@ Rails/FindEach:
Exclude:
- 'app/models/spree/shipment.rb'
# Offense count: 9
# Offense count: 11
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
@@ -172,12 +165,14 @@ Rails/HasAndBelongsToMany:
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/spree/line_item.rb'
- 'app/models/spree/option_value.rb'
- 'app/models/spree/role.rb'
- 'app/models/spree/shipping_method.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
- 'app/models/spree/zone.rb'
# Offense count: 38
# Offense count: 41
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
@@ -197,7 +192,7 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/spree/shipping_method.rb'
- 'app/models/spree/taxonomy.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant_decorator.rb'
- 'app/models/spree/variant.rb'
- 'app/models/subscription.rb'
# Offense count: 84
@@ -272,13 +267,13 @@ Rails/ReflectionClassName:
- 'app/models/spree/order.rb'
- 'app/models/subscription.rb'
# Offense count: 247
# Offense count: 250
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
Rails/SkipsModelValidations:
Exclude:
- 'app/controllers/admin/resource_controller.rb'
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/resource_controller.rb'
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
- 'app/controllers/spree/admin/taxons_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
@@ -294,10 +289,12 @@ Rails/SkipsModelValidations:
- 'app/models/spree/inventory_unit.rb'
- 'app/models/spree/order.rb'
- 'app/models/spree/payment.rb'
- 'app/models/spree/product.rb'
- 'app/models/spree/shipment.rb'
- 'app/models/spree/shipping_method.rb'
- 'app/models/spree/tax_category.rb'
- 'app/models/spree/taxonomy.rb'
- 'app/models/spree/variant.rb'
- 'app/models/spree/zone.rb'
- 'app/models/subscription.rb'
- 'app/models/variant_override.rb'
@@ -440,14 +437,12 @@ Style/FormatStringToken:
- 'lib/open_food_network/sales_tax_report.rb'
- 'spec/features/admin/bulk_order_management_spec.rb'
# Offense count: 765
# Offense count: 760
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'app/controllers/admin/bulk_line_items_controller.rb'
- 'app/controllers/admin/column_preferences_controller.rb'
- 'app/controllers/admin/contents_controller.rb'
@@ -518,7 +513,6 @@ Style/FrozenStringLiteralComment:
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/properties_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/admin/resource_controller.rb'
- 'app/controllers/spree/admin/return_authorizations_controller.rb'
- 'app/controllers/spree/admin/search_controller.rb'
- 'app/controllers/spree/admin/shipping_categories_controller.rb'
@@ -635,16 +629,10 @@ Style/FrozenStringLiteralComment:
- 'app/models/spree/gateway/migs.rb'
- 'app/models/spree/gateway/pin.rb'
- 'app/models/spree/gateway/stripe_connect.rb'
- 'app/models/spree/option_type_decorator.rb'
- 'app/models/spree/preferences/file_configuration.rb'
- 'app/models/spree/price_decorator.rb'
- 'app/models/spree/product_decorator.rb'
- 'app/models/spree/product_option_type_decorator.rb'
- 'app/models/spree/product_property_decorator.rb'
- 'app/models/spree/product_set.rb'
- 'app/models/spree/property.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant_decorator.rb'
- 'app/models/stripe_account.rb'
- 'app/models/subscription.rb'
- 'app/models/subscription_line_item.rb'
@@ -725,7 +713,6 @@ Style/FrozenStringLiteralComment:
- 'app/validators/date_time_string_validator.rb'
- 'app/validators/distributors_validator.rb'
- 'app/validators/integer_array_validator.rb'
- 'config.ru'
- 'engines/order_management/app/controllers/order_management/application_controller.rb'
- 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb'
- 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb'
@@ -750,29 +737,11 @@ Style/FrozenStringLiteralComment:
- 'engines/order_management/app/services/reports/permissions.rb'
- 'engines/order_management/app/services/reports/renderers/base.rb'
- 'engines/order_management/app/services/reports/report_data/base.rb'
- 'engines/order_management/config/routes.rb'
- 'engines/order_management/lib/order_management.rb'
- 'engines/order_management/lib/order_management/engine.rb'
- 'engines/order_management/lib/order_management/version.rb'
- 'engines/order_management/order_management.gemspec'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/authorizer_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/parameters_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/permissions_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb'
- 'engines/web/app/controllers/web/angular_templates_controller.rb'
- 'engines/web/app/controllers/web/api/cookies_consent_controller.rb'
- 'engines/web/app/controllers/web/application_controller.rb'
- 'engines/web/app/helpers/web/cookies_policy_helper.rb'
- 'engines/web/config/routes.rb'
- 'engines/web/lib/web.rb'
- 'engines/web/lib/web/cookies_consent.rb'
- 'engines/web/lib/web/engine.rb'
- 'engines/web/lib/web/version.rb'
- 'engines/web/spec/helpers/cookies_policy_helper_spec.rb'
- 'engines/web/web.gemspec'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/address_finder.rb'
- 'lib/open_food_network/available_payment_method_filter.rb'
@@ -849,370 +818,8 @@ Style/FrozenStringLiteralComment:
- 'lib/tasks/sample_data/user_factory.rb'
- 'lib/tasks/specs.rake'
- 'lib/tasks/users.rake'
- 'spec/controllers/admin/bulk_line_items_controller_spec.rb'
- 'spec/controllers/admin/column_preferences_controller_spec.rb'
- 'spec/controllers/admin/customers_controller_spec.rb'
- 'spec/controllers/admin/enterprises_controller_spec.rb'
- 'spec/controllers/admin/inventory_items_controller_spec.rb'
- 'spec/controllers/admin/manager_invitations_controller_spec.rb'
- 'spec/controllers/admin/order_cycles_controller_spec.rb'
- 'spec/controllers/admin/proxy_orders_controller_spec.rb'
- 'spec/controllers/admin/schedules_controller_spec.rb'
- 'spec/controllers/admin/stripe_accounts_controller_spec.rb'
- 'spec/controllers/admin/stripe_connect_settings_controller_spec.rb'
- 'spec/controllers/admin/subscription_line_items_controller_spec.rb'
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
- 'spec/controllers/admin/tag_rules_controller_spec.rb'
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
- 'spec/controllers/api/base_controller_spec.rb'
- 'spec/controllers/api/customers_controller_spec.rb'
- 'spec/controllers/api/enterprise_fees_controller_spec.rb'
- 'spec/controllers/api/enterprises_controller_spec.rb'
- 'spec/controllers/api/logos_controller_spec.rb'
- 'spec/controllers/api/order_cycles_controller_spec.rb'
- 'spec/controllers/api/orders_controller_spec.rb'
- 'spec/controllers/api/product_images_controller_spec.rb'
- 'spec/controllers/api/products_controller_spec.rb'
- 'spec/controllers/api/promo_images_controller_spec.rb'
- 'spec/controllers/api/shipments_controller_spec.rb'
- 'spec/controllers/api/statuses_controller_spec.rb'
- 'spec/controllers/api/taxonomies_controller_spec.rb'
- 'spec/controllers/api/taxons_controller_spec.rb'
- 'spec/controllers/api/terms_and_conditions_controller_spec.rb'
- 'spec/controllers/api/variants_controller_spec.rb'
- 'spec/controllers/base_controller_spec.rb'
- 'spec/controllers/cart_controller_spec.rb'
- 'spec/controllers/checkout_controller_spec.rb'
- 'spec/controllers/enterprises_controller_spec.rb'
- 'spec/controllers/groups_controller_spec.rb'
- 'spec/controllers/line_items_controller_spec.rb'
- 'spec/controllers/registration_controller_spec.rb'
- 'spec/controllers/shop_controller_spec.rb'
- 'spec/controllers/shops_controller_spec.rb'
- 'spec/controllers/spree/admin/adjustments_controller_spec.rb'
- 'spec/controllers/spree/admin/base_controller_spec.rb'
- 'spec/controllers/spree/admin/general_settings_controller_spec.rb'
- 'spec/controllers/spree/admin/invoices_controller_spec.rb'
- 'spec/controllers/spree/admin/mail_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/orders/customer_details_controller_spec.rb'
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
- 'spec/controllers/spree/admin/overview_controller_spec.rb'
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/products_controller_spec.rb'
- 'spec/controllers/spree/admin/reports_controller_spec.rb'
- 'spec/controllers/spree/admin/search_controller_spec.rb'
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/users_controller_spec.rb'
- 'spec/controllers/spree/admin/variants_controller_spec.rb'
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
- 'spec/controllers/spree/orders_controller_spec.rb'
- 'spec/controllers/spree/user_sessions_controller_spec.rb'
- 'spec/controllers/spree/users_controller_spec.rb'
- 'spec/controllers/stripe/callbacks_controller_spec.rb'
- 'spec/controllers/stripe/webhooks_controller_spec.rb'
- 'spec/controllers/user_confirmations_controller_spec.rb'
- 'spec/controllers/user_passwords_controller_spec.rb'
- 'spec/controllers/user_registrations_controller_spec.rb'
- 'spec/factories.rb'
- 'spec/factories/address_factory.rb'
- 'spec/factories/calculated_adjustment_factory.rb'
- 'spec/factories/calculator_factory.rb'
- 'spec/factories/enterprise_factory.rb'
- 'spec/factories/order_cycle_factory.rb'
- 'spec/factories/order_factory.rb'
- 'spec/factories/product_factory.rb'
- 'spec/factories/return_authorization_factory.rb'
- 'spec/factories/shipment_factory.rb'
- 'spec/factories/shipping_method_factory.rb'
- 'spec/factories/state_factory.rb'
- 'spec/factories/stock_movement_factory.rb'
- 'spec/factories/subscription_factory.rb'
- 'spec/factories/tag_rule_factory.rb'
- 'spec/factories/user_factory.rb'
- 'spec/factories/variant_factory.rb'
- 'spec/features/admin/adjustments_spec.rb'
- 'spec/features/admin/authentication_spec.rb'
- 'spec/features/admin/bulk_order_management_spec.rb'
- 'spec/features/admin/bulk_product_update_spec.rb'
- 'spec/features/admin/configuration/content_spec.rb'
- 'spec/features/admin/configuration/general_settings_spec.rb'
- 'spec/features/admin/configuration/mail_methods_spec.rb'
- 'spec/features/admin/configuration/states_spec.rb'
- 'spec/features/admin/configuration/tax_categories_spec.rb'
- 'spec/features/admin/configuration/tax_rates_spec.rb'
- 'spec/features/admin/configuration/taxonomies_spec.rb'
- 'spec/features/admin/configuration/zones_spec.rb'
- 'spec/features/admin/customers_spec.rb'
- 'spec/features/admin/enterprise_fees_spec.rb'
- 'spec/features/admin/enterprise_groups_spec.rb'
- 'spec/features/admin/enterprise_relationships_spec.rb'
- 'spec/features/admin/enterprise_roles_spec.rb'
- 'spec/features/admin/enterprise_user_spec.rb'
- 'spec/features/admin/enterprises/index_spec.rb'
- 'spec/features/admin/enterprises_spec.rb'
- 'spec/features/admin/external_services_spec.rb'
- 'spec/features/admin/multilingual_spec.rb'
- 'spec/features/admin/overview_spec.rb'
- 'spec/features/admin/payment_method_spec.rb'
- 'spec/features/admin/payments_spec.rb'
- 'spec/features/admin/product_import_spec.rb'
- 'spec/features/admin/products_spec.rb'
- 'spec/features/admin/reports/packing_report_spec.rb'
- 'spec/features/admin/reports_spec.rb'
- 'spec/features/admin/schedules_spec.rb'
- 'spec/features/admin/shipping_methods_spec.rb'
- 'spec/features/admin/subscriptions_spec.rb'
- 'spec/features/admin/tag_rules_spec.rb'
- 'spec/features/admin/tax_settings_spec.rb'
- 'spec/features/admin/users_spec.rb'
- 'spec/features/admin/variant_overrides_spec.rb'
- 'spec/features/admin/variants_spec.rb'
- 'spec/features/consumer/account/cards_spec.rb'
- 'spec/features/consumer/account/settings_spec.rb'
- 'spec/features/consumer/account_spec.rb'
- 'spec/features/consumer/authentication_spec.rb'
- 'spec/features/consumer/confirm_invitation_spec.rb'
- 'spec/features/consumer/footer_links_spec.rb'
- 'spec/features/consumer/groups_spec.rb'
- 'spec/features/consumer/multilingual_spec.rb'
- 'spec/features/consumer/producers_spec.rb'
- 'spec/features/consumer/registration_spec.rb'
- 'spec/features/consumer/shopping/cart_spec.rb'
- 'spec/features/consumer/shopping/checkout_auth_spec.rb'
- 'spec/features/consumer/shopping/checkout_paypal_spec.rb'
- 'spec/features/consumer/shopping/checkout_spec.rb'
- 'spec/features/consumer/shopping/embedded_groups_spec.rb'
- 'spec/features/consumer/shopping/embedded_shopfronts_spec.rb'
- 'spec/features/consumer/shopping/orders_spec.rb'
- 'spec/features/consumer/shopping/products_spec.rb'
- 'spec/features/consumer/shopping/shopping_spec.rb'
- 'spec/features/consumer/shopping/variant_overrides_spec.rb'
- 'spec/features/consumer/shops_spec.rb'
- 'spec/features/consumer/sitemap_spec.rb'
- 'spec/helpers/admin/orders_helper_spec.rb'
- 'spec/helpers/admin/subscriptions_helper_spec.rb'
- 'spec/helpers/checkout_helper_spec.rb'
- 'spec/helpers/enterprises_helper_spec.rb'
- 'spec/helpers/groups_helper_spec.rb'
- 'spec/helpers/html_helper_spec.rb'
- 'spec/helpers/i18n_helper_spec.rb'
- 'spec/helpers/injection_helper_spec.rb'
- 'spec/helpers/navigation_helper_spec.rb'
- 'spec/helpers/order_cycles_helper_spec.rb'
- 'spec/helpers/serializer_helper_spec.rb'
- 'spec/helpers/shared_helper_spec.rb'
- 'spec/helpers/shop_helper_spec.rb'
- 'spec/helpers/spree/admin/base_helper_spec.rb'
- 'spec/helpers/spree/admin/orders_helper_spec.rb'
- 'spec/helpers/spree/orders_helper_spec.rb'
- 'spec/jobs/confirm_order_job_spec.rb'
- 'spec/jobs/confirm_signup_job_spec.rb'
- 'spec/jobs/heartbeat_job_spec.rb'
- 'spec/jobs/order_cycle_notification_job_spec.rb'
- 'spec/jobs/subscription_confirm_job_spec.rb'
- 'spec/jobs/subscription_placement_job_spec.rb'
- 'spec/jobs/welcome_enterprise_job_spec.rb'
- 'spec/lib/open_food_network/address_finder_spec.rb'
- 'spec/lib/open_food_network/customers_report_spec.rb'
- 'spec/lib/open_food_network/enterprise_fee_applicator_spec.rb'
- 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb'
- 'spec/lib/open_food_network/enterprise_issue_validator_spec.rb'
- 'spec/lib/open_food_network/error_logger_spec.rb'
- 'spec/lib/open_food_network/feature_toggle_spec.rb'
- 'spec/lib/open_food_network/group_buy_report_spec.rb'
- 'spec/lib/open_food_network/i18n_config_spec.rb'
- 'spec/lib/open_food_network/lettuce_share_report_spec.rb'
- 'spec/lib/open_food_network/order_and_distributor_report_spec.rb'
- 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb'
- 'spec/lib/open_food_network/order_cycle_management_report_spec.rb'
- 'spec/lib/open_food_network/order_cycle_permissions_spec.rb'
- 'spec/lib/open_food_network/order_grouper_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb'
- 'spec/lib/open_food_network/packing_report_spec.rb'
- 'spec/lib/open_food_network/permissions_spec.rb'
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
- 'spec/lib/open_food_network/property_merge_spec.rb'
- 'spec/lib/open_food_network/referer_parser_spec.rb'
- 'spec/lib/open_food_network/sales_tax_report_spec.rb'
- 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb'
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
- 'spec/lib/open_food_network/user_balance_calculator_spec.rb'
- 'spec/lib/open_food_network/users_and_enterprises_report_spec.rb'
- 'spec/lib/open_food_network/xero_invoices_report_spec.rb'
- 'spec/lib/spree/localized_number_spec.rb'
- 'spec/lib/stripe/account_connector_spec.rb'
- 'spec/lib/stripe/webhook_handler_spec.rb'
- 'spec/lib/tasks/enterprises_rake_spec.rb'
- 'spec/lib/tasks/users_rake_spec.rb'
- 'spec/mailers/enterprise_mailer_spec.rb'
- 'spec/mailers/producer_mailer_spec.rb'
- 'spec/mailers/subscription_mailer_spec.rb'
- 'spec/mailers/user_mailer_spec.rb'
- 'spec/models/adjustment_metadata_spec.rb'
- 'spec/models/calculator/flat_percent_item_total_spec.rb'
- 'spec/models/calculator/flat_percent_per_item_spec.rb'
- 'spec/models/calculator/flat_rate_spec.rb'
- 'spec/models/calculator/flexi_rate_spec.rb'
- 'spec/models/calculator/per_item_spec.rb'
- 'spec/models/calculator/price_sack_spec.rb'
- 'spec/models/calculator/weight_spec.rb'
- 'spec/models/column_preference_spec.rb'
- 'spec/models/concerns/order_shipment_spec.rb'
- 'spec/models/concerns/product_stock_spec.rb'
- 'spec/models/concerns/variant_stock_spec.rb'
- 'spec/models/content_configuration_spec.rb'
- 'spec/models/customer_spec.rb'
- 'spec/models/enterprise_caching_spec.rb'
- 'spec/models/enterprise_fee_spec.rb'
- 'spec/models/enterprise_group_spec.rb'
- 'spec/models/enterprise_relationship_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/models/exchange_spec.rb'
- 'spec/models/model_set_spec.rb'
- 'spec/models/order_cycle_spec.rb'
- 'spec/models/product_import/entry_processor_spec.rb'
- 'spec/models/product_import/inventory_reset_strategy_spec.rb'
- 'spec/models/product_import/reset_absent_spec.rb'
- 'spec/models/product_import/settings_spec.rb'
- 'spec/models/product_importer_spec.rb'
- 'spec/models/proxy_order_spec.rb'
- 'spec/models/spree/ability_spec.rb'
- 'spec/models/spree/addresses_spec.rb'
- 'spec/models/spree/adjustment_spec.rb'
- 'spec/models/spree/calculator_spec.rb'
- 'spec/models/spree/classification_spec.rb'
- 'spec/models/spree/credit_card_spec.rb'
- 'spec/models/spree/gateway/stripe_connect_spec.rb'
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/order/checkout_spec.rb'
- 'spec/models/spree/order_spec.rb'
- 'spec/models/spree/payment_method_spec.rb'
- 'spec/models/spree/payment_spec.rb'
- 'spec/models/spree/preferences/file_configuration_spec.rb'
- 'spec/models/spree/price_spec.rb'
- 'spec/models/spree/product_set_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/shipping_method_spec.rb'
- 'spec/models/spree/stock/availability_validator_spec.rb'
- 'spec/models/spree/tax_rate_spec.rb'
- 'spec/models/spree/user_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/models/stripe_account_spec.rb'
- 'spec/models/subscription_line_item_spec.rb'
- 'spec/models/subscription_spec.rb'
- 'spec/models/tag_rule/discount_order_spec.rb'
- 'spec/models/tag_rule/filter_order_cycles_spec.rb'
- 'spec/models/tag_rule/filter_payment_methods_spec.rb'
- 'spec/models/tag_rule/filter_products_spec.rb'
- 'spec/models/tag_rule/filter_shipping_methods_spec.rb'
- 'spec/models/tag_rule_spec.rb'
- 'spec/models/variant_override_spec.rb'
- 'spec/performance/injection_helper_spec.rb'
- 'spec/performance/orders_controller_spec.rb'
- 'spec/performance/shop_controller_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
- 'spec/requests/checkout/paypal_spec.rb'
- 'spec/requests/checkout/stripe_connect_spec.rb'
- 'spec/requests/embedded_shopfronts_headers_spec.rb'
- 'spec/requests/large_request_spec.rb'
- 'spec/serializers/api/admin/customer_serializer_spec.rb'
- 'spec/serializers/api/admin/enterprise_serializer_spec.rb'
- 'spec/serializers/api/admin/exchange_serializer_spec.rb'
- 'spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb'
- 'spec/serializers/api/admin/index_enterprise_serializer_spec.rb'
- 'spec/serializers/api/admin/order_cycle_serializer_spec.rb'
- 'spec/serializers/api/admin/product_serializer_spec.rb'
- 'spec/serializers/api/admin/subscription_customer_serializer_spec.rb'
- 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb'
- 'spec/serializers/api/admin/variant_override_serializer_spec.rb'
- 'spec/serializers/api/admin/variant_serializer_spec.rb'
- 'spec/serializers/api/cached_enterprise_serializer_spec.rb'
- 'spec/serializers/api/credit_card_serializer_spec.rb'
- 'spec/serializers/api/current_order_serializer_spec.rb'
- 'spec/serializers/api/enterprise_serializer_spec.rb'
- 'spec/serializers/api/enterprise_shopfront_list_serializer_spec.rb'
- 'spec/serializers/api/enterprise_shopfront_serializer_spec.rb'
- 'spec/serializers/api/group_list_serializer_spec.rb'
- 'spec/serializers/api/order_cycle_serializer_spec.rb'
- 'spec/serializers/api/order_serializer_spec.rb'
- 'spec/serializers/api/product_serializer_spec.rb'
- 'spec/serializers/api/shipping_method_serializer_spec.rb'
- 'spec/serializers/api/variant_serializer_spec.rb'
- 'spec/services/bulk_invoice_service_spec.rb'
- 'spec/services/cart_service_spec.rb'
- 'spec/services/default_shipping_category_spec.rb'
- 'spec/services/default_stock_location_spec.rb'
- 'spec/services/embedded_page_service_spec.rb'
- 'spec/services/exchange_products_renderer_spec.rb'
- 'spec/services/exchange_variant_bulk_updater_spec.rb'
- 'spec/services/invoice_renderer_spec.rb'
- 'spec/services/mail_configuration_spec.rb'
- 'spec/services/order_cycle_distributed_products_spec.rb'
- 'spec/services/order_cycle_distributed_variants_spec.rb'
- 'spec/services/order_cycle_form_spec.rb'
- 'spec/services/order_cycle_warning_spec.rb'
- 'spec/services/order_factory_spec.rb'
- 'spec/services/order_syncer_spec.rb'
- 'spec/services/order_workflow_spec.rb'
- 'spec/services/permissions/order_spec.rb'
- 'spec/services/product_tag_rules_filterer_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/search_orders_spec.rb'
- 'spec/services/tax_rate_finder_spec.rb'
- 'spec/services/upload_sanitizer_spec.rb'
- 'spec/services/variant_units/option_value_namer_spec.rb'
- 'spec/services/variants_stock_levels_spec.rb'
- 'spec/spec_helper.rb'
- 'spec/support/ability_helper.rb'
- 'spec/support/api_helper.rb'
- 'spec/support/cancan_helper.rb'
- 'spec/support/controller_helper.rb'
- 'spec/support/delayed_job_helper.rb'
- 'spec/support/downloads_helper.rb'
- 'spec/support/email_helper.rb'
- 'spec/support/embedded_pages_helper.rb'
- 'spec/support/enterprise_groups_helper.rb'
- 'spec/support/feature_toggle_helper.rb'
- 'spec/support/features/datepicker_helper.rb'
- 'spec/support/filters_helper.rb'
- 'spec/support/html_helper.rb'
- 'spec/support/i18n_error_raising.rb'
- 'spec/support/localized_number_helper.rb'
- 'spec/support/matchers/date_time_validator_matchers.rb'
- 'spec/support/matchers/delegate_matchers.rb'
- 'spec/support/matchers/email_confirmation_matchers.rb'
- 'spec/support/matchers/flash_message_matchers.rb'
- 'spec/support/matchers/integer_array_validator_matchers.rb'
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/support/performance_helper.rb'
- 'spec/support/products_helper.rb'
- 'spec/support/request/admin_helper.rb'
- 'spec/support/request/authentication_helper.rb'
- 'spec/support/request/cookie_helper.rb'
- 'spec/support/request/distribution_helper.rb'
- 'spec/support/request/menu_helper.rb'
- 'spec/support/request/shop_workflow.rb'
- 'spec/support/request/ui_component_helper.rb'
- 'spec/support/request/web_helper.rb'
- 'spec/support/seeds.rb'
- 'spec/support/spree/checkout_helpers.rb'
- 'spec/support/spree/money_helper.rb'
- 'spec/support/spree/url_helpers.rb'
- 'spec/support/timecop.rb'
- 'spec/validators/date_time_string_validator_spec.rb'
- 'spec/validators/integer_array_validator_spec.rb'
- 'spec/views/spree/admin/orders/edit.html.haml_spec.rb'
- 'spec/views/spree/admin/orders/index.html.haml_spec.rb'
- 'spec/views/spree/admin/payment_methods/index.html.haml_spec.rb'
- 'spec/views/spree/admin/shared/_order_links.html.haml_spec.rb'
# Offense count: 44
# Offense count: 39
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
@@ -1229,8 +836,6 @@ Style/GuardClause:
- 'app/models/enterprise_group.rb'
- 'app/models/producer_property.rb'
- 'app/models/spree/preferences/preferable_class_methods.rb'
- 'app/models/spree/price_decorator.rb'
- 'app/models/spree/product_decorator.rb'
- 'app/services/order_syncer.rb'
- 'app/services/variant_units/variant_and_line_item_naming.rb'
- 'lib/discourse/single_sign_on.rb'

View File

@@ -1 +1 @@
2.3.7
2.4.4

37
Gemfile
View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby "2.3.7"
ruby "2.4.4"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'i18n'
@@ -19,20 +21,18 @@ gem 'web', path: './engines/web'
gem 'activerecord-postgresql-adapter'
gem 'pg', '~> 0.21.0'
gem 'acts_as_list', '= 0.3.0'
gem 'awesome_nested_set', '~> 3.2.1'
gem 'acts_as_list', '0.9.19'
gem 'awesome_nested_set', '~> 3.3.1'
gem 'cancan', '~> 1.6.10'
gem 'ffaker'
gem 'highline', '2.0.3' # Necessary for the install generator
gem 'json'
gem 'money', '< 6.1.0'
gem 'paranoia', '~> 2.0'
gem 'monetize', '~> 1.1'
gem 'paranoia', '~> 2.4'
gem 'ransack', '~> 1.8.10'
gem 'state_machines-activerecord'
gem 'stringex', '~> 2.8.5'
gem 'spree_i18n', github: 'openfoodfoundation/spree_i18n', branch: '1-3-stable'
# Our branch contains the following changes:
# - Pass customer email and phone number to PayPal (merged to upstream master)
# - Change type of password from string to password to hide it in the form
@@ -45,9 +45,9 @@ gem 'stripe'
# which is needed for Pin Payments (and possibly others).
gem 'activemerchant', '~> 1.78.0'
gem 'devise', '~> 3.5.10' # v4.0.0 needs rails 4.1
gem 'devise'
gem 'devise-encryptable'
gem 'devise-token_authenticatable', '~> 0.4.10' # v0.5.0 needs devise v4
gem 'devise-token_authenticatable'
gem 'jwt', '~> 2.2'
gem 'oauth2', '~> 1.4.4' # Used for Stripe Connect
@@ -55,7 +55,7 @@ gem 'daemons'
gem 'delayed_job_active_record'
gem 'delayed_job_web'
gem 'kaminari', '~> 0.17.0'
gem 'kaminari', '~> 1.2.1'
gem 'andand'
gem 'angularjs-rails', '1.5.5'
@@ -80,7 +80,6 @@ gem 'dalli'
gem 'figaro'
gem 'geocoder'
gem 'gmaps4rails'
gem 'oj'
gem 'paper_trail', '~> 7.1.3'
gem 'paperclip', '~> 3.4.1'
gem 'rack-rewrite'
@@ -111,7 +110,7 @@ gem 'foundation-icons-sass-rails'
gem 'foundation-rails', '= 5.5.2.1'
gem 'jquery-migrate-rails'
gem 'jquery-rails', '3.1.5'
gem 'jquery-rails', '4.4.0'
gem 'jquery-ui-rails', '~> 4.2'
gem 'select2-rails', '~> 3.4.7'
@@ -126,10 +125,10 @@ group :test, :development do
# Pretty printed test output
gem 'atomic'
gem 'awesome_print'
gem 'capybara', '>= 2.18.0' # 3.0 requires rack 1.6 that only works with Rails 4.2
gem 'capybara'
gem 'database_cleaner', require: false
gem "factory_bot_rails", '4.10.0', require: false
gem 'fuubar', '~> 2.5.0'
gem "factory_bot_rails", '5.2.0', require: false
gem 'fuubar', '~> 2.5.1'
gem 'json_spec', '~> 1.1.4'
gem 'knapsack'
gem 'letter_opener', '>= 1.4.1'
@@ -146,17 +145,17 @@ end
group :test do
gem 'simplecov', require: false
gem 'test-prof'
gem 'test_after_commit' # needed to test Devise callbacks
gem 'webmock'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
end
group :development do
gem 'byebug', '~> 11.0.0' # 11.1 requires ruby 2.4
gem 'byebug'
gem 'debugger-linecache'
gem "newrelic_rpm", "~> 3.0"
gem "pry", "~> 0.12.0" # pry 0.13 is not compatible with pry-byebug 3.7
gem 'pry-byebug', '~> 3.7.0' # 3.8 requires ruby 2.4
gem 'pry'
gem 'pry-byebug'
gem 'rubocop'
gem 'rubocop-rails'
gem 'spring'

View File

@@ -19,15 +19,6 @@ GIT
specs:
ofn-qz (0.1.0)
GIT
remote: https://github.com/openfoodfoundation/spree_i18n.git
revision: 12f18312232f0ce70270d47859d2951d12f7791c
branch: 1-3-stable
specs:
spree_i18n (1.0.0)
i18n (~> 0.5)
rails-i18n
PATH
remote: engines/catalog
specs:
@@ -110,7 +101,7 @@ GEM
tzinfo (~> 1.1)
acts-as-taggable-on (4.0.0)
activerecord (>= 4.0)
acts_as_list (0.3.0)
acts_as_list (0.9.19)
activerecord (>= 3.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
@@ -125,9 +116,9 @@ GEM
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.5.5)
arel (6.0.4)
ast (2.4.0)
ast (2.4.1)
atomic (1.1.101)
awesome_nested_set (3.2.1)
awesome_nested_set (3.3.1)
activerecord (>= 4.0.0, < 7.0)
awesome_print (1.8.0)
aws-sdk (1.67.0)
@@ -136,25 +127,26 @@ GEM
json (~> 1.4)
nokogiri (~> 1)
bcrypt (3.1.16)
bugsnag (6.18.0)
bugsnag (6.19.0)
concurrent-ruby (~> 1.0)
builder (3.2.4)
byebug (11.0.1)
byebug (11.1.3)
cancan (1.6.10)
capybara (2.18.0)
capybara (3.32.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (3.0.0)
chronic (0.10.2)
chunky_png (1.3.14)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.2)
coderay (1.1.3)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
@@ -162,7 +154,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
combine_pdf (1.0.16)
combine_pdf (1.0.21)
ruby-rc4 (>= 0.1.5)
compass (1.0.3)
chunky_png (~> 1.2)
@@ -192,32 +184,31 @@ GEM
activerecord (>= 3.2.0, < 5.0)
fog (~> 1.0)
rails (>= 3.2.0, < 5.0)
ddtrace (0.42.0)
ddtrace (0.43.0)
msgpack
debugger-linecache (1.2.0)
delayed_job (4.1.8)
activesupport (>= 3.0, < 6.1)
delayed_job_active_record (4.1.4)
activerecord (>= 3.0, < 6.1)
delayed_job (4.1.9)
activesupport (>= 3.0, < 6.2)
delayed_job_active_record (4.1.5)
activerecord (>= 3.0, < 6.2)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.4.3)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
rack-protection (>= 1.5.5)
sinatra (>= 1.4.4)
devise (3.5.10)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-token_authenticatable (0.4.10)
devise (>= 3.5.2, < 4.0.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
docile (1.3.2)
docile (1.3.4)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dry-inflector (0.1.2)
@@ -225,14 +216,14 @@ GEM
eventmachine (1.2.7)
excon (0.78.0)
execjs (2.7.0)
factory_bot (4.10.0)
activesupport (>= 3.0.0)
factory_bot_rails (4.10.0)
factory_bot (~> 4.10.0)
railties (>= 3.0.0)
factory_bot (5.2.0)
activesupport (>= 4.2.0)
factory_bot_rails (5.2.0)
factory_bot (~> 5.2.0)
railties (>= 4.2.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffaker (2.11.0)
ffaker (2.16.0)
ffi (1.13.1)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
@@ -393,7 +384,7 @@ GEM
foundation-rails (5.5.2.1)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
fuubar (2.5.0)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.6.4)
@@ -402,7 +393,7 @@ GEM
globalid (0.4.2)
activesupport (>= 4.2.0)
gmaps4rails (2.1.2)
haml (5.2.0)
haml (5.2.1)
temple (>= 0.8.0)
tilt
hashdiff (1.0.1)
@@ -418,10 +409,10 @@ GEM
immigrant (0.3.6)
activerecord (>= 3.0)
ipaddress (0.8.3)
jaro_winkler (1.5.4)
jquery-migrate-rails (1.2.1)
jquery-rails (3.1.5)
railties (>= 3.0, < 5.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
@@ -432,23 +423,32 @@ GEM
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jwt (2.2.2)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
kgio (2.11.3)
knapsack (1.19.0)
knapsack (1.20.0)
rake
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.7.0)
launchy (~> 2.2)
libv8 (7.3.492.27.1)
loofah (2.7.0)
loofah (2.8.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
@@ -456,16 +456,16 @@ GEM
mini_portile2 (2.4.0)
mini_racer (0.2.15)
libv8 (> 7.3)
minitest (5.14.2)
money (5.0.0)
i18n (~> 0.4)
json
minitest (5.14.3)
monetize (1.9.4)
money (~> 6.12)
money (6.13.8)
i18n (>= 0.6.4, <= 2)
msgpack (1.3.3)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
netrc (0.11.0)
newrelic_rpm (3.18.1.330)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.4)
@@ -474,7 +474,6 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
oj (3.10.8)
optimist (3.0.1)
orm_adapter (0.5.0)
paper_trail (7.1.3)
@@ -486,11 +485,11 @@ GEM
activesupport (>= 3.0.0)
cocaine (~> 0.5.0)
mime-types
parallel (1.19.1)
paranoia (2.4.2)
activerecord (>= 4.0, < 6.1)
parser (2.7.1.0)
ast (~> 2.4.0)
parallel (1.20.1)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.0.0.0)
ast (~> 2.4.1)
paypal-sdk-core (0.2.10)
multi_json (~> 1.0)
xml-simple
@@ -498,15 +497,15 @@ GEM
paypal-sdk-core (~> 0.2.3)
pg (0.21.0)
power_assert (1.2.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.10)
pry (~> 0.13.0)
public_suffix (4.0.6)
rack (1.6.13)
rack-mini-profiler (2.0.2)
rack-mini-profiler (2.3.0)
rack (>= 1.2.0)
rack-protection (1.5.5)
rack
@@ -545,7 +544,7 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.1)
rake (13.0.3)
ransack (1.8.10)
actionpack (>= 3.0, < 5.2)
activerecord (>= 3.0, < 5.2)
@@ -559,7 +558,8 @@ GEM
json (>= 1.8)
nokogiri (~> 1.5)
optimist (~> 3.0)
redcarpet (3.5.0)
redcarpet (3.5.1)
regexp_parser (1.8.2)
request_store (1.5.0)
rack (>= 1.4)
responders (2.4.1)
@@ -584,25 +584,25 @@ GEM
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (4.0.1)
rspec-rails (4.0.2)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.9)
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.0)
rspec-support (3.10.1)
rswag (2.3.1)
rswag-api (= 2.3.1)
rswag-specs (= 2.3.1)
@@ -616,21 +616,24 @@ GEM
rswag-ui (2.3.1)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (0.81.0)
jaro_winkler (~> 1.5.1)
rubocop (1.8.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-rails (2.5.2)
activesupport
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.0)
parser (>= 2.7.1.5)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.72.0)
ruby-progressbar (1.10.1)
rubocop (>= 0.90.0, < 2.0)
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
rubyzip (1.3.0)
rubyzip (2.3.0)
sass (3.4.25)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
@@ -644,18 +647,17 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
shoulda-matchers (4.0.1)
shoulda-matchers (4.4.1)
activesupport (>= 4.2.0)
simplecov (0.17.1)
simplecov (0.18.5)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
spring (1.7.2)
spring (2.1.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (2.12.5)
@@ -675,24 +677,26 @@ GEM
activerecord (>= 4.1)
state_machines-activemodel (>= 0.5.0)
stringex (2.8.5)
stripe (5.28.0)
stripe (5.29.0)
temple (0.8.2)
test-prof (0.7.5)
test-unit (3.3.7)
test-prof (0.11.3)
test-unit (3.3.9)
power_assert
test_after_commit (1.2.2)
activerecord (>= 3.2, < 5.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (1.4.1)
timecop (0.9.2)
tzinfo (1.2.8)
tzinfo (1.2.9)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
unicorn (5.7.0)
unicode-display_width (2.0.0)
unicorn (5.8.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-rails (2.2.1)
@@ -703,11 +707,11 @@ GEM
unicorn (>= 4, < 6)
warden (1.2.7)
rack (>= 1.0)
webdrivers (4.2.0)
webdrivers (4.4.2)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.10.0)
webmock (3.11.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -732,19 +736,19 @@ DEPENDENCIES
activerecord-postgresql-adapter
activerecord-session_store
acts-as-taggable-on (~> 4.0)
acts_as_list (= 0.3.0)
acts_as_list (= 0.9.19)
andand
angular-rails-templates (~> 0.3.0)
angularjs-file-upload-rails (~> 2.4.1)
angularjs-rails (= 1.5.5)
atomic
awesome_nested_set (~> 3.2.1)
awesome_nested_set (~> 3.3.1)
awesome_print
aws-sdk (= 1.67.0)
bugsnag
byebug (~> 11.0.0)
byebug
cancan (~> 1.6.10)
capybara (>= 2.18.0)
capybara
catalog!
coffee-rails (~> 4.2.2)
combine_pdf
@@ -758,17 +762,17 @@ DEPENDENCIES
debugger-linecache
delayed_job_active_record
delayed_job_web
devise (~> 3.5.10)
devise
devise-encryptable
devise-token_authenticatable (~> 0.4.10)
devise-token_authenticatable
dfc_provider!
eventmachine (>= 1.2.3)
factory_bot_rails (= 4.10.0)
factory_bot_rails (= 5.2.0)
ffaker
figaro
foundation-icons-sass-rails
foundation-rails (= 5.5.2.1)
fuubar (~> 2.5.0)
fuubar (~> 2.5.1)
geocoder
gmaps4rails
haml
@@ -777,27 +781,25 @@ DEPENDENCIES
i18n-js (~> 3.8.0)
immigrant
jquery-migrate-rails
jquery-rails (= 3.1.5)
jquery-rails (= 4.4.0)
jquery-ui-rails (~> 4.2)
json
json_spec (~> 1.1.4)
jwt (~> 2.2)
kaminari (~> 0.17.0)
kaminari (~> 1.2.1)
knapsack
letter_opener (>= 1.4.1)
mini_racer (= 0.2.15)
money (< 6.1.0)
newrelic_rpm (~> 3.0)
monetize (~> 1.1)
oauth2 (~> 1.4.4)
ofn-qz!
oj
order_management!
paper_trail (~> 7.1.3)
paperclip (~> 3.4.1)
paranoia (~> 2.0)
paranoia (~> 2.4)
pg (~> 0.21.0)
pry (~> 0.12.0)
pry-byebug (~> 3.7.0)
pry
pry-byebug
rack-mini-profiler (< 3.0.0)
rack-rewrite
rack-ssl
@@ -820,7 +822,6 @@ DEPENDENCIES
selenium-webdriver
shoulda-matchers
simplecov
spree_i18n!
spree_paypal_express!
spring
spring-commands-rspec
@@ -829,6 +830,7 @@ DEPENDENCIES
stripe
test-prof
test-unit (~> 3.3)
test_after_commit
timecop
uglifier (>= 1.0.3)
unicorn
@@ -842,7 +844,7 @@ DEPENDENCIES
wkhtmltopdf-binary
RUBY VERSION
ruby 2.3.7p456
ruby 2.4.4p296
BUNDLED WITH
1.17.3

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env rake
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

View File

@@ -16,7 +16,7 @@ angular.module("admin.indexUtils").factory "PagedFetcher", (dataFetcher) ->
fetchPages: (url, page, pageCallback) ->
dataFetcher(@urlForPage(url, page)).then (data) =>
@page++
@last_page = data.pages
@last_page = data.pagination.pages
pageCallback(data) if pageCallback

View File

@@ -127,7 +127,16 @@ $(document).ready(function() {
nextText: Spree.translations.next,
showOn: "focus"
});
$.datepicker.regional[I18n.locale] = {
prevText: Spree.translations.previous,
nextText: Spree.translations.next,
monthNames: Spree.translations.month_names,
dayNames: Spree.translations.abbr_day_names,
dayNamesMin: Spree.translations.abbr_day_names,
dateFormat: Spree.translations.date_picker
};
$.datepicker.setDefaults( $.datepicker.regional[I18n.locale]);
// Correctly display range dates
$('.date-range-filter .datepicker-from').datepicker('option', 'onSelect', function(selectedDate) {
$(".date-range-filter .datepicker-to" ).datepicker( "option", "minDate", selectedDate );

View File

@@ -1,7 +1,7 @@
Darkswarm.controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards) ->
angular.extend(this, new FieldsetMixin($scope))
$scope.savedCreditCards = CreditCards.saved
$scope.setDefault = CreditCards.setDefault
$scope.confirmSetDefault = CreditCards.confirmSetDefault
$scope.CreditCard = CreditCard
$scope.secrets = CreditCard.secrets
$scope.showForm = CreditCard.show

View File

@@ -25,3 +25,6 @@ Darkswarm.controller "OrderCycleChangeCtrl", ($scope, $rootScope, $timeout, Orde
Cart.reloadFinalisedLineItems()
ChangeableOrdersAlert.reload()
$rootScope.$broadcast 'orderCycleSelected'
$scope.closesInLessThan3Months = () ->
moment().diff(moment(OrderCycle.orders_close_at(), "YYYY-MM-DD HH:mm:SS Z"), 'days') > -75

View File

@@ -5,15 +5,13 @@ Darkswarm.directive "tabsetCtrl", (Tabsets, $location) ->
selected: "@"
navigate: "="
prefix: "@?"
alwaysopen: "="
controller: ($scope, $element) ->
if $scope.navigate
path = $location.path()?.match(/^\/\w+$/)?[0]
$scope.selected = path[1..] if path
this.toggle = (name) ->
state = if $scope.alwaysopen then 'open' else null
Tabsets.toggle($scope.id, name, state)
Tabsets.toggle($scope.id, name)
this.select = (selection) ->
$scope.$broadcast("selection:changed", selection)

View File

@@ -50,7 +50,7 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
@popQueue() if @update_enqueued
.error (response, status)=>
Messages.flash({error: t('js.cart.add_to_cart_failed')})
Messages.flash({error: response.error})
@update_running = false
compareAndNotifyStockLevels: (stockLevels) =>

View File

@@ -1,4 +1,4 @@
Darkswarm.factory 'CreditCards', ($http, $filter, savedCreditCards, Messages)->
Darkswarm.factory 'CreditCards', ($http, $filter, savedCreditCards, Messages, Customers)->
new class CreditCard
saved: $filter('orderBy')(savedCreditCards,'-is_default')
@@ -11,5 +11,13 @@ Darkswarm.factory 'CreditCards', ($http, $filter, savedCreditCards, Messages)->
othercard.is_default = false
$http.put("/credit_cards/#{card.id}", is_default: true).then (data) ->
Messages.success(t('js.default_card_updated'))
Customers.clearAllAllowCharges()
, (response) ->
Messages.flash(response.data.flash)
confirmSetDefault: (card, event) =>
if confirm t("js.default_card_voids_auth")
@setDefault(card)
else
event.preventDefault()
return false

View File

@@ -1,4 +1,4 @@
angular.module("Darkswarm").factory 'Customer', ($resource, Messages) ->
angular.module("Darkswarm").factory 'Customer', ($resource, $injector, Messages) ->
Customer = $resource('/api/customers/:id/:action.json', {}, {
'index':
method: 'GET'
@@ -12,8 +12,21 @@ angular.module("Darkswarm").factory 'Customer', ($resource, Messages) ->
})
Customer.prototype.update = ->
if @allow_charges
Messages.loading(t('js.authorising'))
@$update().then (response) =>
Messages.success(t('js.changes_saved'))
if response.gateway_recurring_payment_client_secret && $injector.has('stripePublishableKey')
Messages.clear()
stripe = Stripe($injector.get('stripePublishableKey'), { stripeAccount: response.gateway_shop_id })
stripe.confirmCardSetup(response.gateway_recurring_payment_client_secret).then (result) =>
if result.error
@allow_charges = false
@$update(allow_charges: false)
Messages.error(result.error.message)
else
Messages.success(t('js.changes_saved'))
else
Messages.success(t('js.changes_saved'))
, (response) =>
Messages.error(response.data.error)

View File

@@ -12,3 +12,7 @@ angular.module("Darkswarm").factory 'Customers', (Customer) ->
for customer in customers
@all.push customer
@byID[customer.id] = customer
clearAllAllowCharges: () ->
for customer in @index()
customer.allow_charges = false

View File

@@ -7,12 +7,10 @@ Darkswarm.factory 'Tabsets', ->
@tabsets.push { ctrl: ctrl, id: id, selected: selected }
ctrl.select(selected) if selected?
toggle: (id, name, state=null) ->
toggle: (id, name) ->
tabset = @findTabsetByObject(id)
if tabset.selected == name
@select(tabset, null) unless state == "open"
else
@select(tabset, name) unless state == "closed"
if tabset.selected != name
@select(tabset, name)
select: (tabset, name) ->
tabset.selected = name

View File

@@ -41,19 +41,21 @@ ordercycle {
.order-cycle-select {
border: 1px solid $teal-300;
display: inline-block;
display: flex;
font-size: 1em;
border-radius: $radius-small;
margin-right: 10px;
margin-left: 10px;
.select-label {
background-color: rgba($teal-300, 0.5);
display: inline-block;
display: flex;
align-items: center;
justify-content: center;
border-radius: $radius-small 0 0 $radius-small;
float: left;
font-size: 1em;
line-height: 1.3em;
padding: 0.5em 0.75em;
height: 2.35em;
span {
width: max-content;
@@ -65,6 +67,7 @@ ordercycle {
background-image: image-url('white-caret.svg');
background-size: 30px auto;
background-position-x: 102%;
height: 2.35em;
}
p {
@@ -82,7 +85,6 @@ ordercycle {
padding: 0.5em 1.25em 0.5em 0.75em;
font-size: 1em;
line-height: 1.3em;
height: 2.35em;
min-width: 13em;
width: 200px;

View File

@@ -1,5 +1,6 @@
module Admin
class BulkLineItemsController < Spree::Admin::BaseController
include PaginationData
# GET /admin/bulk_line_items.json
#
def index
@@ -12,9 +13,12 @@ module Admin
ransack(params[:q]).result.
reorder('spree_line_items.order_id ASC, spree_line_items.id ASC')
@line_items = @line_items.page(page).per(params[:per_page]) if using_pagination?
@line_items = @line_items.page(page).per(params[:per_page]) if pagination_required?
render json: { line_items: serialized_line_items, pagination: pagination_data }
render json: {
line_items: serialized_line_items,
pagination: pagination_data(@line_items)
}
end
# PUT /admin/bulk_line_items/:id.json
@@ -87,21 +91,6 @@ module Admin
::Permissions::Order.new(spree_current_user)
end
def using_pagination?
params[:per_page]
end
def pagination_data
return unless using_pagination?
{
results: @line_items.total_count,
pages: @line_items.num_pages,
page: page.to_i,
per_page: params[:per_page].to_i
}
end
def page
params[:page] || 1
end

View File

@@ -1,5 +1,5 @@
module Admin
class ColumnPreferencesController < ResourceController
class ColumnPreferencesController < Admin::ResourceController
before_action :load_collection, only: [:bulk_update]
respond_to :json

View File

@@ -1,7 +1,7 @@
require 'open_food_network/address_finder'
module Admin
class CustomersController < ResourceController
class CustomersController < Admin::ResourceController
before_action :load_managed_shops, only: :index, if: :html_request?
respond_to :json
@@ -42,7 +42,7 @@ module Admin
end
end
# copy of Spree::Admin::ResourceController without flash notice
# copy of Admin::ResourceController without flash notice
def destroy
invoke_callbacks(:destroy, :before)
if @object.destroy
@@ -95,7 +95,7 @@ module Admin
)
end
# Used in ResourceController#update
# Used in Admin::ResourceController#update
def permitted_resource_params
customer_params
end

View File

@@ -1,5 +1,5 @@
module Admin
class EnterpriseFeesController < ResourceController
class EnterpriseFeesController < Admin::ResourceController
before_action :load_enterprise_fee_set, only: :index
before_action :load_data

View File

@@ -1,5 +1,5 @@
module Admin
class EnterpriseGroupsController < ResourceController
class EnterpriseGroupsController < Admin::ResourceController
before_action :load_data, except: :index
before_action :load_object_data, only: [:new, :edit, :create, :update]

View File

@@ -1,5 +1,5 @@
module Admin
class EnterpriseRelationshipsController < ResourceController
class EnterpriseRelationshipsController < Admin::ResourceController
def index
@my_enterprises = Enterprise.
includes(:shipping_methods, :payment_methods).

View File

@@ -1,5 +1,5 @@
module Admin
class EnterpriseRolesController < ResourceController
class EnterpriseRolesController < Admin::ResourceController
def index
@enterprise_roles = EnterpriseRole.by_user_email
@users = Spree::User.order('spree_users.email')

View File

@@ -3,7 +3,7 @@ require 'open_food_network/permissions'
require 'open_food_network/order_cycle_permissions'
module Admin
class EnterprisesController < ResourceController
class EnterprisesController < Admin::ResourceController
# These need to run before #load_resource so that @object is initialised with sanitised values
prepend_before_action :override_owner, only: :create
prepend_before_action :override_sells, only: :create
@@ -326,7 +326,7 @@ module Admin
)
end
# Used in ResourceController#create
# Used in Admin::ResourceController#create
def permitted_resource_params
enterprise_params
end

View File

@@ -1,5 +1,5 @@
module Admin
class InventoryItemsController < ResourceController
class InventoryItemsController < Admin::ResourceController
respond_to :json
respond_override update: { json: {

View File

@@ -1,5 +1,5 @@
module Admin
class OrderCyclesController < ResourceController
class OrderCyclesController < Admin::ResourceController
include OrderCyclesHelper
include PaperTrailLogging

View File

@@ -1,5 +1,5 @@
module Admin
class ProducerPropertiesController < ResourceController
class ProducerPropertiesController < Admin::ResourceController
before_action :load_enterprise
before_action :load_properties
before_action :setup_property, only: [:index]

View File

@@ -1,5 +1,5 @@
module Admin
class ProxyOrdersController < ResourceController
class ProxyOrdersController < Admin::ResourceController
respond_to :json
def edit

View File

@@ -1,41 +1,303 @@
require 'action_callbacks'
module Admin
class ResourceController < Spree::Admin::ResourceController
class ResourceController < Spree::Admin::BaseController
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
before_action :load_resource, except: [:update_positions]
rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
rescue_from CanCan::AccessDenied, with: :unauthorized
respond_to :html
respond_to :js, except: [:show, :index]
def new
invoke_callbacks(:new_action, :before)
respond_with(@object) do |format|
format.html { render layout: !request.xhr? }
format.js { render layout: false }
end
end
def edit
respond_with(@object) do |format|
format.html { render layout: !request.xhr? }
format.js { render layout: false }
end
end
def update
invoke_callbacks(:update, :before)
if @object.update(permitted_resource_params)
invoke_callbacks(:update, :after)
flash[:success] = flash_message_for(@object, :successfully_updated)
respond_with(@object) do |format|
format.html { redirect_to location_after_save }
format.js { render layout: false }
end
else
invoke_callbacks(:update, :fails)
respond_with(@object)
end
end
def create
invoke_callbacks(:create, :before)
@object.attributes = permitted_resource_params
if @object.save
invoke_callbacks(:create, :after)
flash[:success] = flash_message_for(@object, :successfully_created)
respond_with(@object) do |format|
format.html { redirect_to location_after_save }
format.js { render layout: false }
end
else
invoke_callbacks(:create, :fails)
respond_with(@object)
end
end
def update_positions
params[:positions].each do |id, index|
model_class.where(id: id).update_all(position: index)
end
respond_to do |format|
format.js { render text: 'Ok' }
end
end
def destroy
invoke_callbacks(:destroy, :before)
if @object.destroy
invoke_callbacks(:destroy, :after)
flash[:success] = flash_message_for(@object, :successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }
end
else
invoke_callbacks(:destroy, :fails)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
end
end
end
protected
def resource_not_found
flash[:error] = flash_message_for(model_class.new, :not_found)
redirect_to collection_url
end
class << self
attr_accessor :parent_data
attr_accessor :callbacks
def belongs_to(model_name, options = {})
@parent_data ||= {}
@parent_data[:model_name] = model_name
@parent_data[:model_class] = model_name.to_s.classify.constantize
@parent_data[:find_by] = options[:find_by] || :id
end
def new_action
@callbacks ||= {}
@callbacks[:new_action] ||= ActionCallbacks.new
end
def create
@callbacks ||= {}
@callbacks[:create] ||= ActionCallbacks.new
end
def update
@callbacks ||= {}
@callbacks[:update] ||= ActionCallbacks.new
end
def destroy
@callbacks ||= {}
@callbacks[:destroy] ||= ActionCallbacks.new
end
end
def model_class
controller_name.classify.to_s.constantize
controller_class_name.constantize
end
def model_name
parent_data[:model_name].gsub('spree/', '')
end
def object_name
controller_name.singularize
end
def load_resource
if member_action?
@object ||= load_resource_instance
# call authorize! a third time (called twice already in Admin::BaseController)
# this time we pass the actual instance so fine-grained abilities can control
# access to individual records, not just entire models.
authorize! action, @object
instance_variable_set("@#{object_name}", @object)
# If we don't have access, clear the object
unless can? action, @object
instance_variable_set("@#{object_name}", nil)
end
authorize! action, @object
else
@collection ||= collection
# note: we don't call authorize here as the collection method should use
# CanCan's accessible_by method to restrict the actual records returned
instance_variable_set("@#{controller_name}", @collection)
end
end
def load_resource_instance
if new_actions.include?(action)
build_resource
elsif params[:id]
find_resource
end
end
def parent_data
self.class.parent_data
end
def parent
return nil if parent_data.blank?
@parent ||= parent_data[:model_class].
public_send("find_by", parent_data[:find_by] => params["#{model_name}_id"])
instance_variable_set("@#{model_name}", @parent)
end
def find_resource
if parent_data.present?
parent.public_send(controller_name).find(params[:id])
else
model_class.find(params[:id])
end
end
def build_resource
if parent_data.present?
parent.public_send(controller_name).build
else
model_class.new
end
end
def collection
return parent.public_send(controller_name) if parent_data.present?
if model_class.respond_to?(:accessible_by) &&
!current_ability.has_block?(params[:action], model_class)
model_class.accessible_by(current_ability, action)
else
model_class.scoped
end
end
def location_after_save
collection_url
end
def invoke_callbacks(action, callback_type)
callbacks = self.class.callbacks || {}
return if callbacks[action].nil?
case callback_type.to_sym
when :before then callbacks[action].before_methods.each { |method| __send__ method }
when :after then callbacks[action].after_methods.each { |method| __send__ method }
when :fails then callbacks[action].fails_methods.each { |method| __send__ method }
end
end
# URL helpers
def new_object_url(options = {})
if parent_data.present?
main_app.new_polymorphic_url([:admin, parent, model_class], options)
url_helper.new_polymorphic_url([:admin, parent, model_class], options)
else
main_app.new_polymorphic_url([:admin, model_class], options)
url_helper.new_polymorphic_url([:admin, model_class], options)
end
end
def edit_object_url(object, options = {})
if parent_data.present?
main_app.public_send "edit_admin_#{model_name}_#{object_name}_url", parent, object, options
url_helper.public_send "edit_admin_#{model_name}_#{object_name}_url",
parent, object, options
else
main_app.public_send "edit_admin_#{object_name}_url", object, options
url_helper.public_send "edit_admin_#{object_name}_url",
object, options
end
end
def object_url(object = nil, options = {})
target = object || @object
if parent_data.present?
main_app.public_send "admin_#{model_name}_#{object_name}_url", parent, target, options
url_helper.public_send "admin_#{model_name}_#{object_name}_url", parent, target, options
else
main_app.public_send "admin_#{object_name}_url", target, options
url_helper.public_send "admin_#{object_name}_url", target, options
end
end
# Permit specific list of params
#
# Example: params.require(object_name).permit(:name)
def permitted_resource_params
raise "All extending controllers need to override the method permitted_resource_params"
end
def collection_url(options = {})
if parent_data.present?
main_app.polymorphic_url([:admin, parent, model_class], options)
url_helper.polymorphic_url([:admin, parent, model_class], options)
else
main_app.polymorphic_url([:admin, model_class], options)
url_helper.polymorphic_url([:admin, model_class], options)
end
end
def collection_actions
[:index]
end
def member_action?
!collection_actions.include? action
end
def new_actions
[:new, :create]
end
private
def controller_class_name
if spree_controller?
"Spree::#{controller_name.classify}"
else
controller_name.classify.to_s
end
end
def url_helper
if spree_controller?
spree
else
main_app
end
end
def spree_controller?
controller_path.starts_with? "spree"
end
end
end

View File

@@ -2,7 +2,7 @@ require 'open_food_network/permissions'
require 'order_management/subscriptions/proxy_order_syncer'
module Admin
class SchedulesController < ResourceController
class SchedulesController < Admin::ResourceController
include PaperTrailLogging
before_action :adapt_params, only: [:update]

View File

@@ -3,7 +3,7 @@ require 'open_food_network/order_cycle_permissions'
require 'open_food_network/scope_variant_to_hub'
module Admin
class SubscriptionLineItemsController < ResourceController
class SubscriptionLineItemsController < Admin::ResourceController
before_action :load_build_context, only: [:build]
before_action :ensure_shop, only: [:build]
before_action :ensure_variant, only: [:build]

View File

@@ -1,7 +1,7 @@
require 'open_food_network/permissions'
module Admin
class SubscriptionsController < ResourceController
class SubscriptionsController < Admin::ResourceController
before_action :load_shops, only: [:index]
before_action :load_form_data, only: [:new, :edit]
before_action :strip_banned_attrs, only: [:update]

View File

@@ -1,5 +1,5 @@
module Admin
class TagRulesController < ResourceController
class TagRulesController < Admin::ResourceController
respond_to :json
respond_override destroy: { json: {

View File

@@ -1,7 +1,7 @@
require 'open_food_network/spree_api_key_loader'
module Admin
class VariantOverridesController < ResourceController
class VariantOverridesController < Admin::ResourceController
include OpenFoodNetwork::SpreeApiKeyLoader
include EnterprisesHelper

View File

@@ -15,7 +15,6 @@ module Api
before_action :set_content_type
before_action :authenticate_user
after_action :set_jsonp_format
rescue_from Exception, with: :error_during_processing
rescue_from CanCan::AccessDenied, with: :unauthorized
@@ -34,13 +33,6 @@ module Api
use_renderers :json
check_authorization
def set_jsonp_format
return unless params[:callback] && request.get?
self.response_body = "#{params[:callback]}(#{response_body})"
headers["Content-Type"] = 'application/javascript'
end
def respond_with_conflict(json_hash)
render json: json_hash, status: :conflict
end
@@ -63,16 +55,12 @@ module Api
end
def set_content_type
content_type = case params[:format]
when "json"
"application/json"
when "xml"
"text/xml"
end
headers["Content-Type"] = content_type
headers["Content-Type"] = "application/json"
end
def error_during_processing(exception)
Bugsnag.notify(exception)
render(json: { exception: exception.message },
status: :unprocessable_entity) && return
end

View File

@@ -11,13 +11,25 @@ module Api
@customer = Customer.find(params[:id])
authorize! :update, @customer
client_secret = RecurringPayments.setup_for(@customer) if params[:customer][:allow_charges]
if @customer.update(customer_params)
add_recurring_payment_info(client_secret)
render json: @customer, serializer: CustomerSerializer, status: :ok
else
invalid_resource!(@customer)
end
end
private
def add_recurring_payment_info(client_secret)
return unless client_secret
@customer.gateway_recurring_payment_client_secret = client_secret
@customer.gateway_shop_id = @customer.enterprise.stripe_account&.stripe_user_id
end
def customer_params
params.require(:customer).permit(:code, :email, :enterprise_id, :allow_charges)
end

View File

@@ -5,6 +5,7 @@
# Pagination is optional and can be required by using param[:page]
module Api
class ExchangeProductsController < Api::BaseController
include PaginationData
DEFAULT_PER_PAGE = 100
skip_authorization_check only: [:index]
@@ -77,29 +78,16 @@ module Api
end
def render_paginated_products(paginated_products)
serializer = ActiveModel::ArraySerializer.new(
serialized_products = ActiveModel::ArraySerializer.new(
paginated_products,
each_serializer: Api::Admin::ForOrderCycle::SuppliedProductSerializer,
order_cycle: @order_cycle
)
result = { products: serializer }
result = result.merge(pagination: pagination_data(paginated_products)) if pagination_required?
render text: result.to_json
end
def pagination_data(paginated_products)
{
results: paginated_products.total_count,
pages: paginated_products.num_pages,
page: params[:page].to_i,
per_page: (params[:per_page] || DEFAULT_PER_PAGE).to_i
render json: {
products: serialized_products,
pagination: pagination_data(paginated_products)
}
end
def pagination_required?
params[:page].present?
end
end
end

View File

@@ -1,5 +1,7 @@
module Api
class OrdersController < Api::BaseController
include PaginationData
def show
authorize! :read, order
render json: order, serializer: Api::OrderDetailedSerializer, current_order: order
@@ -8,11 +10,11 @@ module Api
def index
authorize! :admin, Spree::Order
search_results = SearchOrders.new(params, current_api_user)
orders = SearchOrders.new(params, current_api_user).orders
render json: {
orders: serialized_orders(search_results.orders),
pagination: search_results.pagination_data
orders: serialized_orders(orders),
pagination: pagination_data(orders)
}
end

View File

@@ -3,8 +3,8 @@ require 'spree/core/product_duplicator'
module Api
class ProductsController < Api::BaseController
include PaginationData
respond_to :json
DEFAULT_PAGE = 1
DEFAULT_PER_PAGE = 15
skip_authorization_check only: [:show, :bulk_products, :overridable]
@@ -63,7 +63,7 @@ module Api
@products = product_query.
ransack(query_params_with_defaults).
result.
page(params[:page] || DEFAULT_PAGE).
page(params[:page] || 1).
per(params[:per_page] || DEFAULT_PER_PAGE)
render_paged_products @products
@@ -130,33 +130,21 @@ module Api
end
def render_paged_products(products, product_serializer = ::Api::Admin::ProductSerializer)
serializer = ActiveModel::ArraySerializer.new(
serialized_products = ActiveModel::ArraySerializer.new(
products,
each_serializer: product_serializer
)
render text: {
products: serializer,
# This line is used by the PagedFetcher JS service (inventory).
pages: products.num_pages,
# This hash is used by the BulkProducts JS service.
render json: {
products: serialized_products,
pagination: pagination_data(products)
}.to_json
}
end
def query_params_with_defaults
(params[:q] || {}).reverse_merge(s: 'created_at desc')
end
def pagination_data(results)
{
results: results.total_count,
pages: results.num_pages,
page: (params[:page] || DEFAULT_PAGE).to_i,
per_page: (params[:per_page] || DEFAULT_PER_PAGE).to_i
}
end
def product_params
params.require(:product).permit PermittedAttributes::Product.attributes
end

View File

@@ -11,7 +11,8 @@ class CartController < BaseController
Spree::Adjustment.without_callbacks do
cart_service = CartService.new(order)
if cart_service.populate(params.slice(:products, :variants, :quantity), true)
cart_service.populate(params.slice(:products, :variants, :quantity), true)
if cart_service.valid?
order.update_distribution_charge!
order.cap_quantity_at_stock!
order.update!
@@ -22,7 +23,8 @@ class CartController < BaseController
stock_levels: VariantsStockLevels.new.call(order, variant_ids) },
status: :ok
else
render json: { error: true }, status: :precondition_failed
render json: { error: cart_service.errors.full_messages.join(",") },
status: :precondition_failed
end
end
populate_variant_attributes

View File

@@ -0,0 +1,26 @@
# frozen_string_literal: true
module PaginationData
extend ActiveSupport::Concern
def pagination_data(objects)
return unless objects.respond_to? :total_count
{
results: objects.total_count,
pages: objects.total_pages,
page: (params[:page] || 1).to_i,
per_page: (params[:per_page] || default_per_page).to_i
}
end
def pagination_required?
params[:page].present? || params[:per_page].present?
end
def default_per_page
return unless defined? self.class::DEFAULT_PER_PAGE
self.class::DEFAULT_PER_PAGE
end
end

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class AdjustmentsController < ResourceController
class AdjustmentsController < ::Admin::ResourceController
belongs_to 'spree/order', find_by: :number
destroy.after :reload_order

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class CountriesController < ResourceController
class CountriesController < ::Admin::ResourceController
protected
def permitted_resource_params

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ImagesController < ResourceController
class ImagesController < ::Admin::ResourceController
# This will make resource controller redirect correctly after deleting product images.
# This can be removed after upgrading to Spree 2.1.
# See here https://github.com/spree/spree/commit/334a011d2b8e16355e4ae77ae07cd93f7cbc8fd1

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class PaymentMethodsController < ResourceController
class PaymentMethodsController < ::Admin::ResourceController
skip_before_action :load_resource, only: [:create, :show_provider_preferences]
before_action :load_data
before_action :validate_payment_method_provider, only: [:create]
@@ -51,7 +51,7 @@ module Spree
end
# Only show payment methods that user has access to and sort by distributor name
# ! Redundant code copied from Spree::Admin::ResourceController with modifications marked
# ! Redundant code copied from Admin::ResourceController with modifications marked
def collection
return parent.public_send(controller_name) if parent_data.present?

View File

@@ -135,7 +135,9 @@ module Spree
return unless @payment.payment_method.class == Spree::Gateway::StripeSCA
@payment.authorize!
raise Spree::Core::GatewayError, I18n.t('authorization_failure') unless @payment.pending?
return if @payment.pending? && @payment.cvv_response_message.nil?
raise Spree::Core::GatewayError, I18n.t('authorization_failure')
end
end
end

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ProductPropertiesController < ResourceController
class ProductPropertiesController < ::Admin::ResourceController
belongs_to 'spree/product', find_by: :permalink
before_action :find_properties
before_action :setup_property, only: [:index]

View File

@@ -4,7 +4,7 @@ require 'open_food_network/permissions'
module Spree
module Admin
class ProductsController < ResourceController
class ProductsController < ::Admin::ResourceController
helper 'spree/products'
include OpenFoodNetwork::SpreeApiKeyLoader
include OrderCyclesHelper

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class PropertiesController < ResourceController
class PropertiesController < ::Admin::ResourceController
def permitted_resource_params
params.require(:property).permit(:name, :presentation)
end

View File

@@ -1,282 +0,0 @@
require 'action_callbacks'
module Spree
module Admin
class ResourceController < Spree::Admin::BaseController
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
before_action :load_resource, except: [:update_positions]
rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
rescue_from CanCan::AccessDenied, with: :unauthorized
respond_to :html
respond_to :js, except: [:show, :index]
def new
invoke_callbacks(:new_action, :before)
respond_with(@object) do |format|
format.html { render layout: !request.xhr? }
format.js { render layout: false }
end
end
def edit
respond_with(@object) do |format|
format.html { render layout: !request.xhr? }
format.js { render layout: false }
end
end
def update
invoke_callbacks(:update, :before)
if @object.update(permitted_resource_params)
invoke_callbacks(:update, :after)
flash[:success] = flash_message_for(@object, :successfully_updated)
respond_with(@object) do |format|
format.html { redirect_to location_after_save }
format.js { render layout: false }
end
else
invoke_callbacks(:update, :fails)
respond_with(@object)
end
end
def create
invoke_callbacks(:create, :before)
@object.attributes = permitted_resource_params
if @object.save
invoke_callbacks(:create, :after)
flash[:success] = flash_message_for(@object, :successfully_created)
respond_with(@object) do |format|
format.html { redirect_to location_after_save }
format.js { render layout: false }
end
else
invoke_callbacks(:create, :fails)
respond_with(@object)
end
end
def update_positions
params[:positions].each do |id, index|
model_class.where(id: id).update_all(position: index)
end
respond_to do |format|
format.js { render text: 'Ok' }
end
end
def destroy
invoke_callbacks(:destroy, :before)
if @object.destroy
invoke_callbacks(:destroy, :after)
flash[:success] = flash_message_for(@object, :successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }
end
else
invoke_callbacks(:destroy, :fails)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
end
end
end
protected
def resource_not_found
flash[:error] = flash_message_for(model_class.new, :not_found)
redirect_to collection_url
end
class << self
attr_accessor :parent_data
attr_accessor :callbacks
def belongs_to(model_name, options = {})
@parent_data ||= {}
@parent_data[:model_name] = model_name
@parent_data[:model_class] = model_name.to_s.classify.constantize
@parent_data[:find_by] = options[:find_by] || :id
end
def new_action
@callbacks ||= {}
@callbacks[:new_action] ||= ActionCallbacks.new
end
def create
@callbacks ||= {}
@callbacks[:create] ||= ActionCallbacks.new
end
def update
@callbacks ||= {}
@callbacks[:update] ||= ActionCallbacks.new
end
def destroy
@callbacks ||= {}
@callbacks[:destroy] ||= ActionCallbacks.new
end
end
def model_class
"Spree::#{controller_name.classify}".constantize
end
def model_name
parent_data[:model_name].gsub('spree/', '')
end
def object_name
controller_name.singularize
end
def load_resource
if member_action?
@object ||= load_resource_instance
# call authorize! a third time (called twice already in Admin::BaseController)
# this time we pass the actual instance so fine-grained abilities can control
# access to individual records, not just entire models.
authorize! action, @object
instance_variable_set("@#{object_name}", @object)
# If we don't have access, clear the object
unless can? action, @object
instance_variable_set("@#{object_name}", nil)
end
authorize! action, @object
else
@collection ||= collection
# note: we don't call authorize here as the collection method should use
# CanCan's accessible_by method to restrict the actual records returned
instance_variable_set("@#{controller_name}", @collection)
end
end
def load_resource_instance
if new_actions.include?(action)
build_resource
elsif params[:id]
find_resource
end
end
def parent_data
self.class.parent_data
end
def parent
return nil if parent_data.blank?
@parent ||= parent_data[:model_class].
public_send("find_by", parent_data[:find_by] => params["#{model_name}_id"])
instance_variable_set("@#{model_name}", @parent)
end
def find_resource
if parent_data.present?
parent.public_send(controller_name).find(params[:id])
else
model_class.find(params[:id])
end
end
def build_resource
if parent_data.present?
parent.public_send(controller_name).build
else
model_class.new
end
end
def collection
return parent.public_send(controller_name) if parent_data.present?
if model_class.respond_to?(:accessible_by) &&
!current_ability.has_block?(params[:action], model_class)
model_class.accessible_by(current_ability, action)
else
model_class.scoped
end
end
def location_after_save
collection_url
end
def invoke_callbacks(action, callback_type)
callbacks = self.class.callbacks || {}
return if callbacks[action].nil?
case callback_type.to_sym
when :before then callbacks[action].before_methods.each { |method| __send__ method }
when :after then callbacks[action].after_methods.each { |method| __send__ method }
when :fails then callbacks[action].fails_methods.each { |method| __send__ method }
end
end
# URL helpers
def new_object_url(options = {})
if parent_data.present?
spree.new_polymorphic_url([:admin, parent, model_class], options)
else
spree.new_polymorphic_url([:admin, model_class], options)
end
end
def edit_object_url(object, options = {})
if parent_data.present?
spree.public_send "edit_admin_#{model_name}_#{object_name}_url", parent, object, options
else
spree.public_send "edit_admin_#{object_name}_url", object, options
end
end
def object_url(object = nil, options = {})
target = object || @object
if parent_data.present?
spree.public_send "admin_#{model_name}_#{object_name}_url", parent, target, options
else
spree.public_send "admin_#{object_name}_url", target, options
end
end
# Permit specific list of params
#
# Example: params.require(object_name).permit(:name)
def permitted_resource_params
raise "All extending controllers need to override the method permitted_resource_params"
end
def collection_url(options = {})
if parent_data.present?
spree.polymorphic_url([:admin, parent, model_class], options)
else
spree.polymorphic_url([:admin, model_class], options)
end
end
def collection_actions
[:index]
end
def member_action?
!collection_actions.include? action
end
def new_actions
[:new, :create]
end
end
end
end

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ReturnAuthorizationsController < ResourceController
class ReturnAuthorizationsController < ::Admin::ResourceController
belongs_to 'spree/order', find_by: :number
update.after :associate_inventory_units

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ShippingCategoriesController < ResourceController
class ShippingCategoriesController < ::Admin::ResourceController
protected
def permitted_resource_params

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ShippingMethodsController < ResourceController
class ShippingMethodsController < ::Admin::ResourceController
before_action :load_data, except: [:index]
before_action :set_shipping_category, only: [:create, :update]
before_action :set_zones, only: [:create, :update]

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class StatesController < ResourceController
class StatesController < ::Admin::ResourceController
belongs_to 'spree/country'
before_action :load_data

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class TaxCategoriesController < ResourceController
class TaxCategoriesController < ::Admin::ResourceController
def destroy
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class TaxRatesController < ResourceController
class TaxRatesController < ::Admin::ResourceController
before_action :load_data
private

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class TaxonomiesController < ResourceController
class TaxonomiesController < ::Admin::ResourceController
respond_to :json, only: [:get_children]
def get_children

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class UsersController < ResourceController
class UsersController < ::Admin::ResourceController
rescue_from Spree::User::DestroyWithOrdersError, with: :user_destroy_with_orders_error
after_action :sign_in_if_change_own_password, only: :update
@@ -100,7 +100,7 @@ module Spree
private
# handling raise from Spree::Admin::ResourceController#destroy
# handling raise from Admin::ResourceController#destroy
def user_destroy_with_orders_error
invoke_callbacks(:destroy, :fails)
render status: :forbidden, text: Spree.t(:error_user_destroy_with_orders)

View File

@@ -2,7 +2,7 @@ require 'open_food_network/scope_variants_for_search'
module Spree
module Admin
class VariantsController < ResourceController
class VariantsController < ::Admin::ResourceController
helper 'spree/products'
belongs_to 'spree/product', find_by: :permalink
@@ -23,7 +23,9 @@ module Spree
flash[:success] = flash_message_for(@object, :successfully_updated)
redirect_to spree.admin_product_variants_url(params[:product_id], @url_filters)
else
redirect_to spree.edit_admin_product_variant_url(params[:product_id], @object, @url_filters)
redirect_to spree.edit_admin_product_variant_url(params[:product_id],
@object,
@url_filters)
end
end

View File

@@ -1,6 +1,6 @@
module Spree
module Admin
class ZonesController < ResourceController
class ZonesController < ::Admin::ResourceController
before_action :load_data, except: [:index]
def new

View File

@@ -1,3 +1,7 @@
# frozen_string_literal: true
require 'stripe/credit_card_remover'
module Spree
class CreditCardsController < BaseController
def new_from_token
@@ -27,6 +31,7 @@ module Spree
authorize! :update, @credit_card
if @credit_card.update(credit_card_params)
remove_shop_authorizations if credit_card_params["is_default"]
render json: @credit_card, serializer: ::Api::CreditCardSerializer, status: :ok
else
update_failed
@@ -39,11 +44,12 @@ module Spree
@credit_card = Spree::CreditCard.find_by(id: params[:id])
if @credit_card
authorize! :destroy, @credit_card
destroy_at_stripe
Stripe::CreditCardRemover.new(@credit_card).call
end
# Using try because we may not have a card here
if @credit_card.try(:destroy)
remove_shop_authorizations if @credit_card.is_default
flash[:success] = I18n.t(:card_has_been_removed, number: "x-#{@credit_card.last_digits}")
else
flash[:error] = I18n.t(:card_could_not_be_removed)
@@ -56,18 +62,8 @@ module Spree
private
# It destroys the whole customer object
def destroy_at_stripe
stripe_customer = Stripe::Customer.retrieve(@credit_card.gateway_customer_profile_id, {})
stripe_customer&.delete
end
def stripe_account_id
StripeAccount.
find_by(enterprise_id: @credit_card.payment_method.preferred_enterprise_id).
andand.
stripe_user_id
def remove_shop_authorizations
@credit_card.user.customers.update_all(allow_charges: false)
end
def create_customer(token)

View File

@@ -18,26 +18,6 @@ module Spree
before_action :check_permissions, only: [:edit, :update]
skip_before_action :require_no_authentication
# GET /resource/sign_up
def new
super
@user = resource
end
# POST /resource/sign_up
def create
@user = build_resource(params[:spree_user])
if resource.save
set_flash_message(:notice, :signed_up)
sign_in(:spree_user, @user)
associate_user
respond_with resource, location: after_sign_up_path_for(resource)
else
clean_up_passwords(resource)
render :new
end
end
# GET /resource/edit
def edit
super

View File

@@ -130,10 +130,6 @@ module Admin
json: @hub_permissions.to_json }
end
def admin_inject_products
admin_inject_json_ams_array "ofn.admin", "products", @products, Api::Admin::ProductSerializer
end
def admin_inject_tax_categories(opts = { module: 'ofn.admin' })
admin_inject_json_ams_array opts[:module],
"tax_categories",

View File

@@ -1,6 +1,6 @@
module ApplicationHelper
def feature?(feature)
OpenFoodNetwork::FeatureToggle.enabled? feature
def feature?(feature, user = nil)
OpenFoodNetwork::FeatureToggle.enabled?(feature, user)
end
def ng_form_for(name, *args, &block)

View File

@@ -1,4 +1,4 @@
require 'spree/money_decorator'
require 'spree/money'
module Spree
module ReportsHelper

View File

@@ -62,7 +62,7 @@ class SubscriptionConfirmJob
return unless order.payment_required?
prepare_for_payment!(order)
order.process_payments!
order.process_payments_offline!
raise if order.errors.any?
end

View File

@@ -25,6 +25,9 @@ class Customer < ActiveRecord::Base
before_create :associate_user
attr_accessor :gateway_recurring_payment_client_secret
attr_accessor :gateway_shop_id
private
def downcase_email

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'open_food_network/locking'
require 'open_food_network/permalink_generator'
require 'spree/core/s3_support'
@@ -66,10 +68,10 @@ class EnterpriseGroup < ActiveRecord::Base
def unset_undefined_address_fields
return if address.blank?
address.phone.sub!(/^#{I18n.t(:undefined)}$/, '')
address.address1.sub!(/^#{I18n.t(:undefined)}$/, '')
address.city.sub!(/^#{I18n.t(:undefined)}$/, '')
address.zipcode.sub!(/^#{I18n.t(:undefined)}$/, '')
address.phone = address.phone.sub(/^#{I18n.t(:undefined)}$/, '')
address.address1 = address.address1.sub(/^#{I18n.t(:undefined)}$/, '')
address.city = address.city.sub(/^#{I18n.t(:undefined)}$/, '')
address.zipcode = address.zipcode.sub(/^#{I18n.t(:undefined)}$/, '')
end
def to_param

View File

@@ -86,18 +86,10 @@ module Spree
# Update the boolean _eligible_ attribute which determines which adjustments
# count towards the order's adjustment_total.
def set_eligibility
result = mandatory || (amount != 0 && eligible_for_originator?)
result = mandatory || amount != 0
update_column(:eligible, result)
end
# Allow originator of the adjustment to perform an additional eligibility of the adjustment
# Should return _true_ if originator is absent or doesn't implement _eligible?_
def eligible_for_originator?
return true if originator.nil?
!originator.respond_to?(:eligible?) || originator.eligible?(source)
end
# Update both the eligibility and amount of the adjustment. Adjustments
# delegate updating of amount to their Originator when present, but only if
# +locked+ is false. Adjustments that are +locked+ will never change their amount.

View File

@@ -31,6 +31,10 @@ module Spree
failed_activemerchant_billing_response(e.message)
end
def charge_offline(money, creditcard, gateway_options)
purchase(money, creditcard, gateway_options)
end
# NOTE: the name of this method is determined by Spree::Payment::Processing
def void(response_code, _creditcard, gateway_options)
gateway_options[:stripe_account] = stripe_account_id

View File

@@ -45,11 +45,21 @@ module Spree
failed_activemerchant_billing_response(e.message)
end
# NOTE: the name of this method is determined by Spree::Payment::Processing
def charge_offline(money, creditcard, gateway_options)
customer, payment_method =
Stripe::CreditCardCloner.new(creditcard, stripe_account_id).find_or_clone
options = basic_options(gateway_options).merge(customer: customer, off_session: true)
provider.purchase(money, payment_method, options)
rescue Stripe::StripeError => e
failed_activemerchant_billing_response(e.message)
end
# NOTE: the name of this method is determined by Spree::Payment::Processing
def authorize(money, creditcard, gateway_options)
authorize_response = provider.authorize(*options_for_authorize(money,
creditcard,
gateway_options))
authorize_response =
provider.authorize(*options_for_authorize(money, creditcard, gateway_options))
Stripe::AuthorizeResponsePatcher.new(authorize_response).call!
rescue Stripe::StripeError => e
failed_activemerchant_billing_response(e.message)
@@ -61,7 +71,7 @@ module Spree
payment_intent_response = Stripe::PaymentIntent.retrieve(payment_intent_id,
stripe_account: stripe_account_id)
gateway_options[:stripe_account] = stripe_account_id
provider.refund(payment_intent_response.amount_received, response_code, gateway_options)
provider.refund(refundable_amount(payment_intent_response), response_code, gateway_options)
end
# NOTE: the name of this method is determined by Spree::Payment::Processing
@@ -79,6 +89,11 @@ module Spree
private
def refundable_amount(payment_intent_response)
payment_intent_response.amount_received -
payment_intent_response.charges.data.map(&:amount_refunded).sum
end
# In this gateway, what we call 'secret_key' is the 'login'
def options
options = super
@@ -97,8 +112,8 @@ module Spree
options = basic_options(gateway_options)
options[:return_url] = full_checkout_path
customer_id, payment_method_id = Stripe::CreditCardCloner.new.clone(creditcard,
stripe_account_id)
customer_id, payment_method_id =
Stripe::CreditCardCloner.new(creditcard, stripe_account_id).find_or_clone
options[:customer] = customer_id
[money, payment_method_id, options]
end

View File

@@ -34,14 +34,24 @@ module Spree
end
def find_dimensions
temporary = attachment.queued_for_write[:original]
filename = temporary.path unless temporary.nil?
filename = attachment.path if filename.blank?
geometry = Paperclip::Geometry.from_file(filename)
return if attachment.errors.present?
geometry = Paperclip::Geometry.from_file(local_filename_of_original)
self.attachment_width = geometry.width
self.attachment_height = geometry.height
end
def local_filename_of_original
temporary = attachment.queued_for_write[:original]
if temporary&.path.present?
temporary.path
else
attachment.path
end
end
# if there are errors from the plugin, then add a more meaningful message
def no_attachment_errors
return if attachment.errors.empty?

View File

@@ -500,22 +500,19 @@ module Spree
# :allow_checkout_on_gateway_error is set to false
#
def process_payments!
raise Core::GatewayError, Spree.t(:no_pending_payments) if pending_payments.empty?
pending_payments.each do |payment|
break if payment_total >= total
payment.process!
if payment.completed?
self.payment_total += payment.amount
end
end
process_each_payment(&:process!)
rescue Core::GatewayError => e
result = !!Spree::Config[:allow_checkout_on_gateway_error]
errors.add(:base, e.message) && (return result)
end
def process_payments_offline!
process_each_payment(&:process_offline!)
rescue Core::GatewayError => e
errors.add(:base, e.message)
false
end
def billing_firstname
bill_address.try(:firstname)
end
@@ -778,6 +775,20 @@ module Spree
private
def process_each_payment
raise Core::GatewayError, Spree.t(:no_pending_payments) if pending_payments.empty?
pending_payments.each do |payment|
break if payment_total >= total
yield payment
if payment.completed?
self.payment_total += payment.amount
end
end
end
def link_by_email
self.email = user.email if user
end

View File

@@ -4,16 +4,7 @@ module Spree
class Payment < ActiveRecord::Base
module Processing
def process!
return unless payment_method&.source_required?
raise Core::GatewayError, Spree.t(:payment_processing_failed) unless source
return if processing?
unless payment_method.supports?(source)
invalidate!
raise Core::GatewayError, Spree.t(:payment_method_not_supported)
end
return unless validate!
if payment_method.auto_capture?
purchase!
@@ -22,6 +13,16 @@ module Spree
end
end
def process_offline!
return unless validate!
if payment_method.auto_capture?
charge_offline!
else
authorize!
end
end
def authorize!
started_processing!
gateway_action(source, :authorize, :pend)
@@ -32,6 +33,11 @@ module Spree
gateway_action(source, :purchase, :complete)
end
def charge_offline!
started_processing!
gateway_action(source, :charge_offline, :complete)
end
def capture!
return true if completed?
@@ -193,6 +199,20 @@ module Spree
private
def validate!
return false unless payment_method&.source_required?
raise Core::GatewayError, Spree.t(:payment_processing_failed) unless source
return false if processing?
unless payment_method.supports?(source)
invalidate!
raise Core::GatewayError, Spree.t(:payment_method_not_supported)
end
true
end
def calculate_refund_amount(refund_amount = nil)
refund_amount ||= if credit_allowed >= order.outstanding_balance.abs
order.outstanding_balance.abs

View File

@@ -110,23 +110,8 @@ module Spree
end
def self.clean_name
case name
when "Spree::PaymentMethod::Check"
"Cash/EFT/etc. (payments for which automatic validation is not required)"
when "Spree::Gateway::Migs"
"MasterCard Internet Gateway Service (MIGS)"
when "Spree::Gateway::Pin"
"Pin Payments"
when "Spree::Gateway::StripeConnect"
"Stripe"
when "Spree::Gateway::StripeSCA"
"Stripe SCA"
when "Spree::Gateway::PayPalExpress"
"PayPal Express"
else
i = name.rindex('::') + 2
name[i..-1]
end
i18n_key = "spree.admin.payment_methods.providers." + name.demodulize.downcase
I18n.t(i18n_key)
end
private

View File

@@ -115,6 +115,7 @@ module Spree
when :password
value.to_s
when :decimal
value = 0 if value.blank?
BigDecimal(value.to_s).round(2, BigDecimal::ROUND_HALF_UP)
when :integer
value.to_i

View File

@@ -1,4 +1,4 @@
# frozen_string_literal: true
# frozen_string_literal: false
module Spree
class Price < ActiveRecord::Base

View File

@@ -7,7 +7,7 @@ module Spree
return if Zone.default_tax
record.errors.add(:included_in_price, Spree.t(:included_price_validation))
record.errors.add(:included_in_price, Spree.t("errors.messages.included_price_validation"))
end
end
end

View File

@@ -1,7 +1,8 @@
module Spree
class User < ActiveRecord::Base
devise :database_authenticatable, :token_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :encryptable, encryptor: 'authlogic_sha512'
:rememberable, :trackable, :validatable,
:encryptable, :confirmable, encryptor: 'authlogic_sha512', reconfirmable: true
has_many :orders
belongs_to :ship_address, foreign_key: 'ship_address_id', class_name: 'Spree::Address'
@@ -39,9 +40,6 @@ module Spree
validate :limit_owned_enterprises
# We use the same options as Spree and add :confirmable
devise :confirmable, reconfirmable: true
class DestroyWithOrdersError < StandardError; end
def self.admin_created?

View File

@@ -1,5 +1,14 @@
module Api
class CustomerSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :name, :code, :email, :allow_charges
def attributes
hash = super
if secret = object.gateway_recurring_payment_client_secret
hash.merge!(gateway_recurring_payment_client_secret: secret)
end
hash.merge!(gateway_shop_id: object.gateway_shop_id) if object.gateway_shop_id
hash
end
end
end

View File

@@ -22,6 +22,10 @@ class CartService
valid?
end
def valid?
errors.empty?
end
private
def attempt_cart_add_variants(variants_data)
@@ -109,10 +113,6 @@ class CartService
end
end
def valid?
errors.empty?
end
def cart_remove(variant_id)
variant = Spree::Variant.find(variant_id)
@order.remove_variant(variant)
@@ -145,7 +145,7 @@ class CartService
def check_order_cycle_provided
order_cycle_provided = @order_cycle.present?
errors.add(:base, "Please choose an order cycle for this order.") unless order_cycle_provided
errors.add(:base, I18n.t(:spree_order_cycle_error)) unless order_cycle_provided
order_cycle_provided
end

View File

@@ -2,7 +2,6 @@ require 'open_food_network/scope_product_to_hub'
class ProductsRenderer
class NoProducts < RuntimeError; end
DEFAULT_PAGE = 1
DEFAULT_PER_PAGE = 10
def initialize(distributor, order_cycle, customer, args = {})
@@ -51,7 +50,7 @@ class ProductsRenderer
query.
ransack(args[:q]).
result.
page(args[:page] || DEFAULT_PAGE).
page(args[:page] || 1).
per(args[:per_page] || DEFAULT_PER_PAGE)
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
class RecurringPayments
def self.setup_for(customer)
return unless card = customer.user.default_card
return unless stripe_account = customer.enterprise.stripe_account&.stripe_user_id
customer_id, payment_method_id =
Stripe::CreditCardCloner.new(card, stripe_account).find_or_clone
setup_intent = Stripe::SetupIntent.create(
{ payment_method: payment_method_id, customer: customer_id },
stripe_account: stripe_account
)
setup_intent.client_secret
end
end

View File

@@ -8,17 +8,6 @@ class SearchOrders
@orders = fetch_orders
end
def pagination_data
return unless using_pagination?
{
results: @orders.total_count,
pages: @orders.num_pages,
page: params[:page].to_i,
per_page: params[:per_page].to_i
}
end
private
attr_reader :params, :current_user
@@ -50,6 +39,6 @@ class SearchOrders
end
def using_pagination?
params[:per_page]
params[:page]
end
end

View File

@@ -1,8 +1,11 @@
%div{"ng-controller" => "OrderCycleChangeCtrl", "ng-cloak" => true}
%closing
%div{"ng-if" => "OrderCycle.selected()"}
= t :enterprises_next_closing
%strong {{ OrderCycle.orders_close_at() | date_in_words }}
%div{"ng-if" => "closesInLessThan3Months()"}
= t :enterprises_next_closing
%strong {{ OrderCycle.orders_close_at() | date_in_words }}
%div{"ng-if" => "!closesInLessThan3Months()"}
= t :enterprises_currently_open
%div{"ng-if" => "!OrderCycle.selected()"}
= t :enterprises_choose

View File

@@ -59,10 +59,6 @@
= label_tag(key, Spree.t(key) + ': ') + tag(:br) if type != :boolean
= preference_field_tag(key, Spree::Config[key], :type => type)
= label_tag(key, Spree.t(key)) + tag(:br) if type == :boolean
.field
= label_tag :currency, Spree.t(:choose_currency)
%br/
= select_tag :currency, currency_options, :class => 'fullwidth'
.field
= label_tag Spree.t(:currency_symbol_position)
%br/

View File

@@ -1,4 +1,7 @@
%table
%tr
%td{ colspan: 2 }
= t('spree.users.cards.authorised_shops_agreement')
%tr
%th= t(".shop_name")
%th= t(".allow_charges?")

View File

@@ -18,9 +18,7 @@
.new_card{ ng: { show: 'CreditCard.visible', class: '{visible: CreditCard.visible}' } }
%h3= t(:add_new_credit_card)
= render 'new_card_form'
.authorised_shops{ ng: { controller: 'AuthorisedShopsCtrl', hide: 'CreditCard.visible' } }
.authorised_shops{ ng: { controller: 'AuthorisedShopsCtrl', hide: 'CreditCard.visible || savedCreditCards.length == 0' } }
%h3
= t('.authorised_shops')
%button.button.secondary.tiny.help-btn.ng-scope{ "help-modal" => t('.authorised_shops_popover') }
%i.ofn-i_013-help
= render 'authorised_shops'

View File

@@ -10,7 +10,7 @@
%td.number{ ng: { bind: '::card.number' } }
%td.expiry{ ng: { bind: '::card.expiry' } }
%td.is-default
%input{ type: 'radio', name: 'default_card', ng: { model: 'card.is_default', change: 'setDefault(card)', value: "true"} }
%input{ type: 'radio', name: 'default_card', ng: { model: 'card.is_default', click: 'confirmSetDefault(card, $event)', value: "true"} }
%td.actions
%a{"rel" => "nofollow", "data-method" => "delete", "ng-href" => "{{card.delete_link}}" }
= t(:delete)

View File

@@ -5,6 +5,7 @@
- if Stripe.publishable_key
:javascript
angular.module('Darkswarm').value("stripeObject", Stripe("#{Stripe.publishable_key}"))
angular.module('Darkswarm').value("stripePublishableKey", "#{Stripe.publishable_key}")
.darkswarm
.row.pad-top

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
if ENV.fetch('KILL_UNICORNS', false) && ['production', 'staging'].include?(ENV['RAILS_ENV'])

View File

@@ -60,4 +60,11 @@ SMTP_PASSWORD: 'f00d'
# STRIPE_CLIENT_ID: "ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET: "whsec_xxxx"
# Feature toggles
#
# Adding user emails separated by commas will enable them the use of certain features. See
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS: ofn@example.com,superadmin@example.com
MEMCACHED_VALUE_MAX_MEGABYTES: '4'

View File

@@ -0,0 +1,5 @@
require 'open_food_network/feature_toggle'
beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/)
OpenFoodNetwork::FeatureToggle.enable(:customer_balance, beta_testers)

View File

@@ -1568,6 +1568,7 @@ ar:
shopping_groups_part_of: "جزء من:"
shopping_producers_of_hub: "منتجو %{hub}:"
enterprises_next_closing: "إغلاق الطلب التالي"
enterprises_currently_open: "الطلبات متاحة حاليا"
enterprises_ready_for: "جاهز ل"
enterprises_choose: "اختر عندما تريد طلبك:"
maps_open: "افتح"
@@ -2081,6 +2082,7 @@ ar:
spree_classification_primary_taxon_error: "Taxon %{taxon} هو التصنيف الأساسي %{product} ولا يمكن حذفه"
spree_order_availability_error: "لا يمكن لموزع أو دورة طلب توفير المنتجات في سلة التسوق"
spree_order_populator_error: "لا يمكن لهذا الموزع أو دورة الطلب توفير جميع المنتجات في سلة التسوق. الرجاء اختيار آخر."
spree_order_cycle_error: "الرجاء اختيار دورة الطلب لهذا الطلب."
spree_order_populator_availability_error: "هذا المنتج غير متوفر من الموزع المختار أو دورة الطلب."
spree_distributors_error: "يجب تحديد مركز واحد على الأقل"
spree_user_enterprise_limit_error: "^ %{email} غير مسموح به لامتلاك أي مؤسسات أخرى (الحد الأقصى هو %{enterprise_limit})."
@@ -2386,6 +2388,7 @@ ar:
resolve_errors: يرجى حل الأخطاء التالية
more_items: "+ %{count} ايضا"
default_card_updated: تم تحديث البطاقة الافتراضية
default_card_voids_auth: سيؤدي تغيير بطاقتك الافتراضية إلى إزالة تفويضات المتاجر الحالية لشحنها. يمكنك إعادة تفويض المحلات التجارية بعد تحديث البطاقة الافتراضية. هل ترغب في تغيير البطاقة الافتراضية؟"
cart:
add_to_cart_failed: >
حدثت مشكلة أثناء إضافة هذا المنتج إلى عربة التسوق. ربما أصبح غير متوفر أو
@@ -3622,11 +3625,11 @@ ar:
delete?: حذف؟
cards:
authorised_shops: المتاجر المعتمدة
authorised_shops_popover: هذه هي قائمة المتاجر التي يُسمح لها باستحقاق الدفع عن طريق بطاقتك الائتمانية الافتراضية عن أي اشتراكات (على سبيل المثال ، الطلبات المتكررة) التي قد قمت بعملها. سيتم الاحتفاظ بتفاصيل بطاقتك بأمان ولن تتم مشاركتها مع أصحاب المتاجر. سيتم إخطارك دائمًا عند تحصيل الرسوم منك.
authorised_shops_agreement: هذه قائمة بالمحلات التجارية المسموح لها بشحن بطاقة الائتمان الافتراضية الخاصة بك مقابل أي اشتراكات (مثل تكرار الطلبات) قد تكون لديك. سيتم الاحتفاظ بتفاصيل بطاقتك بشكل آمن ولن يتم مشاركتها مع أصحاب المتاجر. سيتم إخطارك دائمًا عند محاسبتك. من خلال تحديد المربع الخاص بمتجر ، فإنك توافق على تخويل هذا المتجر بإرسال تعليمات إلى المؤسسة المالية التي أصدرت بطاقتك لتلقي المدفوعات وفقًا لشروط أي اشتراك تقوم بإنشائه مع هذا المتجر.
saved_cards_popover: هذه قائمة البطاقات التي اخترت حفظها لاستخدامها لاحقًا. سيتم تحديد &quot;الافتراضي&quot; الخاص بك تلقائيًا عند إتمام طلب الشراء ، ويمكن أن يتم تحصيل رسوم من أي متاجر سمحت لها بالقيام بذلك (انظر إلى اليمين).
authorised_shops:
shop_name: "اسم المتجر"
allow_charges?: "السماح للرسوم؟"
allow_charges?: "السماح بالسحب من البطاقة الافتراضية؟"
localized_number:
invalid_format: لديه تنسيق غير صالح. الرجاء إدخال رقم.
api:

View File

@@ -1572,6 +1572,7 @@ ca:
shopping_groups_part_of: "forma part de:"
shopping_producers_of_hub: "Productores de%{hub}:"
enterprises_next_closing: "La següent comanda tanca"
enterprises_currently_open: "Les comandes estan obertes"
enterprises_ready_for: "Llest per"
enterprises_choose: "Escull quan vols la teva comanda:"
maps_open: "Obert"
@@ -2085,6 +2086,7 @@ ca:
spree_classification_primary_taxon_error: "El taxó %{taxon} és el principal taxó d'%{product} i no es pot eliminar"
spree_order_availability_error: "La distribuïdora o el cicle de comanda no pot subministrar els productes de la vostra cistella"
spree_order_populator_error: "Aquesta distribuïdora o cicle de comanda no pot subministrar tots els productes de la vostra cistella. Si us plau trieu-ne d'altres."
spree_order_cycle_error: "Seleccioneu un cicle per a aquesta comanda."
spree_order_populator_availability_error: "Aquest producte no està disponible des de la distribuïdora o cicle de comanda seleccionat."
spree_distributors_error: "Cal seleccionar almenys un grup"
spree_user_enterprise_limit_error: "^ %{email} no està autoritzat a tenir més organitzacions (el límit és %{enterprise_limit})."
@@ -3538,11 +3540,10 @@ ca:
delete?: Suprimeix?
cards:
authorised_shops: Botigues autoritzades
authorised_shops_popover: Aquesta és la llista de botigues que tenen permís per carregar la teva targeta de crèdit predeterminada per a qualsevol subscripció (és a dir, comandes de repetició) que puguis tenir. Les dades de la targeta es mantindran segures i no es compartiran amb els propietaris de botigues. Sempre se us notificarà quan se us faci un càrrec.
saved_cards_popover: Aquesta és la llista de targetes que heu optat per guardar per a un ús posterior. El vostre "valor predeterminat" es seleccionarà automàticament quan valideu una comanda i es pot carregar per qualsevol botiga a la que li hagueu permès fer-ho (vegeu a la dreta).
authorised_shops:
shop_name: "Nom de la botiga"
allow_charges?: "Permetre càrrecs?"
allow_charges?: "Vols permetre els càrrecs a la targeta per defecte?"
localized_number:
invalid_format: té un format no vàlid. Si us plau introdueix un número.
api:

View File

@@ -3582,11 +3582,9 @@ cy:
delete?: Dileu?
cards:
authorised_shops: Siopau Awdurdodedig
authorised_shops_popover: Dyma&#39;r rhestr o siopau y caniateir iddynt godi tâl ar eich cerdyn credyd diofyn am unrhyw danysgrifiadau (h.y. ailadrodd archebion) a allai fod gennych. Bydd manylion eich cerdyn yn cael eu cadw&#39;n ddiogel ac ni fyddant yn cael eu rhannu â pherchnogion siopau. Fe&#39;ch hysbysir bob amser pan godir tâl arnoch.
saved_cards_popover: Dyma&#39;r rhestr o gardiau rydych chi wedi dewis eu cadw i&#39;w defnyddio&#39;n ddiweddarach. Bydd eich &#39;rhagosodiad&#39; yn cael ei ddewis yn awtomatig pan fyddwch chi&#39;n talu archeb, a gall unrhyw siopau rydych chi wedi caniatáu gwneud hynny godi tâl arnyn nhw (gweler ar y dde).
authorised_shops:
shop_name: "Enw&#39;r Siop"
allow_charges?: "Caniatáu Taliadau?"
localized_number:
invalid_format: mae fformat annilys. Rhowch rif.
api:

View File

@@ -3537,11 +3537,9 @@ de_DE:
delete?: Löschen?
cards:
authorised_shops: Bevollmächtigte Läden
authorised_shops_popover: Dies ist die Liste der Shops, die Ihre Standardkreditkarte für eventuell vorhandene Abonnements (dh wiederkehrende Bestellungen) belasten dürfen. Ihre Kartendetails werden sicher aufbewahrt und nicht an Ladenbesitzer weitergegeben. Sie werden immer benachrichtigt, wenn Sie belastet werden.
saved_cards_popover: Dies ist die Liste der Karten, die Sie für spätere Verwendung gespeichert haben. Ihr "Standard" wird automatisch beim Abschließen einer Bestellung ausgewählt und kann von allen Geschäften belastet werden, die Sie dazu berechtigt haben (siehe rechts).
authorised_shops:
shop_name: "Ladenname"
allow_charges?: "Gebühren erlauben?"
localized_number:
invalid_format: hat ein ungültiges Format. Bitte Ziffern eingeben.
api:

View File

@@ -1398,6 +1398,7 @@ en:
unconfirmed: unconfirmed
days: days
authorization_failure: "Authorization Failure"
description: "Description"
label_shop: "Shop"
label_shops: "Shops"
@@ -1677,6 +1678,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
shopping_producers_of_hub: "%{hub}'s producers:"
enterprises_next_closing: "Next order closing"
enterprises_currently_open: "Orders are currently open"
enterprises_ready_for: "Ready for"
enterprises_choose: "Choose when you want your order:"
@@ -2147,6 +2149,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
delivery_method: Delivery Method
fee_type: "Fee Type"
tax_category: "Tax Category"
description: "Description"
display: "Display"
tags: "Tags"
calculator: "Calculator"
calculator_values: "Calculator values"
calculator_settings_warning: "If you are changing the calculator type, you must save first before you can edit the calculator settings"
@@ -2213,6 +2218,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
spree_classification_primary_taxon_error: "Taxon %{taxon} is the primary taxon of %{product} and cannot be deleted"
spree_order_availability_error: "Distributor or order cycle cannot supply the products in your cart"
spree_order_populator_error: "That distributor or order cycle can't supply all the products in your cart. Please choose another."
spree_order_cycle_error: "Please choose an order cycle for this order."
spree_order_populator_availability_error: "That product is not available from the chosen distributor or order cycle."
spree_distributors_error: "At least one hub must be selected"
spree_user_enterprise_limit_error: "^%{email} is not permitted to own any more enterprises (limit is %{enterprise_limit})."
@@ -2509,6 +2515,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
js:
saving: 'Saving...'
changes_saved: 'Changes saved.'
authorising: "Authorising..."
save_changes_first: Save changes first.
all_changes_saved: All changes saved
unsaved_changes: You have unsaved changes
@@ -2524,6 +2531,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
resolve_errors: Please resolve the following errors
more_items: "+ %{count} More"
default_card_updated: Default Card Updated
default_card_voids_auth: Changing your default card will remove shops' existing authorizations to charge it. You can re-authorize shops after updating the default card. Do you wish to change the default card?"
cart:
add_to_cart_failed: >
There was a problem adding this product to the cart.
@@ -3202,6 +3210,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
actions:
update: "Update"
cancel: "Cancel"
shared:
error_messages:
errors_prohibited_this_record_from_being_saved:
@@ -3217,6 +3226,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
payment_state: "Payment State"
errors:
messages:
included_price_validation: "cannot be selected unless you have set a Default Tax Zone"
blank: "can't be blank"
layouts:
admin:
@@ -3427,6 +3437,14 @@ See the %{link} to find out more about %{sitename}'s features and to start using
deactivation_warning: "De-activating a payment method can make the payment method disappear from your list. Alternatively, you can hide a payment method from the checkout page by setting the option 'Display' to 'back office only'."
providers:
provider: "Provider"
check: "Cash/EFT/etc. (payments for which automatic validation is not required)"
migs: "MasterCard Internet Gateway Service (MIGS)"
pin: "Pin Payments"
paypalexpress: "PayPal Express"
stripeconnect: "Stripe"
stripesca: "Stripe SCA"
bogus: "Bogus"
bogussimple: "BogusSimple"
payments:
source_forms:
stripe:
@@ -3699,11 +3717,11 @@ See the %{link} to find out more about %{sitename}'s features and to start using
delete?: Delete?
cards:
authorised_shops: Authorised Shops
authorised_shops_popover: This is the list of shops which are permitted to charge your default credit card for any subscriptions (ie. repeating orders) you may have. Your card details will be kept secure and will not be shared with shop owners. You will always be notified when you are charged.
authorised_shops_agreement: This is the list of shops which are permitted to charge your default credit card for any subscriptions (ie. repeating orders) you may have. Your card details will be kept secure and will not be shared with shop owners. You will always be notified when you are charged. By checking the box for a shop, you are agreeing to authorise that shop to send instructions to the financial institution that issued your card to take payments in accordance with the terms of any subscription you create with that shop.
saved_cards_popover: This is the list of cards you have opted to save for later use. Your 'default' will be selected automatically when you checkout an order, and can be charged by any shops you have allowed to do so (see right).
authorised_shops:
shop_name: "Shop Name"
allow_charges?: "Allow Charges?"
allow_charges?: "Allow Charges to Default Card?"
localized_number:
invalid_format: has an invalid format. Please enter a number.
api:

Some files were not shown because too many files have changed in this diff Show More