Compare commits

...

354 Commits

Author SHA1 Message Date
Luis Ramos
6f819bd13e Merge pull request #5804 from luisramos0/oc_inv_bug_313
Apply PR #5775 to branch v3.1.2 to make v3.1.3 patch
2020-07-22 16:00:40 +01:00
Luis Ramos
d1b21b490a Add spec to cover SQL query issue with OCs where the only products from the coordinator inventory are renderer 2020-07-22 15:57:49 +01:00
Luis Ramos
6a74ea304c Remove unnecessary order statement, the relation will only be used for counting products 2020-07-22 15:57:49 +01:00
Luis Ramos
d4cfa0463f Move select out of scope visible_for because it is breaking exchange_product queries and it's just not needed there. The only other use of this product's scope visible_for is the enterprise serializer so we add the select to it. 2020-07-22 15:57:49 +01:00
Luis Ramos
0fe9d2ac09 Make OC advanced settings work by permitting the extra parameter 2020-07-22 15:57:49 +01:00
Luis Ramos
3d94ce39dd Merge pull request #5793 from luisramos0/payment_fees
Make charges update method update the first pending payment
2020-07-20 21:36:19 +01:00
Luis Ramos
21227d7482 Make charges update method update the first pending payment
Updating the first overall payment could select a failed payment and ignore the pending payment that is about to be processed
2020-07-20 18:23:06 +01:00
Luis Ramos
62a3b6b720 Merge pull request #5406 from kristinalim/fix/5300-optimistic_locking_in_stock_items
5300 Avoid race conditions in Spree::StockItem
2020-07-17 22:24:59 +01:00
Luis Ramos
152e432f78 Merge pull request #5749 from mbudm/issue/1253
Ensure the hero image doesn't pixelate on hamburger menu open
2020-07-17 22:15:46 +01:00
Pau Pérez Fabregat
89906f581d Merge pull request #5778 from openfoodfoundation/transifex
Transifex
2020-07-17 18:37:22 +02:00
Maikel
ea1e23abab Merge pull request #5756 from mkllnk/broken-spec
Make broken spec fail reliably and set it pending
2020-07-17 09:56:56 +10:00
Maikel Linke
b0ac188430 Make broken spec fail reliably and set it pending
This spec has been broken for a long time, at least eight months. But it
regularly passed because the search filter is applied with a delay and
in that time the content matches. And once the filter is applied, no
products are shown and the negative matchers pass.
2020-07-17 09:28:17 +10:00
Transifex-Openfoodnetwork
f31a1ff59c Updating translations for config/locales/en_GB.yml 2020-07-17 04:10:57 +10:00
Luis Ramos
2fe37b5237 Update all locales with the latest Transifex translations 2020-07-16 18:07:40 +01:00
Luis Ramos
981f1c0932 Merge pull request #5754 from openfoodfoundation/transifex
Transifex
2020-07-16 18:06:17 +01:00
Maikel
4e3502cce7 Merge pull request #5766 from mkllnk/5764-fix-pin-payments
5764 Provide credit card brand to Pin Payments
2020-07-16 10:28:18 +10:00
Matt-Yorkley
19b3041e1d Merge pull request #5768 from Matt-Yorkley/pin-payments-params
Update StrongParams for Pin Payments
2020-07-16 00:01:34 +02:00
Pau Perez
4e00c45782 Doc defensive coding needed by pin payments
[skip ci]
2020-07-15 16:46:09 +02:00
Luis Ramos
31e072179b Make method a little simple by extracting method 2020-07-15 15:23:16 +01:00
Luis Ramos
57fd1bdee2 Merge pull request #5744 from openfoodfoundation/dependabot/bundler/i18n-js-3.7.1
Bump i18n-js from 3.7.0 to 3.7.1
2020-07-15 15:04:55 +01:00
Matt-Yorkley
c009fed6be Update StrongParams for Pin Payments 2020-07-15 14:00:19 +02:00
dependabot-preview[bot]
5fae2c08c8 Bump i18n-js from 3.7.0 to 3.7.1
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.7.0...v3.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-15 08:13:42 +00:00
Pau Pérez Fabregat
d4fea5223d Merge pull request #5762 from openfoodfoundation/dependabot/bundler/oj-3.10.7
Bump oj from 3.10.6 to 3.10.7
2020-07-15 10:13:19 +02:00
Maikel Linke
25155cab18 Provide credit card brand to Pin Payments
Spree replaced the Ruby code providing the credit card brand with a
jquery plugin providing it on the checkout screen.

I re-added Ruby code because it's easier and more robust than updating
the user interface with new Javascript.
2020-07-15 17:13:46 +10:00
Steve Roberts
dbc7632c4e Add inline comment to explain two height properties 2020-07-15 09:52:04 +10:00
Steve Roberts
c4d7899a99 Use vh units for new browsers and align tagline bg to top. 2020-07-14 19:26:12 +10:00
Transifex-Openfoodnetwork
f79269e96b Updating translations for config/locales/ca.yml 2020-07-14 17:46:12 +10:00
Steve Roberts
60870a1215 Fix linting errors 2020-07-14 12:58:48 +10:00
Steve Roberts
63a080266e Merge branch 'master' of https://github.com/openfoodfoundation/openfoodnetwork into issue/1253 2020-07-14 12:45:14 +10:00
dependabot-preview[bot]
f4cb14ab1a Bump oj from 3.10.6 to 3.10.7
Bumps [oj](https://github.com/ohler55/oj) from 3.10.6 to 3.10.7.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.10.6...v3.10.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-14 00:10:40 +00:00
Luis Ramos
9c8318d828 Merge pull request #5613 from luisramos0/calculators
Move all Calculators from spree to OFN and out of the Spree namespace
2020-07-13 15:16:15 +01:00
Luis Ramos
d536cc8108 Merge pull request #5755 from Matt-Yorkley/groups-images
Fix StrongParameters for groups images
2020-07-13 14:50:24 +01:00
Matt-Yorkley
f450c21308 Merge pull request #5759 from luisramos0/vo_spec
Comment very flaky spec
2020-07-10 21:44:03 +02:00
Luis Ramos
eb4d648a23 Comment this very flaky spec for now 2020-07-10 19:27:31 +01:00
Transifex-Openfoodnetwork
50427472c4 Updating translations for config/locales/en_NZ.yml 2020-07-10 20:25:20 +10:00
Maikel
c1d700196b Merge pull request #5739 from Matt-Yorkley/flaky-spec-complex-oc
Flaky spec order_cycles/complex_updating_specific_time
2020-07-10 14:59:59 +10:00
Luis Ramos
cc3361aaac Merge pull request #5659 from dmarcoux/issue-5555
Filter orders on inclusive dates in admin/orders
2020-07-09 20:40:45 +01:00
Luis Ramos
ed915006fa Merge pull request #5738 from openfoodfoundation/dependabot/bundler/wicked_pdf-2.1.0
Bump wicked_pdf from 1.4.0 to 2.1.0
2020-07-09 20:40:11 +01:00
Matt-Yorkley
1a132924d2 Fix StrongParameters for groups images 2020-07-09 10:00:02 +02:00
Transifex-Openfoodnetwork
e3980521ea Updating translations for config/locales/fr_CA.yml 2020-07-09 07:58:41 +10:00
Transifex-Openfoodnetwork
e6a2eb8af9 Updating translations for config/locales/en_CA.yml 2020-07-09 07:53:34 +10:00
Luis Ramos
fabddbd1c0 Merge pull request #5746 from coopdevs/remove-specs-dead-code
Remove dead specs helper method
2020-07-08 12:38:24 +01:00
Steve Roberts
2f562809c0 Ensure the hero image doesn't attempt to use the full height of all page content
Not sure exactly why this happens, but when the mobile nav is opened the hero image at #tagline:before uses the height of the full window - often around 4000px. Adding max-height of 100% to the nearest safe parent prevents this behaviour.
2020-07-08 21:31:52 +10:00
Matt-Yorkley
a763a5ee0b Update all locales with the latest Transifex translations 2020-07-08 12:49:20 +02:00
Matt-Yorkley
d718eb9a23 Merge pull request #5726 from openfoodfoundation/transifex
Transifex
2020-07-08 12:33:09 +02:00
Matt-Yorkley
d78db16abe Merge pull request #5718 from Matt-Yorkley/available-locales-bug
Available locales bug
2020-07-08 12:30:18 +02:00
Matt-Yorkley
e742069959 Refactor UI interactions for opening exchange product tabs in OC edit 2020-07-08 11:11:39 +02:00
Matt-Yorkley
c8254b8338 Adjust exchange_row assertion to use slightly more specific criteria 2020-07-08 11:11:39 +02:00
Matt-Yorkley
be1e39f0cb Ensure next page has loaded before interacting with form elements 2020-07-08 11:11:39 +02:00
Pau Perez
a1e8c8ad03 Remove dead specs helper method
I found it while reviewing
https://github.com/openfoodfoundation/openfoodnetwork/pull/5718#discussion_r451390809.
2020-07-08 10:59:13 +02:00
Luis Ramos
312e78ba61 Merge pull request #5742 from Matt-Yorkley/flaky-spec-shopping
Fix flaky shopping_spec
2020-07-07 18:11:00 +01:00
Luis Ramos
207c6bc205 Merge pull request #5741 from Matt-Yorkley/flaky-spec-exchange-renderer
Re-enable and fix flaky exchange products renderer spec
2020-07-07 18:09:02 +01:00
Luis Ramos
f8f7b30095 Merge pull request #5716 from openfoodfoundation/dependabot/bundler/database_cleaner-1.8.5
Bump database_cleaner from 1.7.0 to 1.8.5
2020-07-07 17:29:10 +01:00
Luis Ramos
ebc1ab4469 Merge pull request #5710 from openfoodfoundation/dependabot/bundler/mini_racer-0.2.15
Bump mini_racer from 0.2.14 to 0.2.15
2020-07-07 17:28:33 +01:00
Luis Ramos
5e6739c9f7 Fix long lines in new spec 2020-07-07 17:26:24 +01:00
Luis Ramos
99e12b6f07 Convert calculators in new spec 2020-07-07 17:26:24 +01:00
Luis Ramos
0b79e7c48c Fix rubucop issue in enterprise_fee model 2020-07-07 17:26:24 +01:00
Luis Ramos
d92f97716a Extract compute_for and thus resolve the rubocop complexity issue 2020-07-07 17:26:24 +01:00
Luis Ramos
68359d4d1a Remove unnecessary variable (this sum and += come from the original
spree code and is not necessary here now)
2020-07-07 17:26:24 +01:00
Luis Ramos
70432e301d Early exit if max is zero to make method shorted 2020-07-07 17:26:24 +01:00
Luis Ramos
fbe0a3246d Extract applicable_rate? and thus resolve rubocop complexity issue 2020-07-07 17:26:24 +01:00
Luis Ramos
b096717172 Extract per_order_fees_total out of compute_order 2020-07-07 17:26:24 +01:00
Luis Ramos
21120dd6ab Extract per_item_fees_total out of compute_order 2020-07-07 17:26:24 +01:00
Luis Ramos
4b12a5f592 Extract line_items_total from compute_order 2020-07-07 17:26:24 +01:00
Luis Ramos
eedf31e449 Make migration a bit easier to read 2020-07-07 17:26:24 +01:00
Luis Ramos
e225c5ce3a Migrate calculators to outside spree namespace 2020-07-07 17:26:24 +01:00
Luis Ramos
f62546254f Define DefaultTax calculator outside of spree namespace the tax_rate to be used by the app and make spree specs use calculators outside the spree namespace 2020-07-07 17:26:24 +01:00
Luis Ramos
6a94168ee5 Remove Spree namespace from DefaultTax 2020-07-07 17:26:24 +01:00
Luis Ramos
9c7cb23262 Move calculator specs out of the spree namespace 2020-07-07 17:26:24 +01:00
Luis Ramos
5e8438c446 Move all calculators outside the spree namespace 2020-07-07 17:26:23 +01:00
Luis Ramos
9c3eb3725e Remove dead code related to promotions, we dont have promotions in OFN 2020-07-07 17:20:22 +01:00
Luis Ramos
a544102b1b Fix some rubocop issues 2020-07-07 17:20:22 +01:00
Luis Ramos
f2a46d2cef Merge decorators into original classes brought from spree_core 2020-07-07 17:20:22 +01:00
Luis Ramos
6b04df0dea Fix indentation and extract Calculator as a separate module declaration 2020-07-07 17:20:22 +01:00
Luis Ramos
c2898ba389 Bring calculators from spree_core 2020-07-07 17:20:22 +01:00
Transifex-Openfoodnetwork
6be0ae543a Updating translations for config/locales/pt_BR.yml 2020-07-07 21:46:44 +10:00
Matt-Yorkley
f2e0b0f35a Ensure products list has loaded before interacting with product list UI elements 2020-07-07 13:14:11 +02:00
Matt-Yorkley
0f659d0f5e Merge pull request #5728 from luisramos0/ams_comment
Update ams dependency comment
2020-07-07 12:32:03 +02:00
Matt-Yorkley
30492157f9 Re-enable and fix flaky exchange products renderer spec
For some inexplicable reason `order_cycle.exchanges.incoming.first` and `order_cycle.exchanges.incoming.second` were returning the same exchange. Subsequently the inventory items being created were for the same variant, which throws an error due to a uniqueness validation in InventoryItem on variant_id. Changing from #first and #second to #first and #last results in the correct exchanges being assigned.
2020-07-07 11:21:18 +02:00
Luis Ramos
c1fa4fcc85 Merge pull request #5736 from Matt-Yorkley/flaky-spec-embedded
Fix flaky embedded shopping spec
2020-07-07 09:36:27 +01:00
dependabot-preview[bot]
4bee038109 Bump wicked_pdf from 1.4.0 to 2.1.0
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 1.4.0 to 2.1.0.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/compare/1.4.0...2.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-06 23:50:22 +00:00
Matt-Yorkley
447a873e5c Fix flaky embedded spec
The new cart sidebar takes 300ms to animate in. If we try to click the button on the left during this time, we may click the button on the right as it slides in.
2020-07-07 00:23:43 +02:00
Matt-Yorkley
3d955a952c Merge pull request #5674 from mkllnk/caching_spec
Fix flaky caching spec
2020-07-06 21:56:02 +02:00
Luis Ramos
ce1114556d Merge pull request #5578 from mbudm/issue/3770-manual-update
Update orders swagger spec and fix api_key access to orders endpoint
2020-07-06 20:32:25 +01:00
Luis Ramos
761871c90e Merge pull request #5715 from luisramos0/ship_method
Fix issue in Spree 2.1 and bring Spree::Stock classes to OFN 🎉
2020-07-06 19:15:50 +01:00
Transifex-Openfoodnetwork
2a68e0fbba Updating translations for config/locales/tr.yml 2020-07-07 03:55:56 +10:00
Luis Ramos
ceac8a5d40 Merge pull request #5725 from Matt-Yorkley/admin-order-images
Fix default image display in admin order edit
2020-07-06 14:03:56 +01:00
Luis Ramos
b0dd83b773 Update ams dependency comment 2020-07-05 19:55:53 +01:00
Dany Marcoux
3dfabdc117 Filter orders on inclusive dates in admin/orders
Closes #5555

Co-authored-by: Luis Ramos <luisramos0@gmail.com>
2020-07-05 20:12:16 +02:00
Transifex-Openfoodnetwork
b951bcc379 Updating translations for config/locales/en_IN.yml 2020-07-05 04:34:29 +10:00
Transifex-Openfoodnetwork
6f6e8c0c92 Updating translations for config/locales/en_IN.yml 2020-07-05 04:29:50 +10:00
Transifex-Openfoodnetwork
787648eff2 Updating translations for config/locales/en_FR.yml 2020-07-04 23:52:01 +10:00
Transifex-Openfoodnetwork
7a4a673578 Updating translations for config/locales/fr.yml 2020-07-04 23:51:45 +10:00
Matt-Yorkley
96138e9129 Refactor UserLocaleSetter public methods 2020-07-04 10:15:35 +02:00
Matt-Yorkley
f08a530877 Make #valid_locale_for_user an instance method 2020-07-04 09:51:00 +02:00
Luis Ramos
d2adcd20e5 Merge pull request #5719 from coopdevs/index-state-changes
Index spree_state_changes.stateful_id column
2020-07-03 23:02:01 +01:00
Luis Ramos
ff9133b7aa Merge pull request #5699 from coopdevs/fix-order-button-radius
Make button border radius consistent
2020-07-03 23:01:14 +01:00
Luis Ramos
b917238d1e Merge pull request #5446 from luisramos0/sca_refunds
Make StripeSCA void action work
2020-07-03 22:45:35 +01:00
Transifex-Openfoodnetwork
45b960a7ee Updating translations for config/locales/pt_BR.yml 2020-07-04 07:39:50 +10:00
Matt-Yorkley
e2626a0c3b Add unit tests for UserLocaleSetter service 2020-07-03 23:14:38 +02:00
Matt-Yorkley
46c40bdf33 Fix default image display in admin order edit 2020-07-03 22:58:29 +02:00
Luis Ramos
a472b6525f Merge pull request #5707 from luisramos0/missing_spaces
Add space after translations so that translators dont have to guess a space is needed
2020-07-03 16:10:55 +01:00
Matt-Yorkley
05c1f093b2 Delete dead code
There's nothing done in this bit of code that isn't already done somewhere else, and more effectively.
2020-07-03 16:44:37 +02:00
Matt-Yorkley
0c2fd4bfd2 Fix ensure_valid_locale_persisted and change public interface of service 2020-07-03 16:39:24 +02:00
Matt-Yorkley
cc7b5e2df3 Add pending test for setting locale from cookies during login
This test currently fails
2020-07-03 16:39:23 +02:00
Luis Ramos
804450bcc5 Fix buggy spec
The different shipping method was in the page but only as an option in the dropdown, not as the final selected shipping method! That was the cause of bug #5694. We now check for the label Shipping which preceeds the final shipping method selection in the order page
2020-07-03 15:35:13 +01:00
Luis Ramos
b883a0eb75 Fix easy rubocop issues in shipment_spec 2020-07-03 13:48:12 +01:00
Luis Ramos
7b89b52ab8 Transpec shipment_spec brough from spree_core 2020-07-03 13:48:12 +01:00
Luis Ramos
07a44cfaf3 Update selected shipping rate if there is an original shipping method to keep and it is different from the one selected through the Estimator process
Make sure the shipment is saved (callbacks!) whenever the ship method has changed in the refresh_rates process
2020-07-03 13:48:12 +01:00
Luis Ramos
cd60ee2116 Use flat_map to make ship methods selection faster 2020-07-03 13:48:08 +01:00
Matt-Yorkley
ab63d2234c Guard against nils in conditions 2020-07-03 14:22:32 +02:00
Matt-Yorkley
078726dcca Add explanatory comment on saving selected locale in cookies 2020-07-03 14:21:45 +02:00
Matt-Yorkley
dab0add492 Make conditional more concise 2020-07-03 14:20:51 +02:00
Matt-Yorkley
ebffa381c6 Update cookies[:locale] logic 2020-07-03 14:06:05 +02:00
Matt-Yorkley
faa7c0a7c5 Extract save_cookies_from_locale comment-method 2020-07-03 14:03:52 +02:00
Matt-Yorkley
02549d1b0f Extract all locale-setting logic to a service 2020-07-03 13:44:13 +02:00
Matt-Yorkley
7a00a3ba1e Rename method and add explanatory comment 2020-07-03 11:52:21 +02:00
Matt-Yorkley
c726340ba3 Extract #save_locale_from_params comment-method 2020-07-03 11:48:39 +02:00
Luis Ramos
fcaa9d1b37 Remove extra space from base translations in closing and welcome to 2020-07-03 10:32:09 +01:00
Matt-Yorkley
d2db9b3a66 Merge pull request #5599 from luisramos0/submit_on_enteer
Make Enter submit the form on both products and orders admin
2020-07-03 11:14:57 +02:00
Luis Ramos
91026e6606 Merge pull request #5601 from jeduardo824/enhancement/5454-links-to-shops-in-new-tabs
Enhancement/5454 make links to shops under Groups > Producers open in new tab
2020-07-02 23:51:59 +01:00
Luis Ramos
d9ab7a8d49 Merge pull request #5667 from mkllnk/shopping-spec
Stabilise shopping specs and open them for change
2020-07-02 23:51:25 +01:00
Luis Ramos
758bb17142 Fix some easy rubocop issues and add some exceptions to to manual todo list 2020-07-02 21:24:15 +01:00
Luis Ramos
659de3d24d Replay spree commit a4622ee13a723f0dba2943967b445b9989f67fb2 to fix issue introduced in spree 2.1 2020-07-02 21:24:15 +01:00
Luis Ramos
21ec6ccf0d Remove unused sort packages from prioritizer 2020-07-02 21:24:15 +01:00
Luis Ramos
d323c5bdcb Simplify packer and coordinator baed on the fact that there's only one stock_location so there will only be one package per order 2020-07-02 21:24:15 +01:00
Luis Ramos
ff046f7a6c Remove conditionals related to Config.track_inventory_levels, this config is always true in OFN 2020-07-02 21:24:14 +01:00
Luis Ramos
ee937988e8 Fix easy rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
ee66e37521 Move adjuster, estimator, packer and prioritizer to order management engine 2020-07-02 21:24:14 +01:00
Luis Ramos
83974a832c Move Coordinator from Spree::Stock to OrderManagement::Stock 2020-07-02 21:24:14 +01:00
Luis Ramos
01b1abbd52 Bring method from Spree::Order so that we can move Coordiantor to the order management engine 2020-07-02 21:24:14 +01:00
Luis Ramos
b487185a65 Remove package factory, it is no longer needed, we can just call the Package class in the two places where it is used 2020-07-02 21:24:14 +01:00
Luis Ramos
f0b3ed0d79 Merge Spree::Stock::Package into OrderManagement::Stock::Package 2020-07-02 21:24:14 +01:00
Luis Ramos
943cb7bf05 Move Stock::Package to OrderManagement::Stock::Package 2020-07-02 21:24:14 +01:00
Luis Ramos
1b28592f58 Now that the stock code is on out side we can clean up!
Remove everything related to splitters (including bringing environment.rb so we remove the splitters variable from it
2020-07-02 21:24:14 +01:00
Luis Ramos
8e116dd58a Make ensure_correct_adjustment a public method because we call it in OFN 2020-07-02 21:24:14 +01:00
Luis Ramos
46cf106047 Fix shipment spec brought from spree 2020-07-02 21:24:14 +01:00
Luis Ramos
2e33e02d7f Remove dead code, this method was removed in spree 2.0.4 2020-07-02 21:24:14 +01:00
Luis Ramos
7a03f57da0 Merge shipment decorator with class brought from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
494251b7cf Fix simple rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
4e5259f491 Bring shipment from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
55a4021157 Convert to modern rspec syntax 2020-07-02 21:24:14 +01:00
Luis Ramos
bdb40d68e9 Fix easy rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
b7255130b6 Bring Package from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
0ca8b6aab6 Fix easy rubocop issue 2020-07-02 21:24:14 +01:00
Luis Ramos
3e14c9777e Merge decorator with class brought from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
d505fc2131 Bring availability validator from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
720ad9de0e Convert specs to modern rsspec syntax 2020-07-02 21:24:14 +01:00
Luis Ramos
feadbb086f Adapt spec to OFN context 2020-07-02 21:24:14 +01:00
Luis Ramos
b16db2f40e Fix easy rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
8c3b8c4db5 Bring estimator from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
4711a7469a Adapt coordinator spec to ofn and remove spec that is not applicable (multi stock locations) 2020-07-02 21:24:14 +01:00
Luis Ramos
69b9cfbad2 Make packer use BasicSplitter by default 2020-07-02 21:24:14 +01:00
Luis Ramos
fdc085f701 Convert to modern rspec and remove specs not applicable to ofn 2020-07-02 21:24:14 +01:00
Luis Ramos
ccf928df12 Fix simple rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
e0f9894b7a Bring packer from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
ec50a788a6 Fix easy rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
c2ec34ab9f Bring coordinator from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
a6d7acb6f1 Convert spec to modern rspec syntax 2020-07-02 21:24:14 +01:00
Luis Ramos
eb13595fd3 Fix simple rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
3ae2877d4e Bring adjuster and prioritizer from spree_core 2020-07-02 21:24:14 +01:00
Luis Ramos
d18fec7125 Move Base splitter from main app models to order management engine services 2020-07-02 21:24:14 +01:00
Luis Ramos
735ee1e7ed Fix simple rubocop issues 2020-07-02 21:24:14 +01:00
Luis Ramos
4fce506201 Bring splitter/base from spree 2020-07-02 21:24:14 +01:00
Luis Ramos
658c77f3f5 Merge pull request #5701 from Matt-Yorkley/noimage
Noimage
2020-07-02 20:17:04 +01:00
Luis Ramos
510449547f Merge pull request #5644 from coopdevs/manage-font-with-asset-pipeline
Manage OFN's font through the asset pipeline
2020-07-02 20:09:08 +01:00
Matt-Yorkley
8fc407a9d5 Extract repeated variant thumbnail code to a shared partial 2020-07-02 18:36:43 +02:00
Matt-Yorkley
eeb6c57f99 Update missing image paths in other order views 2020-07-02 18:36:27 +02:00
Matt-Yorkley
b10fd99a53 Update all locales with the latest Transifex translations 2020-07-02 16:46:53 +02:00
Matt-Yorkley
e328dc7657 Merge pull request #5717 from openfoodfoundation/transifex
Transifex
2020-07-02 16:43:58 +02:00
Pau Perez
dee61e8b82 Index spree_state_changes.stateful_id column
This speeds up a great deal one of the most awful queries our DB servers
execute. It's not rare to see traces above 20s in Datadog 😱.

In staging, with no traffic, we go from

```
EXPLAIN ANALYZE SELECT COUNT ( * )
FROM spree_state_changes
WHERE spree_state_changes . stateful_id = 2024
  AND spree_state_changes . stateful_type = 'Spree::Order';

Planning time: 0.142 ms
Execution time: 9.073 ms
```

to

```
EXPLAIN ANALYZE SELECT COUNT ( * )
FROM spree_state_changes
WHERE spree_state_changes . stateful_id = 2024
  AND spree_state_changes . stateful_type = 'Spree::Order';

Planning time: 0.284 ms
Execution time: 0.202 ms
```
2020-07-02 15:39:08 +02:00
Matt-Yorkley
4e08d2049f Ensure a valid locale is persisted during login
This action has to be performed here and not in I18nHelper, as spree_current_user is not initialized yet during the other checks / setting the selected locale value in the app
2020-07-02 15:33:19 +02:00
Matt-Yorkley
91880cdbec Make I18nHelper #available_locale? method public 2020-07-02 14:35:59 +02:00
Matt-Yorkley
d70d61439a Always return an available locale 2020-07-02 14:35:59 +02:00
Matt-Yorkley
aa6f4d4fb9 Don't set unavailable locales on the current user 2020-07-02 14:35:59 +02:00
Matt-Yorkley
8dfaea629b Refactor current_user_locale to a new method 2020-07-02 14:35:59 +02:00
Matt-Yorkley
3326366c6e Add specs for applying stored locales during login 2020-07-02 14:35:58 +02:00
dependabot-preview[bot]
cc34f126ec Bump mini_racer from 0.2.14 to 0.2.15
Bumps [mini_racer](https://github.com/discourse/mini_racer) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/discourse/mini_racer/releases)
- [Changelog](https://github.com/rubyjs/mini_racer/blob/master/CHANGELOG)
- [Commits](https://github.com/discourse/mini_racer/compare/v0.2.14...v0.2.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-02 11:22:57 +00:00
Pau Pérez Fabregat
4ced16c206 Merge pull request #5709 from luisramos0/empty
Replace empty? with blank? and replace unless empty? with if present?
2020-07-02 11:36:37 +02:00
Transifex-Openfoodnetwork
1b8669bb0b Updating translations for config/locales/en_NZ.yml 2020-07-02 18:28:33 +10:00
Pau Pérez Fabregat
c1b635903c Merge pull request #5658 from openfoodfoundation/transifex
Transifex
2020-07-02 10:05:16 +02:00
dependabot-preview[bot]
eff9d6edd0 Bump database_cleaner from 1.7.0 to 1.8.5
Bumps [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) from 1.7.0 to 1.8.5.
- [Release notes](https://github.com/DatabaseCleaner/database_cleaner/releases)
- [Changelog](https://github.com/DatabaseCleaner/database_cleaner/blob/master/History.rdoc)
- [Commits](https://github.com/DatabaseCleaner/database_cleaner/compare/v1.7.0...v1.8.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-02 00:06:17 +00:00
Luis Ramos
7dcc2bb27c Merge pull request #5703 from Matt-Yorkley/checkout-addresses
Checkout addresses
2020-07-01 19:06:29 +01:00
Luis Ramos
e8417b8be6 Remove specs testing filtering of master variants
Master variants are not used in the report
2020-07-01 18:13:30 +01:00
Luis Ramos
6555f8bfba Add specs to cover stripeSCA refunds
Duplication between stripe connect and stripeSCA is done on purpose so we can easily delete stripeConnect code when the migration is done
2020-07-01 18:13:27 +01:00
Pau Pérez Fabregat
66ddde1808 Merge pull request #5682 from Matt-Yorkley/in-digest-ion
Move default versions of Paperclip-managed images to /public
2020-07-01 18:02:15 +02:00
Pau Pérez Fabregat
28376b1056 Merge pull request #5561 from coopdevs/defend-from-invoice-without-bill-address
Do not print the bill addr. name when there's none
2020-07-01 17:50:09 +02:00
Luis Ramos
2d4326ded3 Replace empty? with blank? which is equivalent but a bit more resilient, returns false for nil
Present is not blank, so unless blank? becomes if present?
2020-07-01 14:08:07 +01:00
Luis Ramos
ce493866f9 Extract refunds specs from payments controller spec 2020-07-01 13:19:38 +01:00
Luis Ramos
ecb1920fa9 Move payment_controller_spec to specific folder so we can break it in more specific parts 2020-07-01 13:14:39 +01:00
Luis Ramos
9e4a793b24 Fix rubocop issues 2020-07-01 13:14:39 +01:00
Luis Ramos
2179cc7faf Make StripeSCA void action make a refund instead
StripeSCA does not support voiding confirmed payment intents so we need to make a refund instead
2020-07-01 13:10:56 +01:00
Luis Ramos
63934b7863 Add space after translation so that translators dont have to guess a space is needed after the translation 2020-07-01 11:56:37 +01:00
Pau Pérez Fabregat
819af03239 Merge pull request #5706 from luisramos0/ent
Fix admin enterprises controller spec
2020-07-01 12:28:19 +02:00
Pau Pérez Fabregat
5a72526107 Merge pull request #5692 from luisramos0/taxonomies
Fix taxonomies flaky spec
2020-07-01 12:26:56 +02:00
Pau Perez
8c371fd0d1 Do not print bill addr. in invoice2 either 2020-07-01 11:27:57 +02:00
Matt-Yorkley
49fb01a3bb Add assign default value of current time whilst altering NOT NULL constraint
This argument in #change_column_null assigns this value where any NULL values are found, but it doesn't alter the table's `:default` value
2020-07-01 10:00:21 +02:00
Luis Ramos
2dce10bec2 Fix admin enterprises controller spec, for some reason the correct controller is not being picked up in the test 2020-06-30 10:49:45 +01:00
Matt-Yorkley
11da385624 Enable pending checkout spec 2020-06-30 11:30:16 +02:00
Matt-Yorkley
3e7f5a4ea9 Update user address tests
I considered deleting these tests, as they're not very good and are testing Rails functionality. I decided to leave them in case something explodes in a future upgrade. For reference: there are issues in Rails 4 when using `object.clone.attributes`, and with assigning a hash containing `created_at` and `updated_at` values with `object.update(attributes_hash)`.
2020-06-30 11:30:16 +02:00
Matt-Yorkley
87cd936c94 Blacklist timestamp attributes when assigning for update
Doing #clone or #dup of an object's attributes then passing it to an #update/#update_attributes call means we are manually passing values for created_at and updated_at, which can cause problems, especially if the object being duped hasn't been persisted yet: in this case we would be manually attempting to save timestamps with nil values, which is not a good idea. Here they are blacklisted from the attributes hash.
2020-06-30 11:30:16 +02:00
Matt-Yorkley
ce8908f53b Use #dup when copying attributes hash
In Rails 4, #clone behaves differently. The attributes hash of the cloned object is shared with the original, it's not a separate object! https://github.com/rails/rails/blob/4-0-stable/activerecord/lib/active_record/core.rb#L217-L220
2020-06-30 11:30:16 +02:00
Matt-Yorkley
abe96c6f32 Add specs for updating existing default addresses during checkout
These specs fail with the "NULL values for created_at / updated_at" errors we've been seeing.
2020-06-30 11:30:14 +02:00
Pau Pérez Fabregat
e69d3e5e0c Merge pull request #5693 from luisramos0/knapsack
Reload knapsack report
2020-06-30 09:43:36 +02:00
Pau Pérez Fabregat
2a1fe3f05f Merge pull request #5684 from openfoodfoundation/dependabot/bundler/ddtrace-0.37.0
Bump ddtrace from 0.36.0 to 0.37.0
2020-06-30 09:41:48 +02:00
Matt-Yorkley
57ba2481c4 Require timestamps 2020-06-30 09:09:35 +02:00
Pau Perez
0c93de8298 Manage OFN's font through the asset pipeline 2020-06-30 09:02:36 +02:00
Pau Perez
23178763b0 Do not print the bill addr. name when there's none
The error

```
ActionView::Template::Error: undefined method `full_name' for nil:NilClass
```

happens a few times a day and raises exceptions we don't pay attention to.
They add unnecessary noise that hides other more relevant issues.

This, however, is a symptom of a deeper data integrity problem that needs
solving at some point. This is just a countermeasure.
2020-06-30 08:46:01 +02:00
Luis Ramos
de8b97b2e1 Merge pull request #5526 from cillian/drop-blockenspiel
Drop blockenspiel
2020-06-29 20:09:26 +01:00
Matt-Yorkley
be0131b94c Merge pull request #5645 from coopdevs/fix-scss-deprecation-warning
Rename *.css.scss to *.scss
2020-06-29 20:36:42 +02:00
Matt-Yorkley
bd0e4c75c4 Merge pull request #5636 from fatihorhan/make-user-guide-links-consistent
Update Sell page to use User Guide links from configuration
2020-06-29 20:33:00 +02:00
Matt-Yorkley
b441ac2644 Update paths to "noimage" images 2020-06-29 20:07:08 +02:00
Matt-Yorkley
5bec887f93 Move /assets/images/noimage/* to /public/noimage/* 2020-06-29 19:58:38 +02:00
Cillian O'Ruanaidh
a9664e103d Merge latest :master into :drop-blockenspiel branch and resolve conflicts related to Rubocop fixes. 2020-06-29 18:11:08 +01:00
Pau Perez
c892f9c69b Make button border radius consistent 2020-06-29 12:01:59 +02:00
Transifex-Openfoodnetwork
bb80c81097 Updating translations for config/locales/en_US.yml 2020-06-29 05:22:13 +10:00
Luis Ramos
6516037420 Reload knapsack report 2020-06-27 20:36:33 +01:00
Luis Ramos
10b8c2b789 Relax the assertion and dont check row number so that it passes even if order of elements is not the same 2020-06-27 15:54:58 +01:00
Matt-Yorkley
b325e48957 Update content config spec to use new default image paths 2020-06-27 10:32:38 +02:00
Matt-Yorkley
a5f541b59d Update admin logo path 2020-06-27 08:53:05 +02:00
Matt-Yorkley
ff8cb43717 Move default versions of Paperclip-managed images to /public
Image paths for these files are handled by Paperclip, which (with our current version) does not handle fingerprints on assets. Therefore we need to make these images available under /public
2020-06-27 08:45:59 +02:00
dependabot-preview[bot]
032a70fa7e Bump ddtrace from 0.36.0 to 0.37.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.36.0 to 0.37.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.36.0...v0.37.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-26 19:16:32 +00:00
Transifex-Openfoodnetwork
4f2d32b262 Updating translations for config/locales/tr.yml 2020-06-27 04:22:14 +10:00
Luis Ramos
5e3d7be545 Merge pull request #5630 from openfoodfoundation/dependabot/bundler/ransack-1.8.10
Bump ransack from 1.2.3 to 1.8.10
2020-06-26 13:37:03 +01:00
Transifex-Openfoodnetwork
0d5ad6fac3 Updating translations for config/locales/en_IE.yml 2020-06-26 21:04:54 +10:00
Transifex-Openfoodnetwork
a1227d93ae Updating translations for config/locales/en_GB.yml 2020-06-26 20:27:34 +10:00
Transifex-Openfoodnetwork
f47271ba98 Updating translations for config/locales/fr.yml 2020-06-26 16:59:37 +10:00
Transifex-Openfoodnetwork
1266bcde1b Updating translations for config/locales/en_FR.yml 2020-06-26 16:56:19 +10:00
Maikel Linke
e567348a69 Ensure that enough time passes for caching spec 2020-06-26 14:24:01 +10:00
Maikel Linke
4b25c2d49a Correct typo in file naming 2020-06-26 14:21:21 +10:00
Maikel Linke
d7c9bb2e5a Navigate more efficiently in spec
The spec is not supposed to test the navigation to the shop. Going
directly to the shop reduces the test execution time by 7%.
2020-06-26 09:55:57 +10:00
Maikel Linke
70347148a1 Stabilise shopping specs and open them for change
The way we add items to the cart will change. Encapsulating that code in
a common place will make the mobile ux work clearer and avoid merge
conflicts.

The waiting for background requests has also been improved and made more
consistent which should make these specs more reliable.
2020-06-26 09:55:57 +10:00
Maikel Linke
a0c7dc2ccb Remove leftover empty spec context 2020-06-26 09:55:57 +10:00
Luis Ramos
5929b9c1e5 Merge pull request #5627 from openfoodfoundation/dependabot/bundler/geocoder-1.6.3
[Security] Bump geocoder from 1.5.2 to 1.6.3
2020-06-25 20:34:19 +01:00
Luis Ramos
2ad2836ac6 Merge pull request #5563 from luchiago/fix-missing-closed-oc-info-i18n
add missing i18n key for closed OC
2020-06-25 20:33:55 +01:00
Luis Ramos
93a2e57bc6 Merge pull request #5538 from jeduardo824/bug/4592-payment-methods-table-in-dashboard
Fix Payment Methods table to show proper provider name
2020-06-25 20:32:04 +01:00
Luis Ramos
cb2ccf76d2 Merge pull request #5590 from rmklaus12/5558-shippingcategory-translation
Added translation key to config/locales/en.yml file for shipping_cat…
2020-06-25 20:31:48 +01:00
Luis Ramos
f44533bbd5 Merge pull request #5589 from rmklaus12/2617-mainmenu-translation
Added more key to en.yml to translate More dropdown text
2020-06-25 20:27:46 +01:00
Luis Ramos
bfc134c9e6 Merge pull request #5615 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-4.0.0
Bump acts-as-taggable-on from 3.5.0 to 4.0.0
2020-06-25 20:26:59 +01:00
Pau Pérez Fabregat
7338f196e9 Merge pull request #5663 from luisramos0/constraints
Make db timestamps nullable
2020-06-25 13:14:41 +02:00
Luis Ramos
68946a765e Make timestamps nullable 2020-06-25 08:47:18 +01:00
Transifex-Openfoodnetwork
0b48a53c2f Updating translations for config/locales/tr.yml 2020-06-25 16:02:01 +10:00
Transifex-Openfoodnetwork
54ce5d8c0f Updating translations for config/locales/en_CA.yml 2020-06-25 09:15:11 +10:00
Luis Ramos
ba50491c6d Restructure the spec a little 2020-06-24 16:16:58 +01:00
Luis Ramos
34207fc20f Bring changes to stock_item from spree 2.1, the previous version was from spree 2.0.4 2020-06-24 16:16:58 +01:00
Luis Ramos
e12e50aa84 Move rubocop exception to rubocop todo 2020-06-24 16:16:58 +01:00
Kristina Lim
20fd3c2642 Reset negative count on hand in existing non backorderable stock items 2020-06-24 16:16:58 +01:00
Kristina Lim
4694f1b21a Require count on hand in non backorderable StockItem to be positive or zero
Fix setting of count on hand in line item specs
2020-06-24 16:16:45 +01:00
Kristina Lim
e53913756c Add lock_version to Spree::StockItem 2020-06-24 16:15:37 +01:00
Kristina Lim
774b3720d5 Update stock item count on hand in Spree core specs 2020-06-24 16:15:09 +01:00
Kristina Lim
13ecf0ec73 Update specs for StockItem with transpec 2020-06-24 16:15:09 +01:00
Kristina Lim
fb20f220c0 Use break instead of return in StockItem#process_backorders
We are not using the return value of this method anywhere.
2020-06-24 16:15:09 +01:00
Kristina Lim
0a1cb71ee4 Ignore Rails/UniqueValidationWithoutIndex for unique index of StockItem#stock_location 2020-06-24 16:15:09 +01:00
Kristina Lim
bc530b92b5 Address violation of Rubocop Rails/Validation: 2020-06-24 16:15:09 +01:00
Kristina Lim
2acf61fd0f Address violation of Rubocop Rails/Delegate 2020-06-24 16:15:09 +01:00
Kristina Lim
1e8543dfe7 Address violation of Rubocop Rails/ReadWriteAttribute 2020-06-24 16:15:09 +01:00
Kristina Lim
22c0693beb Address violation of Rubocop Style/NumericPredicate 2020-06-24 16:15:09 +01:00
Kristina Lim
d1725014c4 Auto-correct violationso of Rubocop Layout/* 2020-06-24 16:15:09 +01:00
Kristina Lim
0fd66f9a55 Auto-correct violationso of Rubocop Style/* 2020-06-24 16:15:09 +01:00
Kristina Lim
b783118700 Auto-correct violationso of Rubocop Style/RedundantSelf 2020-06-24 16:15:09 +01:00
Kristina Lim
84d973d383 Specify RSpec.describe in StockItem spec file 2020-06-24 16:15:09 +01:00
Kristina Lim
0e711832fd Bring Spree::StockItem code from spree_core into the app 2020-06-24 16:15:09 +01:00
Transifex-Openfoodnetwork
8d4a9cba21 Updating translations for config/locales/nb.yml 2020-06-24 23:33:12 +10:00
Steve Roberts
3d2a0d4d67 Remove UI and API engine as we will not host the swagger spec right now 2020-06-24 15:51:08 +10:00
Steve Roberts
9541dbf495 Fix order api spec and add incomplete generated swagger.yml 2020-06-24 15:15:18 +10:00
Steve Roberts
b59dbebba6 Revert Gemfile change to specific version of rubocop
Turns out it wasn't necessary. I thought it was needed to install a compatible version of rswag
2020-06-24 13:21:49 +10:00
Steve Roberts
e619ae621c Add rswag and coverage for orders endpoint
Add coverage for core orders endpoint queries (WIP)
2020-06-24 13:21:49 +10:00
Steve Roberts
9e19d79337 Add more detail on the ransack based queries in the description 2020-06-24 13:21:49 +10:00
Steve Roberts
8b79d41b81 Update orders swagger spec and fix api_key access to orders endpoint 2020-06-24 13:21:49 +10:00
Luis Ramos
9e39d970ca Result of running db:migrate 2020-06-23 19:19:18 +01:00
Pau Pérez Fabregat
9e730e6445 Merge pull request #5660 from coopdevs/fix-spree-preferences
Migrate all spree pref. keys to the new format
2020-06-23 18:00:01 +02:00
Transifex-Openfoodnetwork
99096eee2d Updating translations for config/locales/ca.yml 2020-06-24 01:41:21 +10:00
Pau Perez
a81e17f23c Flush the cache
So all preferences are fetch from DB now that they have changed.
2020-06-23 17:23:22 +02:00
Pau Perez
190797717a Defend from the running the migration twice
We only migrate preferences if there are any to migrate.
2020-06-23 17:22:11 +02:00
Pau Perez
0ffa7b3734 Migrate all spree pref. keys to the new format
We realized in Spree v2.1 they follow this format instead and this is
what's causing issues to Katuma production.

This will remove the duplicate ones and convert the current preferences
to the new thus, keeping the values.
2020-06-23 16:21:20 +02:00
Transifex-Openfoodnetwork
923b905a9c Updating translations for config/locales/en_GB.yml 2020-06-23 22:30:53 +10:00
Pau Pérez Fabregat
973ea2ea2d Merge pull request #5641 from openfoodfoundation/transifex
Transifex
2020-06-23 10:43:26 +02:00
Pau Pérez Fabregat
3939febc2f Merge pull request #5653 from luisramos0/rubocop_refresher
Auto correct rubocop, refresh todo lists and fix some more rubocop issues
2020-06-23 10:25:59 +02:00
Luis Ramos
91fc0cd26f Adapt specs to new Ar method update that replaces update_attributes 2020-06-22 17:39:20 +01:00
Luis Ramos
f004b3d573 Fix rubocop issue 2020-06-22 17:39:20 +01:00
Luis Ramos
b49eef5fa9 Fix rubocop issue 2020-06-22 17:39:20 +01:00
Luis Ramos
1c550a594f Fix rubocop issue 2020-06-22 17:39:20 +01:00
Luis Ramos
0ba1642bd2 Fix rubocop issues 2020-06-22 17:39:20 +01:00
Luis Ramos
1e5975c6e2 Fix rubocop issues 2020-06-22 17:39:20 +01:00
Luis Ramos
aa14fd236c Fix rubocop issue 2020-06-22 17:39:20 +01:00
Luis Ramos
ab59ab45f5 Use auto correct to fix rubocop issues 2020-06-22 17:39:20 +01:00
Luis Ramos
f54abbd376 Fix rubocop issues 2020-06-22 17:39:20 +01:00
Luis Ramos
730959f85f Fix rubocop issue 2020-06-22 17:39:20 +01:00
Luis Ramos
8870dc4b06 Move rubocop exception to code 2020-06-22 17:39:20 +01:00
Luis Ramos
1b5f9f105a Fix block alignment 2020-06-22 17:39:20 +01:00
Luis Ramos
ed5fc29c44 Fix hash alignment issue 2020-06-22 17:39:20 +01:00
Luis Ramos
ff68303ef6 Fix long lines 2020-06-22 17:39:20 +01:00
Luis Ramos
0f2e07cc2d Fix long lines 2020-06-22 17:39:20 +01:00
Luis Ramos
0e3b5ad4c3 Revert rubocop auto correct because update! is a method in the adjustment model 2020-06-22 17:39:17 +01:00
Luis Ramos
41ff406e86 Fix rubocop issue by avoiding rails method name update_attributes 2020-06-22 16:51:46 +01:00
Luis Ramos
6a7ed6e0c9 Rebuild .rubocop_manual_todo.yml 2020-06-22 16:51:46 +01:00
Luis Ramos
4e9c21d525 Add new regenerated rubocop_todo 2020-06-22 16:51:46 +01:00
Luis Ramos
b879439d58 Use rubocop auto correct to fix Style/SafeNavigation issue 2020-06-22 16:51:46 +01:00
Luis Ramos
1b6e51c79e Fix rubocop issue 2020-06-22 16:51:46 +01:00
Luis Ramos
f848a89a00 Rename update_attributes to update #rails4 2020-06-22 16:51:43 +01:00
Luis Ramos
8a61257547 Rename all before_filter to before_action, it's the same function with a new name 2020-06-22 13:11:57 +01:00
Luis Ramos
46a1c1cf26 Fix rubocop issue 2020-06-22 13:08:54 +01:00
Luis Ramos
adfe1f89b6 Revert previous rubocop auto correct fix that breaks the cart spec 2020-06-22 13:08:38 +01:00
Luis Ramos
473fee19eb Fix rubocop issues 2020-06-22 13:03:18 +01:00
Luis Ramos
6eebb0e399 Use rubocop autocorrect to fix rubocop issue 2020-06-22 12:58:33 +01:00
Luis Ramos
e574e254db Use rubocop autocorrect to fix rubocop issue 2020-06-22 12:57:12 +01:00
Luis Ramos
3b91dd9dea Use rubocop auto-correct to fix more issues 2020-06-22 12:51:47 +01:00
Luis Ramos
5d710f1e24 Use ruboccop autocorrect to fix issues 2020-06-22 12:46:07 +01:00
Luis Ramos
fb92745db4 Fix rubocop issues 2020-06-22 12:41:31 +01:00
Luis Ramos
8a9dae0ee2 Run rubocop autocorrect
This is the result of bundle exec rubocop --auto-correct
2020-06-22 12:23:10 +01:00
Luis Ramos
15babd8bc4 Merge pull request #5651 from luisramos0/xhr
[Rails 4.1] Change for xhr rquest to avoid csrf during testing
2020-06-22 12:20:41 +01:00
Luis Ramos
57d925a7de Add new rubocop rules and fix the single offence 2020-06-22 12:19:19 +01:00
Lucas Hiago
357c2c7b25 change for xhr to avoid csrf during testing 2020-06-21 20:22:33 +01:00
Transifex-Openfoodnetwork
eb55d00051 Updating translations for config/locales/en_US.yml 2020-06-20 03:34:37 +10:00
Transifex-Openfoodnetwork
c5d3156351 Updating translations for config/locales/fr.yml 2020-06-20 02:37:11 +10:00
Transifex-Openfoodnetwork
28a6f694de Updating translations for config/locales/en_FR.yml 2020-06-20 02:34:30 +10:00
Pau Pérez Fabregat
dd9d9e3316 Merge pull request #5639 from luchiago/fix-seeds-on-setup
FIx setup seed
2020-06-19 16:49:16 +02:00
Pau Perez
f36e08a163 Rename *.css.scss to *.scss
This fixes the following deprecation warning

```
DEPRECATION WARNING: Extra .css in SCSS file is unnecessary. Rename /usr/src/app/app/assets/stylesheets/darkswarm/variables.css.scss to /usr/src/app/app/assets/stylesheets/darkswar
m/variables.scss. (called from _app_views_layouts_darkswarm_html_haml___3990351141569700945_46957256630860 at /usr/src/app/app/views/layouts/darkswarm.html.haml:18)
(...)
```
2020-06-19 16:29:08 +02:00
Transifex-Openfoodnetwork
fd6cbe064d Updating translations for config/locales/tr.yml 2020-06-19 20:27:09 +10:00
Pau Pérez Fabregat
db80992326 Merge branch 'master' into drop-blockenspiel 2020-06-19 12:12:10 +02:00
Lucas Hiago
52da896b03 Fix name when try to search on seed 2020-06-18 21:06:04 -03:00
Eduardo
573f7b1087 make shop links on the producers page open in new tab 2020-06-18 19:55:06 -03:00
Fatih Orhan
27fb3f156c Update sell.html.haml 2020-06-18 20:36:50 +03:00
dependabot-preview[bot]
9c643447c2 Bump ransack from 1.2.3 to 1.8.10
Bumps [ransack](https://github.com/activerecord-hackery/ransack) from 1.2.3 to 1.8.10.
- [Release notes](https://github.com/activerecord-hackery/ransack/releases)
- [Changelog](https://github.com/activerecord-hackery/ransack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/activerecord-hackery/ransack/compare/v1.2.3...v1.8.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-17 19:15:45 +00:00
dependabot-preview[bot]
d67fa6fa5a [Security] Bump geocoder from 1.5.2 to 1.6.3
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.5.2 to 1.6.3. **This update includes a security fix.**
- [Release notes](https://github.com/alexreisner/geocoder/releases)
- [Changelog](https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alexreisner/geocoder/compare/v.1.5.2...v1.6.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-16 23:49:32 +00:00
Lucas Hiago
419b3ef26e add missing i18n key for check hub ready for checkout 2020-06-16 19:49:43 -03:00
Lucas Hiago
e9e43c985f add missing i18n key for closed OC 2020-06-16 19:48:24 -03:00
dependabot-preview[bot]
f8c66cae81 Bump acts-as-taggable-on from 3.5.0 to 4.0.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 3.5.0 to 4.0.0.
- [Release notes](https://github.com/mbleigh/acts-as-taggable-on/releases)
- [Changelog](https://github.com/mbleigh/acts-as-taggable-on/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.5.0...v4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-16 02:30:03 +00:00
Eduardo
27c76cfae2 add view spec to replace feature spec 2020-06-13 14:24:17 -03:00
Cillian O'Ruanaidh
430e5ea9cc Permission to view :bulk_coop report is now added in the #add_bulk_coop_abilities method. 2020-06-13 16:57:43 +01:00
Cillian O'Ruanaidh
0ef3a7e24f Fix some more code climate violations for bulk coop specs which have been moved to the order management engine. 2020-06-13 16:23:11 +01:00
Cillian O'Ruanaidh
fdf0d92366 Move feature spec for bulk coop report to the order management engine. 2020-06-13 15:52:42 +01:00
Cillian O'Ruanaidh
ba126d5afc Move the bulk coop controller specs to the order management engine.
Also deleting old :bulk_coop_report action from the Spree::Admin::ReportsController.
2020-06-13 15:42:26 +01:00
Cillian O'Ruanaidh
c1e57fcc12 Adjust CanCan ability to reflect that the bulk coop report now runs from the order management engine. 2020-06-13 15:41:09 +01:00
Cillian O'Ruanaidh
3abcb5b23c Don't move the :parameter_not_allowed_error translation to a different scope yet.
It will make it harder to merge and deploy this PR if every translation locale file has to be updated too.
2020-06-13 15:37:44 +01:00
Cillian O'Ruanaidh
bcf79ef803 Fix code climate violations related to removing blockenspiel. 2020-06-13 13:27:44 +01:00
Cillian O'Ruanaidh
6dbb6f3f09 Add an underscore before unused method arguments rather than an empty splat operator so it's easier to understand what is being passed in. 2020-06-13 13:09:09 +01:00
Cillian O'Ruanaidh
293e8949a9 Remove unused AuthenticationWorkflow module from the BulkCoopReport specs. 2020-06-13 12:59:23 +01:00
Cillian O'Ruanaidh
bfc6daf076 Remove duplicate PackingReport tests from the BulkCoopReport spec.
These tests already exist in spec/lib/open_food_network/packing_report_spec.rb:72
2020-06-13 12:57:14 +01:00
Cillian O'Ruanaidh
ed82c7e3db BulkCoopReport has been moved to the engines/order_management so move it's spec there too. 2020-06-13 12:51:29 +01:00
Luis Ramos
e6e4b6f95c Add keypress events to text input fields on orders search page 2020-06-13 12:15:49 +01:00
Luis Ramos
1740879261 Revert directive and just use ng-kkeypress 2020-06-13 12:07:45 +01:00
Luis Ramos
f08b837115 Make enter submit the search form in products list 2020-06-13 11:51:00 +01:00
Eduardo
5ed5ed2873 fix payment methods table to show proper provider name 2020-06-12 18:26:54 -03:00
Robin Klaus
f8ebe11728 Added translation keyt to config/locales/en.yml file for shipping_category 2020-06-12 13:19:15 +10:00
Robin Klaus
b8f228cc3d Added more key to en.yml to translate More dropdown text 2020-06-12 11:34:22 +10:00
Cillian O'Ruanaidh
f90969134d Fix a couple of Rubocop violations. 2020-06-05 20:03:17 +01:00
Cillian O'Ruanaidh
bafa8beab3 Use :parameter_not_allowed_error_message to from base Reports::Authorizer. 2020-06-05 17:05:26 +01:00
Cillian O'Ruanaidh
e58852289f Move the :require_valid_datetime_range method to OrderManagement::Reports::Parameters::Base so it can be reused on multiple reports. 2020-06-05 16:58:56 +01:00
Cillian O'Ruanaidh
9172606780 Allow the order management report partial to be reused on different reports. 2020-06-05 16:51:43 +01:00
Cillian O'Ruanaidh
406309c577 Move BulkCoop reports out of deprecated lib/ directory into OrderManagement engine.
The BulkCoop reports are not generated the same way as the EnterpriseFeeSummary report is generated yet so that may need to be updated.
2020-06-05 16:43:38 +01:00
Cillian O'Ruanaidh
d436d18d19 Fix code climate violations in removal of Blockenspiel dependency. 2020-06-05 10:13:06 +01:00
Cillian O'Ruanaidh
d02f64da06 Define bulk coop report summary row and columns with lists of method names instead of Procs. 2020-05-29 11:34:12 +01:00
Cillian O'Ruanaidh
1fba998b9e Drop Blockenspiel and use :rules/:columns methods instead of :organise/:summary_columns DSL.
For https://github.com/openfoodfoundation/openfoodnetwork/issues/3231
2020-05-28 19:04:18 +01:00
519 changed files with 11186 additions and 3952 deletions

View File

@@ -21,12 +21,10 @@
Layout/LineLength:
Max: 100
Exclude:
- Gemfile
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/contents_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprise_groups_controller.rb
- app/controllers/admin/enterprise_relationships_controller.rb
- app/controllers/admin/enterprise_roles_controller.rb
- app/controllers/admin/enterprises_controller.rb
@@ -38,9 +36,6 @@ Layout/LineLength:
- app/controllers/admin/variant_overrides_controller.rb
- app/controllers/api/enterprise_attachment_controller.rb
- app/controllers/api/product_images_controller.rb
- app/controllers/spree/admin/adjustments_controller_decorator.rb
- app/controllers/spree/admin/orders_controller_decorator.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/stripe/callbacks_controller.rb
- app/helpers/angular_form_builder.rb
@@ -50,8 +45,6 @@ Layout/LineLength:
- app/helpers/injection_helper.rb
- app/helpers/markdown_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/shop_helper.rb
- app/helpers/spree/admin/base_helper_decorator.rb
- app/helpers/spree/orders_helper.rb
- app/jobs/subscription_confirm_job.rb
- app/mailers/subscription_mailer.rb
@@ -61,14 +54,10 @@ Layout/LineLength:
- app/models/concerns/variant_stock.rb
- app/models/content_configuration.rb
- app/models/customer.rb
- app/models/enterprise_fee.rb
- app/models/enterprise_group.rb
- app/models/enterprise_role.rb
- app/models/inventory_item.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/product_import/spreadsheet_data.rb
- app/models/product_import/spreadsheet_entry.rb
- app/models/product_import/unit_converter.rb
- app/models/proxy_order.rb
@@ -85,19 +74,23 @@ Layout/LineLength:
- app/models/spree/payment_method_decorator.rb
- app/models/spree/product_decorator.rb
- app/models/spree/shipping_method_decorator.rb
- app/models/spree/tax_rate_decorator.rb
- app/models/spree/taxon_decorator.rb
- app/models/spree/tax_rate_decorator.rb
- app/models/spree/user.rb
- app/models/subscription.rb
- app/models/variant_override.rb
- app/models/variant_override_set.rb
- app/serializers/api/admin/subscription_line_item_serializer.rb
- app/services/cart_service.rb
- app/services/default_stock_location.rb
- app/services/embedded_page_service.rb
- app/services/order_cycle_form.rb
- app/services/order_factory.rb
- app/services/variants_stock_levels.rb
- engines/order_management/app/services/order_management/subscriptions/validator.rb
- engines/web/app/helpers/web/cookies_policy_helper.rb
- engines/web/config/routes.rb
- engines/web/spec/features/consumer/cookies_spec.rb
- Gemfile
- lib/discourse/single_sign_on.rb
- lib/open_food_network/available_payment_method_filter.rb
- lib/open_food_network/bulk_coop_report.rb
@@ -112,12 +105,12 @@ Layout/LineLength:
- lib/open_food_network/payments_report.rb
- lib/open_food_network/reports/bulk_coop_allocation_report.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/scope_variants_for_search.rb
- lib/open_food_network/variant_and_line_item_naming.rb
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/core/controller_helpers/respond_with_decorator.rb
- lib/spree/localized_number.rb
- lib/spree/product_filters.rb
- lib/stripe/profile_storer.rb
- lib/tasks/data.rake
- lib/tasks/enterprises.rake
- spec/controllers/admin/bulk_line_items_controller_spec.rb
@@ -151,19 +144,21 @@ Layout/LineLength:
- 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/orders/customer_details_controller_spec.rb
- spec/controllers/spree/admin/orders_controller_spec.rb
- spec/controllers/spree/admin/orders/customer_details_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/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/spree/user_sessions_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/factories/order_factory.rb
- spec/factories.rb
- spec/features/admin/adjustments_spec.rb
- spec/features/admin/bulk_order_management_spec.rb
- spec/features/admin/bulk_product_update_spec.rb
@@ -171,13 +166,19 @@ Layout/LineLength:
- spec/features/admin/enterprise_fees_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/images_spec.rb
- spec/features/admin/enterprises/index_spec.rb
- spec/features/admin/enterprises_spec.rb
- spec/features/admin/enterprise_user_spec.rb
- spec/features/admin/image_settings_spec.rb
- spec/features/admin/multilingual_spec.rb
- spec/features/admin/order_cycles_spec.rb
- spec/features/admin/order_cycles/complex_creating_specific_time_spec.rb
- spec/features/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb
- spec/features/admin/order_cycles/complex_editing_spec.rb
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/admin/order_cycles/list_spec.rb
- spec/features/admin/order_cycles/simple_spec.rb
- spec/features/admin/order_spec.rb
- spec/features/admin/overview_spec.rb
- spec/features/admin/payment_method_spec.rb
- spec/features/admin/product_import_spec.rb
@@ -193,9 +194,11 @@ Layout/LineLength:
- spec/features/consumer/account/settings_spec.rb
- spec/features/consumer/account_spec.rb
- spec/features/consumer/authentication_spec.rb
- spec/features/consumer/cookies_spec.rb
- spec/features/consumer/caching/darkwarm_caching_spec.rb
- spec/features/consumer/caching/shops_caching_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
@@ -234,6 +237,7 @@ Layout/LineLength:
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
- spec/lib/open_food_network/scope_variant_to_hub_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/stripe/account_connector_spec.rb
@@ -254,8 +258,8 @@ Layout/LineLength:
- spec/models/exchange_spec.rb
- spec/models/model_set_spec.rb
- spec/models/order_cycle_spec.rb
- spec/models/producer_property_spec.rb
- spec/models/product_importer_spec.rb
- spec/models/product_import/reset_absent_spec.rb
- spec/models/proxy_order_spec.rb
- spec/models/spree/ability_spec.rb
- spec/models/spree/adjustment_spec.rb
@@ -269,10 +273,9 @@ Layout/LineLength:
- spec/models/spree/payment_spec.rb
- spec/models/spree/product_set_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/property_spec.rb
- spec/models/spree/shipping_method_spec.rb
- spec/models/spree/tax_rate_spec.rb
- spec/models/spree/taxon_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
@@ -285,10 +288,10 @@ Layout/LineLength:
- spec/performance/orders_controller_spec.rb
- spec/performance/shop_controller_spec.rb
- spec/requests/checkout/failed_checkout_spec.rb
- spec/requests/checkout/stripe_sca_spec.rb
- spec/requests/embedded_shopfronts_headers_spec.rb
- spec/serializers/api/admin/customer_serializer_spec.rb
- spec/serializers/api/admin/exchange_serializer_spec.rb
- spec/serializers/api/admin/for_order_cycle/enterprise_serializer_spec.rb
- spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
- spec/serializers/api/admin/subscription_customer_serializer_spec.rb
@@ -297,6 +300,7 @@ Layout/LineLength:
- spec/serializers/api/enterprise_shopfront_serializer_spec.rb
- spec/serializers/api/order_serializer_spec.rb
- spec/services/cart_service_spec.rb
- spec/services/checkout/form_data_adapter_spec.rb
- spec/services/embedded_page_service_spec.rb
- spec/services/exchange_products_renderer_spec.rb
- spec/services/order_cycle_distributed_products_spec.rb
@@ -304,16 +308,17 @@ Layout/LineLength:
- spec/services/order_cycle_form_spec.rb
- spec/services/order_factory_spec.rb
- spec/services/order_syncer_spec.rb
- spec/services/order_tax_adjustments_fetcher_spec.rb
- spec/services/permissions/order_spec.rb
- spec/services/product_tag_rules_filterer_spec.rb
- spec/services/permitted_attributes/order_cycle_spec.rb
- spec/services/products_renderer_spec.rb
- spec/services/product_tag_rules_filterer_spec.rb
- spec/spec_helper.rb
- spec/support/cancan_helper.rb
- spec/support/delayed_job_helper.rb
- spec/support/matchers/delegate_matchers.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/support/request/authentication_workflow.rb
- spec/support/request/shop_workflow.rb
- spec/support/request/web_helper.rb
- spec/support/seeds.rb
@@ -327,7 +332,6 @@ 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/schedules_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscription_line_items_controller.rb
- app/controllers/admin/subscriptions_controller.rb
@@ -337,14 +341,12 @@ Metrics/AbcSize:
- app/controllers/api/shipments_controller.rb
- app/controllers/api/taxons_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/base_controller.rb
- app/controllers/cart_controller.rb
- app/controllers/discourse_sso_controller.rb
- app/controllers/enterprises_controller.rb
- app/controllers/spree/admin/adjustments_controller_decorator.rb
- app/controllers/spree/admin/image_settings_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- app/controllers/spree/admin/overview_controller.rb
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
@@ -354,13 +356,12 @@ Metrics/AbcSize:
- 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/user_passwords_controller.rb
- app/controllers/spree/user_registrations_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/spree/users_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/user_confirmations_controller.rb
- app/controllers/user_passwords_controller.rb
@@ -368,18 +369,19 @@ Metrics/AbcSize:
- app/helpers/checkout_helper.rb
- app/helpers/i18n_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/zones_helper.rb
- app/helpers/spree/orders_helper.rb
- app/models/calculator/flat_percent_per_item.rb
- app/models/column_preference.rb
- app/models/enterprise.rb
- app/models/enterprise_group.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/model_set.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/proxy_order.rb
- app/models/spree/ability_decorator.rb
- app/models/spree/calculator/default_tax_decorator.rb
@@ -388,14 +390,19 @@ Metrics/AbcSize:
- app/models/spree/order_decorator.rb
- app/models/spree/payment_decorator.rb
- app/models/spree/product_decorator.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon_decorator.rb
- app/models/spree/tax_rate_decorator.rb
- app/serializers/api/admin/enterprise_serializer.rb
- app/serializers/api/admin/order_cycle_serializer.rb
- app/serializers/api/product_serializer.rb
- app/serializers/api/variant_serializer.rb
- app/services/cart_service.rb
- app/services/create_order_cycle.rb
- app/services/order_cycle_form.rb
- app/services/order_syncer.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- engines/order_management/app/services/order_management/stock/package.rb
- engines/order_management/app/services/order_management/stock/packer.rb
- engines/order_management/app/services/order_management/subscriptions/validator.rb
- lib/active_merchant/billing/gateways/stripe_decorator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
@@ -414,7 +421,6 @@ Metrics/AbcSize:
- lib/open_food_network/payments_report.rb
- lib/open_food_network/permissions.rb
- lib/open_food_network/products_and_inventory_report.rb
- lib/open_food_network/rack_request_blocker.rb
- lib/open_food_network/reports/line_items.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/users_and_enterprises_report.rb
@@ -425,15 +431,17 @@ Metrics/AbcSize:
- lib/spree/localized_number.rb
- lib/stripe/account_connector.rb
- lib/tasks/enterprises.rake
- lib/tasks/sample_data/order_factory.rb
- lib/tasks/sample_data/product_factory.rb
- spec/features/admin/product_import_spec.rb
- spec/features/admin/reports_spec.rb
- spec/features/admin/subscriptions_spec.rb
- spec/features/consumer/shopping/checkout_paypal_spec.rb
- spec/features/consumer/shopping/shopping_spec.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/models/enterprise_spec.rb
- spec/models/product_importer_spec.rb
- spec/services/restart_checkout_spec.rb
- spec/services/order_checkout_restart_spec.rb
- spec/support/performance_helper.rb
Metrics/BlockLength:
@@ -452,15 +460,17 @@ Metrics/BlockLength:
"scenario"
]
Exclude:
- app/models/spree/shipment.rb
- lib/tasks/data.rake
- spec/controllers/spree/admin/invoices_controller_spec.rb
- spec/factories.rb
- spec/factories/enterprise_factory.rb
- spec/factories/order_cycle_factory.rb
- spec/factories/order_factory.rb
- spec/factories/product_factory.rb
- spec/factories.rb
- spec/factories/shipping_method_factory.rb
- spec/factories/subscription_factory.rb
- spec/factories/user_factory.rb
- spec/factories/variant_factory.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/lib/open_food_network/group_buy_report_spec.rb
@@ -480,17 +490,17 @@ Metrics/CyclomaticComplexity:
- app/helpers/checkout_helper.rb
- app/helpers/i18n_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_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/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability_decorator.rb
- app/models/spree/payment_decorator.rb
- app/models/spree/payment_method_decorator.rb
- app/models/spree/product_decorator.rb
- app/models/variant_override_set.rb
- app/services/cart_service.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/bulk_coop_report.rb
@@ -512,11 +522,10 @@ Metrics/PerceivedComplexity:
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise_relationship.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability_decorator.rb
- app/models/spree/order_decorator.rb
- app/models/spree/product_decorator.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/bulk_coop_report.rb
@@ -529,6 +538,7 @@ Metrics/PerceivedComplexity:
Metrics/MethodLength:
Max: 10
Exclude:
- app/controllers/admin/contents_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
@@ -540,12 +550,11 @@ Metrics/MethodLength:
- app/controllers/api/shipments_controller.rb
- app/controllers/api/taxons_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/base_controller.rb
- app/controllers/cart_controller.rb
- app/controllers/shop_controller.rb
- app/controllers/spree/admin/image_settings_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/products_controller.rb
@@ -564,9 +573,9 @@ Metrics/MethodLength:
- app/controllers/user_registrations_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/jobs/subscription_placement_job.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/mailers/producer_mailer.rb
- app/models/column_preference.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
@@ -582,10 +591,14 @@ Metrics/MethodLength:
- app/models/spree/payment_decorator.rb
- app/models/spree/payment_method_decorator.rb
- app/models/spree/product_decorator.rb
- app/models/spree/shipment.rb
- app/serializers/api/admin/order_cycle_serializer.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/services/order_cycle_form.rb
- app/services/permitted_attributes/checkout.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- engines/order_management/app/services/order_management/stock/package.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/bulk_coop_report.rb
@@ -616,6 +629,9 @@ Metrics/MethodLength:
- lib/spree/core/controller_helpers/respond_with_decorator.rb
- lib/spree/localized_number.rb
- lib/stripe/profile_storer.rb
- lib/tasks/data/truncate_data.rb
- lib/tasks/sample_data/group_factory.rb
- lib/tasks/sample_data/order_factory.rb
- lib/tasks/sample_data/product_factory.rb
- spec/features/consumer/shopping/checkout_paypal_spec.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
@@ -627,16 +643,16 @@ Metrics/ClassLength:
Exclude:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
- app/controllers/application_controller.rb
- app/controllers/checkout_controller.rb
- app/controllers/spree/admin/base_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- 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/products_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/models/enterprise.rb
@@ -645,6 +661,7 @@ Metrics/ClassLength:
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/spree/ability_decorator.rb
- app/models/spree/shipment.rb
- app/models/spree/user.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/serializers/api/enterprise_shopfront_serializer.rb
@@ -667,8 +684,9 @@ Metrics/ModuleLength:
Exclude:
- app/helpers/admin/injection_helper.rb
- app/helpers/injection_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- engines/order_management/spec/services/order_management/stock/package_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/estimator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/form_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
@@ -692,6 +710,7 @@ Metrics/ModuleLength:
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
- spec/lib/open_food_network/scope_variant_to_hub_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/models/spree/ability_spec.rb
- spec/models/spree/adjustment_spec.rb

View File

@@ -40,6 +40,12 @@ Layout/MultilineMethodCallIndentation:
Layout/LineLength:
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
## TEMPORARY/CONTESTED SETTINGS
#
# These are still to be decided upon, but recommended for inclusion by

View File

@@ -1,114 +1,24 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 1400`
# on 2020-02-22 11:23:29 +0000 using RuboCop version 0.80.0.
# on 2020-06-22 13:28:10 +0100 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
# versions of RuboCop, may require this file to be generated again.
# Offense count: 6
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/open_food_network/bulk_coop_report.rb'
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
- 'lib/open_food_network/packing_report.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'app/models/spree/adjustment_decorator.rb'
- 'spec/features/admin/order_cycles_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'spec/controllers/api/orders_controller_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Layout/EndAlignment:
Exclude:
- 'lib/open_food_network/permalink_generator.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb'
# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'Gemfile'
- 'app/helpers/application_helper.rb'
- 'app/models/enterprise.rb'
# Offense count: 3
# Offense count: 139
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 115
# Offense count: 1
# Cop supports --auto-correct.
Layout/SpaceAfterColon:
Exclude:
- 'lib/open_food_network/order_cycle_form_applicator.rb'
Max: 268
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
# SupportedStylesForExponentOperator: space, no_space
Layout/SpaceAroundOperators:
Exclude:
- 'app/services/cart_service.rb'
- 'spec/support/cancan_helper.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'spec/controllers/checkout_controller_spec.rb'
# Offense count: 2
Lint/AmbiguousOperator:
Exclude:
- 'spec/controllers/api/enterprise_fees_controller_spec.rb'
- 'spec/controllers/spree/admin/payments_controller_spec.rb'
# Offense count: 2
Lint/Debugger:
Exclude:
- 'app/services/order_factory.rb'
# Offense count: 1
Lint/DuplicateHashKey:
Exclude:
- 'spec/models/calculator/weight_spec.rb'
# Offense count: 4
Lint/DuplicateMethods:
Exclude:
- 'lib/discourse/single_sign_on.rb'
# Offense count: 10
# Offense count: 9
Lint/IneffectiveAccessModifier:
Exclude:
- 'app/models/column_preference.rb'
@@ -117,31 +27,6 @@ Lint/IneffectiveAccessModifier:
- 'lib/open_food_network/feature_toggle.rb'
- 'spec/lib/open_food_network/reports/report_spec.rb'
# Offense count: 1
Lint/InterpolationCheck:
Exclude:
- 'spec/features/consumer/shopping/embedded_groups_spec.rb'
# Offense count: 3
# Cop supports --auto-correct.
Lint/NonDeterministicRequireOrder:
Exclude:
- 'engines/order_management/spec/spec_helper.rb'
- 'engines/web/spec/spec_helper.rb'
- 'spec/spec_helper.rb'
# Offense count: 3
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'app/models/model_set.rb'
- 'spec/models/model_set_spec.rb'
# Offense count: 2
# Configuration parameters: AllowKeywordBlockArguments.
Lint/UnderscorePrefixedVariableName:
Exclude:
- 'spec/support/cancan_helper.rb'
# Offense count: 5
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
@@ -152,21 +37,10 @@ Lint/UselessAccessModifier:
- 'lib/open_food_network/reports/bulk_coop_report.rb'
- 'spec/lib/open_food_network/reports/report_spec.rb'
# Offense count: 1
Lint/UselessAssignment:
Exclude:
- 'spec/**/*'
- 'app/models/enterprise.rb'
# Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
- 'app/serializers/api/enterprise_serializer.rb'
# Offense count: 1
# Offense count: 6
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 16
Max: 37
# Offense count: 1
# Configuration parameters: CountComments, ExcludedMethods.
@@ -174,6 +48,21 @@ Metrics/AbcSize:
Metrics/BlockLength:
Max: 27
# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 101
# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 7
# Offense count: 6
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 20
# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
@@ -195,26 +84,15 @@ Naming/HeredocDelimiterNaming:
Exclude:
- 'app/models/content_configuration.rb'
# Offense count: 3
# Offense count: 4
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'app/mailers/producer_mailer.rb'
- 'lib/open_food_network/address_finder.rb'
# Offense count: 7
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
Naming/MethodParameterName:
Exclude:
- 'app/helpers/spree/base_helper_decorator.rb'
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'lib/open_food_network/reports/bulk_coop_report.rb'
- 'lib/open_food_network/xero_invoices_report.rb'
- 'spec/lib/open_food_network/reports/report_spec.rb'
- 'spec/mailers/producer_mailer_spec.rb'
# Offense count: 22
# Offense count: 19
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# ForbiddenPrefixes: is_, has_, have_
@@ -232,7 +110,6 @@ Naming/PredicateName:
- 'app/models/spree/order_decorator.rb'
- 'app/models/spree/payment_method_decorator.rb'
- 'app/models/spree/preferences/file_configuration.rb'
- 'app/models/spree/product_decorator.rb'
- 'app/models/spree/shipping_method_decorator.rb'
- 'lib/open_food_network/customers_report.rb'
- 'lib/open_food_network/order_cycle_management_report.rb'
@@ -240,143 +117,6 @@ Naming/PredicateName:
- 'lib/open_food_network/packing_report.rb'
- 'lib/tasks/data.rake'
# Offense count: 154
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, Include.
# SupportedStyles: action, filter
# Include: app/controllers/**/*.rb
Rails/ActionFilter:
Exclude:
- 'app/controllers/admin/column_preferences_controller.rb'
- 'app/controllers/admin/customers_controller.rb'
- 'app/controllers/admin/enterprise_fees_controller.rb'
- 'app/controllers/admin/enterprise_groups_controller.rb'
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/admin/order_cycles_controller.rb'
- 'app/controllers/admin/producer_properties_controller.rb'
- 'app/controllers/admin/product_import_controller.rb'
- 'app/controllers/admin/schedules_controller.rb'
- 'app/controllers/admin/stripe_connect_settings_controller.rb'
- 'app/controllers/admin/subscription_line_items_controller.rb'
- 'app/controllers/admin/subscriptions_controller.rb'
- 'app/controllers/admin/variant_overrides_controller.rb'
- 'app/controllers/api/base_controller.rb'
- 'app/controllers/api/enterprise_attachment_controller.rb'
- 'app/controllers/api/enterprises_controller.rb'
- 'app/controllers/api/shipments_controller.rb'
- 'app/controllers/api/variants_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/base_controller.rb'
- 'app/controllers/cart_controller.rb'
- 'app/controllers/checkout_controller.rb'
- 'app/controllers/discourse_sso_controller.rb'
- 'app/controllers/enterprises_controller.rb'
- 'app/controllers/home_controller.rb'
- 'app/controllers/line_items_controller.rb'
- 'app/controllers/producers_controller.rb'
- 'app/controllers/registration_controller.rb'
- 'app/controllers/shop_controller.rb'
- 'app/controllers/shops_controller.rb'
- 'app/controllers/spree/admin/adjustments_controller.rb'
- 'app/controllers/spree/admin/base_controller.rb'
- 'app/controllers/spree/admin/images_controller.rb'
- 'app/controllers/spree/admin/mail_methods_controller.rb'
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
- 'app/controllers/spree/admin/orders_controller.rb'
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/admin/product_properties_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/reports/enterprise_fee_summaries_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/shipping_methods_controller.rb'
- 'app/controllers/spree/admin/states_controller.rb'
- 'app/controllers/spree/admin/tax_rates_controller.rb'
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/admin/zones_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/controllers/spree/store_controller.rb'
- 'app/controllers/spree/user_registrations_controller.rb'
- 'app/controllers/spree/user_sessions_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/stripe/webhooks_controller.rb'
- 'app/controllers/user_passwords_controller.rb'
- 'app/controllers/user_registrations_controller.rb'
# Offense count: 192
# Cop supports --auto-correct.
Rails/ActiveRecordAliases:
Exclude:
- 'app/controllers/admin/bulk_line_items_controller.rb'
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/admin/subscriptions_controller.rb'
- 'app/controllers/api/customers_controller.rb'
- 'app/controllers/api/enterprise_attachment_controller.rb'
- 'app/controllers/api/enterprises_controller.rb'
- 'app/controllers/api/product_images_controller.rb'
- 'app/controllers/api/products_controller.rb'
- 'app/controllers/api/shipments_controller.rb'
- 'app/controllers/api/taxons_controller.rb'
- 'app/controllers/api/variants_controller.rb'
- 'app/controllers/checkout_controller.rb'
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
- 'app/controllers/spree/admin/orders_controller.rb'
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/resource_controller.rb'
- 'app/controllers/spree/admin/taxons_controller.rb'
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/credit_cards_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/helpers/i18n_helper.rb'
- 'app/jobs/subscription_placement_job.rb'
- 'app/models/spree/adjustment_decorator.rb'
- 'app/models/spree/line_item_decorator.rb'
- 'app/models/spree/product_set.rb'
- 'app/services/line_item_syncer.rb'
- 'app/services/order_factory.rb'
- 'app/services/order_syncer.rb'
- 'app/services/user_default_address_setter.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/subscription_payment_updater.rb'
- 'lib/stripe/profile_storer.rb'
- 'spec/controllers/admin/proxy_orders_controller_spec.rb'
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
- 'spec/controllers/api/orders_controller_spec.rb'
- 'spec/controllers/line_items_controller_spec.rb'
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
- 'spec/controllers/spree/orders_controller_spec.rb'
- 'spec/features/admin/order_cycles_spec.rb'
- 'spec/features/admin/subscriptions_spec.rb'
- 'spec/features/admin/variant_overrides_spec.rb'
- 'spec/features/admin/variants_spec.rb'
- 'spec/features/consumer/account_spec.rb'
- 'spec/features/consumer/registration_spec.rb'
- 'spec/features/consumer/shopping/cart_spec.rb'
- 'spec/features/consumer/shopping/orders_spec.rb'
- 'spec/features/consumer/shopping/shopping_spec.rb'
- 'spec/jobs/subscription_confirm_job_spec.rb'
- 'spec/jobs/subscription_placement_job_spec.rb'
- 'spec/lib/open_food_network/proxy_order_syncer_spec.rb'
- 'spec/models/customer_spec.rb'
- 'spec/models/enterprise_caching_spec.rb'
- 'spec/models/exchange_spec.rb'
- 'spec/models/order_cycle_spec.rb'
- 'spec/models/producer_property_spec.rb'
- 'spec/models/proxy_order_spec.rb'
- 'spec/models/spree/adjustment_spec.rb'
- 'spec/models/spree/credit_card_spec.rb'
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/order_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/user_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/requests/checkout/stripe_connect_spec.rb'
- 'spec/services/order_syncer_spec.rb'
- 'spec/services/subscription_estimator_spec.rb'
# Offense count: 1
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
@@ -384,17 +124,13 @@ Rails/Date:
Exclude:
- 'app/models/order_cycle.rb'
# Offense count: 5
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Whitelist: find_by_sql
Rails/DynamicFindBy:
Exclude:
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
- 'app/controllers/spree/admin/orders_controller.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'spec/support/request/web_helper.rb'
# Offense count: 16
# Configuration parameters: EnforcedStyle.
@@ -426,19 +162,25 @@ Rails/FindBy:
- 'app/models/product_import/spreadsheet_data.rb'
- 'app/models/spree/user.rb'
# Offense count: 7
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/FindEach:
Exclude:
- 'app/models/spree/order_decorator.rb'
# Offense count: 5
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/order_cycle.rb'
- 'app/models/schedule.rb'
- 'app/models/spree/concerns/payment_method_distributors.rb'
- 'app/models/spree/line_item_decorator.rb'
# Offense count: 24
# Offense count: 25
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
@@ -449,13 +191,13 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/spree/adjustment_decorator.rb'
- 'app/models/spree/order_decorator.rb'
- 'app/models/spree/payment_method_decorator.rb'
- 'app/models/spree/property_decorator.rb'
- 'app/models/spree/property.rb'
- 'app/models/spree/shipping_method_decorator.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant_decorator.rb'
- 'app/models/subscription.rb'
# Offense count: 83
# Offense count: 84
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
@@ -471,12 +213,30 @@ Rails/HelperInstanceVariable:
- 'app/helpers/spree/admin/orders_helper.rb'
- 'app/helpers/spree/orders_helper.rb'
# Offense count: 1
# Offense count: 35
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Rails/Output:
# Include: app/controllers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/services/order_factory.rb'
- 'app/controllers/admin/enterprise_groups_controller.rb'
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/admin/order_cycles_controller.rb'
- 'app/controllers/admin/producer_properties_controller.rb'
- 'app/controllers/admin/product_import_controller.rb'
- 'app/controllers/admin/schedules_controller.rb'
- 'app/controllers/admin/subscriptions_controller.rb'
- 'app/controllers/registration_controller.rb'
- 'app/controllers/spree/admin/adjustments_controller.rb'
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/admin/product_properties_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/search_controller.rb'
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/admin/zones_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/user_passwords_controller.rb'
# Offense count: 12
Rails/OutputSafety:
@@ -490,13 +250,14 @@ Rails/OutputSafety:
- 'app/helpers/spree/reports_helper.rb'
- 'app/serializers/api/product_serializer.rb'
- 'lib/spree/money_decorator.rb'
- 'spec/features/admin/orders_spec.rb'
- 'spec/features/admin/order_print_ticket_spec.rb'
# Offense count: 2
# Configuration parameters: Include.
# Include: **/Rakefile, **/*.rake
Rails/RakeEnvironment:
Exclude:
- 'lib/capistrano/tasks/**/*.rake'
- 'lib/tasks/specs.rake'
# Offense count: 9
@@ -507,7 +268,7 @@ Rails/ReflectionClassName:
- 'app/models/enterprise_role.rb'
- 'app/models/subscription.rb'
# Offense count: 213
# Offense count: 227
# 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:
@@ -527,10 +288,13 @@ Rails/SkipsModelValidations:
- 'app/models/spree/credit_card_decorator.rb'
- 'app/models/spree/order_decorator.rb'
- 'app/models/spree/payment_decorator.rb'
- 'app/models/spree/shipping_method_decorator.rb'
- 'app/models/subscription.rb'
- 'app/models/variant_override.rb'
- 'app/services/order_factory.rb'
- 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb'
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb'
- 'engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb'
- 'lib/tasks/data/anonymize_data.rake'
- 'lib/tasks/sample_data/product_factory.rb'
- 'lib/tasks/users.rake'
@@ -552,9 +316,12 @@ Rails/SkipsModelValidations:
- 'spec/features/admin/bulk_order_management_spec.rb'
- 'spec/features/admin/bulk_product_update_spec.rb'
- 'spec/features/admin/configuration/tax_rates_spec.rb'
- 'spec/features/admin/order_cycles_spec.rb'
- 'spec/features/admin/orders_spec.rb'
- 'spec/features/admin/order_cycles/complex_editing_spec.rb'
- 'spec/features/admin/order_cycles/simple_spec.rb'
- 'spec/features/admin/order_spec.rb'
- 'spec/features/admin/payments_spec.rb'
- 'spec/features/admin/reports_spec.rb'
- 'spec/features/consumer/caching/shops_caching_spec.rb'
- 'spec/features/consumer/shopping/checkout_spec.rb'
- 'spec/features/consumer/shopping/products_spec.rb'
- 'spec/features/consumer/shopping/shopping_spec.rb'
@@ -566,7 +333,7 @@ Rails/SkipsModelValidations:
- 'spec/lib/open_food_network/permissions_spec.rb'
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
- 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb'
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
- 'spec/lib/stripe/credit_card_cloner_spec.rb'
- 'spec/models/calculator/weight_spec.rb'
- 'spec/models/concerns/variant_stock_spec.rb'
- 'spec/models/enterprise_relationship_spec.rb'
@@ -574,18 +341,34 @@ Rails/SkipsModelValidations:
- 'spec/models/spree/adjustment_spec.rb'
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/order_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/models/tag_rule/discount_order_spec.rb'
- 'spec/performance/proxy_order_syncer_spec.rb'
- 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb'
- 'spec/services/cache_service_spec.rb'
- 'spec/services/order_cart_reset_spec.rb'
- 'spec/services/order_checkout_restart_spec.rb'
- 'spec/services/order_cycle_distributed_products_spec.rb'
- 'spec/services/order_factory_spec.rb'
- 'spec/services/order_syncer_spec.rb'
- 'spec/services/product_tag_rules_filterer_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/restart_checkout_spec.rb'
- 'spec/support/request/shop_workflow.rb'
- 'spec/views/spree/shared/_order_details.html.haml_spec.rb'
# Offense count: 2
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/customer.rb'
- 'app/models/exchange.rb'
# Offense count: 2
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/spree/stock_item.rb'
# Offense count: 1
# Configuration parameters: Environments.
@@ -600,13 +383,12 @@ Style/CaseEquality:
- 'app/helpers/angular_form_helper.rb'
- 'spec/models/spree/payment_spec.rb'
# Offense count: 76
# Offense count: 75
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'app/helpers/angular_form_helper.rb'
- 'app/models/calculator/flat_percent_per_item.rb'
- 'app/models/spree/concerns/payment_method_distributors.rb'
- 'app/models/spree/gateway/migs.rb'
@@ -685,29 +467,15 @@ Style/ClassVars:
Exclude:
- 'lib/open_food_network/rack_request_blocker.rb'
# Offense count: 1
Style/CommentedKeyword:
Exclude:
- 'app/controllers/application_controller.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'app/controllers/api/taxons_controller.rb'
# Offense count: 6
# Offense count: 4
# Configuration parameters: EnforcedStyle.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
Exclude:
- 'app/helpers/order_cycles_helper.rb'
- 'lib/open_food_network/sales_tax_report.rb'
- 'spec/features/admin/bulk_order_management_spec.rb'
# Offense count: 920
# Offense count: 874
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
@@ -742,7 +510,6 @@ Style/FrozenStringLiteralComment:
- 'app/controllers/admin/variant_overrides_controller.rb'
- 'app/controllers/api/base_controller.rb'
- 'app/controllers/api/customers_controller.rb'
- 'app/controllers/api/enterprise_attachment_controller.rb'
- 'app/controllers/api/enterprise_fees_controller.rb'
- 'app/controllers/api/enterprises_controller.rb'
- 'app/controllers/api/logos_controller.rb'
@@ -786,7 +553,6 @@ Style/FrozenStringLiteralComment:
- 'app/controllers/spree/admin/product_properties_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/properties_controller.rb'
- 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/admin/resource_controller.rb'
- 'app/controllers/spree/admin/return_authorizations_controller.rb'
@@ -847,7 +613,6 @@ Style/FrozenStringLiteralComment:
- 'app/helpers/spree/api/api_helpers.rb'
- 'app/helpers/spree/base_helper_decorator.rb'
- 'app/helpers/spree/orders_helper.rb'
- 'app/helpers/spree/products_helper_decorator.rb'
- 'app/helpers/spree/reports_helper.rb'
- 'app/helpers/spree_currency_helper.rb'
- 'app/jobs/confirm_order_job.rb'
@@ -935,7 +700,6 @@ Style/FrozenStringLiteralComment:
- 'app/models/spree/gateway_decorator.rb'
- 'app/models/spree/image_decorator.rb'
- 'app/models/spree/line_item_decorator.rb'
- 'app/models/spree/money_decorator.rb'
- 'app/models/spree/option_type_decorator.rb'
- 'app/models/spree/order_decorator.rb'
- 'app/models/spree/payment_decorator.rb'
@@ -947,9 +711,7 @@ Style/FrozenStringLiteralComment:
- 'app/models/spree/product_property_decorator.rb'
- 'app/models/spree/product_set.rb'
- 'app/models/spree/property.rb'
- 'app/models/spree/property_decorator.rb'
- 'app/models/spree/shipment_decorator.rb'
- 'app/models/spree/shipping_category_decorator.rb'
- 'app/models/spree/shipping_method_decorator.rb'
- 'app/models/spree/stock/availability_validator_decorator.rb'
- 'app/models/spree/stock_location_decorator.rb'
@@ -1072,8 +834,6 @@ Style/FrozenStringLiteralComment:
- 'app/services/permissions/order.rb'
- 'app/services/product_tag_rules_filterer.rb'
- 'app/services/products_renderer.rb'
- 'app/services/reset_order_service.rb'
- 'app/services/restart_checkout.rb'
- 'app/services/search_orders.rb'
- 'app/services/tax_rate_finder.rb'
- 'app/services/upload_sanitizer.rb'
@@ -1112,7 +872,6 @@ Style/FrozenStringLiteralComment:
- '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/performance/order_management/subscriptions/proxy_order_syncer_spec.rb'
- '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'
@@ -1120,7 +879,6 @@ Style/FrozenStringLiteralComment:
- '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/order_management/spec/spec_helper.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'
@@ -1131,7 +889,6 @@ Style/FrozenStringLiteralComment:
- 'engines/web/lib/web/engine.rb'
- 'engines/web/lib/web/version.rb'
- 'engines/web/spec/helpers/cookies_policy_helper_spec.rb'
- 'engines/web/spec/spec_helper.rb'
- 'engines/web/web.gemspec'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/address_finder.rb'
@@ -1184,7 +941,6 @@ Style/FrozenStringLiteralComment:
- 'lib/open_food_network/scope_variant_to_hub.rb'
- 'lib/open_food_network/scope_variants_for_search.rb'
- 'lib/open_food_network/spree_api_key_loader.rb'
- 'lib/open_food_network/subscription_payment_updater.rb'
- 'lib/open_food_network/tag_rule_applicator.rb'
- 'lib/open_food_network/user_balance_calculator.rb'
- 'lib/open_food_network/users_and_enterprises_report.rb'
@@ -1204,7 +960,6 @@ Style/FrozenStringLiteralComment:
- 'lib/stripe/webhook_handler.rb'
- 'lib/tasks/data.rake'
- 'lib/tasks/data/anonymize_data.rake'
- 'lib/tasks/data/truncate_data.rake'
- 'lib/tasks/enterprises.rake'
- 'lib/tasks/karma.rake'
- 'lib/tasks/missing_payments.rake'
@@ -1245,7 +1000,6 @@ Style/FrozenStringLiteralComment:
- '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/exchange_products_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'
@@ -1278,7 +1032,6 @@ Style/FrozenStringLiteralComment:
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/payments_controller_spec.rb'
- 'spec/controllers/spree/admin/products_controller_spec.rb'
- 'spec/controllers/spree/admin/reports/enterprise_fee_summaries_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'
@@ -1333,14 +1086,11 @@ Style/FrozenStringLiteralComment:
- 'spec/features/admin/external_services_spec.rb'
- 'spec/features/admin/image_settings_spec.rb'
- 'spec/features/admin/multilingual_spec.rb'
- 'spec/features/admin/order_cycles_spec.rb'
- 'spec/features/admin/orders_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/enterprise_fee_summaries_spec.rb'
- 'spec/features/admin/reports/packing_report_spec.rb'
- 'spec/features/admin/reports_spec.rb'
- 'spec/features/admin/schedules_spec.rb'
@@ -1356,7 +1106,6 @@ Style/FrozenStringLiteralComment:
- 'spec/features/consumer/account_spec.rb'
- 'spec/features/consumer/authentication_spec.rb'
- 'spec/features/consumer/confirm_invitation_spec.rb'
- 'spec/features/consumer/cookies_spec.rb'
- 'spec/features/consumer/footer_links_spec.rb'
- 'spec/features/consumer/groups_spec.rb'
- 'spec/features/consumer/multilingual_spec.rb'
@@ -1384,7 +1133,6 @@ Style/FrozenStringLiteralComment:
- 'spec/helpers/injection_helper_spec.rb'
- 'spec/helpers/navigation_helper_spec.rb'
- 'spec/helpers/order_cycles_helper_spec.rb'
- 'spec/helpers/products_helper_spec.rb'
- 'spec/helpers/serializer_helper_spec.rb'
- 'spec/helpers/shared_helper_spec.rb'
- 'spec/helpers/shop_helper_spec.rb'
@@ -1431,7 +1179,6 @@ Style/FrozenStringLiteralComment:
- '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/subscription_payment_updater_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'
@@ -1465,7 +1212,6 @@ Style/FrozenStringLiteralComment:
- 'spec/models/model_set_spec.rb'
- 'spec/models/order_cycle_spec.rb'
- 'spec/models/order_updater_spec.rb'
- 'spec/models/producer_property_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'
@@ -1494,7 +1240,6 @@ Style/FrozenStringLiteralComment:
- 'spec/models/spree/price_spec.rb'
- 'spec/models/spree/product_set_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/property_spec.rb'
- 'spec/models/spree/shipment_spec.rb'
- 'spec/models/spree/shipping_method_spec.rb'
- 'spec/models/spree/stock/availability_validator_spec.rb'
@@ -1563,8 +1308,6 @@ Style/FrozenStringLiteralComment:
- 'spec/services/permissions/order_spec.rb'
- 'spec/services/product_tag_rules_filterer_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/reset_order_service_spec.rb'
- 'spec/services/restart_checkout_spec.rb'
- 'spec/services/search_orders_spec.rb'
- 'spec/services/tax_rate_finder_spec.rb'
- 'spec/services/upload_sanitizer_spec.rb'
@@ -1573,7 +1316,6 @@ Style/FrozenStringLiteralComment:
- 'spec/support/ability_helper.rb'
- 'spec/support/api_helper.rb'
- 'spec/support/cancan_helper.rb'
- 'spec/support/controller_hacks.rb'
- 'spec/support/controller_helper.rb'
- 'spec/support/delayed_job_helper.rb'
- 'spec/support/downloads_helper.rb'
@@ -1614,18 +1356,19 @@ Style/FrozenStringLiteralComment:
- 'spec/views/spree/admin/orders/edit.html.haml_spec.rb'
- 'spec/views/spree/admin/orders/index.html.haml_spec.rb'
# Offense count: 50
# Offense count: 51
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/admin/order_cycles_controller.rb'
- 'app/controllers/admin/product_import_controller.rb'
- 'app/controllers/api/shipments_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/base_controller.rb'
- 'app/controllers/checkout_controller.rb'
- 'app/controllers/home_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/controllers/spree/paypal_controller_decorator.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/producer_property.rb'
@@ -1645,48 +1388,19 @@ Style/GuardClause:
- 'spec/support/request/distribution_helper.rb'
- 'spec/support/request/shop_workflow.rb'
# Offense count: 3
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse:
Exclude:
- 'app/controllers/admin/column_preferences_controller.rb'
- 'app/controllers/admin/variant_overrides_controller.rb'
- 'app/controllers/api/taxons_controller.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
Exclude:
- 'lib/open_food_network/reports/line_items.rb'
# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'app/helpers/application_helper.rb'
# Offense count: 5
# Offense count: 4
Style/MixinUsage:
Exclude:
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
- 'spec/features/admin/orders_spec.rb'
- 'spec/lib/open_food_network/bulk_coop_report_spec.rb'
- 'spec/lib/open_food_network/order_cycle_management_report_spec.rb'
- 'spec/lib/open_food_network/packing_report_spec.rb'
# Offense count: 1
Style/MultipleComparison:
Exclude:
- 'spec/models/product_importer_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: both, prefix, postfix
Style/NegatedUnless:
Exclude:
- 'app/services/cart_service.rb'
# Offense count: 41
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
@@ -1719,25 +1433,7 @@ Style/NumericPredicate:
- 'lib/spree/money_decorator.rb'
- 'lib/tasks/sample_data.rake'
# Offense count: 16
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/credit_cards_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/helpers/i18n_helper.rb'
- 'app/helpers/shop_helper.rb'
- 'app/models/producer_property.rb'
- 'app/models/product_import/entry_validator.rb'
- 'app/models/product_import/product_importer.rb'
- 'app/models/proxy_order.rb'
- 'lib/discourse/single_sign_on.rb'
- 'spec/factories.rb'
# Offense count: 232
# Offense count: 231
Style/Send:
Exclude:
- 'app/models/spree/shipping_method_decorator.rb'
@@ -1757,7 +1453,6 @@ Style/Send:
- 'spec/lib/open_food_network/permissions_spec.rb'
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
- 'spec/lib/open_food_network/sales_tax_report_spec.rb'
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
- 'spec/lib/open_food_network/xero_invoices_report_spec.rb'
- 'spec/lib/stripe/webhook_handler_spec.rb'

14
Gemfile
View File

@@ -3,7 +3,7 @@ ruby "2.3.7"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'i18n', '~> 0.6.11'
gem 'i18n-js', '~> 3.7.0'
gem 'i18n-js', '~> 3.7.1'
gem 'rails', '~> 4.0.13'
gem 'rails-i18n', '~> 4.0'
gem 'rails_safe_tasks', '~> 1.0'
@@ -33,7 +33,7 @@ gem 'httparty', '~> 0.18' # Used to check alerts in spree_core, this is not used
gem 'json', '>= 1.7.7'
gem 'money', '5.1.1'
gem 'paranoia', '~> 2.0'
gem 'ransack', '~> 1.2.3'
gem 'ransack', '~> 1.8.10'
gem 'state_machine', '1.2.0'
gem 'stringex', '~> 1.5.1'
@@ -75,13 +75,12 @@ gem 'truncate_html', '0.9.2'
gem 'unicorn'
gem 'actionpack-action_caching'
# AMS is pinned to 0.8.4 because 0.9.x is a complete re-write, as is 0.10.x
# Once Rails is updated to 5.x we should bump directly to 0.10.x
# AMS 0.9.x and 0.10.x are very different from 0.8.4 and the upgrade is not straight forward
# AMS is deprecated, we will introduce an alternative at some point
gem "active_model_serializers", "0.8.4"
gem 'activerecord-session_store'
gem 'acts-as-taggable-on', '~> 3.4'
gem 'acts-as-taggable-on', '~> 4.0'
gem 'angularjs-file-upload-rails', '~> 2.4.1'
gem 'blockenspiel'
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
gem 'dalli'
gem 'diffy'
@@ -110,7 +109,7 @@ gem 'test-unit', '~> 3.3'
gem 'coffee-rails', '~> 4.2.2'
gem 'compass-rails'
gem 'mini_racer', '0.2.14'
gem 'mini_racer', '0.2.15'
gem 'uglifier', '>= 1.0.3'
@@ -145,6 +144,7 @@ group :test, :development do
gem 'letter_opener', '>= 1.4.1'
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry'
gem 'rswag'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'

View File

@@ -124,8 +124,8 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
acts-as-taggable-on (3.5.0)
activerecord (>= 3.2, < 5)
acts-as-taggable-on (4.0.0)
activerecord (>= 4.0)
acts_as_list (0.2.0)
activerecord (>= 3.0)
addressable (2.7.0)
@@ -150,7 +150,6 @@ GEM
bcrypt (3.1.13)
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
blockenspiel (0.5.0)
bugsnag (6.13.1)
concurrent-ruby (~> 1.0)
builder (3.1.4)
@@ -202,12 +201,12 @@ GEM
addressable
daemons (1.3.1)
dalli (2.7.10)
database_cleaner (1.7.0)
database_cleaner (1.8.5)
db2fog (0.9.0)
activerecord (>= 3.2.0, < 5.0)
fog (~> 1.0)
rails (>= 3.2.0, < 5.0)
ddtrace (0.36.0)
ddtrace (0.37.0)
msgpack
debugger-linecache (1.2.0)
delayed_job (4.1.8)
@@ -407,7 +406,7 @@ GEM
fuubar (2.5.0)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.5.2)
geocoder (1.6.3)
get_process_mem (0.2.5)
ffi (~> 1.0)
gmaps4rails (2.1.2)
@@ -421,7 +420,7 @@ GEM
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (0.6.11)
i18n-js (3.7.0)
i18n-js (3.7.1)
i18n (>= 0.6.6)
immigrant (0.3.6)
activerecord (>= 3.0)
@@ -434,6 +433,8 @@ GEM
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (1.8.6)
json-schema (2.8.1)
addressable (>= 2.4)
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
@@ -457,7 +458,7 @@ GEM
mime-types-data (3.2020.0512)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mini_racer (0.2.14)
mini_racer (0.2.15)
libv8 (> 7.3)
minitest (4.7.5)
momentjs-rails (2.20.1)
@@ -477,7 +478,7 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
oj (3.10.6)
oj (3.10.7)
optimist (3.0.0)
orm_adapter (0.5.0)
paper_trail (5.2.3)
@@ -500,8 +501,6 @@ GEM
paypal-sdk-merchant (1.106.1)
paypal-sdk-core (~> 0.2.3)
pg (0.21.0)
polyamorous (1.0.0)
activerecord (>= 3.0)
power_assert (1.2.0)
pry (0.12.2)
coderay (~> 1.1.0)
@@ -540,12 +539,11 @@ GEM
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.1)
ransack (1.2.3)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
ransack (1.8.10)
actionpack (>= 3.0, < 5.2)
activerecord (>= 3.0, < 5.2)
activesupport (>= 3.0, < 5.2)
i18n
polyamorous (~> 1.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
@@ -590,6 +588,19 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.9.2)
rswag (2.2.0)
rswag-api (= 2.2.0)
rswag-specs (= 2.2.0)
rswag-ui (= 2.2.0)
rswag-api (2.2.0)
railties (>= 3.1, < 6.1)
rswag-specs (2.2.0)
activesupport (>= 3.1, < 6.1)
json-schema (~> 2.2)
railties (>= 3.1, < 6.1)
rswag-ui (2.2.0)
actionpack (>= 3.1, < 6.1)
railties (>= 3.1, < 6.1)
rubocop (0.81.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
@@ -679,7 +690,7 @@ GEM
hashdiff (>= 0.4.0, < 2.0.0)
whenever (1.0.0)
chronic (>= 0.6.3)
wicked_pdf (1.4.0)
wicked_pdf (2.1.0)
activesupport
wkhtmltopdf-binary (0.12.5)
xml-simple (1.1.5)
@@ -697,7 +708,7 @@ DEPENDENCIES
activerecord-import
activerecord-postgresql-adapter
activerecord-session_store
acts-as-taggable-on (~> 3.4)
acts-as-taggable-on (~> 4.0)
acts_as_list (= 0.2.0)
andand
angular-rails-templates (~> 0.3.0)
@@ -707,7 +718,6 @@ DEPENDENCIES
awesome_nested_set (~> 3.0.0.rc.1)
awesome_print
aws-sdk (= 1.11.1)
blockenspiel
bugsnag
byebug (~> 11.0.0)
cancan (~> 1.6.10)
@@ -743,7 +753,7 @@ DEPENDENCIES
highline (= 1.6.18)
httparty (~> 0.18)
i18n (~> 0.6.11)
i18n-js (~> 3.7.0)
i18n-js (~> 3.7.1)
immigrant
jquery-migrate-rails
jquery-rails (= 3.1.5)
@@ -754,7 +764,7 @@ DEPENDENCIES
kaminari (~> 0.14.1)
knapsack
letter_opener (>= 1.4.1)
mini_racer (= 0.2.14)
mini_racer (= 0.2.15)
momentjs-rails
money (= 5.1.1)
newrelic_rpm (~> 3.0)
@@ -774,12 +784,13 @@ DEPENDENCIES
rails (~> 4.0.13)
rails-i18n (~> 4.0)
rails_safe_tasks (~> 1.0)
ransack (~> 1.2.3)
ransack (~> 1.8.10)
redcarpet
roadie-rails (~> 1.3.0)
roo (~> 2.8.3)
rspec-rails (>= 3.5.2)
rspec-retry
rswag
rubocop
rubocop-rails
sass

View File

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -23,10 +23,13 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
$scope.fetchResults()
$scope.fetchResults = (page=1) ->
startDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_gteq'], ' 00:00:00')
endDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_lteq'], ' 23:59:59')
$scope.resetSelected()
params = {
'q[completed_at_lt]': $scope['q']['completed_at_lt'],
'q[completed_at_gt]': $scope['q']['completed_at_gt'],
'q[completed_at_gteq]': startDateWithTime,
'q[completed_at_lteq]': endDateWithTime,
'q[state_eq]': $scope['q']['state_eq'],
'q[number_cont]': $scope['q']['number_cont'],
'q[email_cont]': $scope['q']['email_cont'],
@@ -43,6 +46,11 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
}
RequestMonitor.load(Orders.index(params).$promise)
$scope.appendStringIfNotEmpty = (baseString, stringToAppend) ->
return baseString unless baseString
baseString + stringToAppend
$scope.resetSelected = ->
$scope.selected_orders.length = 0
$scope.selected = false

View File

@@ -12,4 +12,4 @@ Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)->
if moment().add(2, 'days') < moment(date, dateFormat)
t 'orders_open'
else
t('closing') + date_in_wordsFilter(date)
t('closing') + ' ' + date_in_wordsFilter(date)

View File

@@ -34,7 +34,7 @@ Darkswarm.factory 'Products', (OrderCycleResource, OrderCycle, Shopfront, curren
product.price = Math.min.apply(null, prices)
product.hasVariants = product.variants?.length > 0
product.primaryImage = product.images[0]?.small_url if product.images
product.primaryImageOrMissing = product.primaryImage || "/assets/noimage/small.png"
product.primaryImageOrMissing = product.primaryImage || "/noimage/small.png"
product.largeImage = product.images[0]?.large_url if product.images
dereference: ->

View File

@@ -15,6 +15,6 @@
.columns.small-12.medium-6.large-6.product-img
%img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}
%img.placeholder{ src: "/assets/noimage/large.png", "ng-if" => "::!product.largeImage"}
%img.placeholder{ src: "/noimage/large.png", "ng-if" => "::!product.largeImage"}
%ng-include{src: "'partials/close.html'"}

View File

@@ -17,10 +17,12 @@
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
// Use vh units for new browsers - fixed issue 1253
height: 100vh;
}
h1 {

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