Compare commits

...

992 Commits

Author SHA1 Message Date
Maikel
58c0d30af3 Merge pull request #8207 from openfoodfoundation/revert-8064-Kill_stripe_connect
Revert "Kill stripe connect"
2021-09-20 08:59:16 +10:00
Maikel Linke
4336350140 Updates from Transifex 2021-09-20 08:54:17 +10:00
Maikel
a3c31f7d86 Revert "Kill stripe connect" 2021-09-20 08:39:34 +10:00
Andy Brett
6ee9daf768 Merge pull request #8198 from openfoodfoundation/dependabot/bundler/bootsnap-1.9.0
Bump bootsnap from 1.8.1 to 1.9.0
2021-09-17 08:50:08 -07:00
dependabot[bot]
d086f7694a Bump bootsnap from 1.8.1 to 1.9.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: bootsnap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 09:02:52 +00:00
Matt-Yorkley
f4c86a1b51 Merge pull request #8061 from Matt-Yorkley/turbo-checkout
Split Checkout new toys
2021-09-17 10:48:59 +02:00
Matt-Yorkley
02bcb7bcc7 Merge pull request #8192 from Matt-Yorkley/orders-path-issue
Fix order_path issue in cart page
2021-09-16 16:16:36 +02:00
Matt-Yorkley
d55a3f3340 Bump Turbo 2021-09-16 14:12:31 +01:00
Matt-Yorkley
47346e9f2c Uncomment ActionCable in application.rb
We're not directly utilising it yet, but CableReady expects it to be loaded.
2021-09-15 18:52:24 +01:00
Andy Brett
f28200164b Merge pull request #8154 from meronokbay/8098-custom-modal-order-deletion
Replaced the default alert and confirm modals in the order page by custom modals
2021-09-15 09:22:58 -07:00
Andy Brett
6e674b47ac Merge pull request #8153 from sinansonmez/6140-change-profile-link-based-on-enterprise-profile
update profile link based on enterprise profile
2021-09-15 09:22:03 -07:00
Matt-Yorkley
0c879dc4c9 Fix order_path issue in cart page
The order_path route wasn't being inferred correctly from this Spree controller, causing errors to be thrown in the cart page if the number of editable orders was precisely one:

ActionView::Template::Error: undefined method `order_path'
2021-09-15 10:54:59 +01:00
Nihal M. Kelanthodika
9d216f0cea Merge pull request #8160 from apricot12/8019-Delivery_report
Show order total in Delivery/Payment Method reports instead of first …
2021-09-15 13:11:43 +05:30
Maikel
16aeb16519 Merge pull request #8172 from openfoodfoundation/dependabot/bundler/activemerchant-1.123.0
Bump activemerchant from 1.121.0 to 1.123.0
2021-09-15 17:14:29 +10:00
Andy Brett
2f5f2a03dd Merge pull request #8182 from openfoodfoundation/dependabot/bundler/test-unit-3.4.7
Bump test-unit from 3.4.6 to 3.4.7
2021-09-14 11:02:48 -07:00
Andy Brett
8c78316718 Merge pull request #8181 from openfoodfoundation/dependabot/bundler/rubocop-1.21.0
Bump rubocop from 1.20.0 to 1.21.0
2021-09-14 11:02:19 -07:00
dependabot[bot]
841a7a31fa Bump test-unit from 3.4.6 to 3.4.7
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.6...3.4.7)

---
updated-dependencies:
- dependency-name: test-unit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 09:03:26 +00:00
dependabot[bot]
6d9173deba Bump rubocop from 1.20.0 to 1.21.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.20.0 to 1.21.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.20.0...v1.21.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 09:02:19 +00:00
Andy Brett
82a8eed652 Merge pull request #8165 from openfoodfoundation/dependabot/bundler/view_component-2.40.0
Bump view_component from 2.39.0 to 2.40.0
2021-09-13 15:26:55 -07:00
Andy Brett
77ca05ebe5 Merge pull request #8175 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.0
Bump jest from 27.1.1 to 27.2.0
2021-09-13 15:26:31 -07:00
Andy Brett
da912d2fdf Merge pull request #8173 from openfoodfoundation/dependabot/bundler/test-unit-3.4.6
Bump test-unit from 3.4.5 to 3.4.6
2021-09-13 15:26:08 -07:00
Andy Brett
297dc56fe5 Merge pull request #8174 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.2
Bump rubocop-rails from 2.12.0 to 2.12.2
2021-09-13 15:25:45 -07:00
dependabot[bot]
b0b91c959e Bump jest from 27.1.1 to 27.2.0
Bumps [jest](https://github.com/facebook/jest) from 27.1.1 to 27.2.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.1.1...v27.2.0)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:09:54 +00:00
dependabot[bot]
a7e9acd435 Bump rubocop-rails from 2.12.0 to 2.12.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.0 to 2.12.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.12.0...v2.12.2)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:05:04 +00:00
dependabot[bot]
d75b03debd Bump test-unit from 3.4.5 to 3.4.6
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.5 to 3.4.6.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.5...3.4.6)

---
updated-dependencies:
- dependency-name: test-unit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:04:26 +00:00
dependabot[bot]
685a3eb14f Bump activemerchant from 1.121.0 to 1.123.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.121.0 to 1.123.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.121.0...v1.123.0)

---
updated-dependencies:
- dependency-name: activemerchant
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:02:43 +00:00
Meron Ogbai
94ff59ebab Make order spec click clearer 2021-09-11 13:37:14 +03:00
Meron Ogbai
a065a92616 Reorganize alert and confirm code 2021-09-11 13:36:28 +03:00
Meron Ogbai
aed84912a3 Use selector to get del element 2021-09-11 13:10:33 +03:00
Andy Brett
1ec9cce439 Merge pull request #8163 from mkllnk/migration-specs
Remove problematic migration spec
2021-09-10 10:32:29 -07:00
Nihal M. Kelanthodika
5811b6e3d1 Merge pull request #8064 from apricot12/Kill_stripe_connect
Kill stripe connect
2021-09-10 22:57:00 +05:30
Nihal
98a879a0e9 Restore removed spec to profile_storer_spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
98ff3980f8 Migration of StripeConnect to StripeSCA 2021-09-10 14:43:34 +05:30
Nihal Mohammed
eb17c208f9 Update stripe_stubs to handle stripeSCA 2021-09-10 14:43:34 +05:30
Nihal Mohammed
fa9f6432c3 Fix profile_storer.rb and profile_storer_spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
6ac835de2e Fix response for payment_profile_id in profile_storer.rb 2021-09-10 14:43:34 +05:30
Nihal Mohammed
696d434979 Removed stripe connect example and fixed JSON generation in profile_storer spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
48c1312cea Remove expectation to generate clean name for StripeConnect from payment_method_spec 2021-09-10 14:43:34 +05:30
Luis Ramos
0c240cee9a A few more removals of stripe connect related code 2021-09-10 14:43:34 +05:30
Luis Ramos
f90e34bb47 Adapt specs to use stripe_sca_payment_method factory and delete stripe_connect_payment_method 2021-09-10 14:43:34 +05:30
Luis Ramos
9de9b41575 Remove stripe connect spec, there's a similar spec for stripesca below 2021-09-10 14:43:34 +05:30
Luis Ramos
60a8ae6675 Remove Stripe Connect gateway and related code 2021-09-10 14:43:24 +05:30
Luis Ramos
5434b51f75 Switch filter to StripeSCA, this must have been an error, must be tested (manually or automatically) 2021-09-10 14:41:06 +05:30
dependabot[bot]
93118f9c32 Bump view_component from 2.39.0 to 2.40.0
Bumps [view_component](https://github.com/github/view_component) from 2.39.0 to 2.40.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.39.0...v2.40.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 09:02:41 +00:00
Nihal
43e6d1b933 Show order total in Delivery/Payment Method reports instead of first payment 2021-09-10 13:08:00 +05:30
Maikel Linke
10c2a1c55c Remove problematic migration spec
Unfortunately, loading the migration code also reloads some Spree models
which causes errors later on. Another spec was failing with:

  1) full-page cart viewing the cart when a product is soft-deleted shows the cart without errors
     Failure/Error: variant.instance_variable_set :@hub, @hub

     FrozenError:
       can't modify frozen NilClass: nil
     # ./lib/open_food_network/scope_variant_to_hub.rb:12:in `instance_variable_set'

The command to reproduce was:

rspec ./spec/features/consumer/shopping/cart_spec.rb[1:1:3:1]\
 ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb[1:1:1:1] --seed 0

I couldn't find a quick solution to make the migration not use app code.
Since the migration is a historical record now, it doesn't need repeated
testing.
2021-09-10 16:19:40 +10:00
Maikel
9affc6a945 Merge pull request #8108 from Matt-Yorkley/andand
Remove `andand` gem
2021-09-10 15:06:00 +10:00
Maikel Linke
e013d81e3d Simplify safe navigation operator use < and [] 2021-09-10 14:40:46 +10:00
Andy Brett
6fea506e05 Update all locales with the latest Transifex translations 2021-09-09 17:52:29 -07:00
Andy Brett
069cb043ee Merge pull request #8148 from jibees/5236-remove-incomplete-orders-from-admin-interface-2
Only shows order that actually have at least one line_item V2
2021-09-09 16:49:30 -07:00
Andy Brett
46a3214bc6 Merge pull request #8157 from openfoodfoundation/dependabot/bundler/spring-3.0.0
Bump spring from 2.1.1 to 3.0.0
2021-09-09 16:47:42 -07:00
Andy Brett
392ba6f3d1 Merge pull request #7975 from vishaldeepak/mail-customer-information
Add customer information to mail when we notify producers when required
2021-09-09 16:10:46 -07:00
Sinan Chaush
868187aaaf create helper to select correct url 2021-09-09 22:22:25 +02:00
Andy Brett
9124e03c11 Merge pull request #8144 from meronokbay/6942-fix-payment-method-fee-bug
6942 fix payment method fee bug
2021-09-09 09:28:40 -07:00
Sinan Sonmez (Chaush)
12c154934d Update app/views/spree/admin/overview/single_enterprise_dashboard.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2021-09-09 16:29:28 +02:00
Matt-Yorkley
fe57484c03 Merge pull request #8159 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.1.1
Bump jest from 27.1.0 to 27.1.1
2021-09-09 14:05:59 +02:00
Matt-Yorkley
29d2fc34ab Merge pull request #8158 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.0
Bump rubocop-rails from 2.11.3 to 2.12.0
2021-09-09 14:05:35 +02:00
Matt-Yorkley
b352476301 Update app/models/proxy_order.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-09-09 13:39:08 +02:00
dependabot[bot]
f3af4e586c Bump jest from 27.1.0 to 27.1.1
Bumps [jest](https://github.com/facebook/jest) from 27.1.0 to 27.1.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.1.0...v27.1.1)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:06:27 +00:00
dependabot[bot]
43f276596a Bump rubocop-rails from 2.11.3 to 2.12.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.3 to 2.12.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.3...v2.12.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:03:55 +00:00
dependabot[bot]
dc75c5139a Bump spring from 2.1.1 to 3.0.0
Bumps [spring](https://github.com/rails/spring) from 2.1.1 to 3.0.0.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v2.1.1...v3.0.0)

---
updated-dependencies:
- dependency-name: spring
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:03:34 +00:00
Meron Ogbai
4eda15fb71 Expect custom modal instead of alert in order spec 2021-09-09 11:57:56 +03:00
Meron Ogbai
95e294c9ec Use custom modals for deleting orders 2021-09-09 06:25:03 +03:00
Meron Ogbai
4806ba540f Add modals in orders page 2021-09-09 06:23:39 +03:00
Meron Ogbai
2de75ef7f4 Remove default rails confirm behavior 2021-09-09 06:22:55 +03:00
Meron Ogbai
d4f7b318e7 Add haml and css for custom modals 2021-09-09 06:21:14 +03:00
Andy Brett
f8486bcbf8 Merge pull request #7769 from Matt-Yorkley/payment-status-checking
Stripe: payment status debugging
2021-09-08 15:21:38 -07:00
Andy Brett
afa1861181 pass payment to Stripe Validator instead of the status object 2021-09-08 12:26:56 -07:00
Sinan Chaush
f883e66c96 update profile link based on enterprise profile 2021-09-08 21:10:12 +02:00
Andy Brett
de29d7e7d7 Merge pull request #8125 from jibees/5782-add-i18n-for-devise
Add devise-i18n and handle i18nization for devise controllers
2021-09-08 11:48:12 -07:00
Matt-Yorkley
44b870d248 Bump MRUJS and update syntax for new plugin architecture 2021-09-08 19:39:52 +01:00
Andy Brett
26e973828f Merge pull request #8151 from Matt-Yorkley/codecov-tasks
Remove Codecov upload tasks
2021-09-08 11:11:43 -07:00
Matt-Yorkley
48d4341e2d Merge pull request #8112 from cillian/eager-load-permissions-with-enterprise-relationships
Eager load the EnterpriseRelationship :permissions association on the enterprise permissions page
2021-09-08 19:46:14 +02:00
Matt-Yorkley
1d5077061e Remove andand
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Matt-Yorkley
2d2e0a5b24 Add unit test for not_empty scope 2021-09-08 12:18:08 +01:00
Matt-Yorkley
b53371d870 Fix not_empty scope 2021-09-08 12:14:53 +01:00
Matt-Yorkley
2b95ede1a2 Merge pull request #8115 from pacodelaluna/update-docker-configuration
Update Docker configuration to support sidekiq and webpacker
2021-09-08 12:06:08 +02:00
Matt-Yorkley
ef02197bab Remove Codecov upload tasks 2021-09-08 10:48:28 +01:00
Matt-Yorkley
086c5ab264 Replace directive with data-confirm 2021-09-08 10:34:34 +01:00
Matt-Yorkley
8bf3f72ad3 Extract CableCar responses code to a concern 2021-09-08 10:34:34 +01:00
Matt-Yorkley
5ef34347a3 Implement optional non-Angular flash messages 2021-09-08 10:34:34 +01:00
Matt-Yorkley
e48b9d84e5 Extract boilerplate code 2021-09-08 10:34:34 +01:00
Matt-Yorkley
03abc395f2 Update responses to use cable_ready 2021-09-08 10:34:34 +01:00
Matt-Yorkley
7fa9457550 Add cable_ready 2021-09-08 10:34:34 +01:00
Matt-Yorkley
edb599b426 Disable Turbo page caching 2021-09-08 10:34:34 +01:00
Matt-Yorkley
062a3abc2d Enable Turbo in the new checkout 2021-09-08 10:34:34 +01:00
Matt-Yorkley
6b028ba849 Disable Turbo site-wide 2021-09-08 10:34:34 +01:00
Matt-Yorkley
23779fd5e4 Include progressbar for mrujs form submissions 2021-09-08 10:34:34 +01:00
Matt-Yorkley
20ff594014 Set data-remote on checkout form 2021-09-08 10:34:34 +01:00
Matt-Yorkley
9be73a8ff1 Respond with HTTP error code on update failure 2021-09-08 10:34:34 +01:00
Matt-Yorkley
10f6368524 Add Angular teardown 2021-09-08 10:34:34 +01:00
Matt-Yorkley
a23171ea51 Compile Webpacker assets only once in test environment 2021-09-08 10:34:34 +01:00
Matt-Yorkley
658f0eccbb Replace ng-app with explicit Angular bootstrapping and move scripts to head 2021-09-08 10:34:34 +01:00
Jean-Baptiste Bellet
7656f5d20f Add an order with no line_items, should not be returned by API 2021-09-08 10:44:04 +02:00
Jean-Baptiste Bellet
9c86adf0f4 Add line_items to each orders
Now, API returns only orders with line_items: add to each in specs.
2021-09-08 10:43:59 +02:00
Matt-Yorkley
b29d88be25 Add progress bar styling 2021-09-08 00:05:04 +01:00
Matt-Yorkley
79efa50a34 Add Turbo and MRUJS 2021-09-08 00:05:04 +01:00
Andy Brett
3ef427aa7d Merge pull request #8076 from jibees/8009-handling-shipping-adress
Split Checkout: Handle shipping address
2021-09-07 11:15:52 -07:00
Jean-Baptiste Bellet
0ec35b1f0d Only shows order that actually have at least one line_item
Filter inside the API to shows only orders that have at least one line items
2021-09-07 17:25:46 +02:00
Matt-Yorkley
b4278aabbf Merge branch 'master' into 8009-handling-shipping-adress 2021-09-07 09:44:49 +02:00
jibees
a16430d10c Merge pull request #6 from Matt-Yorkley/8009-handling-shipping-adress
8009-handling-shipping-adress: REDUX
2021-09-07 09:03:22 +02:00
Andy Brett
ee546ffdd6 Merge pull request #8146 from Matt-Yorkley/dev-log-level
Make log_level more easily configurable in development
2021-09-06 18:05:39 -07:00
Matt-Yorkley
3bcfc673f7 Ensure selected shipping method is actually selected
Hashes with symbol keys != hashes with string keys 🙈
2021-09-06 20:58:22 +01:00
Matt-Yorkley
78e28c517b Make log_level more easily configurable in development 2021-09-06 19:13:00 +01:00
Matt-Yorkley
fb7a3a681b Validate attributes per checkout step and decouple order-advancing 2021-09-06 14:25:16 +01:00
Matt-Yorkley
71412f8d4b Update validations 2021-09-06 14:22:28 +01:00
Matt-Yorkley
c3b52ef00a Remove payments validation 2021-09-06 14:19:35 +01:00
Matt-Yorkley
cfee804339 Improve concern loading
It shouldn't need `require` or `prepend`
2021-09-06 14:19:13 +01:00
Matt-Yorkley
e3e53b1504 Ensure feature toggle works for non-logged-in users 2021-09-05 22:39:47 +01:00
Matt-Yorkley
70513ae989 Don't transition to address before page load 2021-09-05 20:19:22 +01:00
Meron Ogbai
5ca552d380 Show flash error if preferred amount isn't valid 2021-09-05 01:11:12 +03:00
Meron Ogbai
712c204bca Add error message in en.yml 2021-09-05 01:09:03 +03:00
Andy Brett
3e0509d232 Merge pull request #8141 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.8
Bump @storybook/addon-controls from 6.3.7 to 6.3.8
2021-09-04 12:16:46 -07:00
dependabot[bot]
ed2f555d84 Bump @storybook/addon-controls from 6.3.7 to 6.3.8
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.8/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 18:07:53 +00:00
Andy Brett
c0eb71f67f Merge pull request #8138 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.8
Bump @storybook/addon-docs from 6.3.7 to 6.3.8
2021-09-04 11:03:22 -07:00
dependabot[bot]
585f5a4cfa Bump @storybook/addon-docs from 6.3.7 to 6.3.8
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.8/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 17:22:07 +00:00
Andy Brett
8b00807a20 Merge pull request #8110 from openfoodfoundation/dependabot/bundler/bootsnap-1.8.1
Bump bootsnap from 1.7.7 to 1.8.1
2021-09-04 10:13:23 -07:00
Andy Brett
7600838490 Merge pull request #8116 from openfoodfoundation/dependabot/bundler/paper_trail-12.1.0
Bump paper_trail from 12.0.0 to 12.1.0
2021-09-04 10:11:23 -07:00
Andy Brett
4cddd031aa Merge pull request #8137 from openfoodfoundation/dependabot/bundler/test-unit-3.4.5
Bump test-unit from 3.4.4 to 3.4.5
2021-09-04 10:10:19 -07:00
Andy Brett
a9e53272c6 Merge pull request #8139 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.1.0
Bump jest from 27.0.6 to 27.1.0
2021-09-04 10:10:02 -07:00
Andy Brett
85f893c7ed Merge pull request #8140 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.8
Bump @storybook/server from 6.3.7 to 6.3.8
2021-09-04 10:09:37 -07:00
dependabot[bot]
c9a631df2a Bump @storybook/server from 6.3.7 to 6.3.8
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.8/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 10:23:28 +00:00
dependabot[bot]
d47a089bfb Bump jest from 27.0.6 to 27.1.0
Bumps [jest](https://github.com/facebook/jest) from 27.0.6 to 27.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.0.6...v27.1.0)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 10:22:06 +00:00
dependabot[bot]
dbafbd6391 Bump test-unit from 3.4.4 to 3.4.5
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.4 to 3.4.5.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.4...3.4.5)

---
updated-dependencies:
- dependency-name: test-unit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 10:13:33 +00:00
Andy Brett
75f827aee9 Merge pull request #8120 from openfoodfoundation/dependabot/bundler/test-prof-1.0.7
Bump test-prof from 1.0.6 to 1.0.7
2021-09-03 17:35:32 -07:00
Andy Brett
b2f8d978c6 Merge pull request #8107 from openfoodfoundation/dependabot/bundler/rubocop-1.20.0
Bump rubocop from 1.19.1 to 1.20.0
2021-09-03 12:05:28 -07:00
Matt-Yorkley
54987dd622 Merge pull request #8099 from jibees/8097-test-stimulus
Add jest and stimulusjs testing
2021-09-03 16:16:16 +02:00
Jean-Baptiste Bellet
ec4d5bd9a2 Remove babel warning 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
149c0d4de4 Add yarn jest to the github workflow 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
7cdf09322c First test for toggle_controller 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
310c3c4005 Define each file to be tested by jest 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
195464361d Install needed dependencies 2021-09-03 14:14:25 +02:00
Matt-Yorkley
86da71d6c0 Update all locales with the latest Transifex translations 2021-09-03 10:33:33 +01:00
Matt-Yorkley
fe99a5cc55 Merge pull request #8129 from Matt-Yorkley/searchable
Searchable attributes
2021-09-03 09:43:25 +02:00
Matt-Yorkley
72d494c640 Merge pull request #8127 from Matt-Yorkley/session-uri-parsing
Strip subdomains from session cookie host
2021-09-03 09:38:11 +02:00
Matt-Yorkley
fbdc38b6c4 Merge pull request #8111 from jibees/4582-remove-units-on-quantity-column-
Display variant quantity on the quantity column on the edit order page in backoffice
2021-09-02 20:45:22 +02:00
Matt-Yorkley
0459071ce3 Set RAILS_ENV=test in test suite 2021-09-02 17:29:26 +01:00
Matt-Yorkley
dc8939c35f Strip subdomains from session cookie host 2021-09-02 17:29:26 +01:00
vishaldeepak
b13b2b9b95 Customer Information on mail show be displayed depending on order cycle coordinator's customer names flag 2021-09-02 18:59:28 +05:30
Matt-Yorkley
3fc0278776 Whitelist searchable attributes on primary models 2021-09-02 14:06:15 +01:00
Matt-Yorkley
b25759670e Implement ransackable whitelisting 2021-09-02 13:43:22 +01:00
Jean-Baptiste Bellet
97fd7e3d78 Improve look and feel by adding some responsive margins 2021-09-01 17:16:30 +02:00
Jean-Baptiste Bellet
1b7c36664e Add missing i18n key for Devise
and update tests as well:
 - from feature to system
 - Add the reset password scenario
 - Add some errors scenario to the reset password scenario: token expired, token invalid, and not the same password
2021-09-01 17:16:29 +02:00
Matt-Yorkley
fd8de65749 Merge pull request #8123 from openfoodfoundation/dependabot/bundler/view_component-2.39.0
Bump view_component from 2.38.0 to 2.39.0
2021-09-01 16:52:05 +02:00
Matt-Yorkley
cab470bd86 Merge pull request #8122 from openfoodfoundation/dependabot/npm_and_yarn/tar-6.1.11
Bump tar from 6.1.5 to 6.1.11
2021-09-01 16:51:00 +02:00
Matt-Yorkley
9d6e5e9420 Remove currently unused code 2021-09-01 15:04:53 +01:00
Matt-Yorkley
1fca7d2a6c Remove error-clearing from edit action 2021-09-01 15:04:53 +01:00
Matt-Yorkley
4cff185b4b Extract params handling to service 2021-09-01 15:04:53 +01:00
Matt-Yorkley
57504f42d8 Move validations to state transitions 2021-09-01 15:04:53 +01:00
Matt-Yorkley
6acb1f6484 Tidy up view variables 2021-09-01 15:04:33 +01:00
Matt-Yorkley
9800483433 Simplify displaying selected shipping method 2021-09-01 15:04:33 +01:00
Matt-Yorkley
b7e1882bd8 Simplify setting address params 2021-09-01 15:04:33 +01:00
Matt-Yorkley
3fabe308cd Extract #shipping_and_billing_match? helper 2021-09-01 15:04:33 +01:00
Matt-Yorkley
ac4d721de0 Extract #set_payment_amount method 2021-09-01 15:04:33 +01:00
Matt-Yorkley
2786fb30ba Simplify order advancing process 2021-09-01 15:04:33 +01:00
Matt-Yorkley
978c882ed9 Don't select a random shipping method in Shipment 2021-09-01 15:04:33 +01:00
Matt-Yorkley
3dd8ed85b4 Implement manual shipping method selection 2021-09-01 14:16:32 +01:00
Matt-Yorkley
ebe2923512 Improve form outputs and error handling 2021-09-01 14:16:32 +01:00
Jean-Baptiste Bellet
19d7ca70b4 Add devise-i18n gem to handle i18nization inside devise controllers 2021-09-01 12:10:07 +02:00
dependabot[bot]
6d16b66a76 Bump view_component from 2.38.0 to 2.39.0
Bumps [view_component](https://github.com/github/view_component) from 2.38.0 to 2.39.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.38.0...v2.39.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-01 09:03:48 +00:00
dependabot[bot]
cd75fcf6c2 Bump tar from 6.1.5 to 6.1.11
Bumps [tar](https://github.com/npm/node-tar) from 6.1.5 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.5...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 23:01:16 +00:00
Matt-Yorkley
aaf45afbfe Merge pull request #8090 from Matt-Yorkley/session-storage
Allow sessions to work across subdomains
2021-08-31 22:11:44 +02:00
dependabot[bot]
1bebe96df6 Bump test-prof from 1.0.6 to 1.0.7
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.6...v1.0.7)

---
updated-dependencies:
- dependency-name: test-prof
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 09:03:23 +00:00
Andy Brett
fba7699d0b select shipping method when advancing to payment 2021-08-31 11:00:54 +02:00
Jean-Baptiste Bellet
a1438f91e9 Display error on email (triggered by advance_order_state method) 2021-08-31 11:00:54 +02:00
Andy Brett
69ec17ef92 do not require phone number on orders 2021-08-31 10:59:13 +02:00
Matt-Yorkley
c72e0f7268 Merge pull request #8117 from openfoodfoundation/dependabot/bundler/rack-mini-profiler-2.3.3
Bump rack-mini-profiler from 2.3.2 to 2.3.3
2021-08-31 10:15:30 +02:00
dependabot[bot]
2554083557 Bump rack-mini-profiler from 2.3.2 to 2.3.3
Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases)
- [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.3.2...v2.3.3)

---
updated-dependencies:
- dependency-name: rack-mini-profiler
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 09:03:59 +00:00
dependabot[bot]
ae46863d77 Bump paper_trail from 12.0.0 to 12.1.0
Bumps [paper_trail](https://github.com/airblade/paper_trail) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/airblade/paper_trail/releases)
- [Changelog](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airblade/paper_trail/compare/v12.0.0...v12.1.0)

---
updated-dependencies:
- dependency-name: paper_trail
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 09:02:50 +00:00
François Turbelin
9aba846112 Add webpacker config 2021-08-29 21:49:26 +02:00
François Turbelin
4e03874e2b Update the jobs starter with sidekiq command 2021-08-29 21:49:26 +02:00
Andy Brett
ca7da94fd8 Merge pull request #8088 from jibees/8087-select-unselect-orders-in-admin
Handle select/unselect all orders in the admin orders page
2021-08-28 11:34:20 -07:00
Jean-Baptiste Bellet
5c05be22f5 As it is a quantity column, display variant quantity
(this column was confused, and was understood like a simply quantity column not the item quantity separated according to its "state")

Update specs as well
2021-08-27 15:15:14 +02:00
Cillian O'Ruanaidh
e1478e3ae8 Eager load the EnterpriseRelationship :permissions association on the enterprise permissions page
For #8028
2021-08-27 12:01:25 +01:00
dependabot[bot]
56f9c24527 Bump bootsnap from 1.7.7 to 1.8.1
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.7 to 1.8.1.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.7...v1.8.1)

---
updated-dependencies:
- dependency-name: bootsnap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-27 09:02:52 +00:00
Andy Brett
e833921d2f Merge pull request #8106 from andrewpbrett/remove-codecov
Remove codecov
2021-08-26 10:37:49 -07:00
Andy Brett
2d511c6d18 Merge pull request #8044 from apricot12/Undo_reversing_of_email_copy_paste
Allow copy paste of email from contact tab and footer without reversing
2021-08-26 10:02:09 -07:00
Andy Brett
3fcce8574e Merge pull request #8040 from guidoDutra/7627-prevent-removing-last-item-in-order
Prevent removing last item in order
2021-08-26 10:01:42 -07:00
dependabot[bot]
dd0a162a47 Bump rubocop from 1.19.1 to 1.20.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.19.1 to 1.20.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.19.1...v1.20.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 09:02:03 +00:00
Jean-Baptiste Bellet
748a37f670 Terms and conditions error message 2021-08-26 09:28:31 +02:00
Jean-Baptiste Bellet
44ab87961a i18nize the global error message 2021-08-26 09:28:31 +02:00
Andy Brett
3fad554dbd remove codecov 2021-08-25 17:24:11 -07:00
Andy Brett
bee1b1a097 respect checkbox for ship address same as bill address 2021-08-25 15:22:25 -07:00
Andy Brett
759c5d6bdd don't override existing addresses on order with AddressFinder 2021-08-25 13:11:48 -07:00
Jean-Baptiste Bellet
b5024c5a16 On summary page, display shipping address as well as billing one 2021-08-25 16:31:45 +02:00
Jean-Baptiste Bellet
642e822e0e button is rounded 2021-08-25 15:58:55 +02:00
Jean-Baptiste Bellet
10ddaf4384 Last step (ie. summary) is larger than the two previous step 2021-08-25 15:53:22 +02:00
Jean-Baptiste Bellet
75390d2a48 Specify right i18n key 2021-08-25 15:29:24 +02:00
Jean-Baptiste Bellet
82ea33e9ca Do not display ship address form if not needed
ie. the shipping method does not require any address
2021-08-25 11:10:47 +02:00
vishaldeepak
813deb49a4 Add customer information to mail when we notify producers when required 2021-08-25 08:29:54 +05:30
Matt-Yorkley
c0cd68a747 Merge pull request #8084 from openfoodfoundation/dependabot/bundler/pagy-4.11.0
Bump pagy from 4.10.2 to 4.11.0
2021-08-24 23:48:13 +02:00
Andy Brett
50395d3142 Merge pull request #8096 from openfoodfoundation/dependabot/bundler/sidekiq-6.2.2
Bump sidekiq from 6.2.1 to 6.2.2
2021-08-24 13:25:59 -07:00
Andy Brett
d86148420a improve shipping_method_id handling 2021-08-24 12:29:48 -07:00
Andy Brett
7dd2c09641 ensure terms are accepted before order is placed 2021-08-24 12:29:23 -07:00
Andy Brett
3414d9f057 clear errors on ship address as well 2021-08-24 12:15:20 -07:00
Andy Brett
71076d36a1 favor dig to protect against nils 2021-08-24 11:54:02 -07:00
Andy Brett
c02b5ccd85 Fix typo in translation 2021-08-24 11:47:05 -07:00
Andy Brett
ea6739d565 guard against a nil value for @order.user 2021-08-24 11:46:50 -07:00
Andy Brett
874e1d7f02 only advance order to payment if no payment exists 2021-08-24 11:23:08 -07:00
Andy Brett
417770e716 guard against nil when populating ship address 2021-08-24 11:22:20 -07:00
Andy Brett
ea695105b5 populate ship address with bill address if no ship address 2021-08-24 10:57:36 -07:00
dependabot[bot]
43072dcfcd Bump sidekiq from 6.2.1 to 6.2.2
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.2.1...v6.2.2)

---
updated-dependencies:
- dependency-name: sidekiq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-24 09:04:07 +00:00
jibees
13e32149c1 Merge pull request #8093 from openfoodfoundation/dependabot/bundler/webpacker-5.4.2
Bump webpacker from 5.4.0 to 5.4.2
2021-08-24 10:33:13 +02:00
jibees
6766801aed Merge pull request #8094 from openfoodfoundation/dependabot/npm_and_yarn/rails/webpacker-5.4.2
Bump @rails/webpacker from 5.4.0 to 5.4.2
2021-08-24 10:32:46 +02:00
Andy Brett
1399171cc2 Merge pull request #8085 from openfoodfoundation/dependabot/bundler/webdrivers-4.6.1
Bump webdrivers from 4.6.0 to 4.6.1
2021-08-23 13:23:16 -07:00
Andy Brett
185493f846 Merge pull request #8077 from openfoodfoundation/dependabot/bundler/codecov-0.6.0
Bump codecov from 0.5.2 to 0.6.0
2021-08-23 13:22:18 -07:00
Andy Brett
4b79ee5f68 Merge pull request #8078 from openfoodfoundation/dependabot/bundler/rubocop-1.19.1
Bump rubocop from 1.19.0 to 1.19.1
2021-08-23 13:22:04 -07:00
Andy Brett
e8873ccb4f Merge pull request #8092 from filipefurtad0/improve_oc_spec
Sets OC-times in relation to the Zone time
2021-08-23 12:29:53 -07:00
Jean-Baptiste Bellet
9fd126ca0f The ship address is filled from bill address for some attributes
firstname, lastname and phone are the same between those two address. Fill it automatically.
2021-08-23 15:42:29 +02:00
Jean-Baptiste Bellet
1ecfeca88c Populate view with both shipping_method_id & ship_address_same_as_billing
... and then handle correctly the display of the form
2021-08-23 15:23:53 +02:00
dependabot[bot]
031b93af5e Bump @rails/webpacker from 5.4.0 to 5.4.2
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/v5.4.2/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: "@rails/webpacker"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 09:06:00 +00:00
dependabot[bot]
9aa6cf7804 Bump webpacker from 5.4.0 to 5.4.2
Bumps [webpacker](https://github.com/rails/webpacker) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: webpacker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 09:02:13 +00:00
Jean-Baptiste Bellet
fe65359d71 Display no shipping method selected error 2021-08-23 10:16:53 +02:00
jibees
67f04856a8 Merge pull request #8083 from openfoodfoundation/dependabot/bundler/rails-6.1.4.1
Bump rails from 6.1.4 to 6.1.4.1
2021-08-23 09:42:15 +02:00
Matt-Yorkley
39372f7bd7 Update cookies policy notes and related spec
The session cookie is now named `_ofn_session_id` instead of `_session_id`.
2021-08-22 15:57:43 +01:00
Matt-Yorkley
1d472d0dec Add Rack Middleware for transitioning existing sessions
This checks if the current request has been submitted using the old session key (_session_id) and transparently migrates the session id to a new session cookie with the new settings and the new key (_ofn_session_id).
2021-08-22 15:57:43 +01:00
Matt-Yorkley
e6ac57ac3a Migrate session cookies to new setup
Currently sessions set on (www.openfoodnetwork.xxx) are not usable on the bare domain (openfoonetwork.xxx). When transitioning from one to the other, the user's session is completely lost.

This change means sessions on subdomains (including www) will be transferable.
2021-08-22 15:53:41 +01:00
filipefurtad0
cd16e8527c Sets OC-times in relation to the Zone time 2021-08-21 19:13:26 +01:00
Matt-Yorkley
697a073330 Merge pull request #8060 from Matt-Yorkley/script-split
Maps and AMS conditional loading
2021-08-21 16:35:46 +02:00
Andy Brett
3bee30ac60 clear error messages on order and bill address on first load 2021-08-20 09:18:08 -07:00
Jean-Baptiste Bellet
26c5361b0a set shipping method only if param is present 2021-08-20 09:18:08 -07:00
Jean-Baptiste Bellet
8fe0a82b75 Change ng-click to ng-change to capture ng-model updated value
- Create a feature test for this feature
2021-08-20 15:18:09 +02:00
Nihal Mohammed
92ecdb4163 Add Angular directive to undo reverse of email 2021-08-20 18:34:42 +05:30
dependabot[bot]
bd190145f6 Bump webdrivers from 4.6.0 to 4.6.1
Bumps [webdrivers](https://github.com/titusfortner/webdrivers) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/titusfortner/webdrivers/releases)
- [Changelog](https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/titusfortner/webdrivers/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: webdrivers
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:04:50 +00:00
dependabot[bot]
d41cd695a8 Bump pagy from 4.10.2 to 4.11.0
Bumps [pagy](https://github.com/ddnexus/pagy) from 4.10.2 to 4.11.0.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/4.10.2...4.11.0)

---
updated-dependencies:
- dependency-name: pagy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:03:47 +00:00
dependabot[bot]
3f6251fa29 Bump rails from 6.1.4 to 6.1.4.1
Bumps [rails](https://github.com/rails/rails) from 6.1.4 to 6.1.4.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4...v6.1.4.1)

---
updated-dependencies:
- dependency-name: rails
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:02:58 +00:00
Nihal Mohammed
d2dcfa5848 Undo changes 2021-08-20 13:15:44 +05:30
Andy Brett
138b7824ba remove ship address if shipping method does not require it 2021-08-19 10:18:11 -07:00
Andy Brett
dd00c30503 fill ship address with bill address if checkbox is checked 2021-08-19 10:17:51 -07:00
Andy Brett
c07046e2f6 return an error if no shipping method is selected 2021-08-19 10:16:46 -07:00
dependabot[bot]
b3deaa65f6 Bump rubocop from 1.19.0 to 1.19.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.19.0...v1.19.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 09:03:16 +00:00
dependabot[bot]
26143980b3 Bump codecov from 0.5.2 to 0.6.0
Bumps [codecov](https://github.com/codecov/codecov-ruby) from 0.5.2 to 0.6.0.
- [Release notes](https://github.com/codecov/codecov-ruby/releases)
- [Changelog](https://github.com/codecov/codecov-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-ruby/compare/v0.5.2...v0.6.0)

---
updated-dependencies:
- dependency-name: codecov
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 09:02:23 +00:00
Jean-Baptiste Bellet
402bfdac30 Show/Hide shipping address form depending on the checkbox/radio state 2021-08-19 10:34:07 +02:00
Jean-Baptiste Bellet
c806b3e889 Be more generic: address is enough
as it could be billing or shipping address
2021-08-19 10:33:16 +02:00
Andy Brett
68311f8fa4 Merge pull request #8073 from openfoodfoundation/dependabot/bundler/pagy-4.10.2
Bump pagy from 4.10.1 to 4.10.2
2021-08-18 09:47:37 -07:00
Guido Oliveira
b1cd163900 Prevent removing last item in order 2021-08-18 12:00:32 -03:00
dependabot[bot]
828e06b271 Bump pagy from 4.10.1 to 4.10.2
Bumps [pagy](https://github.com/ddnexus/pagy) from 4.10.1 to 4.10.2.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/4.10.1...4.10.2)

---
updated-dependencies:
- dependency-name: pagy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-18 09:01:48 +00:00
Andy Brett
f783926deb Merge pull request #8063 from openfoodfoundation/dependabot/bundler/bullet-6.1.5
Bump bullet from 6.1.4 to 6.1.5
2021-08-17 10:30:00 -07:00
Andy Brett
28c1ba1ad4 Merge pull request #8062 from openfoodfoundation/dependabot/bundler/ffaker-2.19.0
Bump ffaker from 2.18.0 to 2.19.0
2021-08-17 10:29:18 -07:00
Andy Brett
dd84e428e3 Merge pull request #8031 from openfoodfoundation/dependabot/bundler/stripe-5.38.0
Bump stripe from 5.37.0 to 5.38.0
2021-08-17 08:41:03 -07:00
dependabot[bot]
79d45513a5 Bump bullet from 6.1.4 to 6.1.5
Bumps [bullet](https://github.com/flyerhzm/bullet) from 6.1.4 to 6.1.5.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/6.1.4...6.1.5)

---
updated-dependencies:
- dependency-name: bullet
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-17 09:03:46 +00:00
dependabot[bot]
099a4e682d Bump ffaker from 2.18.0 to 2.19.0
Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.18.0 to 2.19.0.
- [Release notes](https://github.com/ffaker/ffaker/releases)
- [Changelog](https://github.com/ffaker/ffaker/blob/main/Changelog.md)
- [Commits](https://github.com/ffaker/ffaker/compare/v2.18.0...v2.19.0)

---
updated-dependencies:
- dependency-name: ffaker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-17 09:02:15 +00:00
jibees
1ab7cb517f Merge pull request #8058 from Matt-Yorkley/n-plus-ones
Fix some N+1s
2021-08-17 10:02:20 +02:00
Matt-Yorkley
63dc188d5e Merge pull request #8032 from Matt-Yorkley/order-confirm
Split checkout backend
2021-08-16 23:12:06 +02:00
Andy Brett
36cbe7b2ce Merge pull request #8041 from openfoodfoundation/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-08-16 12:59:43 -07:00
Andy Brett
ea848f51e7 Merge pull request #8043 from openfoodfoundation/dependabot/bundler/rubocop-1.19.0
Bump rubocop from 1.18.4 to 1.19.0
2021-08-16 12:58:21 -07:00
Andy Brett
f575cba75c Merge pull request #8042 from openfoodfoundation/dependabot/bundler/view_component-2.38.0
Bump view_component from 2.37.0 to 2.38.0
2021-08-16 12:57:57 -07:00
Matt-Yorkley
7f7ba35c01 Merge pull request #8052 from openfoodfoundation/dependabot/bundler/rspec-rails-5.0.2
Bump rspec-rails from 5.0.1 to 5.0.2
2021-08-16 18:09:06 +02:00
dependabot[bot]
ec818e3571 Bump rspec-rails from 5.0.1 to 5.0.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v5.0.1...v5.0.2)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 14:58:21 +00:00
Matt-Yorkley
08123c7ea9 Merge pull request #8014 from openfoodfoundation/dependabot/bundler/puma-5.4.0
Bump puma from 5.3.2 to 5.4.0
2021-08-16 16:57:04 +02:00
Matt-Yorkley
744bd9d1be Only load Google Maps JS where it's actually needed 2021-08-16 15:31:00 +01:00
Matt-Yorkley
28bf71e77e Fix N+1 in CachedEnterpriseSerializer 2021-08-16 14:58:52 +01:00
Matt-Yorkley
20a3940605 Fix N+1 in #items_bought_by_user 2021-08-16 14:58:52 +01:00
Matt-Yorkley
a98e4417c0 Only inject taxons and properties AMS data in pages where it's actually needed 2021-08-16 13:22:06 +01:00
Matt-Yorkley
b94c586bc5 Merge pull request #7992 from jibees/7959-populate-hub-for-packing-report
Add appropriate distributors and suppliers to the packing report
2021-08-14 12:38:35 +02:00
dependabot[bot]
a48e6f6c1b Bump stripe from 5.37.0 to 5.38.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.37.0 to 5.38.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.37.0...v5.38.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-14 08:47:42 +00:00
Matt-Yorkley
5c4a225180 Merge pull request #8026 from Matt-Yorkley/angular-update
Angular version bump
2021-08-14 10:46:24 +02:00
Andy Brett
b20382ed56 Merge pull request #8022 from openfoodfoundation/dependabot/bundler/ddtrace-0.52.0
Bump ddtrace from 0.51.1 to 0.52.0
2021-08-13 14:58:06 -07:00
Matt-Yorkley
2b555691a4 Update all locales with the latest Transifex translations 2021-08-13 20:15:00 +01:00
Nihal Mohammed
2be8e15797 Allow copy paste of email from contact tab and footer without reversing 2021-08-13 15:57:59 +05:30
dependabot[bot]
48750f7cb8 Bump rubocop from 1.18.4 to 1.19.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.4 to 1.19.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.4...v1.19.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 09:03:53 +00:00
dependabot[bot]
5f1b5b679d Bump view_component from 2.37.0 to 2.38.0
Bumps [view_component](https://github.com/github/view_component) from 2.37.0 to 2.38.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.37.0...v2.38.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 09:02:44 +00:00
dependabot[bot]
8955d1bba0 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 01:10:41 +00:00
Matt-Yorkley
fb6ee65865 Remove more (currently) unused code 2021-08-12 17:24:20 +01:00
Matt-Yorkley
d1b22dfff3 Merge pull request #8024 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.7
Bump @storybook/addon-docs from 6.3.6 to 6.3.7
2021-08-12 18:22:27 +02:00
dependabot[bot]
fda068fe83 Bump @storybook/addon-docs from 6.3.6 to 6.3.7
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.6 to 6.3.7.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.7/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 12:46:33 +00:00
Matt-Yorkley
39fb6b6f9b Merge pull request #8025 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.7
Bump @storybook/addon-controls from 6.3.6 to 6.3.7
2021-08-12 14:43:26 +02:00
dependabot[bot]
7b795c1da9 Bump @storybook/addon-controls from 6.3.6 to 6.3.7
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.6 to 6.3.7.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.7/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 12:34:06 +00:00
Matt-Yorkley
0030bd1464 Merge pull request #8030 from openfoodfoundation/dependabot/bundler/bugsnag-6.22.1
Bump bugsnag from 6.21.0 to 6.22.1
2021-08-12 14:29:26 +02:00
Matt-Yorkley
9e26a39660 Merge pull request #8023 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.7
Bump @storybook/server from 6.3.6 to 6.3.7
2021-08-12 14:28:16 +02:00
Matt-Yorkley
ad0cc85991 Merge pull request #8021 from openfoodfoundation/dependabot/bundler/view_component-2.37.0
Bump view_component from 2.36.0 to 2.37.0
2021-08-12 14:27:54 +02:00
Matt-Yorkley
ba3d4c0c82 Merge pull request #8018 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.10.1
Bump view_component_storybook from 0.9.0 to 0.10.1
2021-08-12 14:27:07 +02:00
Matt-Yorkley
d31ab5b104 Merge pull request #8012 from openfoodfoundation/dependabot/bundler/knapsack-4.0.0
Bump knapsack from 3.1.0 to 4.0.0
2021-08-12 14:26:27 +02:00
Matt-Yorkley
30295c4390 Merge pull request #8013 from openfoodfoundation/dependabot/bundler/webmock-3.14.0
Bump webmock from 3.13.0 to 3.14.0
2021-08-12 14:26:10 +02:00
Matt-Yorkley
1d074c2151 Extract callbacks to a concern 2021-08-12 13:06:50 +01:00
Matt-Yorkley
1147c5b2ca Update saved address loading 2021-08-12 12:53:45 +01:00
Matt-Yorkley
026e51081c Clear invalid payments
When going back and changing the payment option, the previous payment gets invalidated.
2021-08-12 12:53:45 +01:00
Matt-Yorkley
98ae82147c Avoid using Angular in shipping and payment method display 2021-08-12 12:53:45 +01:00
Matt-Yorkley
41c62b97d5 Use flash.now unless redirecting 2021-08-12 12:53:45 +01:00
Matt-Yorkley
dbefd95b5e Improve order workflow shipping method selection 2021-08-12 12:53:45 +01:00
Matt-Yorkley
5fb3943634 Validate payment object exists before advancing from payment to confirmation 2021-08-12 12:53:45 +01:00
Matt-Yorkley
6c885f0f42 Declare validations together 2021-08-12 12:53:45 +01:00
Matt-Yorkley
5d9c4315d8 Remove dead code 2021-08-12 12:53:45 +01:00
Matt-Yorkley
99f0672f9d Set order amount when creating payment object 2021-08-12 12:53:45 +01:00
Matt-Yorkley
598e81ed32 Progress order to address at start of checkout 2021-08-12 12:53:45 +01:00
Matt-Yorkley
7e8daea233 Reduce data loading on steps 2021-08-12 12:53:45 +01:00
Matt-Yorkley
4916f823aa Handle order confirmation 2021-08-12 12:53:45 +01:00
Matt-Yorkley
ffc3736f4b Update fields on confirmation page 2021-08-12 12:53:45 +01:00
Matt-Yorkley
41ffffe170 Tidy up use of @checkout_step 2021-08-12 12:53:45 +01:00
Matt-Yorkley
2a12e21cf4 Merge pull request #8034 from Matt-Yorkley/live
Fix deprecated syntax for live() function
2021-08-12 13:47:50 +02:00
Matt-Yorkley
0158106f28 Merge pull request #7949 from Matt-Yorkley/producers-caching
Fragment-Cache producers AMS data
2021-08-12 13:27:41 +02:00
Matt-Yorkley
fa94392fb6 Fix deprecated syntax for live() function 2021-08-12 12:09:55 +01:00
Matt-Yorkley
3c2c3a1801 Extract helper and update tabs 2021-08-11 16:17:29 +01:00
Matt-Yorkley
070cb1abc1 Improve checkout flow logic 2021-08-11 15:54:21 +01:00
Matt-Yorkley
e91a8d603f Return a boolean in OrderWorkflow#advance_to_state
Returns true if advancing was successful, which is helpful in control flows that use the method in a conditional
2021-08-11 15:53:01 +01:00
Matt-Yorkley
4d77d4df77 Add confirm event and update workflow helpers 2021-08-11 15:53:01 +01:00
Matt-Yorkley
055c6b78af Add order confirmation step to checkout flow 2021-08-11 15:53:01 +01:00
Matt-Yorkley
d113f2a5fc Merge pull request #8004 from jibees/split-checkout-step-3
Split checkout step 3
2021-08-11 16:41:23 +02:00
Matt-Yorkley
a631d057f1 Update payment methods form 2021-08-11 15:22:28 +01:00
Matt-Yorkley
8f7c3a9369 Remove more unused AMS data injection 2021-08-11 15:22:28 +01:00
Jean-Baptiste Bellet
a873499b97 Decrease title font size on checkout
to match specifications
2021-08-11 15:22:28 +01:00
Jean-Baptiste Bellet
b66b1fcdae Add step 3 2021-08-11 15:22:26 +01:00
Jean-Baptiste Bellet
4c81f0f27b Specify name for this payment input 2021-08-11 15:20:03 +01:00
Jean-Baptiste Bellet
c286189225 Add link into success tab
to go back to previous step and edit details once completed
2021-08-11 15:20:01 +01:00
Jean-Baptiste Bellet
66892ed51a Add a success class for step that are already validated 2021-08-11 15:17:08 +01:00
Jean-Baptiste Bellet
623753a745 Add right name to the radio button input 2021-08-11 15:15:31 +01:00
dependabot[bot]
1ec523f558 Bump bugsnag from 6.21.0 to 6.22.1
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.21.0 to 6.22.1.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.21.0...v6.22.1)

---
updated-dependencies:
- dependency-name: bugsnag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 09:03:04 +00:00
Matt-Yorkley
0fefdfb619 Delete unused Angular service ofnConfirmHandler 2021-08-10 16:24:40 +01:00
Matt-Yorkley
f50d4fdee0 Update enterprises spec
The bug mentioned here is no longer present (two alert boxes opened instead of one), and the old hack for Poltergeist is no longer needed. 🎉
2021-08-10 16:22:47 +01:00
Matt-Yorkley
5d4d3d4fcf Trigger a digest cycle when opening modals with dynamic content 2021-08-10 16:22:47 +01:00
Matt-Yorkley
5fb782aeba Update $qProvider configuration
The default logic for how rejected promises are handled has changed slightly. This reinstates the previous default behaviour.
2021-08-10 16:22:47 +01:00
Matt-Yorkley
d268cc7bb7 Replace missing #lowercase function 2021-08-10 16:22:47 +01:00
Matt-Yorkley
40531d769c Update deprecated #success and #error methods on $http service 2021-08-10 16:22:47 +01:00
Matt-Yorkley
5f70275ed4 Update $locationProvider config
The defaults were changed to something our app doesn't expect. This reinstates the expected behavior
2021-08-10 16:22:47 +01:00
Matt-Yorkley
f8e0d71b15 Bump Angular to 1.8.0 2021-08-10 16:22:47 +01:00
Matt-Yorkley
85e83807cf Merge pull request #7989 from Matt-Yorkley/invoice-display
Invoice display
2021-08-10 14:14:41 +02:00
dependabot[bot]
01865cd769 Bump @storybook/server from 6.3.6 to 6.3.7
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.6 to 6.3.7.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.7/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 09:07:11 +00:00
dependabot[bot]
045614fd0c Bump ddtrace from 0.51.1 to 0.52.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.51.1 to 0.52.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.51.1...v0.52.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 09:04:50 +00:00
dependabot[bot]
ba470aa75e Bump view_component from 2.36.0 to 2.37.0
Bumps [view_component](https://github.com/github/view_component) from 2.36.0 to 2.37.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.36.0...v2.37.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 09:03:17 +00:00
Matt-Yorkley
3db6cb2db3 Merge pull request #8005 from Matt-Yorkley/angular-tidyup
Angular tidyup
2021-08-09 18:59:53 +02:00
dependabot[bot]
9bf66a35f9 Bump view_component_storybook from 0.9.0 to 0.10.1
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.9.0 to 0.10.1.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Changelog](https://github.com/jonspalmer/view_component_storybook/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/jonspalmer/view_component_storybook/compare/v0.9.0...v0.10.1)

---
updated-dependencies:
- dependency-name: view_component_storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-09 09:03:36 +00:00
dependabot[bot]
e4611cc604 Bump puma from 5.3.2 to 5.4.0
Bumps [puma](https://github.com/puma/puma) from 5.3.2 to 5.4.0.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.3.2...v5.4.0)

---
updated-dependencies:
- dependency-name: puma
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:04:45 +00:00
dependabot[bot]
705b0d8a71 Bump webmock from 3.13.0 to 3.14.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.13.0 to 3.14.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.13.0...v3.14.0)

---
updated-dependencies:
- dependency-name: webmock
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:03:35 +00:00
dependabot[bot]
f71ae8a496 Bump knapsack from 3.1.0 to 4.0.0
Bumps [knapsack](https://github.com/KnapsackPro/knapsack) from 3.1.0 to 4.0.0.
- [Release notes](https://github.com/KnapsackPro/knapsack/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack/compare/v3.1.0...v4.0.0)

---
updated-dependencies:
- dependency-name: knapsack
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:03:03 +00:00
Matt-Yorkley
d122af286b Update all locales with the latest Transifex translations 2021-08-05 16:38:28 +01:00
Matt-Yorkley
f81abab355 Merge pull request #8002 from Matt-Yorkley/angular-tab-clicks
Avoid opening tabs when navigating away from page
2021-08-05 15:32:18 +02:00
Matt-Yorkley
eec829de0f Merge pull request #7974 from Matt-Yorkley/jquery2
Switch to jQuery 2
2021-08-05 14:47:24 +02:00
Matt-Yorkley
2595cb85f7 Merge pull request #8001 from Matt-Yorkley/terms-and-conditionals
Fix platform terms of service checkbox
2021-08-05 14:17:48 +02:00
Matt-Yorkley
2a5675c526 Merge pull request #7746 from Matt-Yorkley/puma
Puma
2021-08-05 11:55:05 +02:00
Matt-Yorkley
965e8b144e Merge pull request #8007 from openfoodfoundation/dependabot/npm_and_yarn/tar-6.1.5
Bump tar from 6.1.0 to 6.1.5
2021-08-05 10:45:30 +02:00
Matt-Yorkley
05dcf75ff9 Merge pull request #7990 from Matt-Yorkley/void-transactions
Cancel payments on stock shortages
2021-08-05 00:38:33 +02:00
Matt-Yorkley
a92847d80d Merge pull request #7947 from andrewpbrett/zeitwerk
Use zeitwerk for autoloading
2021-08-05 00:36:32 +02:00
dependabot[bot]
6074af349f Bump tar from 6.1.0 to 6.1.5
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.5.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.5)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-04 03:22:21 +00:00
Matt-Yorkley
c18409a6f7 Merge pull request #8003 from openfoodfoundation/dependabot/bundler/bootsnap-1.7.7
Bump bootsnap from 1.7.6 to 1.7.7
2021-08-03 22:07:17 +02:00
Matt-Yorkley
d625e0b643 Merge pull request #8006 from openfoodfoundation/transifex
Transifex
2021-08-03 22:06:10 +02:00
Transifex-Openfoodnetwork
8d16c4c97f Updating translations for config/locales/en_FR.yml 2021-08-04 05:43:13 +10:00
Transifex-Openfoodnetwork
2a1b547b74 Updating translations for config/locales/fr.yml 2021-08-04 05:42:46 +10:00
Transifex-Openfoodnetwork
80a6527a5a Updating translations for config/locales/fr.yml 2021-08-04 05:39:37 +10:00
Matt-Yorkley
ec240283d9 Remove unused Array::unique override 2021-08-03 16:20:20 +01:00
Matt-Yorkley
15b6b1271a Remove event handlers in Angular directives on the $destroy event
This is a common source of memory leaks!
2021-08-03 16:20:19 +01:00
Matt-Yorkley
b15ae89944 Merge pull request #7840 from jibees/new-checkout-first-step
New checkout first + second step
2021-08-03 12:00:26 +02:00
Matt-Yorkley
623c0eada5 Reinstate removed naming on checkout routes and tidy up 2021-08-03 11:24:22 +02:00
Matt-Yorkley
937ba3ca0a Ensure previously selected shipping method is selected in form 2021-08-03 11:24:17 +02:00
Matt-Yorkley
6f2035febe Update (provisional) checkout actions boilerplate 2021-08-03 11:24:13 +02:00
Matt-Yorkley
2207aae679 Add strong params for checkout
We'll need to add more as we go
2021-08-03 11:24:08 +02:00
Matt-Yorkley
a32ca23ca5 Simplify routes and partials 2021-08-03 11:24:03 +02:00
Matt-Yorkley
aba3cf99a3 Fix address2 field 2021-08-03 11:23:58 +02:00
Matt-Yorkley
d10899d9ea Simplify use of nested field helpers 2021-08-03 11:23:53 +02:00
Matt-Yorkley
cea2433c3e Fix indentation 2021-08-03 11:23:30 +02:00
Matt-Yorkley
6b430f9440 Drop AMS injection for shipping methods
We don't need this now
2021-08-03 11:23:10 +02:00
dependabot[bot]
984a549dc3 Bump bootsnap from 1.7.6 to 1.7.7
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.6 to 1.7.7.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.6...v1.7.7)

---
updated-dependencies:
- dependency-name: bootsnap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-03 09:03:27 +00:00
Matt-Yorkley
4569dbe800 Remove unused smoothScrollTo directive 2021-08-02 20:58:10 +01:00
Matt-Yorkley
f5a05bf0d8 Remove angular-backstretch 2021-08-02 20:58:10 +01:00
Matt-Yorkley
54df1b3e51 Fix use of Mixin
Don't bind junk to the window object 👍
2021-08-02 20:58:10 +01:00
Matt-Yorkley
e1155277fc Remove Darkswarm from window 2021-08-02 18:59:42 +01:00
Matt-Yorkley
3acd9ed35c Merge pull request #8000 from openfoodfoundation/dependabot/bundler/i18n-js-3.9.0
Bump i18n-js from 3.8.4 to 3.9.0
2021-08-02 09:37:53 +02:00
Matt-Yorkley
ab0866b57e Avoid opening tabs when navigating away from page
Fixes a long-standing mini bug that creates little javascript console errors. Also stops pointless requests being sent to the server.
2021-08-02 08:07:15 +01:00
Matt-Yorkley
5725989343 Fix deprecated syntax in old controller helper
This syntax for rendering a file isn't valid in Rails 6.x...
2021-07-31 13:11:10 +01:00
Matt-Yorkley
1b112961d1 Handle request timeouts explicitly with rack-timeout
Puma doesn't terminate execution of long-running requests by default.
2021-07-31 13:11:10 +01:00
Matt-Yorkley
af7355a780 Merge pull request #7988 from jibees/7919-add-enterprise-fees-validation
Enterprise fee must be linked with an enterprise: add validations
2021-07-30 19:16:04 +02:00
Matt-Yorkley
27be399727 Merge pull request #7995 from jibees/5168-filter-by-shipping-method-in-OCM-report
Reports/Order Cycle Management: filter by shipping method
2021-07-30 18:29:58 +02:00
Matt-Yorkley
b7a75188d8 Simplify checkbox selectors used in checkout specs 2021-07-30 17:29:21 +01:00
Matt-Yorkley
fc8e69b5de Fix platform terms of service checkbox 2021-07-30 16:50:34 +01:00
Matt-Yorkley
7e3b9be506 Allow StripeSCA Gateway to actually void payments 2021-07-30 11:48:57 +01:00
dependabot[bot]
d1facd3656 Bump i18n-js from 3.8.4 to 3.9.0
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.8.4 to 3.9.0.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.8.4...v3.9.0)

---
updated-dependencies:
- dependency-name: i18n-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-30 09:02:32 +00:00
jibees
e6d600cf57 Merge pull request #7998 from openfoodfoundation/dependabot/bundler/view_component-2.36.0
Bump view_component from 2.35.0 to 2.36.0
2021-07-30 09:18:31 +02:00
Matt-Yorkley
60aec2eff0 Update all locales with the latest Transifex translations 2021-07-29 18:42:50 +01:00
Matt-Yorkley
dd59ae7f69 Merge pull request #7997 from openfoodfoundation/dependabot/bundler/redis-4.4.0
Bump redis from 4.3.1 to 4.4.0
2021-07-29 19:34:25 +02:00
Matt-Yorkley
f18d075220 Merge pull request #7994 from jibees/5472-add-OC-coordinator-to-list-of-enterprises-fees
Add order cycle coordinator to the list of enterprises with fees for order cycle incoming products form
2021-07-29 19:29:00 +02:00
Matt-Yorkley
b22bcd46ff Merge pull request #7993 from openfoodfoundation/dependabot/bundler/haml-5.2.2
Bump haml from 5.2.1 to 5.2.2
2021-07-29 13:28:27 +02:00
dependabot[bot]
948bab47b8 Bump view_component from 2.35.0 to 2.36.0
Bumps [view_component](https://github.com/github/view_component) from 2.35.0 to 2.36.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.35.0...v2.36.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 09:03:35 +00:00
dependabot[bot]
9b11671d34 Bump redis from 4.3.1 to 4.4.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 09:03:11 +00:00
Jean-Baptiste Bellet
09491cfc6d Only return order with the selected shipping rates is true
Same concept as

https://github.com/openfoodfoundation/openfoodnetwork/blob/master/app/services/search_orders.rb#L31
2021-07-28 17:05:50 +02:00
Matt-Yorkley
bd041a2e09 Use puma in the test suite and remove server errors hack 2021-07-28 12:43:05 +01:00
Matt-Yorkley
4fe49fe559 Switch from Unicorn to Puma 2021-07-28 12:37:23 +01:00
Jean-Baptiste Bellet
2116779527 Add order cycle coordinator to the list of enterprises with fees
- Thus, coordinator can choose to add its own fee for a specific supplier
2021-07-28 11:40:57 +02:00
dependabot[bot]
5024d3b707 Bump haml from 5.2.1 to 5.2.2
Bumps [haml](https://github.com/haml/haml) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/haml/haml/releases)
- [Changelog](https://github.com/haml/haml/blob/main/CHANGELOG.md)
- [Commits](https://github.com/haml/haml/compare/5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: haml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-28 09:02:50 +00:00
Matt-Yorkley
b113162582 Merge pull request #7984 from openfoodfoundation/dependabot/bundler/bootsnap-1.7.6
Bump bootsnap from 1.7.5 to 1.7.6
2021-07-28 10:37:20 +02:00
Matt-Yorkley
edb0960a51 Merge pull request #7950 from openfoodfoundation/dependabot/bundler/activerecord-import-1.2.0
Bump activerecord-import from 1.1.0 to 1.2.0
2021-07-28 10:35:08 +02:00
Maikel
5e1f1ca81c Merge pull request #7985 from openfoodfoundation/dependabot/bundler/i18n-js-3.8.4
Bump i18n-js from 3.8.3 to 3.8.4
2021-07-28 10:17:31 +10:00
Maikel
eeaac6fdb0 Merge pull request #7991 from openfoodfoundation/transifex
Transifex
2021-07-28 10:02:43 +10:00
Transifex-Openfoodnetwork
832f08d13a Updating translations for config/locales/de_DE.yml 2021-07-28 09:12:46 +10:00
Matt-Yorkley
e1393c96ca Correctly void transactions when payments are cancelled due to stock issues 2021-07-27 23:24:00 +01:00
Matt-Yorkley
ec84564f28 Add test coverage for TaxHelper 2021-07-27 22:09:14 +01:00
Matt-Yorkley
83f6132b6a Fix shipping tax display in regular invoice template 2021-07-27 22:01:24 +01:00
Jean-Baptiste Bellet
4acc942100 Add appropriate distributors and suppliers to the packing report
ie. the ones that are distributing/supplying products the current user is distributing/supplying

 - As the orders_and_fullfillment reports already had the right filled distributors and suppliers, use the same method: add_appropriate_distributors_and_suppliers
2021-07-27 18:06:30 +02:00
Jean-Baptiste Bellet
434f9600b7 Enterprise fee must be linked with an enterprise
Add 2 validation / errorproof options:
 - Add rails validation on `enterprise_id`  on enterprise_fee model
 - Do not add a blank option on the select: ie. user can select a blank enterprise in the form

Update tests as well
2021-07-27 15:39:40 +02:00
Matt-Yorkley
440eb2a996 Merge pull request #7987 from openfoodfoundation/transifex
Transifex
2021-07-27 14:53:23 +02:00
Transifex-Openfoodnetwork
db0063314b Updating translations for config/locales/en_FR.yml 2021-07-27 22:33:38 +10:00
Transifex-Openfoodnetwork
4e6bc33b05 Updating translations for config/locales/fr.yml 2021-07-27 22:33:04 +10:00
Matt-Yorkley
28fe72c1ec Merge pull request #7976 from openfoodfoundation/transifex
Transifex
2021-07-27 14:26:22 +02:00
Matt-Yorkley
886e03af2f Merge pull request #7805 from Matt-Yorkley/adjustments-admin
[Adjustments] Admin adjustments
2021-07-27 12:23:29 +02:00
Matt-Yorkley
9d4b34b35b Merge pull request #7977 from Matt-Yorkley/tidy-up
Spree tidy-up
2021-07-27 11:52:22 +02:00
Matt-Yorkley
9311070f26 Merge pull request #7979 from Matt-Yorkley/cuprite-update
Test suite update
2021-07-27 11:51:17 +02:00
dependabot[bot]
94e0748234 Bump i18n-js from 3.8.3 to 3.8.4
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.8.3 to 3.8.4.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.8.3...v3.8.4)

---
updated-dependencies:
- dependency-name: i18n-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:03:51 +00:00
dependabot[bot]
23e336c7ac Bump bootsnap from 1.7.5 to 1.7.6
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.5 to 1.7.6.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.5...v1.7.6)

---
updated-dependencies:
- dependency-name: bootsnap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:03:26 +00:00
Matt-Yorkley
a26a78c9fe Merge pull request #7286 from luisramos0/am
Replace setup_intents class from active merchant v1.98 with a decorator that will change the current v1.119
2021-07-26 21:29:01 +02:00
Matt-Yorkley
c00ca35f09 Merge pull request #7972 from jibees/#7928-transform-locale-for-flatpickr
Flatpickr only use language and not locale
2021-07-26 18:31:14 +02:00
Jean-Baptiste Bellet
57d7191332 Add new step, second one: payment method
Add payment method form

- select the right form depending on the path
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
9b29997498 Add selected class on form tab depending on the current path 2021-07-26 15:47:36 +02:00
Andy Brett
3d77ba49ac pseudocode flow for steps 2021-07-26 15:47:36 +02:00
Andy Brett
939169c504 remove unused advance_to_state param 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
91c4beea0f No need to add flash error for error
as we render error on each input with error
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
151a6fd16b Add first stimulus controllers to display elements
1. Introduce a stimulus toggle_controller

 - controller: { "data-controller": "toggle" }
 - action: { "data-action": "toggle#toggle" }
 - show or not: { "data-toggle-show":  true || false  }
- targets: { "data-toggle-target": "content", style: "display: none" }
Display payment method price

2. States are populated via a new dependant_select_controller by stimulus.
Usage:

 - controller : { "data-controller": "dependant-select", "data-dependant-select-options-value": [ [1: ["option", "for", "1"], [2: ["option", "for", "2"] ] }
 - target (on the populating target):  { "data-dependant-select-target": "select" }
 - source and action (on the input that leads the dependant select): {"data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange"}
Some improvements on readability

3. Populate ShippingMethod description thanks to "shippingmethod_controller"


+
 - Add countries and states
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
200ced62fb Load shipping methods in the Controller
needed to populate the form
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
1076ec777c Define a method error_message_on to display error by field 2021-07-26 15:47:36 +02:00
Andy Brett
6866cecdfa start with a straight copy of CheckoutController - WIP! 2021-07-26 15:47:36 +02:00
Andy Brett
0ea968a900 add redirection to correct step 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
87a0a5846d WIP; only advance order to delivery state
Use the hidden_field_tag rails helper and move it
2021-07-26 15:47:36 +02:00
Andy Brett
af79969d96 add SplitCheckoutController and conditional route 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
49f026629c Add tabs for the new split checkout + first step: your details
- Add new split checkout for user with `split_checkout` feature
 - Add the first step: Your details
 - with 3 parts : Your details, Billing address and Delivery address
2021-07-26 15:47:36 +02:00
Matt-Yorkley
4dccd55490 Merge pull request #7981 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.6
Bump @storybook/addon-docs from 6.3.5 to 6.3.6
2021-07-26 14:40:30 +02:00
dependabot[bot]
5c350acb1c Bump @storybook/addon-docs from 6.3.5 to 6.3.6
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.6/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 11:57:32 +00:00
Matt-Yorkley
110a5ed398 Merge pull request #7982 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.6
Bump @storybook/server from 6.3.5 to 6.3.6
2021-07-26 13:53:24 +02:00
Matt-Yorkley
0d4534eff4 Merge pull request #7980 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.6
Bump @storybook/addon-controls from 6.3.5 to 6.3.6
2021-07-26 13:53:10 +02:00
dependabot[bot]
b01888f092 Bump @storybook/server from 6.3.5 to 6.3.6
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.6/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 09:11:05 +00:00
dependabot[bot]
8744441c8a Bump @storybook/addon-controls from 6.3.5 to 6.3.6
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.6/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 09:08:26 +00:00
Matt-Yorkley
6daa37a5c0 Ensure TaxRateFinder returns an array if the given adjustment has no tax 2021-07-25 22:47:40 +01:00
Matt-Yorkley
cb114283ea Update spec/migrations/migrate_admin_tax_amounts_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-07-25 22:47:40 +01:00
Matt-Yorkley
cab36f375b Update app/services/order_tax_adjustments_fetcher.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-07-25 22:47:40 +01:00
Matt-Yorkley
091bfc710f Add test for applying multiple tax rates per tax zone 2021-07-25 22:47:40 +01:00
Matt-Yorkley
69e4670a17 Tidy up building default address objects 2021-07-25 22:47:40 +01:00
Matt-Yorkley
41757254d6 Recalculate taxes when an order's customer details are changed 2021-07-25 22:47:40 +01:00
Matt-Yorkley
d55079f474 Extract comment-method 2021-07-25 22:47:40 +01:00
Matt-Yorkley
ca6979e394 Extract call to Spree::TaxRate.match to a separate method and update tests 2021-07-25 22:47:40 +01:00
Matt-Yorkley
8f62ccb9b7 Match tax rates using rates applicable to the order 2021-07-25 22:47:40 +01:00
Matt-Yorkley
5da545c751 Improve adjustment listing in UI 2021-07-25 22:47:40 +01:00
Luis Ramos
d1f1f62f9a Add needed constant to class eval 2021-07-25 16:08:30 +01:00
Luis Ramos
02b4693068 Fix class name 2021-07-25 16:08:30 +01:00
Luis Ramos
901c1589ee Remove decorator, it's not needed now in v1.119 of active merchant 2021-07-25 16:08:30 +01:00
Luis Ramos
4057445562 Replace setup_intents class from active merchat v1.i98 with a decorator that will adapt the version in v1.119 2021-07-25 16:06:49 +01:00
Matt-Yorkley
21f26669b4 Split spec configurations into smaller parts
base_spec_helper now defines configs that are universal, whereas spec_helper is for configs that are using DatabaseCleaner and Selenium. This means we can include the base_spec_helper in both the system test setup and the regular setup but separate the other configurations for each type.
2021-07-25 12:32:36 +01:00
Matt-Yorkley
afce55dab5 Add Devise System spec helpers
This is recommended when using Devise.
2021-07-25 11:25:44 +01:00
Matt-Yorkley
38aac70705 Remove class_eval on Spree::Gateway 2021-07-24 21:28:13 +01:00
Matt-Yorkley
0764484f41 Remove class_eval in PaymentMethodDistributors 2021-07-24 21:28:13 +01:00
Matt-Yorkley
87c7fceae9 Remove dead code for Ruby 1.8... 2021-07-24 21:28:13 +01:00
Matt-Yorkley
cc1410fbb5 Remove now unused decorator loading 2021-07-24 21:28:13 +01:00
Matt-Yorkley
58f95bd34c Remove ActionController::Metal class_eval hack 2021-07-24 21:28:13 +01:00
Matt-Yorkley
7493697955 Tidy up CalculatedAdjustments in Spree::PaymentMethod 2021-07-24 21:28:13 +01:00
Matt-Yorkley
2d69810c5d Convert CalculatedAdjustments into a proper Concern and remove class_eval 2021-07-24 21:28:13 +01:00
Andy Brett
f2ec806d9c move all calculators to reload block 2021-07-24 11:54:46 -07:00
Andy Brett
afa3de8040 load calculator classes on app reload 2021-07-24 08:24:39 -07:00
Transifex-Openfoodnetwork
d5d378a604 Updating translations for config/locales/en_IE.yml 2021-07-24 23:34:08 +10:00
Andy Brett
bb8dc3f3bc add inflector for StripeSCA 2021-07-23 17:01:22 -07:00
Matt-Yorkley
cdf25ee580 Fix some syntax issues 2021-07-23 23:26:39 +01:00
Matt-Yorkley
6d42820f94 Switch to jQuery 2 2021-07-23 21:49:37 +01:00
Andy Brett
d3ef281e66 Merge pull request #7969 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.5
Bump @storybook/addon-docs from 6.3.4 to 6.3.5
2021-07-23 11:54:53 -07:00
dependabot[bot]
ba59bfd8a4 Bump @storybook/addon-docs from 6.3.4 to 6.3.5
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.4 to 6.3.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.5/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 18:52:48 +00:00
Andy Brett
c15a66d2e1 Merge pull request #7970 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.5
Bump @storybook/addon-controls from 6.3.4 to 6.3.5
2021-07-23 11:47:03 -07:00
dependabot[bot]
efd5629715 Bump @storybook/addon-controls from 6.3.4 to 6.3.5
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.4 to 6.3.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.5/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 18:45:48 +00:00
Andy Brett
96bcaf1b40 Merge pull request #7968 from openfoodfoundation/dependabot/bundler/rubocop-1.18.4
Bump rubocop from 1.18.3 to 1.18.4
2021-07-23 11:45:23 -07:00
Andy Brett
783d2a6a7e Merge pull request #7971 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.5
Bump @storybook/server from 6.3.4 to 6.3.5
2021-07-23 11:40:16 -07:00
Jean-Baptiste Bellet
f39cc49cd2 Create a base_locale attribute onto I18n object
- if "fr": return "fr"
 - if "fr_FR": return "fr"
2021-07-23 14:14:20 +02:00
dependabot[bot]
9c60a2c294 Bump @storybook/server from 6.3.4 to 6.3.5
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.4 to 6.3.5.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.5/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 09:07:10 +00:00
dependabot[bot]
1990bc1ad8 Bump rubocop from 1.18.3 to 1.18.4
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.3 to 1.18.4.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.3...v1.18.4)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 09:01:56 +00:00
Maikel
c9159a3096 Merge pull request #7956 from filipefurtad0/add_ferrum_cuprite
Add the Ferrum-Cuprite driver to the stack
2021-07-23 10:27:41 +10:00
Matt-Yorkley
29acf957ae Update all locales with the latest Transifex translations 2021-07-22 22:16:41 +01:00
Matt-Yorkley
82d8ab0bce Merge pull request #7944 from openfoodfoundation/transifex
Transifex
2021-07-22 23:11:12 +02:00
Filipe
49aa1e189c Merge pull request #69 from Matt-Yorkley/cuprite-tidyup
Cuprite tidyup
2021-07-22 14:30:40 +01:00
Matt-Yorkley
2b4d8fbd63 Reorganise cuprite setup code 2021-07-22 11:01:51 +01:00
Matt-Yorkley
1c493c7238 Don't use feature keyword in system test 2021-07-22 10:49:14 +01:00
Matt-Yorkley
7ee6e48f17 Ignore external scripts
In some cases the browser will try to load external files like fonts, Google maps JS, Stripe JS. This can cause network issues on slow connections and add a lot of unnecessary time to each test.
2021-07-22 10:48:16 +01:00
Matt-Yorkley
0fbba0fa9d Clean up some comments 2021-07-22 10:20:57 +01:00
Matt-Yorkley
a14059a77d Adjust timeout settings for more flexibility 2021-07-22 10:18:50 +01:00
Matt-Yorkley
ac64908c2b Tidy up compiling helper 2021-07-22 10:18:18 +01:00
Filipe
b63eda8adf Merge pull request #68 from Matt-Yorkley/cuprite
Run system tests in their own action
2021-07-21 22:14:41 +01:00
Matt-Yorkley
94e476d21f Run system tests in their own action 2021-07-21 18:58:28 +01:00
filipefurtad0
85d2db52ae Sets headless: true 2021-07-21 16:42:46 +01:00
Transifex-Openfoodnetwork
13e2097272 Updating translations for config/locales/de_DE.yml 2021-07-22 01:34:15 +10:00
filipefurtad0
df7f4d0a31 Removed some unecessary comments 2021-07-21 16:25:20 +01:00
filipefurtad0
ecbab52f06 Removes unecessary CAPYBARA_APP_HOST specification 2021-07-21 15:59:08 +01:00
filipefurtad0
386480d493 Adds changes on Gemfile.lock file 2021-07-21 15:57:42 +01:00
Matt-Yorkley
daa73d1aca Merge pull request #7958 from Matt-Yorkley/pagy-overflow
Add overflow handling on pagination
2021-07-21 13:19:43 +02:00
Matt-Yorkley
7597a58f53 Add overflow handling on pagination 2021-07-21 09:55:42 +01:00
Maikel Linke
cd99b502d8 Update translations 2021-07-21 11:15:39 +10:00
Andy Brett
ba6dd01446 Merge pull request #7957 from Matt-Yorkley/uglifier
Use :harmony option with Uglifier when minimizing javascript
2021-07-20 12:35:36 -07:00
Matt-Yorkley
98ea70bfa0 Use harmony option with Uglifier when minimizing javascript
Resolves a bug where the asset pipeline tries to minify assets that have already been minified by Webpack
2021-07-20 19:11:50 +01:00
jibees
40abefa908 Merge pull request #7955 from Matt-Yorkley/stimulus-js
Add StimulusJS
2021-07-20 17:44:04 +02:00
filipefurtad0
ec07a3cd3d Add the Ferrum-Cuprite driver to the stack 2021-07-20 15:52:21 +01:00
Matt-Yorkley
6882201533 Add StimulusJS and example controller 2021-07-20 15:22:16 +01:00
Transifex-Openfoodnetwork
32a7537cff Updating translations for config/locales/es.yml 2021-07-20 23:38:11 +10:00
Transifex-Openfoodnetwork
94e30b5416 Updating translations for config/locales/ca.yml 2021-07-20 23:37:29 +10:00
Transifex-Openfoodnetwork
71d6680b8b Updating translations for config/locales/en_FR.yml 2021-07-20 17:26:26 +10:00
Transifex-Openfoodnetwork
69a26be0b4 Updating translations for config/locales/fr.yml 2021-07-20 17:26:09 +10:00
Maikel
86500dc2aa Merge pull request #7948 from Matt-Yorkley/remove-foundation-js
Remove Foundation js
2021-07-20 14:57:29 +10:00
Andy Brett
a93eef38c0 Merge pull request #7923 from vishaldeepak/tooltip-order-cycle-subscription
Tooltip added for 'New Schedule' and 'New Order Cycle'
2021-07-19 19:32:09 -07:00
Andy Brett
f60e7a97fd Merge pull request #7953 from filipefurtad0/customer_email_validation
Adds test for valid_email2 email validation
2021-07-19 19:16:36 -07:00
Maikel
b38ad54e15 Merge pull request #7940 from openfoodfoundation/dependabot/bundler/stripe-5.37.0
Bump stripe from 5.36.0 to 5.37.0
2021-07-20 11:08:01 +10:00
filipefurtad0
0e85811cab Adds test for valid_email2 email validation 2021-07-19 18:26:52 +01:00
Matt-Yorkley
51f86cfef4 Merge pull request #7941 from apricot12/revert-7307-Show_notification_setting
Revert 7307 - Profile only producers need the notifications field
2021-07-19 12:07:26 +02:00
dependabot[bot]
fa75d7c440 Bump activerecord-import from 1.1.0 to 1.2.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/zdennis/activerecord-import/releases)
- [Changelog](https://github.com/zdennis/activerecord-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zdennis/activerecord-import/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: activerecord-import
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 09:02:31 +00:00
Transifex-Openfoodnetwork
f0946edfe0 Updating translations for config/locales/fr_CA.yml 2021-07-19 03:11:22 +10:00
Matt-Yorkley
ce24aef5aa Add easy toggle for caching in dev with Redis 2021-07-18 13:45:28 +01:00
Matt-Yorkley
a739e78ff7 Cache producers AMS data 2021-07-18 12:23:31 +01:00
Matt-Yorkley
03863d2bb2 Delete some other dead frontend code 2021-07-18 11:25:01 +01:00
Matt-Yorkley
e2bcb80ac4 Remove Foundation framework JS from Darkswarm 2021-07-18 11:25:01 +01:00
Andy Brett
84c3b39e15 use zeitwerk for autoloading 2021-07-17 16:41:35 -07:00
Andy Brett
c6743d8c6b Merge pull request #7800 from pacodelaluna/improve-dfc-logic
Improve DFC Provider logic to use existing business logic
2021-07-16 15:56:09 -07:00
Transifex-Openfoodnetwork
c684fb8357 Updating translations for config/locales/en_GB.yml 2021-07-16 21:33:15 +10:00
Maikel Linke
fd8766ec77 Update translations 2021-07-16 10:41:08 +10:00
Maikel
3e66f475e5 Merge pull request #7925 from openfoodfoundation/transifex
Transifex
2021-07-16 10:32:46 +10:00
Maikel
6de27703af Merge pull request #7915 from vishaldeepak/payment-state-translation
Fixed Bug on payment transalation state
2021-07-16 10:29:53 +10:00
Maikel
f448c95bbe Merge pull request #7886 from apricot12/invalid_customer_email_subscription_fail
Add valid_email2 gem for email validation to fix subscription failures with invalid emails.
2021-07-16 10:20:37 +10:00
François Turbelin
39bb25e959 Adjust supplied_products id before better data matching 2021-07-15 21:17:14 +02:00
Nihal Mohammed
3793585c38 Revert changes made in #7307 2021-07-16 00:28:40 +05:30
dependabot[bot]
7ef95f82c0 Bump stripe from 5.36.0 to 5.37.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.36.0 to 5.37.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.36.0...v5.37.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-15 09:04:16 +00:00
Transifex-Openfoodnetwork
a46145f44f Updating translations for config/locales/ru.yml 2021-07-15 18:45:17 +10:00
Transifex-Openfoodnetwork
20d4cb1366 Updating translations for config/locales/es.yml 2021-07-15 03:46:05 +10:00
Transifex-Openfoodnetwork
f269fb9104 Updating translations for config/locales/ca.yml 2021-07-15 03:45:09 +10:00
Andy Brett
ac0c1f3c70 Merge pull request #7823 from apricot12/Migrate_Kaminari_to_Pagy_for_pagination
Migrate kaminari to pagy for pagination
2021-07-14 10:11:11 -07:00
Andy Brett
a58e0fe217 Merge pull request #7926 from luisramos0/rubocop_fix
Update Rubocop todo files
2021-07-14 10:05:54 -07:00
Andy Brett
09790b35ef Merge pull request #7927 from openfoodfoundation/dependabot/bundler/ddtrace-0.51.1
Bump ddtrace from 0.51.0 to 0.51.1
2021-07-14 10:03:50 -07:00
François Turbelin
c4a7c05c05 Use check_enterprise filter in a better way 2021-07-14 14:59:19 +02:00
François Turbelin
155d05265d Use manually generated values to test urls 2021-07-14 14:24:10 +02:00
Matt-Yorkley
4b4450d34f Update conditional pagination in Api::OrdersController 2021-07-14 13:19:02 +01:00
Matt-Yorkley
447165f8a1 Update #expect calls to count products correctly 2021-07-14 13:19:02 +01:00
Matt-Yorkley
c1b85b7409 Revert removal of default argument in #fetchResults 2021-07-14 13:19:02 +01:00
Matt-Yorkley
cc5b310694 Fix javascript errors where $scope.filteredLineItems hasn't been initialized yet 2021-07-14 13:19:02 +01:00
Nihal Mohammed
1ac2e1a8a6 Try reverting shopping_spec 2021-07-14 13:19:02 +01:00
Nihal Mohammed
2acc339341 Update shoppign spec 2021-07-14 13:19:02 +01:00
Nihal Mohammed
894a11c9c1 Update shopping spec to fix CI error 2021-07-14 13:18:01 +01:00
Nihal Mohammed
5864e2d36e Update states controller spec 2021-07-14 13:18:01 +01:00
Nihal Mohammed
6bd28bcad8 Update products_renderer for pagy pagination 2021-07-14 13:17:33 +01:00
Matt-Yorkley
4187380225 Customise partial used for showing pagination links 2021-07-14 13:17:33 +01:00
Matt-Yorkley
786cb06c7d Drop duplicate pagination buttons on top of tax zones config page
Showing these buttons at both the top and bottom is inconsistent with other pages like admin/users that have a similar layout and UI; they only show the buttons on the bottom.
2021-07-14 13:17:33 +01:00
Matt-Yorkley
60595059e2 Drop unused options from Pagy initializer 2021-07-14 13:17:33 +01:00
Matt-Yorkley
41f9f07a80 Simplify cases where pagination is conditional and pagination data may or may not be used 2021-07-14 13:17:33 +01:00
Matt-Yorkley
e5afa3a26e Simplify #pagy calls without default item counts
Pagy will pick up the :per_page param by default now, so we don't need to specify `items: params[:per_page]` unless we want to use something beyond that param's value.
2021-07-14 13:17:33 +01:00
Matt-Yorkley
b3c4a38b0f Enable 'pagy/extras/items' for customising items parameter 2021-07-14 13:17:33 +01:00
Matt-Yorkley
18d98500e9 Update pagination in Admin::ZonesController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
a821117b83 Update pagination in Admin::UsersController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
a146782bcd Update pagination in Api::StatesController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
eba60a6130 Deal with Api::OrdersController and SearchOrders service 2021-07-14 13:17:33 +01:00
Matt-Yorkley
3213c30a37 Update pagination in Api::ExchangeProductsController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
6fe68322da Update pagination in Admin::BulkLineItemsController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
1dddaf9b14 Remove dead code in Admin::ProductsController
This is related to some of the data-loading for index actions inherited from Spree's Admin::ResourceController, but we don't actually use it any more...
2021-07-14 13:17:33 +01:00
Nihal Mohammed
e5bdaa603a Setup pagy 2021-07-14 13:17:33 +01:00
François Turbelin
9d1b059835 Fix typo in supplied_products_controller comment 2021-07-14 14:08:09 +02:00
vishaldeepak
b70ba7085a Tooltip added for 'New Schedule' and 'New Order Cycle' in Order Cycles tab of admin 2021-07-14 15:15:12 +05:30
dependabot[bot]
97e8d1d708 Bump ddtrace from 0.51.0 to 0.51.1
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.51.0 to 0.51.1.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/v0.51.1/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.51.0...v0.51.1)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-14 09:02:16 +00:00
Maikel
6e25dec617 Merge pull request #7921 from openfoodfoundation/dependabot/bundler/ddtrace-0.51.0
Bump ddtrace from 0.50.0 to 0.51.0
2021-07-14 15:26:01 +10:00
Maikel
9b5e70dc17 Merge pull request #7916 from openfoodfoundation/dependabot/bundler/addressable-2.8.0
Bump addressable from 2.7.0 to 2.8.0
2021-07-14 15:24:26 +10:00
Maikel
529ea20289 Merge pull request #7913 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.0.0
Bump shoulda-matchers from 4.5.1 to 5.0.0
2021-07-14 15:23:04 +10:00
Maikel
95e5bf16dd Merge pull request #7898 from psychoslave/fit/schema
Update schema after recent migrations
2021-07-14 15:19:51 +10:00
Maikel
3e15e87b11 Merge pull request #7909 from shen-sat/7470-add-shipping-category-feature-test
7470 add shipping category feature test
2021-07-14 14:29:29 +10:00
Luis Ramos
1fb162bb4c Result of running rubocop -a, safe auto correct 2021-07-13 23:06:56 +01:00
Luis Ramos
04ac55b91e Move nesting blocks rule from 4 to 3, same exception list 2021-07-13 22:55:17 +01:00
Luis Ramos
08a4536a6a Update rubocop manual todo
After this commit we can run rubocop and get no offenses
2021-07-13 22:52:57 +01:00
Luis Ramos
01fe6abeed Result of rubocop -a, safe autocorrect 2021-07-13 22:38:05 +01:00
Luis Ramos
a7944af73d Update rubocop todo file 2021-07-13 22:32:28 +01:00
Andy Brett
094ef92638 Merge pull request #7920 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.9.0
Bump view_component_storybook from 0.8.0 to 0.9.0
2021-07-13 14:06:38 -07:00
Andy Brett
98e4136be5 Merge pull request #7912 from openfoodfoundation/dependabot/bundler/stripe-5.36.0
Bump stripe from 5.35.0 to 5.36.0
2021-07-13 14:04:21 -07:00
Transifex-Openfoodnetwork
61598fc971 Updating translations for config/locales/en_CA.yml 2021-07-14 05:40:31 +10:00
Transifex-Openfoodnetwork
e4a7fe7cb2 Updating translations for config/locales/de_DE.yml 2021-07-14 05:12:41 +10:00
Transifex-Openfoodnetwork
8ba0ac0b8f Updating translations for config/locales/en_FR.yml 2021-07-14 01:53:29 +10:00
Transifex-Openfoodnetwork
511bb73278 Updating translations for config/locales/fr.yml 2021-07-14 01:53:21 +10:00
Mathieu Lovato Stumpf Guntz
2522ac4ad5 Merge branch 'master' into fit/schema 2021-07-13 16:45:40 +02:00
Mathieu Lovato Stumpf Guntz
89f97ba0ec integrate db/schema.rb changes 2021-07-13 16:43:55 +02:00
Andy Brett
ef4454ddba Merge pull request #7892 from andrewpbrett/grouped-tax-invoices
Remove duplicative tax line on invoices
2021-07-13 06:30:30 -07:00
Matt-Yorkley
0d16be3f94 Merge pull request #7779 from Matt-Yorkley/stripe-stock-check
Stripe stock check
2021-07-13 14:46:34 +02:00
Matt-Yorkley
70dde65687 Merge pull request #7917 from andrewpbrett/fix-chrome-autocomplete
Use `autocomplete: off` on bulk product page form
2021-07-13 13:22:15 +02:00
dependabot[bot]
33cfee2f9f Bump ddtrace from 0.50.0 to 0.51.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.50.0 to 0.51.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.50.0...v0.51.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:03:20 +00:00
dependabot[bot]
8f2403394e Bump view_component_storybook from 0.8.0 to 0.9.0
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Commits](https://github.com/jonspalmer/view_component_storybook/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: view_component_storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:02:14 +00:00
Shen Sat
2f9751f7ea Fix typo and remove WebHelper 2021-07-13 08:54:19 +01:00
Andy Brett
b475476a22 Update all locales with the latest Transifex translations 2021-07-12 15:45:59 -07:00
Andy Brett
01bfd4bd9d Merge pull request #7911 from openfoodfoundation/transifex
Transifex
2021-07-12 15:43:21 -07:00
Andy Brett
128a2127c9 use autocomplete: off on bulk product page form 2021-07-12 14:41:57 -07:00
dependabot[bot]
22860839e6 Bump addressable from 2.7.0 to 2.8.0
Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/sporkmonger/addressable/releases)
- [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0)

---
updated-dependencies:
- dependency-name: addressable
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 17:22:56 +00:00
Andy Brett
117f0b41a2 Merge pull request #7908 from Matt-Yorkley/pry-warnings
Fix deprecation issues with pry-byebug
2021-07-12 10:22:06 -07:00
Andy Brett
5efc3dc221 Merge pull request #7914 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.3
Bump rubocop-rails from 2.11.2 to 2.11.3
2021-07-12 09:50:40 -07:00
Andy Brett
7d399b4c6d Remove duplicative line item for taxes 2021-07-12 09:16:28 -07:00
vishaldeepak
691853843d Fixed Bug on payment transalation state 2021-07-12 15:45:27 +05:30
dependabot[bot]
08529b3e7e Bump rubocop-rails from 2.11.2 to 2.11.3
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.2...v2.11.3)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:07:00 +00:00
dependabot[bot]
d576f3ea96 Bump shoulda-matchers from 4.5.1 to 5.0.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 4.5.1 to 5.0.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v4.5.1...v5.0.0)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:04:59 +00:00
dependabot[bot]
63597b0221 Bump stripe from 5.35.0 to 5.36.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.35.0 to 5.36.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.35.0...v5.36.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:02:50 +00:00
Transifex-Openfoodnetwork
afbd2b520e Updating translations for config/locales/en_GB.yml 2021-07-12 18:13:42 +10:00
Matt-Yorkley
8e1631bfc7 Set adjustments associated with voided payments to ineligible.
Otherwise we can end up with duplicate transaction fees for voided payments.
2021-07-12 08:28:32 +01:00
Shen Sat
63cb82717b Add feature test for shipping categories 2021-07-11 19:42:41 +01:00
Matt-Yorkley
cb1fd77531 Fix deprecation issues with pry-byebug
The latest version of pry-byebug and the latest version of pry have some weird compatibility issues. The solution requires downgrading pry slightly and upgrading pry-byebug. Fixes:
```
lib/ruby/gems/2.7.0/gems/pry-byebug-3.8.0/lib/pry-byebug/control_d_handler.rb:5:
warning: control_d_handler's arity of 2 parameters was deprecated (eval_string, pry_instance).Now it gets passed just 1 parameter (pry_instance)
```
2021-07-11 18:40:59 +01:00
Matt-Yorkley
77e4a6c465 Migrate admin adjustment tax amounts 2021-07-09 21:50:12 +01:00
Matt-Yorkley
200dde18e8 Update admin adjustment taxes in OrderAdjustmentsFetcher spec 2021-07-09 21:49:36 +01:00
Matt-Yorkley
fe92c31f4a Update AdjustmentsController specs 2021-07-09 21:49:36 +01:00
Matt-Yorkley
cb039fd880 Delete dead code Adjustment#display_included_tax 2021-07-09 21:49:36 +01:00
Matt-Yorkley
3ae31ec1ce Simplify tax adjustment sums in Order::Updater 2021-07-09 21:49:36 +01:00
Matt-Yorkley
12c9914d1b Delete old Adjustment scopes #with_tax and #without_tax 2021-07-09 21:49:36 +01:00
Matt-Yorkley
0876f2ae0d Remove tax rate guessing from TaxRateFinder
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
f2e63fff2e Delete dead code TaxRate: #compute_tax and #with_tax_included_in_price
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
33fc5bbaa2 Delete dead code TaxRate#compute_tax
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
b3f5780862 Refactor OrderTaxAdjustmentsFetcher
Note: we're only dealing with tax adjustments here, and each adjustment has a single associated tax rate, not multiple.
2021-07-09 21:49:35 +01:00
Matt-Yorkley
c60554a14a Update display of associated tax amounts 2021-07-09 21:49:35 +01:00
Matt-Yorkley
ad1b9f3f2f Update Adjustment#has_tax? 2021-07-09 21:49:35 +01:00
Matt-Yorkley
c16e008ba1 Delete dead code Adjustment#set_absolute_included_tax! 2021-07-09 21:49:35 +01:00
Matt-Yorkley
9215d3292b Remove edit/delete buttons for shipping and payment adjustments 2021-07-09 21:49:35 +01:00
Matt-Yorkley
ea9724a671 Remove dead code #adjustment_tax_amount and #no_tax_adjustments? 2021-07-09 21:49:35 +01:00
Matt-Yorkley
02fc3089d6 Remove dead code OrderTaxAdjustmentsFetcher#all 2021-07-09 21:49:35 +01:00
Matt-Yorkley
18e5fd19fa Update admin adjustment edit forms 2021-07-09 21:49:35 +01:00
Matt-Yorkley
f037bda1de Replace callback for applying tax to an admin adjustment
🎉
2021-07-09 21:49:35 +01:00
Matt-Yorkley
0c369b618d Remove code that guesses what the tax rate might be
🎉
2021-07-09 21:49:35 +01:00
Matt-Yorkley
65eb33ad9e Only update totals and states in AdjustmentsController
Avoids unnecessary updating of all other adjustments
2021-07-09 21:49:35 +01:00
Matt-Yorkley
e8d610f9df Remove dead code AdjustmentsController#enable_updates 2021-07-09 21:49:35 +01:00
Andy Brett
718f9c4af8 Merge pull request #7848 from jibees/7842-locale-management-on-user_passwords-controller
Handle lang management on user passwords controller
2021-07-09 08:55:09 -07:00
Matt-Yorkley
db7c397345 Merge pull request #7906 from openfoodfoundation/transifex
Transifex
2021-07-09 16:53:44 +02:00
Transifex-Openfoodnetwork
e19a407a39 Updating translations for config/locales/ru.yml 2021-07-09 23:31:56 +10:00
Transifex-Openfoodnetwork
3c104158db Updating translations for config/locales/ru.yml 2021-07-09 23:28:55 +10:00
Transifex-Openfoodnetwork
d9e0a6a04f Updating translations for config/locales/fr.yml 2021-07-09 23:28:44 +10:00
Transifex-Openfoodnetwork
99f127148e Updating translations for config/locales/ru.yml 2021-07-09 23:26:43 +10:00
Transifex-Openfoodnetwork
cce6ba65dd Updating translations for config/locales/fr.yml 2021-07-09 23:25:43 +10:00
Transifex-Openfoodnetwork
bb6162059d Updating translations for config/locales/en_FR.yml 2021-07-09 23:25:34 +10:00
Matt-Yorkley
32a2610e7d Refactor arguments for PaymentIntentValidator 2021-07-09 13:42:41 +01:00
Matt-Yorkley
e1846b1030 Extract Stripe payment helper methods to a service 2021-07-09 13:42:40 +01:00
Matt-Yorkley
dcc808a8b9 Improve #stripe_status return value for failed actions 2021-07-09 13:41:54 +01:00
Matt-Yorkley
986d068e28 Add #stripe_captured? method to Payment 2021-07-09 13:41:54 +01:00
Matt-Yorkley
65d9325287 Add #stripe_status helper method to Payment
This method could definitely be used elsewhere, but is currently most useful in debugging; at any time in the console you can bring up a payment object and call #stripe_status on it, and it'll make a live call to Stripe and tell you exactly what state the payment is in on the Stripe side.
2021-07-09 13:41:03 +01:00
Matt-Yorkley
e5a85caef6 Refactor Stripe::PaymentIntentValidator
This makes the interface a lot simpler and moves the fetching of the information it requires inside the service itself.
2021-07-09 13:39:52 +01:00
Matt-Yorkley
e6d9545c30 Use :incomplete scope when voiding payments that can't be processed due to stock changes 2021-07-09 13:31:00 +01:00
Transifex-Openfoodnetwork
4162215582 Updating translations for config/locales/fr.yml 2021-07-09 22:30:01 +10:00
Matt-Yorkley
2b8b690892 Tidy up :valid scope in Spree::Payment 2021-07-09 13:28:38 +01:00
Matt-Yorkley
b4a9a6fea5 Add :incomplete scope in Spree::Payment 2021-07-09 13:28:19 +01:00
Transifex-Openfoodnetwork
cf66d96746 Updating translations for config/locales/en_FR.yml 2021-07-09 22:27:37 +10:00
Transifex-Openfoodnetwork
c82db9716c Updating translations for config/locales/fr.yml 2021-07-09 22:26:57 +10:00
Matt-Yorkley
b1db06a3c6 Allow payments in requires_authorization state to be voided 2021-07-09 13:24:37 +01:00
Matt-Yorkley
a199f80ed4 Add test for insufficient stock behavior after Stripe redirect 2021-07-09 13:14:43 +01:00
Matt-Yorkley
2cd6b05aba Use Order::Contents service in test setup 2021-07-09 13:14:43 +01:00
Matt-Yorkley
9bcf0d5b38 Handle Stripe payments when checkout fails due to stock issues
This can occur when stock is reduced after the user is redirected to Stripe and before they are redirected back. The stock is insufficient, the order is not complete, the user is bounced back to the cart, but a *pending* Stripe payment is left on the order.
2021-07-09 13:13:20 +01:00
Matt-Yorkley
9795734dc8 Merge pull request #7903 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.4
Bump @storybook/addon-controls from 6.3.3 to 6.3.4
2021-07-09 12:41:48 +02:00
Matt-Yorkley
e5242bab49 Merge pull request #7902 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.4
Bump @storybook/server from 6.3.3 to 6.3.4
2021-07-09 12:41:30 +02:00
Matt-Yorkley
d4052a0e62 Merge pull request #7893 from guidoDutra/1861-add-shopfront-sort-placeholder-translations
Add translations to shopfront sorting placeholders
2021-07-09 12:37:40 +02:00
dependabot[bot]
b5b4f6df82 Bump @storybook/addon-controls from 6.3.3 to 6.3.4
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.3 to 6.3.4.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.4/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 09:07:59 +00:00
dependabot[bot]
d89ae67c4d Bump @storybook/server from 6.3.3 to 6.3.4
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.3 to 6.3.4.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.4/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 09:05:47 +00:00
jibees
a225a4e440 Merge pull request #7901 from openfoodfoundation/revert-7821-dependabot/npm_and_yarn/webpack-cli-4.7.2
Revert "Bump webpack-cli from 3.3.12 to 4.7.2"
2021-07-09 11:02:15 +02:00
Matt-Yorkley
626ced812a Revert "Bump webpack-cli from 3.3.12 to 4.7.2" 2021-07-09 10:38:47 +02:00
Maikel
75bdb82b5c Merge pull request #7900 from openfoodfoundation/transifex
Transifex
2021-07-09 17:19:08 +10:00
Transifex-Openfoodnetwork
74ba812061 Updating translations for config/locales/ru.yml 2021-07-09 16:23:32 +10:00
Andy Brett
c966c3b8d7 Merge pull request #7889 from openfoodfoundation/transifex
Transifex
2021-07-08 17:16:36 -07:00
Andy Brett
762d0ca338 Merge pull request #7899 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.4
Bump @storybook/addon-docs from 6.3.2 to 6.3.4
2021-07-08 16:55:17 -07:00
dependabot[bot]
131b22576b Bump @storybook/addon-docs from 6.3.2 to 6.3.4
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.2 to 6.3.4.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.4/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-08 23:34:47 +00:00
Andy Brett
704da21c60 Merge pull request #7897 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.3
Bump @storybook/server from 6.3.2 to 6.3.3
2021-07-08 16:29:27 -07:00
Andy Brett
8bbb150b07 Merge pull request #7896 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.3
Bump @storybook/addon-controls from 6.3.2 to 6.3.3
2021-07-08 16:29:12 -07:00
Mathieu Lovato Stumpf Guntz
9670ca0fbb Update schema after recent migrations
Add table `terms_of_service_files` and a `tax_category_id` field
2021-07-08 19:10:53 +02:00
dependabot[bot]
76f91e7854 Bump @storybook/server from 6.3.2 to 6.3.3
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.2 to 6.3.3.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.3/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-08 09:06:23 +00:00
dependabot[bot]
f911f66ead Bump @storybook/addon-controls from 6.3.2 to 6.3.3
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.2 to 6.3.3.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.3/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-08 09:05:45 +00:00
Jean-Baptiste Bellet
1a8a12fb0c Filter language to not display the current lang in the dropdown
No need to set a lang that is actually already set
2021-07-08 09:15:09 +02:00
Guido Oliveira
9bc41cf04f Add translations to shopfront sorting placeholders 2021-07-07 14:39:10 -03:00
Andy Brett
869532d094 Merge pull request #7888 from openfoodfoundation/dependabot/bundler/rubocop-1.18.3
Bump rubocop from 1.18.2 to 1.18.3
2021-07-07 09:36:57 -07:00
Nihal Mohammed
db88121ed8 Update Customer model to validate email with valid_email2 gem 2021-07-07 20:30:06 +05:30
Nihal Mohammed
262baf1870 Add valid_email2 gem to Gemfile and run bundle install 2021-07-07 20:00:00 +05:30
Transifex-Openfoodnetwork
277a2a4d58 Updating translations for config/locales/de_DE.yml 2021-07-07 22:50:38 +10:00
dependabot[bot]
11a748b94e Bump rubocop from 1.18.2 to 1.18.3
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.2 to 1.18.3.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.2...v1.18.3)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 09:04:35 +00:00
Andy Brett
46cd05c54a Merge pull request #7712 from guidoDutra/1861-enable-shopfront-sorting-by-producer
Enable sorting by producer in shopfront
2021-07-06 09:27:42 -07:00
Andy Brett
ff3784ad3f Merge pull request #7851 from apricot12/view_deleted_payments_in_admin
Allow viewing of payments made with deleted pyment methods in admin
2021-07-06 07:24:42 -07:00
Andy Brett
4f18cf6645 Merge pull request #7882 from openfoodfoundation/dependabot/bundler/view_component-2.35.0
Bump view_component from 2.34.0 to 2.35.0
2021-07-06 06:43:38 -07:00
Jean-Baptiste Bellet
aa982fe8df Create a new method to change the lang of the app
- The old method (link to `?locale=#{l.to_s}`) was not functional for path that already has query params in current path (such as `/user/spree_user/password/edit?reset_password_token=`) ;
 - This seems that the best way to handle this, is to create a new route, new method that effectively set the lang (not the locale actually...) and then redirect_back (ie. using the HTTP_REFERER, with a fallback to `/`)

s
2021-07-06 10:09:37 +02:00
Andy Brett
6a126835cc Merge pull request #7881 from openfoodfoundation/dependabot/bundler/rubocop-1.18.2
Bump rubocop from 1.18.1 to 1.18.2
2021-07-05 10:30:01 -07:00
Pau Pérez Fabregat
c95ce5eb12 Merge pull request #7867 from coopdevs/enable-simplecov-in-dev
Fix coverage in development skipping Codecov
2021-07-05 15:23:29 +02:00
dependabot[bot]
86717f7b25 Bump view_component from 2.34.0 to 2.35.0
Bumps [view_component](https://github.com/github/view_component) from 2.34.0 to 2.35.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.34.0...v2.35.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 09:03:26 +00:00
dependabot[bot]
35fb4c03a7 Bump rubocop from 1.18.1 to 1.18.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.1...v1.18.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 09:02:47 +00:00
Andy Brett
f1cf828f34 Merge pull request #7550 from openfoodfoundation/dependabot/bundler/paper_trail-12.0.0
Bump paper_trail from 10.3.1 to 12.0.0
2021-07-02 10:14:53 -07:00
Andy Brett
ddf6d0b7e2 Merge pull request #7874 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.2
Bump rubocop-rails from 2.11.1 to 2.11.2
2021-07-02 07:19:49 -07:00
Matt-Yorkley
b1324c6269 Merge pull request #7745 from Matt-Yorkley/dotenv
Dotenv
2021-07-02 15:03:15 +02:00
dependabot[bot]
26123510a6 Bump rubocop-rails from 2.11.1 to 2.11.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.1 to 2.11.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.1...v2.11.2)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 09:04:00 +00:00
Andy Brett
3e860f6d54 Merge pull request #7781 from andrewpbrett/decouple-payments
Decouple payments
2021-07-01 18:07:01 -07:00
Matt-Yorkley
97a087707d Merge pull request #7873 from openfoodfoundation/transifex
Transifex
2021-07-01 18:57:56 +02:00
Transifex-Openfoodnetwork
f065df669a Updating translations for config/locales/de_DE.yml 2021-07-02 02:28:44 +10:00
Transifex-Openfoodnetwork
a2196b08a3 Updating translations for config/locales/en_IE.yml 2021-07-02 02:28:42 +10:00
Transifex-Openfoodnetwork
aa7d08dff7 Updating translations for config/locales/en_FR.yml 2021-07-02 02:25:41 +10:00
Transifex-Openfoodnetwork
fab3486669 Updating translations for config/locales/en_GB.yml 2021-07-02 02:25:38 +10:00
Transifex-Openfoodnetwork
71e97b3eba Updating translations for config/locales/es.yml 2021-07-02 02:25:35 +10:00
Pau Pérez Fabregat
021f33645d Merge pull request #7629 from viktorsmari/remove-bin-from-gitignore
Stop gitignoring the bin/ folder
2021-07-01 18:04:01 +02:00
Andy Brett
058ba2bb8c Merge pull request #7862 from openfoodfoundation/dependabot/bundler/stripe-5.35.0
Bump stripe from 5.34.0 to 5.35.0
2021-07-01 08:50:29 -07:00
Andy Brett
a5ead1da86 Merge pull request #7870 from andrewpbrett/revert-webpack-again
Revert "Bump webpack from 5.41.0 to 5.41.1"
2021-07-01 08:46:41 -07:00
Andy Brett
0af845a02d Revert "Bump webpack from 5.41.0 to 5.41.1"
This reverts commit 1a8a0f33d0.
2021-07-01 08:45:34 -07:00
Andy Brett
79eef161f5 Merge pull request #7866 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.2
Bump @storybook/addon-docs from 6.3.1 to 6.3.2
2021-07-01 08:03:03 -07:00
Matt-Yorkley
0005a77115 Update all locales with the latest Transifex translations 2021-07-01 16:01:24 +01:00
Matt-Yorkley
a0b9eff2c1 Merge pull request #7699 from guidoDutra/1971-inventory-page-field-validation
Add validation to inventory page fields
2021-07-01 16:59:20 +02:00
dependabot[bot]
c571767cfb Bump @storybook/addon-docs from 6.3.1 to 6.3.2
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.2/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 14:58:58 +00:00
Andy Brett
b9bb43054a Merge pull request #7863 from openfoodfoundation/dependabot/bundler/good_migrations-0.1.0
Bump good_migrations from 0.0.2 to 0.1.0
2021-07-01 07:51:27 -07:00
Andy Brett
8fb51165bc Merge pull request #7865 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.2
Bump @storybook/addon-controls from 6.3.1 to 6.3.2
2021-07-01 07:49:47 -07:00
Nihal Mohammed
5e7d4bf0c3 Allow viewing of payments made with deleted pyment methods in admin 2021-07-01 19:29:16 +05:30
Pau Pérez Fabregat
f6e0b9af0e Merge pull request #7646 from apricot12/advanced_settings_button_OC_edits
Add advanced settings button to incoming and outgoing pages in OC cyc…
2021-07-01 15:37:16 +02:00
Matt-Yorkley
d2ebda8844 Merge pull request #7856 from andrewpbrett/raise-on-missing-translations
Update config to address deprecation warning for missing translations
2021-07-01 14:22:23 +02:00
Pau Pérez Fabregat
8883aa13ad Merge pull request #7814 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-8.1.0
Bump acts-as-taggable-on from 8.0.0 to 8.1.0
2021-07-01 14:00:17 +02:00
Matt-Yorkley
12f7e2d685 Set nicer Redis defaults for dev environment
In Staging and Production we have two Redis instances running on two different ports. In dev that probably won't be set up, and Redis will be on port 6379 by default. These defaults mean it will work nicely out of the box.
2021-07-01 12:59:11 +01:00
Matt-Yorkley
083f512aae Refactor Sidekiq settings and set expiry in development
This means old cache entries will be automatically removed instead of perpetually filling up the local Redis instance in dev.
2021-07-01 12:59:11 +01:00
Matt-Yorkley
5a06ba651a Add dev and test Dotenv files
These can now be defined separately and overridden locally 🎉
2021-07-01 12:59:11 +01:00
Matt-Yorkley
d31208d1e5 Switch from Figaro to Dotenv for ENV var management 2021-07-01 12:59:11 +01:00
dependabot[bot]
7b2f2ef690 Bump @storybook/addon-controls from 6.3.1 to 6.3.2
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.2/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 11:58:26 +00:00
Pau Pérez Fabregat
13dfbb9a0c Merge pull request #7859 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.41.1
Bump webpack from 5.41.0 to 5.41.1
2021-07-01 13:55:47 +02:00
Pau Pérez Fabregat
8b12fd4af1 Merge pull request #7864 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.2
Bump @storybook/server from 6.3.1 to 6.3.2
2021-07-01 13:55:24 +02:00
Pau Pérez Fabregat
f071ab2038 Merge pull request #7807 from mkllnk/rbenv-install
Add convenience script to install Ruby
2021-07-01 13:53:54 +02:00
Pau Perez
f49e5a8610 Fix coverage in development skipping Codecov
The way we have it set up, Simplecov generates a report in Codecov's format
and tries to send it to them, which fails.

This gets us back to the former Simplecov setup. This lets you check the
visual coverage report navigating to `coverage/index.html`.
2021-07-01 13:34:16 +02:00
dependabot[bot]
16d0235a6e Bump @storybook/server from 6.3.1 to 6.3.2
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.2/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 09:05:40 +00:00
dependabot[bot]
ea8cb9ce7d Bump good_migrations from 0.0.2 to 0.1.0
Bumps [good_migrations](https://github.com/testdouble/good-migrations) from 0.0.2 to 0.1.0.
- [Release notes](https://github.com/testdouble/good-migrations/releases)
- [Changelog](https://github.com/testdouble/good-migrations/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testdouble/good-migrations/compare/v0.0.2...v0.1.0)

---
updated-dependencies:
- dependency-name: good_migrations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 09:04:42 +00:00
dependabot[bot]
00b6b58b4d Bump stripe from 5.34.0 to 5.35.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.34.0 to 5.35.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.34.0...v5.35.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 09:04:14 +00:00
Maikel Linke
23ebe91d32 Spec current version tracking of order cycles
The paper_trail gem doesn't quite work as expected with our
implementation. We need some more code or an additional gem:

https://github.com/westonganger/paper_trail-association_tracking
2021-07-01 14:56:05 +10:00
dependabot[bot]
007dbc858f Bump paper_trail from 10.3.1 to 12.0.0
Bumps [paper_trail](https://github.com/airblade/paper_trail) from 10.3.1 to 12.0.0.
- [Release notes](https://github.com/airblade/paper_trail/releases)
- [Changelog](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airblade/paper_trail/compare/v10.3.1...v12.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 14:47:28 +10:00
Andy Brett
e9a00eb0d4 Merge pull request #7310 from cillian/resumed-order-actions-menu
Make sure the Resend Confirmation and Send/Print Invoice links display for resumed orders
2021-06-30 10:43:07 -07:00
Andy Brett
7451f06fe1 Merge pull request #7307 from cillian/hide-notifications-setting-for-profiles
Don't show the Notifications setting for profile only enterprises in the Users section
2021-06-30 10:14:14 -07:00
Nihal Mohammed
f7795ca21a Fix failing specs 2021-06-30 09:50:38 -07:00
Nihal Mohammed
cd0b97bf0a Update i18n configs 2021-06-30 09:50:38 -07:00
Nihal Mohammed
18282a6f73 Add advanced settings button to incoming and outgoing pages in OC cycle edit 2021-06-30 09:50:38 -07:00
Nihal Mohammed
c335ec3b29 # This is a combination of 5 commits.tree d6d4f31283e42c44c9c4d116567ce7b1a99a13ab
parent b680697af6
author Nihal Mohammed <mnihal64@outlook.com> 1621004464 +0530
committer Nihal Mohammed <mnihal64@outlook.com> 1621022463 +0530

# This is a combination of 4 commits.
# This is the 1st commit message:

Add advanced settings button to incoming and outgoing pages in OC cycle edit

# This is the commit message #2:

Remove extra header text

# This is the commit message #3:

Moved repeating code blocks to partial

# This is the commit message #4:

Refactored code

# This is the commit message #5:

Delete _advanced_settings_hidden.html.haml
2021-06-30 09:50:38 -07:00
Cillian O'Ruanaidh
2bb406fe6a Don't show the Notifications setting for profile only enterprises in the Users settings section
If a enterprise has only set up a profile they won't be getting any order notification emails so showing this setting could be confusing.

#1797
2021-06-30 09:48:08 -07:00
dependabot[bot]
1a8a0f33d0 Bump webpack from 5.41.0 to 5.41.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.41.0 to 5.41.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.41.0...v5.41.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 16:47:01 +00:00
Andy Brett
7eac465b18 Merge pull request #7861 from andrewpbrett/revert-webpack
Revert "Bump webpack from 4.46.0 to 5.41.0"
2021-06-30 09:41:45 -07:00
Andy Brett
404a2d3a2d Revert "Bump webpack from 4.46.0 to 5.41.0"
This reverts commit e753f47291.
2021-06-30 09:26:15 -07:00
Andy Brett
47e954afcb Merge pull request #7858 from openfoodfoundation/dependabot/bundler/rubocop-1.18.1
Bump rubocop from 1.18.0 to 1.18.1
2021-06-30 08:04:56 -07:00
Viktor Smari
c95c2f5772 Add files generated by spring binstub --all 2021-06-30 13:35:09 +02:00
Viktor Smari
14a1992d52 Stop ignoring the /bin folder
New rails apps do not ignore the bin folder.
When running rails app:update, the bin folder also gets update.
This also allows us to use bin/rails to run rails, or bin/yarn etc.
Tip: create an alias r=./bin/rails
2021-06-30 13:33:11 +02:00
dependabot[bot]
e98ad9096d Bump rubocop from 1.18.0 to 1.18.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.0...v1.18.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 09:04:54 +00:00
Matt-Yorkley
7489fd98bf Merge pull request #7837 from openfoodfoundation/dependabot/bundler/rails-6.1.4
Bump rails from 6.1.3.2 to 6.1.4
2021-06-29 21:32:07 +02:00
Matt-Yorkley
189d007304 Merge pull request #7850 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.41.0
Bump webpack from 4.46.0 to 5.41.0
2021-06-29 21:28:04 +02:00
Andy Brett
a97b5b7c90 rename payment state machine events to be verbs 2021-06-29 11:54:51 -07:00
Andy Brett
9b1da14380 mark payment failed after failed authorization 2021-06-29 11:54:51 -07:00
Andy Brett
f61fbee52a refactor to advance_to_state method
this leaves `advance_order!` as is since it's not directly touched by this PR and the metaprogramming looks like it would decrease readability
2021-06-29 11:54:51 -07:00
Andy Brett
aa8067f96b process payments separately from completing the order 2021-06-29 11:54:48 -07:00
Andy Brett
d2701226b6 complete order immediately before adding payment 2021-06-29 11:45:33 -07:00
dependabot[bot]
4bbdcc109d Bump rails from 6.0.3.7 to 6.1.4
Bumps [rails](https://github.com/rails/rails) from 6.0.3.7 to 6.1.4.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.0.3.7...v6.1.4)

---
updated-dependencies:
- dependency-name: rails
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 17:33:32 +00:00
dependabot[bot]
09254215a5 Bump acts-as-taggable-on from 8.0.0 to 8.1.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 8.0.0 to 8.1.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/v8.0.0...v8.1.0)

---
updated-dependencies:
- dependency-name: acts-as-taggable-on
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 17:22:37 +00:00
Andy Brett
63fcb40f6c update config to address deprecation warning for missing translations config 2021-06-29 10:22:25 -07:00
Andy Brett
1a6257257a Merge pull request #7608 from luisramos0/rails61
[Rails 6.1] Upgrade to rails 6.1
2021-06-29 10:21:15 -07:00
Andy Brett
e24d2e5077 address deprecation warning 2021-06-29 09:17:31 -07:00
Andy Brett
eb724bbe10 Merge pull request #7849 from openfoodfoundation/dependabot/bundler/rubocop-1.18.0
Bump rubocop from 1.17.0 to 1.18.0
2021-06-29 06:48:44 -07:00
dependabot[bot]
e753f47291 Bump webpack from 4.46.0 to 5.41.0
Bumps [webpack](https://github.com/webpack/webpack) from 4.46.0 to 5.41.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.46.0...v5.41.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 09:08:03 +00:00
dependabot[bot]
df353aa006 Bump rubocop from 1.17.0 to 1.18.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 09:05:09 +00:00
Andy Brett
7b87476986 Merge pull request #7804 from Matt-Yorkley/default-taxrate-check
Ignore potential error in dev where default tax rate is nil
2021-06-28 10:35:09 -07:00
Andy Brett
837c9bd7d8 Merge pull request #7826 from openfoodfoundation/dependabot/bundler/knapsack-3.1.0
Bump knapsack from 1.22.0 to 3.1.0
2021-06-28 10:34:01 -07:00
Andy Brett
394043dcc2 Merge pull request #7817 from openfoodfoundation/dependabot/bundler/webpacker-5.4.0
Bump webpacker from 5.3.0 to 5.4.0
2021-06-28 10:32:54 -07:00
Andy Brett
bc8ba48100 Merge pull request #7846 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.1
Bump @storybook/addon-docs from 6.3.0 to 6.3.1
2021-06-28 08:51:33 -07:00
dependabot[bot]
1b93d7a45f Bump @storybook/addon-docs from 6.3.0 to 6.3.1
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.1/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 15:50:42 +00:00
Andy Brett
1137341591 Merge pull request #7845 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.1
Bump @storybook/server from 6.3.0 to 6.3.1
2021-06-28 08:46:30 -07:00
Pau Pérez Fabregat
4db0075de3 Merge pull request #7821 from openfoodfoundation/dependabot/npm_and_yarn/webpack-cli-4.7.2
Bump webpack-cli from 3.3.12 to 4.7.2
2021-06-28 17:23:04 +02:00
dependabot[bot]
2a6a3fd64a Bump @storybook/server from 6.3.0 to 6.3.1
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.1/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 15:15:44 +00:00
Pau Pérez Fabregat
9055e186b6 Merge pull request #7847 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.1
Bump @storybook/addon-controls from 6.3.0 to 6.3.1
2021-06-28 17:11:20 +02:00
dependabot[bot]
965ee4a88f Bump @storybook/addon-controls from 6.3.0 to 6.3.1
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.1/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 09:09:34 +00:00
Jean-Baptiste Bellet
0a6d959742 Set locale to the user passwords controller
- Thus this use the same locale that the one which was set previously (if it's different from the browser one)
2021-06-28 10:19:46 +02:00
Andy Brett
cbc0cb707d Merge pull request #7816 from mkllnk/customer-import
Add example script for importing customers
2021-06-25 10:16:54 -07:00
Andy Brett
0e0e9402dd Merge pull request #7836 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.1
Bump rubocop-rails from 2.11.0 to 2.11.1
2021-06-25 09:32:20 -07:00
Transifex-Openfoodnetwork
71609a6489 Updating translations for config/locales/en_IE.yml 2021-06-25 22:28:54 +10:00
dependabot[bot]
5b2a7bf7e7 Bump rubocop-rails from 2.11.0 to 2.11.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.0...v2.11.1)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-25 09:02:06 +00:00
Andy Brett
8ec6b8682f Merge pull request #7831 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.0
Bump @storybook/server from 6.2.9 to 6.3.0
2021-06-24 12:24:40 -07:00
Andy Brett
a1efa685f9 Merge pull request #7830 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.0
Bump @storybook/addon-controls from 6.2.9 to 6.3.0
2021-06-24 12:24:13 -07:00
dependabot[bot]
03b43e3302 Bump @storybook/addon-controls from 6.2.9 to 6.3.0
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.2.9 to 6.3.0.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.0/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 19:22:02 +00:00
dependabot[bot]
75d0be410f Bump @storybook/server from 6.2.9 to 6.3.0
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.2.9 to 6.3.0.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.0/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 19:21:19 +00:00
Andy Brett
afe92dfcad Merge pull request #7827 from openfoodfoundation/dependabot/bundler/bugsnag-6.21.0
Bump bugsnag from 6.20.0 to 6.21.0
2021-06-24 12:20:57 -07:00
Andy Brett
5dea7d218a Merge pull request #7828 from openfoodfoundation/dependabot/bundler/test-prof-1.0.6
Bump test-prof from 1.0.5 to 1.0.6
2021-06-24 12:19:40 -07:00
Andy Brett
28c2601a24 Merge pull request #7829 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.0
Bump @storybook/addon-docs from 6.2.9 to 6.3.0
2021-06-24 12:17:40 -07:00
Andy Brett
07a2a584c3 remove calls to ssl_allowed as well 2021-06-24 12:06:34 -07:00
Andy Brett
334b9b520a removed deprecated calls to force_ssl; rely on config.force_ssl 2021-06-24 11:58:33 -07:00
Andy Brett
0c03ca26af Merge pull request #7832 from openfoodfoundation/RachL-patch-1
Update links to welcoming new people boards
2021-06-24 09:14:43 -07:00
Andy Brett
9a9dd6a308 Merge pull request #7768 from apricot12/delete_shipped_orders_from_BOM
Hide shipped orders from BOM
2021-06-24 09:09:54 -07:00
Andy Brett
df0c98d013 Merge branch 'master' into rails61 2021-06-24 08:02:58 -07:00
Nihal Mohammed
5a94e3b644 Remove duplicate shipment_state conditions from BOM spec 2021-06-24 20:01:19 +05:30
Transifex-Openfoodnetwork
f707284c6c Updating translations for config/locales/ru.yml 2021-06-24 23:38:03 +10:00
Nihal Mohammed
edca260af4 Hide shipped orders from BOM and update specs 2021-06-24 18:26:39 +05:30
Rachel Arnould
636d449de1 Update links to welcoming new people boards
Updating links
2021-06-24 12:22:06 +02:00
dependabot[bot]
2f58f932a7 Bump @storybook/addon-docs from 6.2.9 to 6.3.0
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.2.9 to 6.3.0.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.0/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:05:34 +00:00
dependabot[bot]
68aa42860e Bump test-prof from 1.0.5 to 1.0.6
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.5...v1.0.6)

---
updated-dependencies:
- dependency-name: test-prof
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:05:28 +00:00
dependabot[bot]
c4fbb2e715 Bump bugsnag from 6.20.0 to 6.21.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.20.0 to 6.21.0.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.20.0...v6.21.0)

---
updated-dependencies:
- dependency-name: bugsnag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:05:02 +00:00
dependabot[bot]
dca51ec298 Bump knapsack from 1.22.0 to 3.1.0
Bumps [knapsack](https://github.com/KnapsackPro/knapsack) from 1.22.0 to 3.1.0.
- [Release notes](https://github.com/KnapsackPro/knapsack/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack/compare/v1.22.0...v3.1.0)

---
updated-dependencies:
- dependency-name: knapsack
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:04:04 +00:00
Andy Brett
e37a065f10 Merge pull request #7281 from coopdevs/refactor-subs-placement-job
Refactor subs placement job
2021-06-23 11:47:50 -07:00
Andy Brett
92216cc1c7 Merge pull request #7761 from apricot12/show_variant_SKU_in_xero
Show product variant SKU in Xero report
2021-06-23 08:59:15 -07:00
Andy Brett
ca7b1f047b Merge pull request #7780 from apricot12/new_payment_method_html_bug
Fix HTML bug on new payment method page
2021-06-23 08:58:45 -07:00
Pau Perez
1125ac635b Make test not too dangerously play with time
We could get hurt and introduce flakiness in the build.
2021-06-23 13:47:42 +02:00
Pau Perez
1f3560e964 Pass in the order when it's already initialized
At `CapQuantity`'s instantiation time the proxy's order is not yet
initialized, and so `CapQuantity` was checking against nil all the time.

This went unnoticed because the job's specs were not integration-level
tests and were stubbing way too many things.
2021-06-23 13:47:42 +02:00
Pau Perez
648023750b Move tests exercising the service to its spec file
These are bypassing the job to only test the service, so there's no
point on doing that. They can test the service alone.
2021-06-23 13:45:43 +02:00
François Turbelin
06c19641b4 Remove return on case 2021-06-22 20:44:51 +02:00
Andy Brett
49dbca71b8 Merge pull request #7748 from openfoodfoundation/dependabot/bundler/stripe-5.34.0
Bump stripe from 5.33.0 to 5.34.0
2021-06-22 11:18:20 -07:00
Andy Brett
ec8a892e13 Merge pull request #7820 from openfoodfoundation/dependabot/npm_and_yarn/rails/webpacker-5.4.0
Bump @rails/webpacker from 5.3.0 to 5.4.0
2021-06-22 10:41:41 -07:00
Andy Brett
a69d89130f Merge pull request #7819 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.0
Bump rubocop-rails from 2.10.1 to 2.11.0
2021-06-22 10:31:13 -07:00
dependabot[bot]
3ddc142ee9 Bump webpack-cli from 3.3.12 to 4.7.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.7.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.7.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:06:57 +00:00
dependabot[bot]
d75bc2fd14 Bump @rails/webpacker from 5.3.0 to 5.4.0
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: "@rails/webpacker"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:06:37 +00:00
dependabot[bot]
6e88090b89 Bump rubocop-rails from 2.10.1 to 2.11.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.10.1...v2.11.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:03:42 +00:00
dependabot[bot]
cfb81d7f94 Bump webpacker from 5.3.0 to 5.4.0
Bumps [webpacker](https://github.com/rails/webpacker) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: webpacker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:02:36 +00:00
Maikel Linke
a6753b832c Add example script for importing customers 2021-06-22 13:46:34 +10:00
Transifex-Openfoodnetwork
2eb67cf61b Updating translations for config/locales/de_DE.yml 2021-06-22 07:46:31 +10:00
Andy Brett
fea5c27437 Merge pull request #7775 from Matt-Yorkley/webpacker
Add Webpacker
2021-06-21 11:15:28 -07:00
Andy Brett
9db14a5e8c Merge pull request #7815 from Matt-Yorkley/dev-retries
Move Rspec retries count to CI config and remove in local environment
2021-06-21 09:09:44 -07:00
Matt-Yorkley
99035a250b Move Rspec retries count to CI config and remove in local environment
When running tests locally we want them to fail immediately

Reference: https://github.com/NoRedInk/rspec-retry#environment-variables
2021-06-21 11:21:11 +01:00
Transifex-Openfoodnetwork
27c6a842bd Updating translations for config/locales/es.yml 2021-06-21 18:41:34 +10:00
Transifex-Openfoodnetwork
3cb6f77cbb Updating translations for config/locales/ca.yml 2021-06-21 18:41:21 +10:00
Pau Perez
475474b179 Replace order reloads with association set up 2021-06-21 10:30:12 +02:00
Pau Perez
073c4bc1ae Reload order so line items are visible in spec 2021-06-21 10:30:12 +02:00
Pau Perez
e052f36cc6 Rubocop -a 2021-06-21 10:30:12 +02:00
Pau Perez
827faef690 Fix call to #record_and_log_error 2021-06-21 10:30:12 +02:00
Pau Perez
b69aeae892 Rename PlaceOrder to PlaceProxyOrder
As discussed in
https://github.com/openfoodfoundation/openfoodnetwork/pull/7281#discussion_r650183813.
2021-06-21 10:30:12 +02:00
Pau Perez
f92ca964db Improve service name
As discussed in
https://github.com/openfoodfoundation/openfoodnetwork/pull/7281#discussion_r650069982.
2021-06-21 10:30:12 +02:00
Transifex-Openfoodnetwork
030ad350b6 Updating translations for config/locales/en_GB.yml 2021-06-21 18:17:46 +10:00
Pau Perez
8bcb19f293 Split method into higher-level smaller methods 2021-06-21 09:49:07 +02:00
Pau Perez
f61cdb6608 Extract CapQuantityAndStoreChanges service
This is a responsiblity of its own that makes the job's tests really
complex.
2021-06-21 09:49:07 +02:00
Pau Perez
431f30bb52 Fix proxy_order.placed_at test and deal with time
Relying on Rails' `freeze_time` is much more reliable than this brittle
magic number. It turns out Timecop is not needed for this case anymore.
See
https://frontdeveloper.pl/2020/03/how-we-migrated-from-timecop-to-built-in-rails-5-2-time-helpers/.
2021-06-21 09:47:49 +02:00
Pau Perez
f785851236 Use time with zone 2021-06-21 09:47:49 +02:00
Pau Perez
fcb013eb2a Extract subs placement job logic into new service
While doing that we pass stock changes to the service but we
lazy-evaluate them. This way we don't fetch all this data from DB when
it might not be used due to an early return.

Also, this makes it possible to save the stock-related logic for later.

Finally, when changing things to rely on `#initialize_order`'s boolean
return value I noticed though, that we were evaluating
`proxy_order.order` too early.  When instantiating the service object it
won't exist yet.
2021-06-21 09:47:49 +02:00
Transifex-Openfoodnetwork
5ff13b6e3e Updating translations for config/locales/en_FR.yml 2021-06-21 17:28:50 +10:00
Transifex-Openfoodnetwork
3e0ff968bd Updating translations for config/locales/fr.yml 2021-06-21 17:26:28 +10:00
Matt-Yorkley
6c3c46b0f5 Add foreman and Procfile 2021-06-19 17:51:18 +01:00
Matt-Yorkley
0acd4fc9a1 Change Webpacker default path name
In the current version of Webpacker all assets are kept under a new path called `app/javascript`. This is a really stupid name, as it can contain all kinds of assets that are *not* javascript at all, like SCSS. It's common practise to rename this to something sensible like `app/webpacker` or `app/frontend`...
2021-06-19 17:51:18 +01:00
Matt-Yorkley
a074f627b2 Add Webpacker
Most of this is automatically generated by the rake task: `bundle exec rake webpacker:install`

Docs: https://github.com/rails/webpacker/tree/5-x-stable
2021-06-19 17:51:18 +01:00
Andy Brett
3d65929a74 Merge pull request #7808 from mkllnk/sass-gem
Remove explicit dependency on sass gem
2021-06-19 09:05:21 -07:00
Transifex-Openfoodnetwork
d89a0e2cd9 Updating translations for config/locales/en_CA.yml 2021-06-19 02:05:04 +10:00
Pau Perez
198d4be18f Update all locales with the latest Transifex translations 2021-06-18 18:05:03 +02:00
Transifex-Openfoodnetwork
ecad6c1982 Updating translations for config/locales/ru.yml 2021-06-19 01:41:57 +10:00
Pau Pérez Fabregat
42e26f3328 Merge pull request #7708 from andrewpbrett/payment-states
Add `requires_authorization` Payment state
2021-06-18 17:04:03 +02:00
Pau Perez
cb23cda9e9 Update all locales with the latest Transifex translations 2021-06-18 15:05:26 +02:00
Transifex-Openfoodnetwork
4255dd9141 Updating translations for config/locales/es.yml 2021-06-18 22:57:08 +10:00
Transifex-Openfoodnetwork
654bde6207 Updating translations for config/locales/ca.yml 2021-06-18 22:56:45 +10:00
Pau Pérez Fabregat
4ecbf51b33 Merge pull request #7802 from Matt-Yorkley/confirmation-mails
Add a delay on sending order confirmation emails
2021-06-18 12:27:24 +02:00
Pau Pérez Fabregat
837e65d72a Merge pull request #7792 from openfoodfoundation/dependabot/npm_and_yarn/postcss-7.0.36
Bump postcss from 7.0.35 to 7.0.36
2021-06-18 12:24:33 +02:00
Pau Pérez Fabregat
aa9a85159e Merge pull request #7806 from mkllnk/feature-toggles
Remove custom feature toggles
2021-06-18 12:23:21 +02:00
Pau Pérez Fabregat
db993652c4 Merge branch 'master' into payment-states 2021-06-18 12:20:26 +02:00
Pau Pérez Fabregat
b500486f6b Merge pull request #7211 from jibees/4207-add-query-params-in-url
Orders list : save filters params
2021-06-18 11:19:26 +02:00
Pau Pérez Fabregat
11a7316b9d Merge pull request #7759 from apricot12/fix_duplicate_refund
Disable credit button on click
2021-06-18 09:27:45 +02:00
Pau Pérez Fabregat
75ed148490 Merge pull request #7803 from openfoodfoundation/transifex
Transifex
2021-06-18 09:26:47 +02:00
Transifex-Openfoodnetwork
2f82afcb07 Updating translations for config/locales/en_FR.yml 2021-06-18 16:58:14 +10:00
Transifex-Openfoodnetwork
fcf6f1929b Updating translations for config/locales/fr.yml 2021-06-18 16:58:00 +10:00
Pau Pérez Fabregat
6f90a7b07f Merge pull request #7720 from luisramos0/rubocop_auto_correct
Executed rubocop autocorrect (-a for safe corrections plus adding frozen_string_literal comment to all files)
2021-06-18 08:48:03 +02:00
Transifex-Openfoodnetwork
36fa34a39e Updating translations for config/locales/es.yml 2021-06-18 16:44:01 +10:00
Transifex-Openfoodnetwork
d516b1d885 Updating translations for config/locales/ca.yml 2021-06-18 16:43:55 +10:00
Maikel Linke
2027590a8a Remove explicit dependency on sass gem
We still depend on it via compass and foundation-rails but it's not
explicit any more.

The sass gem has been deprecated in favour of the faster sassc gem.
But sassc has been deprecated in favour of dart-sass which is an npm
package.

https://github.com/sass/ruby-sass#ruby-sass-has-reached-end-of-life
https://github.com/sass/sassc#sassc

This is confusing but we don't have to worry about it because it's not
a direct dependency and other gems can solve the dependency selection
for us, I think. 😄
2021-06-18 15:49:43 +10:00
Maikel Linke
2c8bead8a0 Add convenience script to update Ruby 2021-06-18 15:13:00 +10:00
Andy Brett
d9aa1b054a update payments to be in requires_authorization state in specs 2021-06-17 18:10:41 -07:00
Maikel Linke
a8eecf963d Remove unused custom FeatureToggle implementation
Flipper is now our only source of truth regarding feature toggles.
2021-06-18 10:46:51 +10:00
Maikel Linke
bba85e5e79 Remove feature toggling via ENV vars
We don't use ENV vars for feature toggles any more. Flipper is much
easier to manage.
2021-06-18 10:46:51 +10:00
Maikel Linke
a712f254e0 Remove Australian custom homepage content
This was activated with a feature toggle. But when we re-implemented the
feature toggles, we accidentally broke this one and it hasn't been
active for two months. Nobody complained and it doesn't seem to be
needed while developers are keen to remove instance-specific
customisations anyway.
2021-06-18 10:46:50 +10:00
Luis Ramos
5a05a21dad Revert to false so strings can be mutated in this class 2021-06-17 23:07:54 +01:00
Luis Ramos
f95b0e3c54 Revert frozen string literal comment in codecov config 2021-06-17 23:07:41 +01:00
Luis Ramos
755222a35d Revert to false so strings can be mutated in this class 2021-06-17 23:07:35 +01:00
Luis Ramos
e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Luis Ramos
4fe9a936f0 Regenerate rubocop_todo 2021-06-17 22:32:59 +01:00
Luis Ramos
a253228b96 Add some rubocop disable commands in the code to avoid future wrong rubocop auto corrections 2021-06-17 22:26:54 +01:00
Andy Brett
b41302d5d8 update state transitions for new requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
dd0375aed4 clear authorization url after failing the payment 2021-06-17 14:23:59 -07:00
Andy Brett
d3cca04703 update spec 2021-06-17 14:23:59 -07:00
Andy Brett
3e32abe64f add colors and translations for requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
dc1a24339c update can_resend_auth_email 2021-06-17 14:23:59 -07:00
Andy Brett
95f123d137 update success response in payment spec 2021-06-17 14:23:59 -07:00
Andy Brett
b016337d4f add requires_authorization as a possible payment_state on Orders 2021-06-17 14:23:59 -07:00
Andy Brett
24a60cd108 add translation key 2021-06-17 14:23:59 -07:00
Andy Brett
2699e17b63 update specs to create payment in requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
527f4e2cb3 move payment to requires_authorization if cvv_result is present 2021-06-17 14:23:59 -07:00
Andy Brett
a6cec20056 update success_response in payment_spec 2021-06-17 14:23:59 -07:00
Andy Brett
31738ceb49 rename and consolidate authorization? methods 2021-06-17 14:23:59 -07:00
Andy Brett
674ca3026b change states after failure/requiring auth 2021-06-17 14:23:58 -07:00
Andy Brett
a3d9f1f3cc create requires_authorization payment state and migration 2021-06-17 14:23:58 -07:00
Andy Brett
4d2235c9cc Merge pull request #7794 from openfoodfoundation/dependabot/bundler/bigdecimal-3.0.2
Bump bigdecimal from 1.4.2 to 3.0.2
2021-06-17 14:21:55 -07:00
Luis Ramos
de76a1d41e Manually fix rubocop issue (unsafe auto correct would be wrong) 2021-06-17 22:20:28 +01:00
Luis Ramos
23627c5453 Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
9290 issues fixed
2021-06-17 22:19:26 +01:00
Andy Brett
5a25de1c82 Merge pull request #7760 from apricot12/remove_unused_partial_paypal
Remove unused partial paypal
2021-06-17 13:21:33 -07:00
Andy Brett
355b5ab56f Merge pull request #7788 from jibees/5735-flaky-spec-on-variant-override
Uncomment flaky (?) spec
2021-06-17 12:55:16 -07:00
Andy Brett
bcd0173ed0 Merge pull request #7305 from cillian/add-distributor-to-shipment-email
Add enterprise name to subject and body of shipment shipped email
2021-06-17 12:53:09 -07:00
Andy Brett
7c694e3cf3 Merge pull request #7771 from openfoodfoundation/dependabot/bundler/activemerchant-1.121.0
Bump activemerchant from 1.120.0 to 1.121.0
2021-06-17 12:52:21 -07:00
Jean-Baptiste Bellet
89ea9913e6 Checkbox is correctly handled with null value (and not false)
- It's better to read the comment juste below the line... 😠 (https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498)
 - Add appropriate spec so it is now correctly tested!
2021-06-17 21:40:25 +02:00
Matt-Yorkley
c821380ff1 Merge pull request #7749 from apricot12/remove_paypal_refund_button
Remove refund button from paypal completed order tab
2021-06-17 21:37:51 +02:00
Guido Oliveira
0f2fd47ca0 Fix supplier loader issue in enterprise controller 2021-06-17 13:57:19 -03:00
Guido Oliveira
92031120e3 Create service for select2 autocomplete 2021-06-17 13:54:18 -03:00
Matt-Yorkley
e4e84b0a86 Remove old warning on BigDecimal gem 2021-06-17 16:05:12 +01:00
Matt-Yorkley
a7d873356d Fix shady use of BigDecimal 2021-06-17 15:51:06 +01:00
Matt-Yorkley
148349f0f3 Ignore potential error where default tax rate is nil
If the current tax rates are badly *misconfigured*, and an included-tax rate is being applied but a *default* rate does not exist (there are validations to stop this case from occurring, see DefaultTaxZoneValidator), this line can throw an error. This situation will not actually arise in production, but can happen fairly easily in dev or with staging data when switching datasets, and when it does it's kind of annoying.

Note: the logic in the check here is still good; if there's no default tax rate we check if the order's tax zone matches the zone for the current tax rate, which is correct.
2021-06-17 12:47:41 +01:00
Transifex-Openfoodnetwork
ba7b53051a Updating translations for config/locales/es.yml 2021-06-17 20:30:36 +10:00
Transifex-Openfoodnetwork
5803c0fe50 Updating translations for config/locales/fr.yml 2021-06-17 20:27:31 +10:00
Transifex-Openfoodnetwork
2e701656d2 Updating translations for config/locales/en_US.yml 2021-06-17 20:27:29 +10:00
Pau Pérez Fabregat
a8efbffca6 Merge pull request #7429 from Matt-Yorkley/adjustments-taxrate
[Adjustments] TaxRate changes
2021-06-17 11:51:01 +02:00
Pau Pérez Fabregat
ef724d2de8 Merge pull request #7758 from jibees/7710-manage-comma-as-decimal-separator-in-unit-value-field
[UnitPrice] Manage comma as decimal separator in unit value field
2021-06-17 11:46:22 +02:00
Matt-Yorkley
bb848811e6 Add a delay on sending order confirmation emails
There's a race condition here that means the order's address is not always present when the email is first sent, but it *is* present shortly after. The fix in this commit is a temporary solution.
2021-06-17 09:35:25 +01:00
François Turbelin
7f0c5b8a7a Fix controller specs with be_successful 2021-06-17 09:43:17 +02:00
Matt-Yorkley
6ebc6bcd6f Merge pull request #7797 from luisramos0/bundler
Upgrade to bundler 2
2021-06-17 09:18:13 +02:00
François Turbelin
bcd2790649 Fix failing spec 2021-06-17 09:18:05 +02:00
François Turbelin
7918c2f37c Cosmetics 2021-06-17 08:50:52 +02:00
François Turbelin
1ef7247311 Use a service to fetch variants in the engine 2021-06-17 08:50:52 +02:00
François Turbelin
235a2574dc Add spec for SuppliedProduct serializer 2021-06-17 08:50:52 +02:00
François Turbelin
4dc07d9872 Add spec for CatalogItem serializer 2021-06-17 08:50:52 +02:00
François Turbelin
a87c46843c Factorize serializer code into Base inherited class 2021-06-17 08:50:52 +02:00
François Turbelin
7ff69d5e6d Fix entreprise missing issue on Persons controller 2021-06-17 08:50:52 +02:00
dependabot[bot]
9653b0a965 Bump activemerchant from 1.120.0 to 1.121.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.120.0 to 1.121.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.120.0...v1.121.0)

---
updated-dependencies:
- dependency-name: activemerchant
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-17 00:26:49 +00:00
Andy Brett
aca3a76854 Merge pull request #7793 from openfoodfoundation/dependabot/bundler/ransack-2.4.2
Bump ransack from 2.4.1 to 2.4.2
2021-06-16 17:12:17 -07:00
Andy Brett
d38cf1da1f Merge pull request #7795 from openfoodfoundation/dependabot/bundler/rubocop-1.17.0
Bump rubocop from 1.16.1 to 1.17.0
2021-06-16 17:10:48 -07:00
Luis Ramos
a226aedaec Upgrade to bundler 2 2021-06-16 21:50:01 +01:00
Guido Oliveira
baca89c575 allow select producers for ordering 2021-06-16 15:02:27 -03:00
Guido Oliveira
c5471fc25c enable ordering shopfront by producer id 2021-06-16 15:02:27 -03:00
dependabot[bot]
b39ed424f6 Bump rubocop from 1.16.1 to 1.17.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.16.1 to 1.17.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.16.1...v1.17.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:20:57 +00:00
dependabot[bot]
e4cf6421bd Bump bigdecimal from 1.4.2 to 3.0.2
Bumps [bigdecimal](https://github.com/ruby/bigdecimal) from 1.4.2 to 3.0.2.
- [Release notes](https://github.com/ruby/bigdecimal/releases)
- [Changelog](https://github.com/ruby/bigdecimal/blob/v3.0.2/CHANGES.md)
- [Commits](https://github.com/ruby/bigdecimal/compare/v1.4.2...v3.0.2)

---
updated-dependencies:
- dependency-name: bigdecimal
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:18:50 +00:00
dependabot[bot]
0776fcf5cc Bump ransack from 2.4.1 to 2.4.2
Bumps [ransack](https://github.com/activerecord-hackery/ransack) from 2.4.1 to 2.4.2.
- [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/2.4.1...v2.4.2)

---
updated-dependencies:
- dependency-name: ransack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:17:11 +00:00
Andy Brett
59358443b4 Merge pull request #7786 from andrewpbrett/add-web-console
Add web-console gem for debugging in development
2021-06-15 13:10:25 -07:00
Andy Brett
c4911b1947 add web console for debugging in development 2021-06-15 13:00:22 -07:00
dependabot[bot]
6c24d4bc1a Bump postcss from 7.0.35 to 7.0.36
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-15 19:08:24 +00:00
Matt-Yorkley
8753076dcd Merge pull request #7737 from luisramos0/ruby273
Upgrade to ruby 2.7.3
2021-06-15 21:07:38 +02:00
Jean-Baptiste Bellet
7f5e58bcc3 Uncomment flaky (?) spec 2021-06-15 13:51:40 +02:00
Maikel
d839313cf5 Merge pull request #7782 from openfoodfoundation/dependabot/bundler/redis-4.3.1
Bump redis from 4.2.5 to 4.3.1
2021-06-15 17:17:59 +10:00
Pau Pérez Fabregat
f51f304818 Merge pull request #7778 from openfoodfoundation/transifex
Transifex
2021-06-15 09:12:11 +02:00
Transifex-Openfoodnetwork
7f09fd4c19 Updating translations for config/locales/en_US.yml 2021-06-15 10:23:53 +10:00
Andy Brett
87692b06e6 remove deprecated update_attributes method call 2021-06-14 15:13:51 -07:00
Andy Brett
b8617e0a5a Merge pull request #7783 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.4
Bump karma from 6.3.3 to 6.3.4
2021-06-14 09:18:55 -07:00
Transifex-Openfoodnetwork
6701afcdce Updating translations for config/locales/en_GB.yml 2021-06-14 18:10:03 +10:00
dependabot[bot]
fbf0e48a07 Bump karma from 6.3.3 to 6.3.4
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.3 to 6.3.4.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.3...v6.3.4)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:57:07 +00:00
dependabot[bot]
e4087e9c65 Bump redis from 4.2.5 to 4.3.1
Bumps [redis](https://github.com/redis/redis-rb) from 4.2.5 to 4.3.1.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.2.5...v4.3.1)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:05:07 +00:00
Andy Brett
c790373804 resolve gemfile conflict 2021-06-13 18:29:57 -07:00
Luis Ramos
43401e4b5e Fix double spree scope in i18n
Fix taken from spree: efba9f1a02
2021-06-13 18:19:29 -07:00
Luis Ramos
5948c20326 Fix spec by adding mocked response 2021-06-13 18:19:29 -07:00
Luis Ramos
74aabbbb5f Upgrade to rails 6.1 2021-06-13 18:19:26 -07:00
Nihal Mohammed
522a7384e7 Fix HTML bug on new payment method page and update providers_controller spec 2021-06-12 01:47:08 +05:30
Andy Brett
0eea932778 Merge pull request #7757 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-8.0.0
Bump acts-as-taggable-on from 7.0.0 to 8.0.0
2021-06-11 07:39:57 -07:00
Jean-Baptiste Bellet
db8f8a2675 Create internal methods with regexp test
- Make it more easily readable and add unit tests
2021-06-11 10:40:02 +02:00
Transifex-Openfoodnetwork
3ef5953db2 Updating translations for config/locales/en_FR.yml 2021-06-11 18:38:36 +10:00
Transifex-Openfoodnetwork
586c97b22c Updating translations for config/locales/fr.yml 2021-06-11 18:37:04 +10:00
Transifex-Openfoodnetwork
d54cb9182f Updating translations for config/locales/ca.yml 2021-06-11 18:19:44 +10:00
Transifex-Openfoodnetwork
3257f16667 Updating translations for config/locales/es.yml 2021-06-11 18:17:41 +10:00
Jean-Baptiste Bellet
178c0a441b Move unlocalize_currency filter to a PriceParser service
- It's no longer a filter but more a service: it's therefore more logic.
2021-06-11 10:01:19 +02:00
Matt-Yorkley
937cede9b8 Fix tax adjustment label
:amount is actually a property on the TaxRate object itself that refers to the rate (eg 10% expressed as 0.10), and is not the same as the adjustment amount being passed in to this method (eg: $4.28)
2021-06-10 17:16:45 +01:00
dependabot[bot]
3ff60ede2a Bump stripe from 5.33.0 to 5.34.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.33.0 to 5.34.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.33.0...v5.34.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 17:06:20 +00:00
Nihal Mohammed
3b73f72ac2 Show product variant SKU in Xero report 2021-06-08 19:53:55 +05:30
Nihal Mohammed
3b4baab01a Remove unused _paypal_complete partial 2021-06-08 16:31:26 +05:30
Nihal Mohammed
4476d7f69e Disable credit button on click 2021-06-08 14:41:25 +05:30
Jean-Baptiste Bellet
6cf0c73453 Use our unlocalizeCurrencyFilter to parse unit value field
- More tolerant (can handle `,` or `.` as decimal separator, remove thousands separator) to return a `number`
2021-06-08 10:55:43 +02:00
Jean-Baptiste Bellet
d3c2158121 Handle comma as decimal separator in the unit value field
- Add comma as a decimal separator in the regexp
 - Do not use parseFloat but our `unlocalizeCurrencyFilter` which is more tolerant
2021-06-08 09:51:30 +02:00
Jean-Baptiste Bellet
0cb2739139 Handle case when price is not a number
And return a `null` if so.
2021-06-08 09:46:24 +02:00
dependabot[bot]
0cca01345c Bump acts-as-taggable-on from 7.0.0 to 8.0.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 7.0.0 to 8.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/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: acts-as-taggable-on
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 05:12:23 +00:00
Jean-Baptiste Bellet
3ebba9502a Handle more cases with decimal/thousands separator
- ',' or '.' can be used as decimal separator (defined in the application configuration)
 - Remove thousands separator if it's detected as so (use regexp to match)
2021-06-07 16:53:20 +02:00
Nihal Mohammed
a5190ec5d7 Remove refund button from paypal completed order tab 2021-06-07 16:07:31 +05:30
Matt-Yorkley
5bfe079262 Update Xero Invoices test setup
Uses the new format of enterprise fee taxes
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7b641ace23 Update Xero Invoices scopes for taxable fees
Taxable enterprise fee adjustments now have a tax_category
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7bcb0bcaa8 Eager-load the adjustment's adjustable
Reduces the total migration time by ~15%. Requires including some more models, as order objects are now being eager-loaded as part of the polymorphic associations.
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7ecd67a3fe Skip orphaned adjustments
There are a handful of enterprise fee adjustments on line items in production data where the line item has actually been deleted and no longer exists, but the fee adjustment is still in the database.
2021-06-06 20:20:41 +01:00
Matt-Yorkley
d9f459d94a Update db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-06-06 20:20:41 +01:00
Matt-Yorkley
76756923ba Use non-legacy-tax example in paypal items spec 2021-06-06 20:20:41 +01:00
Matt-Yorkley
401dd99225 Update stubbing of default country id in TaxRate tests 2021-06-06 20:20:41 +01:00
Matt-Yorkley
e21ef3f182 Add test coverage to #create_tax_charge! with legacy taxes 2021-06-06 20:20:41 +01:00
Matt-Yorkley
9e1d8ab369 Introduce legacy tax handing in Order::Updater whenever order totals change
This will remove legacy tax adjustments, recalculate any relevant taxes for items in the order and re-apply them in non-legacy tax adjustments
2021-06-06 20:20:41 +01:00
Matt-Yorkley
00988dc1e7 Use :order_with_totals factory in payments controller spec
This factory makes an order that actually has a line item 👍
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7007de752d Update BulkLineItemsController spec now that taxes on enterprise fees are updated correctly
Tax on fees previously stayed the same unless the fees were deleted recreated from scratch, instead of updating when the fee amounts changed
2021-06-06 20:20:41 +01:00
Matt-Yorkley
832fbb7d5d Update data migration model definitions
The good_migrations gem was not working with polymorphic associations.
2021-06-06 20:18:05 +01:00
Matt-Yorkley
dc7c674a0e Switch to ApplicationRecord in migation spec
Fixes:

An error occurred while loading ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb.
Failure/Error: require_relative '../../db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts'

TypeError:
  superclass mismatch for class Adjustment
# ./db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb:2:in `<class:MigrateEnterpriseFeeTaxAmounts>'
# ./db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb:1:in `<top (required)>'
# ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb:4:in `require_relative'
# ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb:4:in `<top (required)>'
# -e:1:in `<main>'
2021-06-06 20:18:05 +01:00
Matt-Yorkley
bfea47802e Move fee tax call outside of lock and simplify order updating 2021-06-06 20:18:05 +01:00
Matt-Yorkley
28ebb303af Simplify order interface 2021-06-06 20:17:03 +01:00
Matt-Yorkley
f20cf509d3 Add missing Spree translation 2021-06-06 20:17:03 +01:00
Matt-Yorkley
3f9a3b41da Refactor and improve EnterpriseFeeApplicator spec 2021-06-06 20:17:03 +01:00
Matt-Yorkley
38811b5a28 Add Bugsnag message if legacy taxes are used 2021-06-06 20:17:03 +01:00
Matt-Yorkley
f791f6fa20 Add test coverage to recalculating fees and taxes on completed orders 2021-06-06 20:17:03 +01:00
Matt-Yorkley
c84f9e56fb Tax enterprise fee adjustments when calling #recreate_all_fees! 2021-06-06 20:17:03 +01:00
Matt-Yorkley
355837547e Add test coverage for legacy additional taxes in OrderTaxAdjustmentsFetcher
OrderTaxAdjustmentsFetcher is used in various places to display the taxes on an order. This test validates that legacy taxes are still returned and displayed as normal.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
0f5c39317a Re-apply taxes in Admin::OrdersController#update
Ensures taxes are updated properly when hitting the "Update and Recalculate Fees" button on the order edit page.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
43877f4e34 Add unit tests for data migration 2021-06-06 20:16:03 +01:00
Matt-Yorkley
b427fd6876 Add data migration for enterprise fee tax amounts 2021-06-06 20:16:03 +01:00
Matt-Yorkley
a31487a86d Clear any legacy taxes when applying tax to an order
#create_tax_charge! adds tax (adjustments) to all taxable items on an order. If an order order has legacy taxes (lump-sum tax adjustments on the order object), we remove them here before re-applying taxes (using the new setup).
2021-06-06 20:16:03 +01:00
Matt-Yorkley
84a40e6ae0 Improve Order#enterpise_fee_tax 2021-06-06 20:16:03 +01:00
Matt-Yorkley
19f32b7825 Update checkout tax display test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
93e422ec59 Update order fee tax test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
6e9ae0b0db Update tax totals calculation in Order::Updater
Line items, shipments, and fees now all have taxes recorded in a uniform way, so we can drop more complexity here (and the number of queries).
2021-06-06 20:16:03 +01:00
Matt-Yorkley
a1438bdb3d Update enterprise fee tax adjustment specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
510f74f654 Update OrderTaxAdjustmentsFetcher
Taxes on Enterprise Fees are now recorded in proper tax adjustments, so they don't need special treatment.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
52452f7939 Update default tax calculator
Line items, shipments and fees can now all be calculated in the same way when applying tax.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
b3240f859a Add tax category id to adjustments 2021-06-06 20:16:03 +01:00
Matt-Yorkley
2de442f44d Move taxing of enterprise fees to TaxRate 2021-06-06 20:16:03 +01:00
Matt-Yorkley
c2211c501d Improve test setup in Xero Invoices spec 2021-06-06 20:16:03 +01:00
Matt-Yorkley
6c340f8ed4 Update SalesTax test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
a22cc96ea5 Simplify DefaultTax calculator
This logic is handled in TaxRate and doesn't need to be duplicated here.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
8c9733d8da Remove included tax check from CalculatedAdjustments
This is handled in TaxRate now.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
ff9ad96b74 Update TaxRate specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
8479d4ff7c Update outdated calls to TaxRate#adjust in specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
d450aff607 Update Order#create_tax_charge!
TaxRate#adjust now handles individual items instead of the whole order 🎉 We can use this elsewhere too, for example to re-apply taxes on a single line item, we can do: Spree::TaxRate.adjust(order, [line_item])
2021-06-06 20:16:03 +01:00
Matt-Yorkley
1c28b9783f Bring in Spree::TaxRate test coverage 2021-06-06 20:16:03 +01:00
Matt-Yorkley
f92c082df8 Refactor tax adjustment create_label method 2021-06-06 20:16:03 +01:00
Matt-Yorkley
d69f714032 Bring in changes to TaxRate#adjust 2021-06-06 20:16:03 +01:00
Matt-Yorkley
50d0952dd5 Bring in TaxRate#potentially_applicable method and add eager-loading 2021-06-06 20:16:03 +01:00
Luis Ramos
5453a1c0fa Adapt importer error to new ruby version 2.7 2021-06-04 22:42:27 +01:00
Luis Ramos
18231cd950 Adding bigdecimal to avoid errors with BigDecimal
v1.4.2 is the version that works for us, see here for more details: https://github.com/ruby/bigdecimal/issues/127
2021-06-04 22:42:27 +01:00
Luis Ramos
5629dfbe09 Fix warning: deprecated Object#=~ is called 2021-06-04 22:42:27 +01:00
Luis Ramos
21b80db0ee Fix json v1.8.6 common.rb warning
Using this patch https://github.com/flori/json/issues/399#issuecomment-734863279

We can upgrade to json v2 but to do that we need to switch from aws-sdk-v1 to aws-sdk-s3 first
2021-06-04 22:42:27 +01:00
Luis Ramos
c22799bda1 Replace gsub! with gsub so that strings are not modified 2021-06-04 22:42:22 +01:00
Luis Ramos
2b187c0547 Upgrade to ruby 2.7.3 2021-06-04 22:29:49 +01:00
Guido Oliveira
65b760b119 Add validations to variant_override model 2021-06-04 14:11:22 -03:00
Jean-Baptiste Bellet
f73e5c74fb Handle null/undefined cases for price 2021-06-01 11:40:02 +02:00
Jean-Baptiste Bellet
7008b5ec7b Make a more generic solution: KeyValueMapStore
- As QueryPersistence, stored in the localStorage too but it is now more generic and has nothing to do with Query
 - Add some js unit testing
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
f167b09397 Add distributor and order cycle selectors in the test 2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
54c645e33a Add tests for clearing all filters feature
- and check each filter is well reinitialized
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
385446807d Add a clear filters button
- This button clear all stored filters and then update results
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
ea2cb4e6c0 Update flatpickr input value if ng-model change 2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
303bf5420e Add select2WatchNgModel directive
- Select2 components cannot handle ng-model correctly: they do not update if the ng-model change. Add a directive to watch the ng-model and update the component value
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
58a96c6500 Add missing ] char to be consistant 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
4f50afc188 Change shipping_method_id storage: in the query 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
e388238a25 Add tests for saving filter params in Orders list 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
1674c6a252 Improve HTML to improve tests readability
- Specify `for` attribute to `<label />` element
- Initialize component with its default value

So, it's linked to its `<input />`
2021-05-31 10:44:12 +02:00
Matt-Yorkley
93ebfb6a4f Improve checking for presence of saved filters 2021-05-31 10:44:12 +02:00
Matt-Yorkley
47404b1dc8 Improve handling of nils 2021-05-31 10:44:12 +02:00
Matt-Yorkley
c24ceac063 Extract default-setting to comment method 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
c5a2d183d8 Save filter params to sessionStorage for orders list
- Use sessionStorage to save the filters params each time a filter is modified
2021-05-31 10:44:12 +02:00
François Turbelin
e86b6443f2 Add a comment to explain nesting on catalog_item 2021-04-05 20:38:19 +02:00
François Turbelin
bf4bb854b1 Change offeres_to to offers_to for method naming 2021-04-05 20:38:19 +02:00
François Turbelin
779241db7a Improve documentation 2021-04-05 20:38:19 +02:00
François Turbelin
11f1f6cff1 Add more onliner before in specs 2021-04-05 20:38:19 +02:00
François Turbelin
7ad6e1b76a Remove brakets for describe in specs 2021-04-05 20:38:19 +02:00
François Turbelin
d414122efd Rename check_entreprise to set_entreprise 2021-04-05 20:38:19 +02:00
Cillian O'Ruanaidh
7e2d9ff381 The Resend Confirmation and Send/Print Invoice links should display for resumed orders too
These are links inside the Actions drop down menu on the edit order view. Before they were missing if an order was in a resumed state.

Fixes #5946
2021-04-02 15:41:59 +01:00
Cillian O'Ruanaidh
413896af5d Add enterprise name to subject and body of shipment shipped email
Fixes #7052
2021-04-02 11:44:40 +01:00
1151 changed files with 20035 additions and 7691 deletions

1
.browserslistrc Normal file
View File

@@ -0,0 +1 @@
defaults

70
.env Normal file
View File

@@ -0,0 +1,70 @@
# Default ENV vars (primarily for the development environment).
# Create `.env.development.local` or `.env.test.local` to add any local overrides.
# Time zone must match the operating system time zone in order to pass all tests.
# This string is the key for the MAPPING hash constant in ActiveSupport::TimeZone.
# Documentation including the hash="https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
TIMEZONE="Melbourne"
# Default country for dropdowns etc. See for codes="http://en.wikipedia.org/wiki/ISO_3166-1
DEFAULT_COUNTRY_CODE="AU"
# Locale for translation.
LOCALE="en"
# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES="en,es"
# Spree zone.
CHECKOUT_ZONE="Australia"
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.
CURRENCY="AUD"
# The whenever gem can set the `MAILTO` variable for our cron jobs.
# You can define an email address to notify if any job outputs something.
# But you need a working mail server setup so that the message is delivered.
# See: config/schedule.rb
# SCHEDULE_NOTIFICATIONS="admin@example.com"
# Mail settings
MAIL_HOST="example.com"
MAIL_DOMAIN="example.com"
MAIL_PORT="25"
SMTP_USERNAME="ofn"
SMTP_PASSWORD="f00d"
# Optional mail settings
# MAIL_SECURE_CONNECTION="TLS' # 'None' (default), 'SSL' or 'TLS'
# MAILS_FROM="hello@example.com"
# MAIL_BCC="manager@example.com"
# Javascript error reporting via Bugsnag.
# BUGSNAG_JS_KEY=""
# SingleSignOn login for Discourse
#
# DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance.
# DISCOURSE_SSO_SECRET=""
#
# DISCOURSE_URL must be the URL of your Discourse instance.
# DISCOURSE_URL="https://noticeboard.openfoodnetwork.org.au"
# see="https://developers.google.com/maps/documentation/javascript/get-api-key
# GOOGLE_MAPS_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Stripe Connect details for instance account
# Find these under 'API keys' and 'Connect' in your Stripe account dashboard -> Account Settings
# Under 'Connect', the Redirect URI should be set to https://YOUR_SERVER_URL/stripe/callbacks (e.g. https://openfoodnetwork.org.uk/stripe/callbacks)
# Under 'Webhooks', you should set up a Connect endpoint pointing to https://YOUR_SERVER_URL/stripe/webhooks e.g. (https://openfoodnetwork.org.uk/stripe/webhooks)
# STRIPE_INSTANCE_SECRET_KEY="sk_test_xxxxxx" # This can be a test key or a live key
# STRIPE_INSTANCE_PUBLISHABLE_KEY="pk_test_xxxx" # This can be a test key or a live key
# STRIPE_CLIENT_ID="ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET="whsec_xxxx"
# Feature toggles
#
# Adding user emails separated by commas will enable them the use of certain features. See
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS="ofn@example.com,superadmin@example.com"

7
.env.development Normal file
View File

@@ -0,0 +1,7 @@
# ENV vars for the development environment
# Override locally with `.env.development.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

4
.env.test Normal file
View File

@@ -0,0 +1,4 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

5
.github/codecov.yml vendored
View File

@@ -1,5 +0,0 @@
coverage:
status:
project:
default:
informational: true

View File

@@ -9,6 +9,8 @@ env:
DISABLE_KNAPSACK: true
TIMEZONE: UTC
COVERAGE: true
RSPEC_RETRY_RETRY_COUNT: 3
RAILS_ENV: test
jobs:
test-controllers-and-serializers:
@@ -52,9 +54,6 @@ jobs:
- name: Run controller tests
run: bundle exec rspec --profile -- spec/controllers spec/serializers
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-models:
runs-on: ubuntu-18.04
services:
@@ -96,9 +95,6 @@ jobs:
- name: Run tests
run: bundle exec rspec --profile -- spec/models
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-admin-features-1:
runs-on: ubuntu-18.04
services:
@@ -140,9 +136,6 @@ jobs:
- name: Run admin feature tests
run: bundle exec rspec --profile -- spec/features/admin/[a-o0-9]*_spec.rb
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-admin-features-2:
runs-on: ubuntu-18.04
services:
@@ -184,9 +177,6 @@ jobs:
- name: Run admin feature tests
run: bundle exec rspec --profile -- spec/features/admin/[p-z]*_spec.rb
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-consumer-features:
runs-on: ubuntu-18.04
services:
@@ -228,9 +218,6 @@ jobs:
- name: Run consumer feature tests
run: bundle exec rspec --profile -- spec/features/consumer
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-engines-etc:
runs-on: ubuntu-18.04
services:
@@ -272,13 +259,19 @@ jobs:
- name: Run JS tests
run: RAILS_ENV=test bundle exec rake karma:run
- name: Run jest tests
run: yarn jest
# Migration tests need to be run in a separate task.
# See: https://github.com/openfoodfoundation/openfoodnetwork/pull/6924#issuecomment-813056525
- name: Run migration tests
run: bundle exec rspec --pattern "spec/{migrations}/**/*_spec.rb"
- name: Run system tests
run: bundle exec rspec --profile -- spec/system
- name: Run all other tests
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations"]
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations,system"]
test-the-rest:
runs-on: ubuntu-18.04
@@ -320,6 +313,3 @@ jobs:
- name: Run admin feature folders, engines, lib
run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/features/admin/*/*_spec.rb,spec/lib/{,/*/**}/*_spec.rb"
- name: Codecov
uses: codecov/codecov-action@v1.5.0

10
.gitignore vendored
View File

@@ -2,6 +2,9 @@
.rbenv-version
.python-version
.byebug_history
.env.local
.env.development.local
.env.test.local
.swp
*.swo
*.swp
@@ -46,5 +49,10 @@ vendor/bundle/
coverage
/reports/
!/reports/README.md
bin/
/spec/components/stories/**/*.stories.json
/public/packs
/public/packs-test
/yarn-error.log
yarn-debug.log*
.yarn-integrity

View File

@@ -18,49 +18,22 @@
#
# This process probably doesn't need repeating. Otherwise there is plenty
# of room for improvements and automation.
Layout/LineLength:
Max: 100
Exclude:
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/paypal_controller.rb
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
- engines/order_management/spec/services/order_management/order/updater_spec.rb
- engines/order_management/spec/services/order_management/reports/bulk_coop/bulk_coop_report_spec.rb
- lib/open_food_network/reports/line_items.rb
- spec/controllers/spree/admin/orders/invoices_spec.rb
- spec/controllers/spree/admin/tax_rates_controller_spec.rb
- spec/controllers/user_passwords_controller_spec.rb
- spec/features/admin/configuration/general_settings_spec.rb
- spec/features/consumer/shopping/unit_price_spec.rb
- spec/helpers/admin/orders_helper_spec.rb
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
- spec/lib/stripe/authorize_response_patcher_spec.rb
- spec/services/bulk_invoice_service_spec.rb
- spec/services/content_sanitizer_spec.rb
- spec/services/process_payment_intent_spec.rb
- spec/support/features/datepicker_helper.rb
- 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_relationships_controller.rb
- app/controllers/admin/enterprise_roles_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/inventory_items_controller.rb
- app/controllers/admin/manager_invitations_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/enterprise_attachment_controller.rb
- app/controllers/api/product_images_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/api/v0/order_cycles_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/helpers/angular_form_builder.rb
- app/helpers/angular_form_helper.rb
- app/helpers/checkout_helper.rb
- app/helpers/enterprises_helper.rb
- app/helpers/markdown_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/orders_helper.rb
- app/jobs/subscription_confirm_job.rb
@@ -69,110 +42,91 @@ Layout/LineLength:
- app/models/concerns/order_shipment.rb
- app/models/concerns/product_stock.rb
- app/models/concerns/variant_stock.rb
- app/models/content_configuration.rb
- app/models/customer.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/spreadsheet_entry.rb
- app/models/product_import/unit_converter.rb
- app/models/proxy_order.rb
- app/models/schedule.rb
- app/models/spree/app_configuration.rb
- app/models/spree/gateway/stripe_connect.rb
- app/models/spree/image.rb
- app/models/spree/line_item.rb
- app/models/spree/order.rb
- app/models/spree/payment_method.rb
- app/models/spree/product.rb
- app/models/spree/user.rb
- app/models/spree/variant.rb
- app/models/spree/preferences/store.rb
- app/models/subscription.rb
- app/models/variant_override.rb
- app/serializers/api/admin/subscription_line_item_serializer.rb
- app/serializers/api/admin/subscription_serializer.rb
- app/services/cart_service.rb
- app/services/checkout/post_checkout_actions.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/order_syncer.rb
- app/services/variant_units/variant_and_line_item_naming.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/subscriptions/validator.rb
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
- engines/order_management/spec/services/order_management/order/updater_spec.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
- lib/open_food_network/customers_report.rb
- lib/open_food_network/enterprise_fee_applicator.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/lettuce_share_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/open_food_network/reports/line_items.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/scope_variants_for_search.rb
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/localized_number.rb
- lib/stripe/credit_card_clone_finder.rb
- lib/tasks/data.rake
- lib/tasks/enterprises.rake
- spec/controllers/admin/bulk_line_items_controller_spec.rb
- spec/controllers/admin/column_preferences_controller_spec.rb
- spec/controllers/admin/customers_controller_spec.rb
- spec/controllers/admin/enterprises_controller_spec.rb
- spec/controllers/admin/inventory_items_controller_spec.rb
- spec/controllers/admin/manager_invitations_controller_spec.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/admin/proxy_orders_controller_spec.rb
- spec/controllers/admin/schedules_controller_spec.rb
- spec/controllers/admin/stripe_accounts_controller_spec.rb
- spec/controllers/admin/stripe_connect_settings_controller_spec.rb
- spec/controllers/admin/subscription_line_items_controller_spec.rb
- spec/controllers/admin/subscriptions_controller_spec.rb
- spec/controllers/admin/variant_overrides_controller_spec.rb
- spec/controllers/api/base_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
- spec/controllers/api/product_images_controller_spec.rb
- spec/controllers/api/products_controller_spec.rb
- spec/controllers/api/promo_images_controller_spec.rb
- spec/controllers/api/states_controller_spec.rb
- spec/controllers/api/terms_and_conditions_controller_spec.rb
- spec/controllers/api/variants_controller_spec.rb
- spec/controllers/api/v0/base_controller_spec.rb
- spec/controllers/api/v0/enterprises_controller_spec.rb
- spec/controllers/api/v0/exchange_products_controller_spec.rb
- spec/controllers/api/v0/logos_controller_spec.rb
- spec/controllers/api/v0/order_cycles_controller_spec.rb
- spec/controllers/api/v0/orders_controller_spec.rb
- spec/controllers/api/v0/product_images_controller_spec.rb
- spec/controllers/api/v0/products_controller_spec.rb
- spec/controllers/api/v0/promo_images_controller_spec.rb
- spec/controllers/api/v0/terms_and_conditions_controller_spec.rb
- spec/controllers/cart_controller_spec.rb
- spec/controllers/checkout_controller_spec.rb
- spec/controllers/enterprises_controller_spec.rb
- spec/controllers/line_items_controller_spec.rb
- spec/controllers/shop_controller_spec.rb
- spec/controllers/shops_controller_spec.rb
- spec/controllers/spree/admin/adjustments_controller_spec.rb
- spec/controllers/spree/admin/base_controller_spec.rb
- spec/controllers/spree/admin/orders_controller_spec.rb
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
- spec/controllers/spree/admin/orders/invoices_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/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/line_item_factory.rb
- spec/factories/order_factory.rb
- spec/factories/shipment_factory.rb
- spec/factories/stock_location_factory.rb
- spec/factories/user_factory.rb
- spec/features/admin/adjustments_spec.rb
- spec/features/admin/bulk_order_management_spec.rb
- spec/features/admin/bulk_product_update_spec.rb
@@ -180,13 +134,10 @@ Layout/LineLength:
- spec/features/admin/customers_spec.rb
- spec/features/admin/enterprise_fees_spec.rb
- spec/features/admin/enterprise_relationships_spec.rb
- spec/features/admin/enterprise_roles_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/multilingual_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
@@ -195,6 +146,7 @@ Layout/LineLength:
- spec/features/admin/order_spec.rb
- spec/features/admin/overview_spec.rb
- spec/features/admin/payment_method_spec.rb
- spec/features/admin/payments_stripe_spec.rb
- spec/features/admin/product_import_spec.rb
- spec/features/admin/products_spec.rb
- spec/features/admin/reports_spec.rb
@@ -204,76 +156,49 @@ Layout/LineLength:
- spec/features/admin/tag_rules_spec.rb
- spec/features/admin/users_spec.rb
- spec/features/admin/variant_overrides_spec.rb
- spec/features/consumer/account/cards_spec.rb
- spec/features/consumer/account/settings_spec.rb
- spec/features/consumer/account_spec.rb
- spec/features/consumer/authentication_spec.rb
- spec/features/consumer/caching/darkswarm_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
- spec/features/consumer/shopping/checkout_spec.rb
- spec/features/consumer/shopping/checkout_stripe_spec.rb
- spec/features/consumer/shopping/embedded_groups_spec.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/features/consumer/shopping/orders_spec.rb
- spec/features/consumer/shopping/products_spec.rb
- spec/features/consumer/shopping/shopping_spec.rb
- spec/features/consumer/shopping/unit_price_spec.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/features/consumer/shops_spec.rb
- spec/helpers/admin/subscriptions_helper_spec.rb
- spec/helpers/checkout_helper_spec.rb
- spec/helpers/enterprises_helper_spec.rb
- spec/helpers/groups_helper_spec.rb
- spec/helpers/injection_helper_spec.rb
- spec/helpers/order_cycles_helper_spec.rb
- spec/helpers/spree/admin/base_helper_spec.rb
- spec/jobs/confirm_order_job_spec.rb
- spec/jobs/subscription_confirm_job_spec.rb
- spec/jobs/subscription_placement_job_spec.rb
- spec/lib/open_food_network/address_finder_spec.rb
- spec/lib/open_food_network/customers_report_spec.rb
- spec/lib/open_food_network/enterprise_fee_applicator_spec.rb
- spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
- spec/lib/open_food_network/group_buy_report_spec.rb
- spec/lib/open_food_network/lettuce_share_report_spec.rb
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
- spec/lib/open_food_network/order_grouper_spec.rb
- spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb
- spec/lib/open_food_network/permissions_spec.rb
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
- spec/lib/open_food_network/xero_invoices_report_spec.rb
- spec/lib/spree/core/calculated_adjustments_spec.rb
- spec/lib/stripe/account_connector_spec.rb
- spec/lib/stripe/webhook_handler_spec.rb
- spec/lib/stripe/authorize_response_patcher_spec.rb
- spec/mailers/order_mailer_spec.rb
- spec/mailers/producer_mailer_spec.rb
- spec/mailers/subscription_mailer_spec.rb
- spec/models/calculator/flexi_rate_spec.rb
- spec/models/calculator/price_sack_spec.rb
- spec/models/calculator/weight_spec.rb
- spec/models/column_preference_spec.rb
- spec/models/concerns/order_shipment_spec.rb
- spec/models/concerns/product_stock_spec.rb
- spec/models/customer_spec.rb
- spec/models/enterprise_caching_spec.rb
- spec/models/enterprise_fee_spec.rb
- spec/models/enterprise_group_spec.rb
- spec/models/enterprise_relationship_spec.rb
- spec/models/enterprise_spec.rb
- spec/models/exchange_spec.rb
- spec/models/order_cycle_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/address_spec.rb
- spec/models/spree/adjustment_spec.rb
@@ -284,91 +209,50 @@ Layout/LineLength:
- spec/models/spree/order/checkout_spec.rb
- spec/models/spree/order_inventory_spec.rb
- spec/models/spree/order_spec.rb
- spec/models/spree/order/state_machine_spec.rb
- spec/models/spree/payment_method_spec.rb
- spec/models/spree/payment_spec.rb
- spec/models/spree/product_set_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/return_authorization_spec.rb
- spec/models/spree/shipping_method_spec.rb
- spec/models/spree/stock_item_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
- spec/models/tag_rule/discount_order_spec.rb
- spec/models/tag_rule/filter_order_cycles_spec.rb
- spec/models/tag_rule/filter_payment_methods_spec.rb
- spec/models/tag_rule/filter_products_spec.rb
- spec/models/tag_rule/filter_shipping_methods_spec.rb
- spec/models/terms_of_service_file_spec.rb
- spec/models/variant_override_spec.rb
- spec/performance/orders_controller_spec.rb
- spec/performance/shop_controller_spec.rb
- spec/requests/api/orders_spec.rb
- spec/requests/checkout/failed_checkout_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/supplied_product_serializer_spec.rb
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
- spec/serializers/api/admin/subscription_customer_serializer_spec.rb
- spec/serializers/api/admin/variant_override_serializer_spec.rb
- spec/serializers/api/current_order_serializer_spec.rb
- spec/serializers/api/enterprise_shopfront_serializer_spec.rb
- spec/serializers/api/order_serializer_spec.rb
- spec/services/address_geocoder_spec.rb
- spec/services/cart_service_spec.rb
- spec/services/checkout/form_data_adapter_spec.rb
- spec/services/checkout/post_checkout_actions_spec.rb
- spec/services/content_sanitizer_spec.rb
- spec/services/embedded_page_service_spec.rb
- spec/services/exchange_products_renderer_spec.rb
- spec/services/order_cycle_distributed_products_spec.rb
- spec/services/order_cycle_distributed_variants_spec.rb
- spec/services/order_cycle_form_spec.rb
- spec/services/order_factory_spec.rb
- spec/services/order_syncer_spec.rb
- spec/services/paypal_items_builder_spec.rb
- spec/services/permissions/order_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/services/variant_units/option_value_namer_spec.rb
- spec/spec_helper.rb
- spec/support/cancan_helper.rb
- spec/support/matchers/delegate_matchers.rb
- spec/support/features/datepicker_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/support/request/shop_workflow.rb
- spec/support/request/stripe_stubs.rb
- spec/support/request/web_helper.rb
- spec/support/seeds.rb
- spec/swagger_helper.rb
- spec/views/spree/admin/payment_methods/index.html.haml_spec.rb
Metrics/AbcSize:
Max: 15
Exclude:
- app/controllers/admin/schedules_controller.rb
- app/controllers/checkout_controller.rb
- app/controllers/spree/admin/general_settings_controller.rb
- app/controllers/spree/admin/images_controller.rb
- app/controllers/spree/admin/mail_methods_controller.rb
- app/controllers/spree/admin/shipping_methods_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/helpers/spree/base_helper.rb
- app/jobs/subscription_placement_job.rb
- app/models/order_cycle.rb
- app/models/product_import/unit_converter.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/serializers/api/admin/enterprise_serializer.rb
- app/services/order_factory.rb
- app/services/variants_stock_levels.rb
- engines/order_management/app/services/order_management/subscriptions/form.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/order_grouper.rb
- lib/spree/core/controller_helpers/auth.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/product_duplicator.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/profile_storer.rb
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
@@ -376,19 +260,23 @@ Metrics/AbcSize:
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/resource_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
- 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/application_controller.rb
- app/controllers/cart_controller.rb
- app/controllers/api/v0/enterprises_controller.rb
- app/controllers/api/v0/product_images_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/api/v0/shipments_controller.rb
- app/controllers/api/v0/taxons_controller.rb
- app/controllers/api/v0/variants_controller.rb
- app/controllers/checkout_controller.rb
- app/controllers/discourse_sso_controller.rb
- app/controllers/enterprises_controller.rb
- app/controllers/spree/admin/adjustments_controller.rb
- app/controllers/spree/admin/general_settings_controller.rb
- app/controllers/spree/admin/images_controller.rb
- app/controllers/spree/admin/mail_methods_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
@@ -397,14 +285,14 @@ Metrics/AbcSize:
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/search_controller.rb
- app/controllers/spree/admin/shipping_methods_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/spree/paypal_controller.rb
- app/controllers/spree/user_passwords_controller.rb
- app/controllers/spree/user_registrations_controller.rb
- app/controllers/spree/users_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
@@ -416,21 +304,26 @@ Metrics/AbcSize:
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/zones_helper.rb
- app/helpers/spree/base_helper.rb
- app/helpers/spree/orders_helper.rb
- app/mailers/spree/order_mailer.rb
- app/models/calculator/flat_percent_per_item.rb
- app/models/column_preference.rb
- app/models/enterprise_group.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/order_cycle.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/unit_converter.rb
- app/models/proxy_order.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/models/spree/item_adjustments.rb
- app/models/spree/line_item.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_contents.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/payment/processing.rb
@@ -445,13 +338,18 @@ Metrics/AbcSize:
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/product_serializer.rb
- app/serializers/api/admin/enterprise_serializer.rb
- app/serializers/api/variant_serializer.rb
- app/services/cap_quantity.rb
- app/services/cart_service.rb
- app/services/create_order_cycle.rb
- app/services/sets/model_set.rb
- app/services/order_cycle_form.rb
- app/services/order_factory.rb
- app/services/order_syncer.rb
- app/services/place_proxy_order.rb
- app/services/process_payment_intent.rb
- app/services/sets/model_set.rb
- app/services/variants_stock_levels.rb
- app/services/variant_units/option_value_namer.rb
- app/services/variant_units/variant_and_line_item_naming.rb
- engines/order_management/app/services/order_management/order/updater.rb
@@ -459,11 +357,12 @@ Metrics/AbcSize:
- 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/form.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
- lib/discourse/single_sign_on.rb
- lib/open_food_network/customers_report.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/lettuce_share_report.rb
@@ -471,6 +370,7 @@ Metrics/AbcSize:
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/order_grouper.rb
- lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb
- lib/open_food_network/packing_report.rb
- lib/open_food_network/payments_report.rb
@@ -482,15 +382,18 @@ Metrics/AbcSize:
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/api/controller_setup.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/auth.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/spree/core/delegate_belongs_to.rb
- lib/spree/core/permalinks.rb
- lib/spree/core/product_duplicator.rb
- lib/spree/core/s3_support.rb
- lib/spree/localized_number.rb
- lib/spree/money.rb
- lib/stripe/account_connector.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/profile_storer.rb
- lib/tasks/enterprises.rake
- lib/tasks/sample_data/order_factory.rb
- lib/tasks/sample_data/product_factory.rb
@@ -522,17 +425,15 @@ Metrics/BlockLength:
"scenario"
]
Exclude:
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/admin/tag_rules_spec.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment/processing.rb
- app/models/spree/payment.rb
- app/models/spree/shipment.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/tasks/data.rake
- spec/controllers/spree/admin/invoices_controller_spec.rb
- spec/factories/address_factory.rb
- spec/factories/enterprise_factory.rb
- spec/factories/line_item_factory.rb
- spec/factories/order_cycle_factory.rb
- spec/factories/order_factory.rb
- spec/factories/payment_method_factory.rb
@@ -543,11 +444,13 @@ Metrics/BlockLength:
- spec/factories/subscription_factory.rb
- spec/factories/user_factory.rb
- spec/factories/variant_factory.rb
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/consumer/shopping/checkout_spec.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/lib/open_food_network/group_buy_report_spec.rb
- spec/models/tag_rule/discount_order_spec.rb
- spec/requests/api/orders_spec.rb
- spec/spec_helper.rb
- spec/support/cancan_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/swagger_helper.rb
@@ -555,30 +458,14 @@ Metrics/BlockLength:
Metrics/CyclomaticComplexity:
Max: 6
Exclude:
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_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/products_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
- lib/active_merchant/billing/gateways/stripe_decorator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/spree/core/controller_helpers/common.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/credit_card_clone_destroyer.rb
- spec/support/i18n_translations_checker.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
@@ -586,78 +473,88 @@ Metrics/CyclomaticComplexity:
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment_method.rb
- app/models/spree/order_inventory.rb
- app/models/spree/payment.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/services/cart_service.rb
- app/services/sets/variant_override_set.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/spree/localized_number.rb
- spec/models/product_importer_spec.rb
Metrics/PerceivedComplexity:
Max: 7
Exclude:
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/order_inventory.rb
- app/models/spree/shipment.rb
- app/models/spree/variant.rb
- lib/active_merchant/billing/gateways/stripe_decorator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/localized_number.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/credit_card_clone_destroyer.rb
- spec/models/product_importer_spec.rb
- spec/support/i18n_translations_checker.rb
Metrics/PerceivedComplexity:
Max: 7
Exclude:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/api/v0/variants_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/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise_relationship.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order.rb
- app/models/spree/order_inventory.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/spree/localized_number.rb
- spec/models/product_importer_spec.rb
Metrics/MethodLength:
Max: 10
Exclude:
- 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
@@ -667,11 +564,11 @@ Metrics/MethodLength:
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
- app/controllers/api/shipments_controller.rb
- app/controllers/api/taxons_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/cart_controller.rb
- app/controllers/api/v0/product_images_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/api/v0/shipments_controller.rb
- app/controllers/api/v0/taxons_controller.rb
- app/controllers/api/v0/variants_controller.rb
- app/controllers/shop_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
@@ -685,7 +582,7 @@ Metrics/MethodLength:
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/spree/paypal_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/user_confirmations_controller.rb
@@ -696,6 +593,7 @@ Metrics/MethodLength:
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/mailers/producer_mailer.rb
- app/models/calculator/default_tax.rb
- app/models/column_preference.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
@@ -707,28 +605,30 @@ Metrics/MethodLength:
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/credit_card.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_contents.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/payment_method.rb
- app/models/spree/payment/processing.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/store.rb
- app/models/spree/product.rb
- app/models/spree/product_decorator.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/admin/order_cycle_serializer.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/services/cart_service.rb
- app/services/mail_configuration.rb
- app/services/order_cycle_form.rb
- app/services/permitted_attributes/checkout.rb
- app/services/place_proxy_order.rb
- app/services/process_payment_intent.rb
- app/services/variant_units/option_value_namer.rb
- engines/order_management/app/services/order_management/order/updater.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_allocation_report.rb
@@ -754,7 +654,6 @@ Metrics/MethodLength:
- 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
@@ -776,32 +675,27 @@ Metrics/MethodLength:
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/models/product_importer_spec.rb
- spec/support/i18n_translations_checker.rb
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/jobs/subscription_placement_job.rb
- app/models/spree/gateway/pay_pal_express.rb
Metrics/ClassLength:
Max: 100
Exclude:
- app/controllers/admin/customers_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/paypal_controller.rb
- engines/order_management/app/services/order_management/order/updater.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/application_controller.rb
- app/controllers/checkout_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/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/models/enterprise.rb
- app/models/order_cycle.rb
- app/models/product_import/entry_processor.rb
@@ -816,12 +710,15 @@ Metrics/ClassLength:
- app/models/spree/payment.rb
- app/models/spree/product.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/user.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/serializers/api/enterprise_shopfront_serializer.rb
- app/services/cart_service.rb
- app/services/order_syncer.rb
- engines/order_management/app/services/order_management/order/updater.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
@@ -842,20 +739,19 @@ Metrics/ModuleLength:
- app/helpers/injection_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/orders_helper.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment/processing.rb
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb
- lib/open_food_network/column_preference_defaults.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/api/orders_controller_spec.rb
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_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/product_spec.rb
- spec/models/spree/tax_rate_spec.rb
- spec/models/spree/variant_spec.rb
Metrics/ParameterLists:
@@ -865,9 +761,16 @@ Metrics/ParameterLists:
- app/models/product_import/entry_processor.rb
- lib/open_food_network/xero_invoices_report.rb
- spec/features/admin/reports_spec.rb
- spec/support/controller_requests_helper.rb
Lint/UselessAssignment:
Exclude:
- 'spec/**/*'
- 'app/models/spree/taxon.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- app/models/spree/credit_card.rb
- app/models/spree/taxon.rb
- lib/spree/core/controller_helpers/common.rb
Metrics/BlockNesting:
Max: 3
Exclude:
- app/models/spree/payment/processing.rb

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
2.5.9
2.7.3

6
.simplecov Normal file → Executable file
View File

@@ -16,5 +16,7 @@ SimpleCov.start 'rails' do
add_filter '/lib/tasks/sample_data/'
end
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
if ENV['CI']
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

47
Gemfile
View File

@@ -1,21 +1,23 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby "2.5.9"
ruby "2.7.3"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'rails', '~> 6.0.3.7'
gem 'dotenv-rails', require: 'dotenv/rails-now' # Load ENV vars before other gems
gem 'rails', '~> 6.1.4'
gem 'activemerchant', '>= 1.78.0'
gem 'angular-rails-templates', '>= 0.3.0'
gem 'awesome_nested_set'
gem 'ransack', '2.4.1'
gem 'ransack', '2.4.2'
gem 'responders'
gem 'sass', '~> 3.4.0' # this restriction originates from foundation-rails's version
gem 'sass-rails', '< 5.1.0' # this restriction originates from the compass-rails's version
gem 'webpacker', '~> 5'
gem 'i18n'
gem 'i18n-js', '~> 3.8.3'
gem 'i18n-js', '~> 3.9.0'
gem 'rails-i18n'
gem 'rails_safe_tasks', '~> 1.0'
@@ -23,6 +25,8 @@ gem "activerecord-import"
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-6"
gem "fog-aws", "~> 2.0" # db2fog does not support v3
gem "valid_email2"
gem "catalog", path: "./engines/catalog"
gem 'dfc_provider', path: './engines/dfc_provider'
gem "order_management", path: "./engines/order_management"
@@ -45,15 +49,15 @@ gem 'paypal-sdk-merchant', '1.117.2'
gem 'stripe'
gem 'devise'
gem 'devise-i18n'
gem 'devise-encryptable'
gem 'devise-token_authenticatable'
gem 'jwt', '~> 2.2'
gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
gem 'kaminari', '~> 1.2.1'
gem 'pagy', '~> 4.11'
gem 'andand'
gem 'angularjs-rails', '1.5.5'
gem 'angularjs-rails', '1.8.0'
gem 'aws-sdk', '1.67.0'
gem 'bugsnag'
gem 'haml'
@@ -64,26 +68,29 @@ gem 'actionpack-action_caching'
# 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', '~> 7.0'
gem 'acts-as-taggable-on', '~> 8.1'
gem 'angularjs-file-upload-rails', '~> 2.4.1'
gem 'bigdecimal', '3.0.2'
gem 'bootsnap', require: false
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
gem 'dalli'
gem 'figaro'
gem 'geocoder'
gem 'gmaps4rails'
gem 'mimemagic', '> 0.3.5'
gem 'paper_trail', '~> 10.3.1'
gem 'paperclip', '~> 3.4.1'
gem 'paper_trail', '~> 12.1.0'
gem 'rack-rewrite'
gem 'rack-ssl', require: 'rack/ssl'
gem 'roadie-rails'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'puma'
gem 'hiredis'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem "cable_ready", "5.0.0.pre2"
gem 'combine_pdf'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
@@ -107,7 +114,6 @@ gem 'foundation-icons-sass-rails'
gem 'foundation-rails', '= 5.5.2.1'
gem 'jquery-migrate-rails'
gem 'jquery-rails', '4.4.0'
gem 'jquery-ui-rails', '~> 4.2'
gem "select2-rails", github: "openfoodfoundation/select2-rails", branch: "v349_with_thor_v1"
@@ -124,7 +130,8 @@ gem "view_component", require: "view_component/engine"
group :production, :staging do
gem 'ddtrace'
gem 'unicorn-worker-killer'
gem 'rack-timeout'
gem 'sd_notify' # For better Systemd process management. Used by Puma.
end
group :test, :development do
@@ -144,30 +151,32 @@ group :test, :development do
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'unicorn-rails'
gem 'webdrivers'
gem 'cuprite'
end
group :test do
gem 'byebug'
gem 'codecov', require: false
gem 'pdf-reader'
gem 'rails-controller-testing'
gem 'simplecov', require: false
gem 'test-prof'
gem 'webmock'
gem 'rails-controller-testing'
gem 'pdf-reader'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
end
group :development do
gem 'debugger-linecache'
gem 'pry'
gem 'pry-byebug'
gem 'foreman'
gem 'pry', '~> 0.13.0'
gem 'pry-byebug', '~> 3.9.0'
gem 'rubocop'
gem 'rubocop-rails'
gem 'spring'
gem 'spring-commands-rspec'
gem 'web-console'
gem "view_component_storybook", require: "view_component/storybook/engine"

View File

@@ -57,60 +57,62 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.0.3.7)
actionpack (= 6.0.3.7)
actioncable (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.3.7)
actionpack (= 6.0.3.7)
activejob (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
actionmailbox (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
mail (>= 2.7.1)
actionmailer (6.0.3.7)
actionpack (= 6.0.3.7)
actionview (= 6.0.3.7)
activejob (= 6.0.3.7)
actionmailer (6.1.4.1)
actionpack (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activesupport (= 6.1.4.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3.7)
actionview (= 6.0.3.7)
activesupport (= 6.0.3.7)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.4.1)
actionview (= 6.1.4.1)
activesupport (= 6.1.4.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actiontext (6.0.3.7)
actionpack (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
actiontext (6.1.4.1)
actionpack (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
nokogiri (>= 1.8.5)
actionview (6.0.3.7)
activesupport (= 6.0.3.7)
actionview (6.1.4.1)
activesupport (= 6.1.4.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (6.0.3.7)
activesupport (= 6.0.3.7)
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
globalid (>= 0.3.6)
activemerchant (1.120.0)
activemerchant (1.123.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (6.0.3.7)
activesupport (= 6.0.3.7)
activerecord (6.0.3.7)
activemodel (= 6.0.3.7)
activesupport (= 6.0.3.7)
activerecord-import (1.1.0)
activemodel (6.1.4.1)
activesupport (= 6.1.4.1)
activerecord (6.1.4.1)
activemodel (= 6.1.4.1)
activesupport (= 6.1.4.1)
activerecord-import (1.2.0)
activerecord (>= 3.2)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -120,25 +122,26 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.0.3.7)
actionpack (= 6.0.3.7)
activejob (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activesupport (= 6.1.4.1)
marcel (~> 1.0.0)
activesupport (6.0.3.7)
mini_mime (>= 1.1.0)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
acts-as-taggable-on (7.0.0)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
acts-as-taggable-on (8.1.0)
activerecord (>= 5.0, < 6.2)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
andand (1.3.3)
angular-rails-templates (1.1.0)
railties (>= 4.2, < 7)
sprockets (>= 3.0, < 5)
@@ -146,7 +149,7 @@ GEM
angular_rails_csrf (4.5.0)
railties (>= 3, < 7)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.5.5)
angularjs-rails (1.8.0)
ast (2.4.2)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
@@ -157,15 +160,20 @@ GEM
json (~> 1.4)
nokogiri (~> 1)
bcrypt (3.1.16)
bootsnap (1.7.5)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.9.0)
msgpack (~> 1.0)
bugsnag (6.20.0)
bugsnag (6.22.1)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (6.1.4)
bullet (6.1.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cable_ready (5.0.0.pre2)
rails (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.35.3)
addressable
@@ -179,9 +187,10 @@ GEM
chronic (0.10.2)
chunky_png (1.4.0)
climate_control (0.2.0)
cliver (0.3.2)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
codecov (0.5.2)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
coffee-rails (5.0.0)
@@ -216,6 +225,9 @@ GEM
crass (1.0.6)
css_parser (1.9.0)
addressable
cuprite (0.13)
capybara (>= 2.1, < 4)
ferrum (~> 0.11.0)
dalli (2.7.11)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
@@ -223,7 +235,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
ddtrace (0.50.0)
ddtrace (0.52.0)
ffi (~> 1.0)
msgpack
debugger-linecache (1.2.0)
@@ -235,10 +247,16 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-i18n (1.10.0)
devise (>= 4.8.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
docile (1.3.5)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
e2mmap (0.1.0)
erubi (1.10.0)
et-orbi (1.2.4)
@@ -259,10 +277,13 @@ GEM
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
ffaker (2.18.0)
ffi (1.15.1)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
ferrum (0.11)
addressable (~> 2.5)
cliver (~> 0.3)
concurrent-ruby (~> 1.1)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.19.0)
ffi (1.15.3)
flipper (0.20.4)
flipper-active_record (0.20.4)
activerecord (>= 5.0, < 7)
@@ -287,6 +308,7 @@ GEM
fog-xml (0.1.3)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
foreman (0.87.2)
formatador (0.2.5)
foundation-icons-sass-rails (3.0.0)
railties (>= 3.1.1)
@@ -301,15 +323,13 @@ GEM
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.6.7)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (0.5.2)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
good_migrations (0.0.2)
good_migrations (0.1.0)
activerecord (>= 3.1)
railties (>= 3.1)
haml (5.2.1)
haml (5.2.2)
temple (>= 0.8.0)
tilt
hashdiff (1.0.1)
@@ -318,12 +338,11 @@ GEM
hiredis (0.6.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
i18n-js (3.8.3)
i18n-js (3.9.0)
i18n (>= 0.6.6)
immigrant (0.3.6)
activerecord (>= 3.0)
ipaddress (0.8.3)
jquery-migrate-rails (1.2.1)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
@@ -337,27 +356,14 @@ GEM
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jwt (2.2.3)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
kgio (2.11.3)
knapsack (1.22.0)
knapsack (4.0.0)
rake
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
libv8-node (15.14.0.1)
loofah (2.9.1)
loofah (2.12.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -371,7 +377,7 @@ GEM
nokogiri (~> 1)
rake
mini_mime (1.1.0)
mini_portile2 (2.5.3)
mini_portile2 (2.6.1)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.14.4)
@@ -383,9 +389,9 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.7)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
nio4r (2.5.8)
nokogiri (1.12.4)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
@@ -394,8 +400,9 @@ GEM
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
paper_trail (10.3.1)
activerecord (>= 4.2)
pagy (4.11.0)
paper_trail (12.1.0)
activerecord (>= 5.2)
request_store (~> 1.1)
paperclip (3.4.2)
activemodel (>= 3.0.0)
@@ -403,10 +410,10 @@ GEM
activesupport (>= 3.0.0)
cocaine (~> 0.5.0)
mime-types
parallel (1.20.1)
parallel (1.21.0)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.0.1.1)
parser (3.0.2.0)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
@@ -420,40 +427,45 @@ GEM
ruby-rc4
ttfunk
pg (1.2.3)
power_assert (2.0.0)
pry (0.14.1)
power_assert (2.0.1)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.8.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.10)
pry (~> 0.13.0)
public_suffix (4.0.6)
puma (5.4.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.5.2)
rack (2.2.3)
rack-mini-profiler (2.3.2)
rack-mini-profiler (2.3.3)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
rack-proxy (0.7.0)
rack
rack-rewrite (1.5.1)
rack-ssl (1.4.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.7)
actioncable (= 6.0.3.7)
actionmailbox (= 6.0.3.7)
actionmailer (= 6.0.3.7)
actionpack (= 6.0.3.7)
actiontext (= 6.0.3.7)
actionview (= 6.0.3.7)
activejob (= 6.0.3.7)
activemodel (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
bundler (>= 1.3.0)
railties (= 6.0.3.7)
rack-timeout (0.6.0)
rails (6.1.4.1)
actioncable (= 6.1.4.1)
actionmailbox (= 6.1.4.1)
actionmailer (= 6.1.4.1)
actionpack (= 6.1.4.1)
actiontext (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activemodel (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
bundler (>= 1.15.0)
railties (= 6.1.4.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -462,22 +474,21 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.1)
loofah (~> 2.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
rails_safe_tasks (1.0.0)
railties (6.0.3.7)
actionpack (= 6.0.3.7)
activesupport (= 6.0.3.7)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.3)
ransack (2.4.1)
rake (13.0.6)
ransack (2.4.2)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
i18n
@@ -485,7 +496,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.2.5)
redis (4.4.0)
regexp_parser (2.1.1)
request_store (1.5.0)
rack (>= 1.4)
@@ -514,7 +525,7 @@ GEM
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.1)
rspec-rails (5.0.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -538,25 +549,25 @@ GEM
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (1.16.1)
rubocop (1.21.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.7.0, < 2.0)
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.7.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
rubocop-rails (2.10.1)
rubocop-rails (2.12.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
ruby2_keywords (0.0.4)
rubyzip (2.3.0)
rubyzip (2.3.2)
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
@@ -566,12 +577,14 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
sidekiq (6.2.1)
semantic_range (3.0.0)
shoulda-matchers (5.0.0)
activesupport (>= 5.2.0)
sidekiq (6.2.2)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
@@ -588,7 +601,7 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spring (2.1.1)
spring (3.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
@@ -606,48 +619,53 @@ GEM
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stringex (2.8.5)
stripe (5.33.0)
stripe (5.38.0)
temple (0.8.2)
test-prof (1.0.5)
test-unit (3.4.4)
test-prof (1.0.7)
test-unit (3.4.7)
power_assert
thor (1.1.0)
thread_safe (0.3.6)
thread-local (1.1.0)
thwait (0.2.0)
e2mmap
tilt (2.0.10)
timecop (0.9.4)
ttfunk (1.7.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.0.0)
unicorn (6.0.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-rails (2.2.1)
rack
unicorn
unicorn-worker-killer (0.4.5)
get_process_mem (~> 0)
unicorn (>= 4, < 7)
uniform_notifier (1.14.2)
view_component (2.34.0)
activesupport (>= 5.0.0, < 7.0)
view_component_storybook (0.8.0)
view_component (>= 2.2)
valid_email2 (4.0.0)
activemodel (>= 3.2)
mail (~> 2.5)
view_component (2.40.0)
activesupport (>= 5.0.0, < 8.0)
method_source (~> 1.0)
view_component_storybook (0.10.1)
view_component (>= 2.36)
warden (1.2.9)
rack (>= 2.0.9)
webdrivers (4.6.0)
web-console (4.1.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (4.6.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.13.0)
addressable (>= 2.3.6)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.7.4)
webpacker (5.4.2)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
@@ -670,20 +688,21 @@ DEPENDENCIES
activerecord-import
activerecord-postgresql-adapter
activerecord-session_store
acts-as-taggable-on (~> 7.0)
acts-as-taggable-on (~> 8.1)
acts_as_list (= 1.0.4)
andand
angular-rails-templates (>= 0.3.0)
angular_rails_csrf
angularjs-file-upload-rails (~> 2.4.1)
angularjs-rails (= 1.5.5)
angularjs-rails (= 1.8.0)
awesome_nested_set
awesome_print
aws-sdk (= 1.67.0)
bigdecimal (= 3.0.2)
bootsnap
bugsnag
bullet
byebug
cable_ready (= 5.0.0.pre2)
cancancan (~> 1.15.0)
capybara
catalog!
@@ -691,6 +710,7 @@ DEPENDENCIES
coffee-rails (~> 5.0.0)
combine_pdf
compass-rails
cuprite
custom_error_message!
dalli
database_cleaner
@@ -699,15 +719,17 @@ DEPENDENCIES
debugger-linecache
devise
devise-encryptable
devise-i18n
devise-token_authenticatable
dfc_provider!
dotenv-rails
factory_bot_rails (= 6.2.0)
ffaker
figaro
flipper
flipper-active_record
flipper-ui
fog-aws (~> 2.0)
foreman
foundation-icons-sass-rails
foundation-rails (= 5.5.2.1)
fuubar (~> 2.5.1)
@@ -718,15 +740,13 @@ DEPENDENCIES
highline (= 2.0.3)
hiredis
i18n
i18n-js (~> 3.8.3)
i18n-js (~> 3.9.0)
immigrant
jquery-migrate-rails
jquery-rails (= 4.4.0)
jquery-ui-rails (~> 4.2)
json
json_spec (~> 1.1.4)
jwt (~> 2.2)
kaminari (~> 1.2.1)
knapsack
letter_opener (>= 1.4.1)
mimemagic (> 0.3.5)
@@ -735,22 +755,25 @@ DEPENDENCIES
oauth2 (~> 1.4.7)
ofn-qz!
order_management!
paper_trail (~> 10.3.1)
pagy (~> 4.11)
paper_trail (~> 12.1.0)
paperclip (~> 3.4.1)
paranoia (~> 2.4)
paypal-sdk-merchant (= 1.117.2)
pdf-reader
pg (~> 1.2.3)
pry
pry-byebug
pry (~> 0.13.0)
pry-byebug (~> 3.9.0)
puma
rack-mini-profiler (< 3.0.0)
rack-rewrite
rack-ssl
rails (~> 6.0.3.7)
rack-timeout
rails (~> 6.1.4)
rails-controller-testing
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (= 2.4.1)
ransack (= 2.4.2)
redcarpet
redis (>= 4.0)
responders
@@ -761,8 +784,8 @@ DEPENDENCIES
rswag
rubocop
rubocop-rails
sass (~> 3.4.0)
sass-rails (< 5.1.0)
sd_notify
select2-rails!
selenium-webdriver
shoulda-matchers
@@ -778,19 +801,20 @@ DEPENDENCIES
test-unit (~> 3.4)
timecop
uglifier (>= 1.0.3)
unicorn-rails
unicorn-worker-killer
valid_email2
view_component
view_component_storybook
web!
web-console
webdrivers
webmock
webpacker (~> 5)
whenever
wicked_pdf
wkhtmltopdf-binary
RUBY VERSION
ruby 2.5.9p229
ruby 2.7.3p183
BUNDLED WITH
1.17.3
2.1.4

5
Procfile Normal file
View File

@@ -0,0 +1,5 @@
# Foreman Procfile. Start all dev server processes with: `foreman start`
rails: bundle exec rails s -p 3000
webpack: ./bin/webpack-dev-server
sidekiq: bundle exec sidekiq -q mailers -q default

View File

@@ -34,7 +34,7 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration
## Testing
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/openfoodfoundation/openfoodnetwork/projects/31) for some good first issues, both on manual and automated testing (RSpec/Capybara).
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/orgs/openfoodfoundation/projects/1) for some good first issues, both on manual and automated testing (RSpec/Capybara).
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
@@ -47,5 +47,5 @@ Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
[ofn-handbook]: https://ofn-user-guide.gitbook.io/ofn-handbook/
[ofn-install]: https://github.com/openfoodfoundation/ofn-install
[super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide
[welcome-dev]: https://github.com/openfoodfoundation/openfoodnetwork/projects/27
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/2
[zenhub]: https://www.zenhub.com/extension

View File

@@ -8,6 +8,6 @@ require_relative 'config/application'
Openfoodnetwork::Application.load_tasks
unless ENV['DISABLE_KNAPSACK']
Knapsack.load_tasks if defined?(Knapsack)
if !ENV['DISABLE_KNAPSACK'] && defined?(Knapsack)
Knapsack.load_tasks
end

View File

@@ -0,0 +1,3 @@
<svg viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.08646 2.11037L11.1222 4.40105C11.208 4.49756 11.208 4.65501 11.1222 4.75151L6.19306 10.2979L4.09861 10.5595C3.81875 10.595 3.58177 10.3284 3.61337 10.0135L3.84583 7.65677L8.775 2.11037C8.86076 2.01387 9.00069 2.01387 9.08646 2.11037ZM12.7427 1.52881L11.6413 0.28951C11.2983 -0.0965032 10.7408 -0.0965032 10.3955 0.28951L9.59653 1.18851C9.51076 1.28502 9.51076 1.44247 9.59653 1.53897L11.6323 3.82965C11.7181 3.92616 11.858 3.92616 11.9438 3.82965L12.7427 2.93065C13.0858 2.5421 13.0858 1.91483 12.7427 1.52881ZM8.66667 8.78941V11.3747H1.44444V3.2481H6.6309C6.70312 3.2481 6.77083 3.21508 6.82274 3.15921L7.72552 2.14339C7.89705 1.95038 7.77517 1.62278 7.53368 1.62278H1.08333C0.485243 1.62278 0 2.16878 0 2.84177V11.781C0 12.454 0.485243 13 1.08333 13H9.02778C9.62587 13 10.1111 12.454 10.1111 11.781V7.77359C10.1111 7.50186 9.81997 7.36726 9.64844 7.55773L8.74566 8.57355C8.69601 8.63196 8.66667 8.70815 8.66667 8.78941Z" fill="#4CB5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -8,6 +8,9 @@ angular.module("ofn.admin", [
"admin.dropdown",
"admin.products",
"admin.taxons",
"infinite-scroll"
]).config ($httpProvider) ->
"infinite-scroll",
"admin.orders"
]).config ($httpProvider, $locationProvider, $qProvider) ->
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
$locationProvider.hashPrefix('')
$qProvider.errorOnUnhandledRejections(false)

View File

@@ -6,8 +6,7 @@
//
// jquery and angular
//= require jquery
//= require jquery-migrate-min
//= require jquery2
//= require jquery_ujs
//= require jquery.ui.all
//= require jquery.powertip
@@ -110,5 +109,8 @@
// foundation
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
// LocalStorage
//= require ../shared/angular-local-storage.js
// requires the rest of the JS code in this folder
//= require_tree .

View File

@@ -148,7 +148,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$http(
method: "DELETE"
url: "/api/v0/products/" + product.id
).success (data) ->
).then (response) ->
$scope.products.splice $scope.products.indexOf(product), 1
DirtyProducts.deleteProduct product.id
$scope.displayDirtyProducts()
@@ -163,7 +163,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$http(
method: "DELETE"
url: "/api/v0/products/" + product.permalink_live + "/variants/" + variant.id
).success (data) ->
).then (response) ->
$scope.removeVariant(product, variant)
else
alert(t("delete_product_variant"))
@@ -221,16 +221,16 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
import_date: $scope.q.importDateFilter
page: $scope.page
per_page: $scope.per_page
).success((data) ->
).then((response) ->
DirtyProducts.clear()
BulkProducts.updateVariantLists(data.products || [])
BulkProducts.updateVariantLists(response.data.products || [])
$timeout -> $scope.displaySuccess()
).error (data, status) ->
if status == 400 && data.errors?
errorsString = ErrorsParser.toString(data.errors, status)
).catch (response) ->
if response.status == 400 && response.data.errors?
errorsString = ErrorsParser.toString(response.data.errors, response.status)
$scope.displayFailure t("products_update_error") + "\n" + errorsString
else
$scope.displayFailure t("products_update_error_data") + status
$scope.displayFailure t("products_update_error_data") + response.status
$scope.cancel = (destination) ->
$window.location = destination

View File

@@ -1,4 +1,4 @@
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
angular.module("admin.customers").directive 'editAddressDialog', ($rootScope, $compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -18,6 +18,7 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
scope.customer = data
scope.errors = []
template.dialog('close')
$rootScope.$evalAsync()
StatusMessage.display('success', t('admin.customers.index.update_address_success'))
else
scope.errors.push(t('admin.customers.index.update_address_error'))
@@ -33,4 +34,4 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
template = $compile($templateCache.get('admin/edit_address_dialog.html'))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
scope.$apply()
$rootScope.$evalAsync()

View File

@@ -1,4 +1,4 @@
angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
angular.module("admin.customers").directive 'newCustomerDialog', ($rootScope, $compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -20,6 +20,7 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
scope.email = ""
scope.submitted = false
template.dialog('close')
$rootScope.$evalAsync()
, (response) ->
if response.data.errors
scope.errors.push(error) for error in response.data.errors
@@ -37,5 +38,6 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
element.bind 'click', (e) ->
if CurrentShop.shop.id
template.dialog('open')
$rootScope.$evalAsync()
else
alert(t('js.customers.select_shop'))

View File

@@ -0,0 +1,8 @@
angular.module("ofn.admin").directive "select2WatchNgModel", () ->
restrict: 'E'
scope: true
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$render = () ->
newValue = ngModel.$viewValue;
element.children(".select2").select2("val", newValue)

View File

@@ -10,5 +10,5 @@ angular.module('admin.enterpriseFees').controller 'enterpriseFeesCtrl', ($scope,
url += '&' + match[0]
url
$http.get($scope.enterpriseFeesUrl()).success (data) ->
$scope.enterprise_fees = data
$http.get($scope.enterpriseFeesUrl()).then (response) ->
$scope.enterprise_fees = response.data

View File

@@ -1,12 +1,14 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage, RequestMonitor) ->
$scope.Enterprise = enterprise
$scope.Enterprises = Enterprises
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear
$scope.menu = SideMenu
$scope.newManager = { id: null, email: (t('add_manager')) }
$scope.StatusMessage = StatusMessage
$scope.RequestMonitor = RequestMonitor
$scope.$watch 'enterprise_form.$dirty', (newValue) ->
StatusMessage.display 'notice', t('admin.unsaved_changes') if newValue
@@ -59,11 +61,11 @@ angular.module("admin.enterprises")
$scope.invite_errors = $scope.invite_success = null
email = $scope.newUser
$http.post("/admin/manager_invitations", {email: email, enterprise_id: $scope.Enterprise.id}).success (data)->
$scope.addManager({id: data.user, email: email})
$http.post("/admin/manager_invitations", {email: email, enterprise_id: $scope.Enterprise.id}).then (response)->
$scope.addManager({id: response.data.user, email: email})
$scope.invite_success = t('user_invited', email: email)
.error (data) ->
$scope.invite_errors = data.errors
.catch (response) ->
$scope.invite_errors = response.data.errors
$scope.resetModal = ->
$scope.newUser = $scope.invite_errors = $scope.invite_success = null
@@ -90,3 +92,6 @@ angular.module("admin.enterprises")
$scope.translation = (key) ->
t('js.admin.enterprises.form.images.' + key)
$scope.loadSuppliers = ->
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")

View File

@@ -0,0 +1,18 @@
angular.module("admin.enterprises").directive "ofnProducerAutocomplete", (Enterprises, AutocompleteSelect2) ->
scope: true
link: (scope,element,attrs) ->
scope.loadSuppliers() if !scope.suppliers
multiple = scope.$eval attrs.multipleSelection
placeholder = attrs.placeholder
initialSelection = scope.$eval attrs.ngModel
setTimeout ->
scope.suppliers.$promise.then (data) ->
AutocompleteSelect2.autocomplete(
multiple,
placeholder,
element,
(-> Enterprises.findByID(initialSelection)),
(-> Enterprises.findByIDs(initialSelection)),
((term) -> Enterprises.findByTerm(scope.suppliers, term))
)

View File

@@ -1,4 +1,4 @@
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($compile, $templateCache, DialogDefaults, $timeout) ->
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($rootScope, $compile, $templateCache, DialogDefaults, $timeout) ->
restrict: 'A'
scope: true
@@ -10,13 +10,14 @@ angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($com
if scope.template.dialog
scope.template.dialog(DialogDefaults)
scope.template.dialog('open')
scope.$apply()
$rootScope.$evalAsync()
element.bind 'click', scope.hold_file_input_and_show_warning_modal
# When the user presses continue in the warning modal, we open the browser file input dialog
scope.continue = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
# unbind warning modal handler and click file input again to open the browser file input dialog
element.unbind('click').trigger('click')
@@ -27,4 +28,5 @@ angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($com
scope.close = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -15,19 +15,19 @@ angular.module("admin.enterprises").factory 'PermalinkChecker', ($q, $http) ->
Accept: 'application/javascript'
timeout: deferredAbort.promise
)
.success( (data) =>
if data.length > @MAX_PERMALINK_LENGTH || !data.match(/^[\w-]+$/)
.then( (response) =>
if response.data.length > @MAX_PERMALINK_LENGTH || !response.data.match(/^[\w-]+$/)
deferredRequest.resolve
permalink: permalink
available: t('js.error')
else
deferredRequest.resolve
permalink: data
permalink: response.data
available: t('available')
).error (data,status) =>
if status == 409
).catch (response) =>
if response.status == 409
deferredRequest.resolve
permalink: data
permalink: response.data
available: t('js.unavailable')
else
# Something went wrong or request was aborted

View File

@@ -35,7 +35,7 @@ angular.module("admin.indexUtils").factory 'Columns', ($rootScope, $http, $injec
data:
action_name: action_name
column_preferences: (preference for column_name, preference of @columns)
.success (data) =>
for column in data
.then (response) =>
for column in response.data
angular.extend(@columns[column.column_name], column)
angular.extend(@savedColumns[column.column_name], column)

View File

@@ -1,9 +1,9 @@
angular.module("admin.indexUtils").factory "dataFetcher", ($http, $q, RequestMonitor) ->
return (dataLocation) ->
deferred = $q.defer()
RequestMonitor.load $http.get(dataLocation).success((data) ->
deferred.resolve data
).error ->
RequestMonitor.load $http.get(dataLocation).then((response) ->
deferred.resolve response.data
).catch ->
deferred.reject()
deferred.promise

View File

@@ -52,6 +52,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.loadOrders = ->
RequestMonitor.load $scope.orders = Orders.index(
"q[state_not_eq]": "canceled",
"q[shipment_state_not_eq]": "shipped",
"q[completed_at_not_null]": "true",
"q[distributor_id_eq]": $scope.distributorFilter,
"q[order_cycle_id_eq]": $scope.orderCycleFilter,
@@ -62,6 +63,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.loadLineItems = ->
RequestMonitor.load LineItems.index(
"q[order_state_not_eq]": "canceled",
"q[order_shipment_state_not_eq]": "shipped",
"q[order_completed_at_not_null]": "true",
"q[order_distributor_id_eq]": $scope.distributorFilter,
"q[variant_product_supplier_id_eq]": $scope.supplierFilter,
@@ -127,12 +129,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.selectedUnitsVariant = unitsVariant
$scope.sumUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.final_weight_volume
, 0
$scope.sumMaxUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.max_quantity * lineItem.units_variant.unit_value
, 0

View File

@@ -1,4 +1,4 @@
angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($scope, $controller, $location, Enterprise, OrderCycle, ExchangeProduct, ocInstance) ->
angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($scope, $rootScope, $controller, $location, Enterprise, OrderCycle, ExchangeProduct, ocInstance) ->
$controller('AdminOrderCycleExchangesCtrl', {$scope: $scope, ocInstance: ocInstance, $location: $location})
$scope.view = 'incoming'
@@ -28,4 +28,4 @@ angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($
$scope.selectAllVariants = (exchange, selected) ->
$scope.loadAllExchangeProducts(exchange).then ->
$scope.setExchangeVariants(exchange, $scope.suppliedVariants(exchange.enterprise_id), selected)
$scope.$apply()
$rootScope.$evalAsync()

View File

@@ -18,7 +18,7 @@ angular.module('admin.orderCycles')
OrderCycle.exchangeDirection(exchange)
$scope.enterprisesWithFees = ->
$scope.enterprises[id] for id in OrderCycle.participatingEnterpriseIds() when $scope.enterpriseFeesForEnterprise(id).length > 0
$scope.enterprises[id] for id in [OrderCycle.participatingEnterpriseIds()..., [OrderCycle.order_cycle.coordinator_id]...] when $scope.enterpriseFeesForEnterprise(id).length > 0
$scope.removeExchange = ($event, exchange) ->
$event.preventDefault()

View File

@@ -1,4 +1,4 @@
angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compile, $injector, $templateCache, DialogDefaults, OrderCycles, Schedules) ->
angular.module("admin.orderCycles").directive 'scheduleDialog', ($rootScope, $window, $compile, $injector, $templateCache, DialogDefaults, OrderCycles, Schedules) ->
restrict: 'A'
scope:
scheduleId: '@'
@@ -22,9 +22,11 @@ angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compi
scope.template.dialog(angular.extend(settings,{width: $window.innerWidth * 0.6}))
scope.template.dialog(close: -> scope.template.remove())
scope.template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
return
scope.delete = ->
@@ -55,6 +57,7 @@ angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compi
if data.id
scope.submitted = false
scope.template.dialog('close')
$rootScope.$evalAsync()
, (response) ->
if response.data.errors
scope.errors.push(error) for error in response.data.errors

View File

@@ -8,19 +8,19 @@ angular.module("admin.orders").controller "bulkInvoiceCtrl", ($scope, $http, $ti
$scope.poll_wait = 5 # 5 Seconds between each check
$scope.poll_retries = 80 # Maximum checks before stopping
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).success (data) ->
$scope.invoice_id = data
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).then (response) ->
$scope.invoice_id = response.data
$scope.pollBulkInvoice()
$scope.pollBulkInvoice = ->
$timeout($scope.nextPoll, $scope.poll_wait * 1000)
$scope.nextPoll = ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').success (data) ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').then (response) ->
$scope.loading = false
$scope.message = t('js.admin.orders.index.bulk_invoice_created')
.error (data) ->
.catch (response) ->
$scope.poll++
if $scope.poll > $scope.poll_retries

View File

@@ -1,4 +1,4 @@
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter) ->
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter, $location, KeyValueMapStore) ->
$scope.RequestMonitor = RequestMonitor
$scope.pagination = Orders.pagination
$scope.orders = Orders.all
@@ -15,39 +15,54 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
$scope.poll = 0
$scope.rowStatus = {}
KeyValueMapStore.localStorageKey = 'ordersFilters'
KeyValueMapStore.storableKeys = ["q", "sorting", "page", "per_page"]
$scope.initialise = ->
unless KeyValueMapStore.restoreValues($scope)
$scope.setDefaults()
$scope.fetchResults()
$scope.setDefaults = ->
$scope.per_page = 15
$scope.q = {
completed_at_not_null: true
}
$scope.clearFilters = () ->
KeyValueMapStore.clearKeyValueMap()
$scope.setDefaults()
$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')
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_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'],
'q[bill_address_firstname_start]': $scope['q']['bill_address_firstname_start'],
'q[bill_address_lastname_start]': $scope['q']['bill_address_lastname_start'],
'q[state_eq]': $scope.q?.state_eq,
'q[number_cont]': $scope.q?.number_cont,
'q[email_cont]': $scope.q?.email_cont,
'q[bill_address_firstname_start]': $scope.q?.bill_address_firstname_start,
'q[bill_address_lastname_start]': $scope.q?.bill_address_lastname_start,
# Set default checkbox values to null. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498
'q[completed_at_not_null]': $scope['q']['completed_at_not_null'] || null,
'q[distributor_id_in][]': $scope['q']['distributor_id_in'],
'q[order_cycle_id_in][]': $scope['q']['order_cycle_id_in'],
'q[completed_at_not_null]': $scope.q?.completed_at_not_null || null,
'q[distributor_id_in][]': $scope.q?.distributor_id_in,
'q[order_cycle_id_in][]': $scope.q?.order_cycle_id_in,
'q[s]': $scope.sorting || 'completed_at desc',
shipping_method_id: $scope.shipping_method_id,
shipping_method_id: $scope.q?.shipping_method_id,
per_page: $scope.per_page,
page: page
}
KeyValueMapStore.setStoredValues($scope)
RequestMonitor.load(Orders.index(params).$promise)
$scope.appendStringIfNotEmpty = (baseString, stringToAppend) ->
return baseString unless baseString
return baseString if baseString.endsWith(stringToAppend)
baseString + stringToAppend

View File

@@ -1 +1 @@
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation'])
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation', "OFNShared"])

View File

@@ -2,6 +2,6 @@ angular.module("admin.paymentMethods").controller "ProvidersCtrl", ($scope, paym
if paymentMethod.type
$scope.include_html = "/admin/payment_methods/show_provider_preferences?" +
"provider_type=#{paymentMethod.type};" +
"pm_id=#{paymentMethod.id};"
"pm_id=#{paymentMethod.id || ''};"
else
$scope.include_html = ""

View File

@@ -5,9 +5,9 @@ angular.module("admin.paymentMethods").controller "StripeController", ($scope, $
$scope.$watch "paymentMethod.preferred_enterprise_id", (newID, oldID) ->
return unless newID?
$scope.stripe_account = {}
$http.get("/admin/stripe_accounts/status.json?enterprise_id=#{newID}").success (data) ->
angular.extend($scope.stripe_account, data)
.error (response) ->
$http.get("/admin/stripe_accounts/status.json?enterprise_id=#{newID}").then (response) ->
angular.extend($scope.stripe_account, response.data)
.catch (response) ->
$scope.stripe_account.status = "request_failed"
$scope.current_enterprise_stripe_path = ->

View File

@@ -84,14 +84,14 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'end': end
'filepath': ams_data.filepath
'settings': ams_data.importSettings
).success((data, status) ->
angular.merge($scope.entries, angular.fromJson(data['entries']))
$scope.sortUpdates(data['reset_counts'])
).then((response) ->
angular.merge($scope.entries, angular.fromJson(response.data['entries']))
$scope.sortUpdates(response.data['reset_counts'])
$scope.updateProgress()
).error((data, status) ->
$scope.exception = data
console.error(data)
).catch((response) ->
$scope.exception = response.data
console.error(response.data)
)
$scope.sortUpdates = (data) ->
@@ -110,19 +110,19 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'end': end
'filepath': ams_data.filepath
'settings': ams_data.importSettings
).success((data, status) ->
$scope.sortResults(data['results'])
).then((response) ->
$scope.sortResults(response.data['results'])
angular.forEach data['updated_ids'], (id) ->
angular.forEach response.data['updated_ids'], (id) ->
$scope.updated_ids.push(id)
angular.forEach data['errors'], (error) ->
angular.forEach response.data['errors'], (error) ->
$scope.update_errors.push(error)
$scope.updateProgress()
).error((data, status) ->
$scope.exception = data
console.error(data)
).catch((response) ->
$scope.exception = response.data
console.error(response.data)
)
$scope.sortResults = (results) ->
@@ -151,10 +151,10 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'reset_absent': true,
'updated_ids': $scope.updated_ids,
'enterprises_to_reset': enterprises_to_reset
).success((data, status) ->
$scope.updates.products_reset = data
).error((data, status) ->
console.error(data)
).then((response) ->
$scope.updates.products_reset = response.data
).catch((response) ->
console.error(response.data)
)
$scope.updateProgress = () ->

View File

@@ -1,5 +1,5 @@
angular.module("admin.products")
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices) ->
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices, PriceParser) ->
$scope.product = { master: {} }
$scope.product.master.product = $scope.product
$scope.placeholder_text = ""
@@ -26,9 +26,9 @@ angular.module("admin.products")
$scope.processUnitValueWithDescription = ->
if $scope.product.master.hasOwnProperty("unit_value_with_description")
match = $scope.product.master.unit_value_with_description.match(/^([\d\.]+(?= *|$)|)( *)(.*)$/)
match = $scope.product.master.unit_value_with_description.match(/^([\d\.,]+(?= *|$)|)( *)(.*)$/)
if match
$scope.product.master.unit_value = parseFloat(match[1])
$scope.product.master.unit_value = PriceParser.parse(match[1])
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_description = match[3]

View File

@@ -1,4 +1,4 @@
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices) ->
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices, PriceParser) ->
$scope.unitName = (scale, type) ->
VariantUnitManager.getUnitName(scale, type)
@@ -23,7 +23,7 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
$scope.updateValue = ->
unit_value_human = angular.element('#unit_value_human').val()
$scope.unit_value = unit_value_human * $scope.scale
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
variant_unit_value = angular.element('#variant_unit_value').val()
$scope.unit_value_human = variant_unit_value / $scope.scale

View File

@@ -1,7 +1,7 @@
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, unlocalizeCurrencyFilter) ->
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, PriceParser) ->
class UnitPrices
@displayableUnitPrice: (price, scale, unit_type, unit_value, variant_unit_name) ->
price = unlocalizeCurrencyFilter(price)
price = PriceParser.parse(price)
if price && !isNaN(price) && unit_type && unit_value
value = localizeCurrencyFilter(UnitPrices.price(price, scale, unit_type, unit_value, variant_unit_name))
unit = UnitPrices.unit(scale, unit_type, variant_unit_name)

View File

@@ -1,4 +1,4 @@
angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource) ->
angular.module("admin.resources").factory 'Enterprises', ($q, $filter, EnterpriseResource) ->
new class Enterprises
byID: {}
pristineByID: {}
@@ -50,6 +50,17 @@ angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource
))
deferred.promise
findByID: (id) ->
@byID[id]
# For finding multiple Enterprises represented by comma delimited string
findByIDs: (ids) ->
@byID[id] for id in ids.split(",") when @byID[id]
findByTerm: (enterprises, term) ->
$filter('filter')(enterprises, term)
removeLogo: performActionOnEnterpriseResource(EnterpriseResource.removeLogo)
removePromoImage: performActionOnEnterpriseResource(EnterpriseResource.removePromoImage)
removeTermsAndConditions: performActionOnEnterpriseResource(EnterpriseResource.removeTermsAndConditions)

View File

@@ -10,8 +10,8 @@ angular.module("ofn.admin").factory "BulkProducts", (ProductResource, dataFetche
angular.extend(@pagination, data.pagination)
cloneProduct: (product) ->
$http.post("/api/v0/products/" + product.id + "/clone").success (data) =>
dataFetcher("/api/v0/products/" + data.id + "?template=bulk_show").then (newProduct) =>
$http.post("/api/v0/products/" + product.id + "/clone").then (response) =>
dataFetcher("/api/v0/products/" + response.data.id + "?template=bulk_show").then (newProduct) =>
@unpackProduct newProduct
@insertProductAfter(product, newProduct)

View File

@@ -1,24 +0,0 @@
angular.module("ofn.admin").factory "ofnConfirmHandler", (pendingChanges, $compile, $q) ->
return (scope, callback) ->
template = "<div id='dialog-div' style='padding: 10px'><h6>" + t('js.services.unsaved_changes_message') + "</h6></div>"
dialogDiv = $compile(template)(scope)
return ->
if pendingChanges.changeCount(pendingChanges.pendingChanges) > 0
dialogDiv.dialog
dialogClass: "no-close"
resizable: false
height: 140
modal: true
buttons:
"SAVE": ->
dialogDiv = $(this)
$q.all(pendingChanges.submitAll()).then ->
callback()
dialogDiv.dialog "close"
"IGNORE": ->
callback()
$(this).dialog "close"
scope.$apply()
dialogDiv.dialog "open"
else
callback()

View File

@@ -13,15 +13,15 @@ angular.module("ofn.admin").factory 'EnterpriseRelationships', ($http, enterpris
create: (parent_id, child_id, permissions) ->
permissions = (name for name, enabled of permissions when enabled)
$http.post('/admin/enterprise_relationships', {enterprise_relationship: {parent_id: parent_id, child_id: child_id, permissions_list: permissions}}).success (data, status) =>
@enterprise_relationships.unshift(data)
$http.post('/admin/enterprise_relationships', {enterprise_relationship: {parent_id: parent_id, child_id: child_id, permissions_list: permissions}}).then (response) =>
@enterprise_relationships.unshift(response.data)
@create_errors = ""
.error (response, status) =>
@create_errors = response.errors
.catch (response) =>
@create_errors = response.data.errors
delete: (er) ->
$http.delete('/admin/enterprise_relationships/' + er.id).success (data) =>
$http.delete('/admin/enterprise_relationships/' + er.id).then (response) =>
@enterprise_relationships.splice @enterprise_relationships.indexOf(er), 1
permission_presentation: (permission) ->

View File

@@ -6,13 +6,13 @@ angular.module("ofn.admin").factory 'EnterpriseRoles', ($http, enterpriseRoles)
@enterprise_roles = enterpriseRoles
create: (user_id, enterprise_id) ->
$http.post('/admin/enterprise_roles', {enterprise_role: {user_id: user_id, enterprise_id: enterprise_id}}).success (data, status) =>
@enterprise_roles.unshift(data)
$http.post('/admin/enterprise_roles', {enterprise_role: {user_id: user_id, enterprise_id: enterprise_id}}).then (response) =>
@enterprise_roles.unshift(response.data)
@create_errors = ""
.error (response, status) =>
@create_errors = response.errors
.catch (response) =>
@create_errors = response.data.errors
delete: (er) ->
$http.delete('/admin/enterprise_roles/' + er.id).success (data) =>
$http.delete('/admin/enterprise_roles/' + er.id).then (response) =>
@enterprise_roles.splice @enterprise_roles.indexOf(er), 1

View File

@@ -0,0 +1,29 @@
angular.module("admin.indexUtils").factory 'KeyValueMapStore', (localStorageService)->
new class KeyValueMapStore
localStorageKey: ''
storableKeys: []
constructor: ->
localStorageService.setStorageType("sessionStorage")
getStoredKeyValueMap: ->
localStorageService.get(@localStorageKey) || {}
setStoredValues: (source) ->
keyValueMap = {}
for key in @storableKeys
keyValueMap[key] = source[key]
localStorageService.set(@localStorageKey, keyValueMap)
restoreValues: (target) ->
storedKeyValueMap = @getStoredKeyValueMap()
return false if _.isEmpty(storedKeyValueMap)
for k,v of storedKeyValueMap
target[k] = v
return true
clearKeyValueMap: () ->
localStorageService.remove(@localStorageKey)

View File

@@ -1,16 +1,17 @@
$(function() {
var calculator_select = $('select#calc_type')
var original_calc_type = calculator_select.attr('value');
var calculator_select = $('select#calc_type');
var original_calc_type = calculator_select.val();
$('.calculator-settings-warning').hide();
calculator_select.change(function() {
if (calculator_select.attr('value') == original_calc_type) {
calculator_select.on("change", function() {
if (calculator_select.val() === original_calc_type) {
$('div.calculator-settings').show();
$('.calculator-settings-warning').hide();
$('.calculator-settings').find('input,textarea').prop("disabled", false);
} else {
$('div.calculator-settings').hide();
$('.calculator-settings-warning').show();
$('.calculator-settings').find('input,texttarea').prop("disabled", true);
$('.calculator-settings').find('input,textarea').prop("disabled", true);
}
});
})

View File

@@ -2,6 +2,9 @@
$(document).ready(function() {
initAlert()
initConfirm()
if ($('#variant_autocomplete_template').length > 0) {
window.variantTemplate = Handlebars.compile($('#variant_autocomplete_template').text());
window.variantStockTemplate = Handlebars.compile($('#variant_autocomplete_stock_template').text());
@@ -45,7 +48,7 @@ $(document).ready(function() {
if (quantity > maxQuantity) {
quantity = maxQuantity;
save.parents('tr').find('input.line_item_quantity').val(maxQuantity);
alert(t("js.admin.orders.quantity_adjusted"));
ofnAlert(t("js.admin.orders.quantity_adjusted"));
}
toggleItemEdit();
@@ -54,8 +57,9 @@ $(document).ready(function() {
}
$('a.save-item').click(handle_save_click);
handle_delete_click = function(){
var del = $(this);
handle_delete_click = function(elementSelector){
var del = $(elementSelector);
del.hide()
var shipment_number = del.data('shipment-number');
var variant_id = del.data('variant-id');
@@ -63,37 +67,48 @@ $(document).ready(function() {
adjustItems(shipment_number, variant_id, 0);
}
$('a.delete-item').click(handle_delete_click);
$('a.delete-item').click((event) => {
ofnConfirm(() => {
handle_delete_click('#custom-confirm');
});
});
}
});
adjustItems = function(shipment_number, variant_id, quantity){
var shipment = _.findWhere(shipments, {number: shipment_number + ''});
var inventory_units = _.where(shipment.inventory_units, {variant_id: variant_id});
var shipment = _.findWhere(shipments, {number: shipment_number + ''});
var inventory_units = _.where(shipment.inventory_units, {variant_id: variant_id});
var url = Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number;
if (quantity == 0 && inventory_units.length == shipment.inventory_units.length) {
ofnAlert(t("js.admin.orders.cannot_remove_last_item"));
return;
}
var new_quantity = 0;
if(inventory_units.length<quantity){
url += "/add"
new_quantity = (quantity - inventory_units.length);
}else if(inventory_units.length>quantity){
url += "/remove"
new_quantity = (inventory_units.length - quantity);
}
url += '.json';
var url = Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number;
if (new_quantity == 0) {
alert(t("js.admin.orders.quantity_unchanged"));
} else {
$.ajax({
type: "PUT",
url: Spree.url(url),
data: { variant_id: variant_id, quantity: new_quantity }
}).done(function( msg ) {
window.location.reload();
});
}
var new_quantity = 0;
if (inventory_units.length < quantity) {
url += "/add";
new_quantity = (quantity - inventory_units.length);
} else if (inventory_units.length > quantity) {
url += "/remove"
new_quantity = (inventory_units.length - quantity);
}
url += '.json';
if (new_quantity == 0) {
ofnAlert(t("js.admin.orders.quantity_unchanged"));
} else {
$.ajax({
type: "PUT",
url: Spree.url(url),
data: { variant_id: variant_id, quantity: new_quantity }
}).done(function( msg ) {
window.location.reload();
});
}
}
toggleTrackingEdit = function(){
@@ -147,3 +162,27 @@ addVariantFromStockLocation = function() {
}
return 1
}
initAlert = function() {
$('#custom-alert .confirm').click(function(e) {
$('#custom-alert').hide();
})
}
initConfirm = function() {
$('#custom-confirm button.cancel').click(function(e) {
$('#custom-confirm').hide();
});
}
ofnAlert = function(message) {
$('#custom-alert .message').text(message);
$('#custom-alert').show();
}
ofnConfirm = function(callback) {
$('#custom-confirm').data($(event.target).data());
$('#custom-confirm button.confirm').click(callback);
$('#custom-confirm').show();
}

View File

@@ -1,4 +1,4 @@
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($compile, $window, $templateCache, DialogDefaults, shops) ->
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($rootScope, $compile, $window, $templateCache, DialogDefaults, shops) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -26,3 +26,4 @@ angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($compi
scope.newSubscription()
else
template.dialog('open')
$rootScope.$evalAsync()

View File

@@ -52,7 +52,7 @@ angular.module("admin.tagRules").controller "TagRulesCtrl", ($scope, $http, $fil
$http
method: "DELETE"
url: "/admin/enterprises/#{enterprise.id}/tag_rules/#{tagRule.id}.json"
.success ->
.then ->
tagGroup.rules.splice(index, 1)
$scope.updateRuleCounts()
$scope.enterprise_form.$setDirty()

View File

@@ -1,4 +1,4 @@
angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templateCache, DialogDefaults) ->
angular.module("admin.tagRules").directive 'newTagRuleDialog', ($rootScope, $compile, $templateCache, DialogDefaults) ->
restrict: 'A'
scope:
tagGroup: '='
@@ -22,8 +22,10 @@ angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templ
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
template.dialog('open')
$rootScope.$evalAsync()
scope.addRule = (tagGroup, ruleType) ->
scope.addNewRuleTo(tagGroup, ruleType)
template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -1,30 +1,17 @@
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, $sanitize) ->
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, AutocompleteSelect2) ->
# Adapted from Spree's existing taxon autocompletion
scope: true
link: (scope,element,attrs) ->
multiple = scope.$eval attrs.multipleSelection
placeholder = attrs.placeholder
initalSelection = scope.$eval attrs.ngModel
initialSelection = scope.$eval attrs.ngModel
setTimeout ->
element.select2
placeholder: placeholder
multiple: multiple
initSelection: (element, callback) ->
if multiple
callback Taxons.findByIDs(initalSelection)
else
callback Taxons.findByID(initalSelection)
query: (query) ->
query.callback { results: Taxons.findByTerm(query.term) }
formatResult: (taxon) ->
$sanitize(taxon.name)
formatSelection: (taxon) ->
taxon.name
#Allows drag and drop
if multiple
element.select2("container").find("ul.select2-choices").sortable
containment: 'parent'
start: -> element.select2("onSortStart")
update: -> element.select2("onSortEnd")
AutocompleteSelect2.autocomplete(
multiple,
placeholder,
element,
(-> Taxons.findByID(initialSelection)),
(-> Taxons.findByIDs(initialSelection)),
((term) -> Taxons.findByTerm(term))
)

View File

@@ -9,9 +9,9 @@ angular.module("admin.users").directive "resendUserEmailConfirmation", ($http) -
element.bind "click", ->
return if sent
scope.status = "sending"
$http.post("/user/spree_user/confirmation", {spree_user: {email: scope.email}}).success (data) ->
$http.post("/user/spree_user/confirmation", {spree_user: {email: scope.email}}).then (response) ->
sent = true
element.addClass "action--disabled"
scope.status = "done"
.error (data) ->
.catch (response) ->
scope.status = "failed"

View File

@@ -12,7 +12,7 @@ $(document).ready(function() {
altInput: true,
altFormat: Spree.translations.flatpickr_date_format,
dateFormat: "Y-m-d",
locale: I18n.locale,
locale: I18n.base_locale,
plugins: [
ShortcutButtonsPlugin({
button: [{

View File

@@ -2,10 +2,13 @@ angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
flatpickr(element, Object.assign(
flapickrInstance = flatpickr(element, Object.assign(
{},
$window.FLATPICKR_DATE_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
}
));
ngModel.$render = () ->
newValue = ngModel.$viewValue;
flapickrInstance?.setDate(newValue)

View File

@@ -1,4 +1,4 @@
angular.module("admin.utils").directive 'helpModal', ($compile, $templateCache, $window, DialogDefaults) ->
angular.module("admin.utils").directive 'helpModal', ($rootScope, $compile, $templateCache, $window, DialogDefaults) ->
restrict: 'C'
scope:
template: '@'
@@ -10,8 +10,11 @@ angular.module("admin.utils").directive 'helpModal', ($compile, $templateCache,
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) -> template.dialog('open')
element.bind 'click', (e) ->
template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "ofnWithTip", ($sanitize)->
element.attr('data-powertip', $sanitize(attrs.ofnWithTip))
element.powerTip
smartPlacement: true
placement: element.attr('powertip-location')
fadeInTime: 50
fadeOutTime: 50
intentPollInterval: 300

View File

@@ -1,15 +0,0 @@
angular.module("admin.utils").filter "unlocalizeCurrency", ()->
# Convert string to number using injected currency configuration.
(price) ->
# used decimal and thousands separators from currency configuration
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
if (price.length > 4)
# remove configured thousands separator if price is greater than 999
price = price.replaceAll(thousands_separator, '')
if (decimal_separator == ",")
price = price.replace(",", ".")
return parseFloat(price)

View File

@@ -0,0 +1,31 @@
angular.module("admin.utils").factory 'AutocompleteSelect2', ($sanitize) ->
scope: true
autocomplete: (
multiple,
placeholder,
element,
findByID,
findByIDs,
findByTerm
) ->
element.select2
placeholder: placeholder
multiple: multiple
initSelection: (element, callback) ->
if multiple
callback findByIDs()
else
callback findByID()
query: (query) ->
query.callback { results: findByTerm(query.term) }
formatResult: (item) ->
$sanitize(item.name)
formatSelection: (item) ->
item.name
#Allows drag and drop
if multiple
element.select2("container").find("ul.select2-choices").sortable
containment: 'parent'
start: -> element.select2("onSortStart")
update: -> element.select2("onSortEnd")

View File

@@ -10,12 +10,15 @@ angular.module("admin.utils").factory 'ConfirmDialog', ($rootScope, $q, $compile
template = $compile($templateCache.get('admin/confirm_dialog.html'))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
$rootScope.$evalAsync()
scope.confirm = ->
deferred.resolve()
template.dialog('close')
$rootScope.$evalAsync()
null
scope.close = ->
deferred.reject()
template.dialog('close')
$rootScope.$evalAsync()
null
deferred.promise

View File

@@ -15,8 +15,10 @@ angular.module("admin.utils").factory 'InfoDialog', ($rootScope, $q, $compile, $
template = $compile($templateCache.get(templateUrl))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
deferred.resolve()
template.dialog('close')
$rootScope.$evalAsync()
null
deferred.promise

View File

@@ -0,0 +1,31 @@
angular.module("admin.utils").factory "PriceParser", ->
new class PriceParser
parse: (price) =>
return null unless price
# used decimal and thousands separators from currency configuration
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
# Replace comma used as a decimal separator and remplace by "."
price = this.replaceCommaByFinalPoint(price)
# Remove configured thousands separator if it is actually a thousands separator
price = this.removeThousandsSeparator(price, thousands_separator)
if (decimal_separator == ",")
price = price.replace(",", ".")
price = parseFloat(price)
return null if isNaN(price)
return price
replaceCommaByFinalPoint : (price) =>
if price.match(/^[0-9]*(,{1})[0-9]{1,2}$/g) then price.replace(",", ".") else price
removeThousandsSeparator : (price, thousands_separator) =>
if (new RegExp("^([0-9]*(" + thousands_separator + "{1})[0-9]{3}[0-9\.,]*)*$", "g").test(price))
price.replaceAll(thousands_separator, '')
else
price

View File

@@ -62,14 +62,14 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
else
StatusMessage.display 'progress', t('js.saving')
DirtyVariantOverrides.save()
.success (updatedVos) ->
.then (updatedVos) ->
DirtyVariantOverrides.clear()
VariantOverrides.updateIds updatedVos
VariantOverrides.updateIds updatedVos.data
$scope.variant_overrides_form.$setPristine()
StatusMessage.display 'success', t('js.changes_saved')
VariantOverrides.updateData updatedVos # Refresh page data
.error (data, status) ->
StatusMessage.display 'failure', $scope.updateError(data, status)
VariantOverrides.updateData updatedVos.data # Refresh page data
.catch (response) ->
StatusMessage.display 'failure', $scope.updateError(response.data, response.status)
$scope.updateError = (data, status) ->
@@ -98,11 +98,11 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
method: "POST"
url: "/admin/variant_overrides/bulk_reset"
data: { hub_id: $scope.hub_id }
.success (updatedVos) ->
VariantOverrides.updateData updatedVos
.then (updatedVos) ->
VariantOverrides.updateData updatedVos.data
StatusMessage.display 'success', t('js.variant_overrides.stock_reset')
.error (data, status) ->
$timeout -> StatusMessage.display 'failure', $scope.updateError(data, status)
.catch (response) ->
$timeout -> StatusMessage.display 'failure', $scope.updateError(response.data, response.status)
# Variant override count_on_hand field placeholder logic:
# on_demand true -- Show "On Demand"

View File

@@ -1,4 +1,4 @@
#= require jquery
#= require jquery2
#= require jquery_ujs
#= require jquery.ui.all
#
@@ -28,7 +28,6 @@
#= require angular-rails-templates
#= require_tree ../templates
#
#= require angular-backstretch.js
#= require angular-flash.min.js
#
#= require moment/min/moment.min.js
@@ -51,14 +50,27 @@
#
#= require modernizr
#
#= require foundation
#= require ./darkswarm
#= require ./overrides
#= require_tree ./mixins
#= require_tree ./directives
#= require_tree .
$ ->
# Hacky fix for issue - http://foundation.zurb.com/forum/posts/2112-foundation-5100-syntax-error-in-js
Foundation.set_namespace ""
$(document).foundation()
document.addEventListener "turbo:load", ->
window.injector = angular.bootstrap document.body, ["Darkswarm"]
true
document.addEventListener "turbo:before-render", ->
if window.injector
rootscope = window.injector.get("$rootScope")
rootscope?.$destroy()
rootscope = null
window.injector = null
true
document.addEventListener "ajax:beforeSend", (event) =>
window.Turbo.navigator.adapter.progressBar.setValue(0)
window.Turbo.navigator.adapter.progressBar.show()
document.addEventListener "ajax:complete", (event) =>
window.Turbo.navigator.adapter.progressBar.setValue(100)
window.Turbo.navigator.adapter.progressBar.hide()

View File

@@ -7,13 +7,3 @@ $ ->
($ 'form#update-cart').submit ->
($ 'form#update-cart #update-button').attr('disabled', true)
# Temporarily handles the cart showing stuff
$(document).ready ->
$('.cart_adjustment').hide()
$('td.cart-adjustments a').click ->
$('.cart_adjustment').toggle()
$(this).html(t('item_handling_fees'))
false

View File

@@ -1,19 +1,19 @@
Darkswarm.controller "ForgotCtrl", ($scope, $http, $location, AuthenticationService) ->
angular.module('Darkswarm').controller "ForgotCtrl", ($scope, $http, $location, AuthenticationService) ->
$scope.path = "/forgot"
$scope.sent = false
$scope.submit = ->
if $scope.spree_user.email != null
$http.post("/user/spree_user/password", {spree_user: $scope.spree_user}).success (data)->
$http.post("/user/spree_user/password", {spree_user: $scope.spree_user}).then (response)->
$scope.sent = true
.error (data, status) ->
$scope.errors = data.error
$scope.user_unconfirmed = (status == 401)
.catch (response) ->
$scope.errors = response.data.error
$scope.user_unconfirmed = (response.status == 401)
else
$scope.errors = t 'email_required'
$scope.resend_confirmation = ->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).then (response)->
$scope.messages = t('devise.confirmations.send_instructions')
.error (data) ->
.catch (response) ->
$scope.errors = t('devise.confirmations.failed_to_send')

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
angular.module('Darkswarm').controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
$scope.path = "/login"
$scope.modalMessage = null
@@ -10,20 +10,20 @@ Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window,
$scope.submit = ->
Loading.message = t 'logging_in'
$http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).success (data)->
$http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).then (response)->
if Redirections.after_login
$window.location.href = $window.location.origin + Redirections.after_login
else
$window.location.href = $window.location.origin + $window.location.pathname # Strips out hash fragments
.error (data) ->
.catch (response) ->
Loading.clear()
$scope.errors = data.message || data.error
$scope.user_unconfirmed = (data.error == t('devise.failure.unconfirmed'))
$scope.errors = response.data.message || response.data.error
$scope.user_unconfirmed = (response.data.error == t('devise.failure.unconfirmed'))
$scope.resend_confirmation = ->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).then (response)->
$scope.messages = t('devise.confirmations.send_instructions')
.error (data) ->
.catch (response) ->
$scope.errors = t('devise.confirmations.failed_to_send')
$timeout ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
angular.module('Darkswarm').controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
$scope.path = "/signup"
$scope.spree_user.password_confirmation = ''
@@ -8,8 +8,8 @@ Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirecti
password: null
$scope.submit = ->
$http.post("/user/spree_user", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
$http.post("/user/spree_user", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).then (response)->
$scope.errors = {email: null, password: null}
$scope.messages = t('devise.user_registrations.spree_user.signed_up_but_unconfirmed')
.error (data) ->
$scope.errors = data
.catch (response) ->
$scope.errors = response.data

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
angular.module('Darkswarm').controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
$scope.open = AuthenticationService.open
$scope.toggle = AuthenticationService.toggle

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CartCtrl", ($scope, Cart, CurrentHub) ->
angular.module('Darkswarm').controller "CartCtrl", ($scope, Cart, CurrentHub) ->
$scope.Cart = Cart
$scope.CurrentHub = CurrentHub
$scope.max_characters = 20

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
angular.module('Darkswarm').controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
$scope.Cart = Cart
$scope.showCartSidebar = false

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CartFormCtrl", ($scope) ->
angular.module('Darkswarm').controller "CartFormCtrl", ($scope) ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
angular.module('Darkswarm').controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
$scope.accordionSections = ["details", "billing", "shipping", "payment"]
$scope.accordion = { details: true, billing: true, shipping: true, payment: true }

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "BillingCtrl", ($scope, $timeout) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "BillingCtrl", ($scope, $timeout, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.name = "billing"
$scope.nextPanel = "shipping"

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
$scope.Checkout = Checkout
$scope.submitted = false
@@ -35,8 +35,8 @@ Darkswarm.controller "CheckoutCtrl", ($scope, localStorageService, Checkout, Cur
$scope.$broadcast 'purchaseFormInvalid', $scope.formdata
$scope.ensureUserIsGuest = (callback = null) ->
$http.post("/user/registered_email", {email: $scope.order.email}).success (data)->
if data.registered == true
$http.post("/user/registered_email", {email: $scope.order.email}).then (response)->
if response.data.registered == true
$scope.promptLogin()
else
$scope.validateForm() if $scope.submitted

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CountryCtrl", ($scope, availableCountries) ->
angular.module('Darkswarm').controller "CountryCtrl", ($scope, availableCountries) ->
$scope.countries = availableCountries

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "DetailsCtrl", ($scope, $timeout, $http, CurrentUser, AuthenticationService, SpreeUser) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "DetailsCtrl", ($scope, $timeout, $http, CurrentUser, AuthenticationService, SpreeUser, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.name = "details"
$scope.nextPanel = "billing"

View File

@@ -1,5 +1,5 @@
Darkswarm.controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.savedCreditCards = savedCreditCards
$scope.name = "payment"

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "ShippingCtrl", ($scope, $timeout, ShippingMethods) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "ShippingCtrl", ($scope, $timeout, ShippingMethods, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.ShippingMethods = ShippingMethods
$scope.name = "shipping"
$scope.nextPanel = "payment"

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.savedCreditCards = CreditCards.saved
$scope.confirmSetDefault = CreditCards.confirmSetDefault
$scope.CreditCard = CreditCard

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CurrentHubCtrl", ($scope, CurrentHub) ->
angular.module('Darkswarm').controller "CurrentHubCtrl", ($scope, CurrentHub) ->
$scope.CurrentHub = CurrentHub

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
angular.module('Darkswarm').controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
$scope.showBought = false
$scope.removeEnabled = true

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
angular.module('Darkswarm').controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
$scope.Enterprises = Enterprises
$scope.producers_to_filter = Enterprises.producers
$scope.filterSelectors = FilterSelectorsService.createSelectors()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
angular.module('Darkswarm').controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
$scope.filterSelectors = FilterSelectorsService.createSelectors()
$scope.query = Search.search()
$scope.openModal = EnterpriseModal.open

View File

@@ -1,3 +1,3 @@
Darkswarm.controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
angular.module('Darkswarm').controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
$scope.Enterprises = Enterprises
$scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
angular.module('Darkswarm').controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
angular.extend this, $controller('TabsCtrl', {$scope: $scope})
$scope.tabs =

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupsCtrl", ($scope, Groups, Search) ->
angular.module('Darkswarm').controller "GroupsCtrl", ($scope, Groups, Search) ->
$scope.Groups = Groups
$scope.order = 'position'
$scope.query = Search.search()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HomeCtrl", ($scope) ->
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
$scope.brandStoryExpanded = false
$scope.toggleBrandStory = ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
angular.module('Darkswarm').controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
$scope.shopfront_loading = false
$scope.enterprise_details = []
@@ -9,6 +9,8 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
# Toggles shopfront tabs open/closed. Fetches enterprise details from the api, diplays them and adds them
# to $scope.enterprise_details, or simply displays the details again if previously fetched
$scope.toggle = (event) ->
return if event.target.closest("a")
if $scope.open()
$scope.toggle_tab(event)
return
@@ -25,12 +27,12 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
$scope.toggle_tab(event)
$http.get("/api/v0/shops/" + $scope.hub.id)
.success (data) ->
.then (response) ->
$scope.shopfront_loading = false
$scope.hub = data
$scope.hub = response.data
$scope.enterprise_details[$scope.hub.id] = $scope.hub
.error (data) ->
console.error(data)
.catch (response) ->
console.error(response.data)
$scope.toggle_tab = (event) ->
HashNavigation.toggle $scope.hub.hash if event && !angular.element(event.target).inheritedData('is-link')

View File

@@ -1,3 +1,3 @@
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
angular.module('Darkswarm').controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
$scope.OfnMap = OfnMap
$scope.map = angular.copy MapConfiguration.options

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "OffcanvasCtrl", ($scope) ->
angular.module('Darkswarm').controller "OffcanvasCtrl", ($scope) ->
$scope.menu = $(".left-off-canvas-menu")
$scope.setOffcanvasMenuHeight = ->
@@ -9,3 +9,6 @@ Darkswarm.controller "OffcanvasCtrl", ($scope) ->
$scope.setOffcanvasMenuHeight()
$scope.bind()
$scope.$on "$destroy", ->
$(window).off("resize")

View File

@@ -1,8 +1,8 @@
Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, $timeout, OrderCycle) ->
angular.module('Darkswarm').controller "OrderCycleCtrl", ($scope, $rootScope, $timeout, OrderCycle) ->
$scope.order_cycle = OrderCycle.order_cycle
$scope.OrderCycle = OrderCycle
Darkswarm.controller "OrderCycleChangeCtrl", ($scope, $rootScope, $timeout, OrderCycle, Products, Variants, Cart, ChangeableOrdersAlert) ->
angular.module('Darkswarm').controller "OrderCycleChangeCtrl", ($scope, $rootScope, $timeout, OrderCycle, Products, Variants, Cart, ChangeableOrdersAlert) ->
# Track previous order cycle id for use with revertOrderCycle()
$scope.previous_order_cycle_id = OrderCycle.order_cycle.order_cycle_id
$scope.$watch 'order_cycle.order_cycle_id', (newValue, oldValue)->

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "OrdersCtrl", ($scope, Orders) ->
angular.module('Darkswarm').controller "OrdersCtrl", ($scope, Orders) ->
$scope.Orders = Orders

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "PageSelectionCtrl", ($scope, $rootScope, $location) ->
angular.module('Darkswarm').controller "PageSelectionCtrl", ($scope, $rootScope, $location) ->
$scope.selectedPage = ->
# The path looks like `/contact` for the URL `https://ofn.org/shop#/contact`.
# We remove the slash at the beginning.

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http, $timeout) ->
angular.module('Darkswarm').controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http, $timeout) ->
$scope.shopfront_loading = false
$scope.enterprise_details = []
@@ -9,6 +9,8 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
# Toggles shopfront tabs open/closed. Fetches enterprise details from the api, diplays them and adds them
# to $scope.enterprise_details, or simply displays the details again if previously fetched
$scope.toggle = (event) ->
return if event.target.closest("a")
if $scope.open()
$scope.toggle_tab(event)
return
@@ -25,12 +27,12 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
$scope.toggle_tab(event)
$http.get("/api/v0/shops/" + $scope.producer.id)
.success (data) ->
.then (response) ->
$scope.shopfront_loading = false
$scope.producer = data
$scope.producer = response.data
$scope.enterprise_details[$scope.producer.id] = $scope.producer
.error (data) ->
console.error(data)
.catch (response) ->
console.error(response.data)
$scope.toggle_tab = (event) ->
HashNavigation.toggle $scope.producer.hash if event && !angular.element(event.target).inheritedData('is-link')

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "ProductNodeCtrl", ($scope, $modal, FilterSelectorsService) ->
angular.module('Darkswarm').controller "ProductNodeCtrl", ($scope, $modal, FilterSelectorsService) ->
$scope.enterprise = $scope.product.supplier # For the modal, so it's consistent
$scope.productPropertySelectors = FilterSelectorsService.createSelectors()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
angular.module('Darkswarm').controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
$scope.Products = Products
$scope.Cart = Cart
$scope.query = ""
@@ -38,17 +38,12 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
data.map( (taxon) ->
$scope.supplied_taxons[taxon.id] = Taxons.taxons_by_id[taxon.id]
)
# Some taxons may be displayed in a dropdown.
# Foundation needs initialising again to add dropdown actions.
Foundation.init()
OrderCycleResource.properties params, (data)=>
$scope.supplied_properties = {}
data.map( (property) ->
$scope.supplied_properties[property.id] = Properties.properties_by_id[property.id]
)
# Some properties may be displayed in a dropdown.
# Foundation needs initialising again to add dropdown actions.
Foundation.init()
$scope.loadMore = ->
if ($scope.page * $scope.per_page) <= Products.products.length

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