Compare commits

...

324 Commits

Author SHA1 Message Date
Matt-Yorkley
b1bfac5144 Update all locales with the latest Transifex translations 2021-06-01 19:10:58 +01:00
Pau Pérez Fabregat
01f8aff3e0 Merge pull request #7716 from coopdevs/pick-up-site-name-from-env
Allow :site_name to be picked up from ENV vars
2021-06-01 13:50:36 +02:00
Matt-Yorkley
7f9179193e Merge pull request #7713 from openfoodfoundation/dependabot/npm_and_yarn/ws-7.4.6
Bump ws from 7.4.4 to 7.4.6
2021-05-31 16:07:05 +02:00
Pau Perez
3be0e1c13a Allow :site_name to be picked up from ENV vars
This mimics what we did in 6377736f4. This way provisioning an instance
from scratch doesn't require configuring things from the backoffice,
which will simplify the roll out of
https://github.com/openfoodfoundation/ofn-install/pull/734.
2021-05-31 15:50:54 +02:00
Pau Pérez Fabregat
18c020535a Merge pull request #7711 from Matt-Yorkley/sidekiq
Sidekiq!
2021-05-31 15:11:45 +02:00
Matt-Yorkley
8d1fcc06fd Remove logfile config
This setting was removed in Sidekiq 6.0, logs are handled a bit differently now. The logging works though 👍
2021-05-31 10:46:43 +01:00
Matt-Yorkley
2b6a72ffb4 Remove DelayedJob web UI 2021-05-31 10:10:36 +01:00
Pau Pérez Fabregat
157d86c94f Merge pull request #7714 from openfoodfoundation/dependabot/bundler/test-unit-3.4.2
Bump test-unit from 3.4.1 to 3.4.2
2021-05-31 11:04:42 +02:00
Pau Pérez Fabregat
d41de06809 Merge pull request #7707 from openfoodfoundation/transifex
Transifex
2021-05-31 10:59:04 +02:00
Transifex-Openfoodnetwork
d730f21dc7 Updating translations for config/locales/en_GB.yml 2021-05-31 17:54:39 +10:00
dependabot[bot]
49dfaa20ab Bump test-unit from 3.4.1 to 3.4.2
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.1...3.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-31 05:38:26 +00:00
dependabot[bot]
bfeb892cab Bump ws from 7.4.4 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.4.4 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.4...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-30 21:28:21 +00:00
Matt-Yorkley
4b56422abd Add network timeouts
In rare cases where Redis is being updated/restarted while a job is running, this should add some flexibility.
2021-05-29 21:07:36 +01:00
Matt-Yorkley
53e3e2b66d Remove outdated Job test helpers
This logic around testing jobs is already handled by integrations with ActiveJob since Rails 4.2
2021-05-29 16:37:06 +01:00
Matt-Yorkley
834140f0a2 Don't dump massive binary PDF data into the job queue
Here we were rendering an entire PDF, then passing that PDF into the job queue as an *argument* containing the entire binary of the PDF in a massive string. This means the job object itself would contain that entire PDF. That's bad queueing!

We now create the PDF *during* the job (not before it), and pass simple arguments.
2021-05-29 16:06:29 +01:00
Matt-Yorkley
0d95d83ef9 Add sidekiq-scheduler to web UI 2021-05-29 13:12:33 +01:00
Matt-Yorkley
54d373c963 Enqueue scheduled jobs with sidekick-scheduler 2021-05-29 13:12:33 +01:00
Matt-Yorkley
1dfd68c691 Add sidekiq-scheduler 2021-05-29 13:12:33 +01:00
Matt-Yorkley
df9213e812 Bump port for new caching instance 2021-05-29 13:12:33 +01:00
Matt-Yorkley
03a078a3a0 Remove namespacing in cache config 2021-05-29 13:11:59 +01:00
Matt-Yorkley
11da025247 Add Sidekiq web interface 2021-05-29 13:11:59 +01:00
Matt-Yorkley
07a9da901f Switch queue adapter to Sidekiq 2021-05-29 13:11:59 +01:00
Matt-Yorkley
4ac3853be9 Configure Sidekiq 2021-05-29 13:11:59 +01:00
Transifex-Openfoodnetwork
eae7a9978c Updating translations for config/locales/de_DE.yml 2021-05-29 18:47:49 +10:00
Transifex-Openfoodnetwork
bdd8572fbf Updating translations for config/locales/en_US.yml 2021-05-29 02:59:45 +10:00
Matt-Yorkley
07422dac29 Add sidekiq gem 2021-05-28 16:58:26 +01:00
jibees
088ae496cc Merge pull request #7664 from shen-sat/7626-fix-unknown-currency-error
7626 fix unknown currency error
2021-05-28 16:18:04 +02:00
Pau Pérez Fabregat
c83a619082 Merge pull request #7705 from openfoodfoundation/transifex
Transifex
2021-05-28 15:45:58 +02:00
Transifex-Openfoodnetwork
ca7d1b111a Updating translations for config/locales/ru.yml 2021-05-28 21:35:53 +10:00
Pau Pérez Fabregat
3c507c1727 Merge pull request #7696 from openfoodfoundation/transifex
Transifex
2021-05-28 13:28:39 +02:00
Jean-Baptiste Bellet
b111d24488 Update all locales with the latest Transifex translations 2021-05-28 09:12:42 +02:00
Andy Brett
4dc8b44e81 Merge pull request #7695 from coopdevs/fix-ruby-installation-dockerfile
Fix Rbenv and ruby-build installation to get Ruby 2.5.9
2021-05-27 11:30:31 -07:00
Andy Brett
27a9ad7bcb Merge pull request #7698 from Matt-Yorkley/remove-eventmachine
Remove eventmachine gem
2021-05-27 11:30:14 -07:00
Pau Perez
fbd4d512d5 Add libssl as required by Ruby 2.5.9
This is a more recent libssl version in Ubuntu 20. Not related to the
libssl1.0 hack required by older Ruby versions.
2021-05-27 17:50:22 +02:00
Pau Perez
0f85db6d36 Fix Rbenv and ruby-build installation to get 2.5.9
This newer Ruby version can't be found on that ruby-build's branch that
we were installing. The `docker-compose build` command works again.
2021-05-27 17:50:22 +02:00
Pau Pérez Fabregat
0f78b5b315 Merge pull request #7616 from jibees/7602-unit-price-not-displaying-when-comma-is-the-decimal-separator
Backoffice: Unit price not displaying when comma is the decimal separator
2021-05-27 17:45:19 +02:00
Matt-Yorkley
78e3bb1acd Remove eventmachine gem
This was a dependency of a dependency a long time ago...
2021-05-27 15:57:17 +01:00
Transifex-Openfoodnetwork
c5e1c057ae Updating translations for config/locales/es.yml 2021-05-28 00:17:47 +10:00
Transifex-Openfoodnetwork
f34a3c3c02 Updating translations for config/locales/ca.yml 2021-05-28 00:17:29 +10:00
Transifex-Openfoodnetwork
546a32e97a Updating translations for config/locales/en_FR.yml 2021-05-27 22:47:27 +10:00
Transifex-Openfoodnetwork
abd269949d Updating translations for config/locales/fr.yml 2021-05-27 22:47:09 +10:00
Pau Pérez Fabregat
0d5f76b19e Merge pull request #7621 from jibees/7534-upload-logo-and-promo-image-for-enterprise
Upload enterprise image (logo and promo): force content type to "text/plain"
2021-05-27 11:33:56 +02:00
Pau Pérez Fabregat
bfa77baae1 Merge pull request #7542 from jibees/6359-add-payment-method-description-to-invoice
Add payment method description to invoice
2021-05-27 11:01:07 +02:00
Pau Pérez Fabregat
a2a1aac384 Merge pull request #7604 from coopdevs/compile-with-jemalloc
Compile Ruby with jemalloc
2021-05-27 08:30:51 +02:00
Pau Perez
43ede7ba26 Remove libssl1.0 from Dockerfile
We recently removed it from production in
bd9e382fba.
2021-05-27 08:09:51 +02:00
Andy Brett
883e9fdf62 Merge pull request #7690 from Matt-Yorkley/ruby-259
Bump Ruby to 2.5.9
2021-05-26 08:41:15 -07:00
Matt-Yorkley
c625766af1 Bump Ruby to 2.5.9 2021-05-26 09:36:28 +01:00
Andy Brett
23730ab28f Merge pull request #7683 from openfoodfoundation/dependabot/bundler/view_component-2.32.0
Bump view_component from 2.31.1 to 2.32.0
2021-05-25 07:36:25 -07:00
Jean-Baptiste Bellet
0c8bfea2f7 Add feature tests for upload images on enterprise registration
For both logo and promo images
2021-05-25 15:30:35 +02:00
Jean-Baptiste Bellet
0306732a3d Add test for enterprise logo and promo image uploading
- Add a fixture image to do the upload thanks to `fixture_file_upload`
 - Check the response status, the content type and the response body for both logo image and promo image
2021-05-25 15:30:29 +02:00
Jean-Baptiste Bellet
6842cbfda4 Force content type to "text/html"
- Force the content type to be `text/html` (instead of `application/json`)
2021-05-25 15:30:21 +02:00
Matt-Yorkley
ecb4cb31ad Merge pull request #7599 from Matt-Yorkley/cart-rendering
Move line item rendering to a collection in cart page
2021-05-25 13:37:50 +02:00
Jean-Baptiste Bellet
dd47430f19 Improve unlocalizeCurrency filter to handle many cases
- Complete the unit test to handle all these cases.
2021-05-25 13:14:53 +02:00
Matt-Yorkley
74f27544f7 Merge pull request #7647 from andrewpbrett/default-country-codes
Use correct default country code
2021-05-25 11:21:34 +02:00
Matt-Yorkley
5868765087 Merge pull request #7673 from Matt-Yorkley/spree-config-caching
Fix clashing loggers
2021-05-25 11:09:33 +02:00
Maikel
545d64a2e5 Merge pull request #7682 from openfoodfoundation/dependabot/bundler/i18n-js-3.8.3
Bump i18n-js from 3.8.2 to 3.8.3
2021-05-25 14:48:19 +10:00
Matt-Yorkley
c69dee4c96 Merge pull request #7636 from psychoslave/tip/zeus
Remove all material related to Zeus
2021-05-25 00:10:01 +02:00
Andy Brett
b367001b95 Merge pull request #7641 from luisramos0/order_path
[Rails 6.1] Fix view specs
2021-05-24 14:41:32 -07:00
Andy Brett
120fc4ca42 Merge pull request #7605 from filipefurtad0/import_item_products
Products and Inventory import: Items units
2021-05-24 14:17:43 -07:00
Andy Brett
e4756a523a Merge pull request #7678 from mkllnk/schema
Update schema syntax with Rails 5.2
2021-05-24 13:22:18 -07:00
Andy Brett
46843a5efa Merge pull request #7662 from Matt-Yorkley/enterprise-rendering
Render enterprise rows as a collection
2021-05-24 09:37:58 -07:00
Matt-Yorkley
6377736f43 Allow :site_url to be picked up from ENV vars 2021-05-24 14:58:53 +01:00
Jean-Baptiste Bellet
afe97bcc96 Add tests for creating/editing product/variant cases with decimal price 2021-05-24 10:55:05 +02:00
Jean-Baptiste Bellet
8af6fedf8a Factorize js:true as a common configuration around all tests 2021-05-24 10:55:05 +02:00
Jean-Baptiste Bellet
d8042b25e4 Add test for unlocalize currency filter
- Test that comma is well handle in both cases where comma is the default decimal separator or not.
2021-05-24 10:55:05 +02:00
Jean-Baptiste Bellet
f97e71d054 Add test for decimal price separated by point or comma 2021-05-24 10:55:05 +02:00
Jean-Baptiste Bellet
d066f0b94d Enable displayable unit price for price with comma as decimal separator
Retrieve the current decimal separator used to display price (`I18n.toCurrency()`), and check if number is formatted with only if this is `,`. If so, remplace comma by point, to pass the check `!isNaN`, and format unit price
2021-05-24 10:55:05 +02:00
dependabot[bot]
e9d389e4f1 Bump view_component from 2.31.1 to 2.32.0
Bumps [view_component](https://github.com/github/view_component) from 2.31.1 to 2.32.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.31.1...v2.32.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 05:51:25 +00:00
dependabot[bot]
e90403dbbe Bump i18n-js from 3.8.2 to 3.8.3
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.8.2 to 3.8.3.
- [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.2...v3.8.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 05:49:51 +00:00
Matt-Yorkley
3dc3581e6b Ensure Mail configs are applied when the app starts
Previously we only set these part-way through deployment, so the values could be out of sync between our ENV vars and Spree::Config (which itself is a mix of both cached values and database-persisted values).
2021-05-23 23:05:16 +01:00
Matt-Yorkley
ff82f70e9a Remove custom logger object
This is handled already in Delayed::Command and Delayed::Worker
2021-05-23 23:05:16 +01:00
Andy Brett
560f462f7b Merge pull request #7679 from mkllnk/sample-data
Fix sample_data by filtering params for products
2021-05-22 10:37:30 -07:00
Pau Pérez Fabregat
23b2b5ba56 Merge pull request #7563 from filipefurtad0/import_products_fixture_path
Adds file and fixture path to test product import
2021-05-21 10:12:20 +02:00
Maikel Linke
11cb8cbbdc Fix sample_data by filtering params for products
We were passing too many parameters to the product creation. Rails 5.2
complained that products don't have a distributor. Filtering the
parameters helps.
2021-05-21 12:41:55 +10:00
Maikel Linke
41799b2663 Update schema syntax with Rails 5.2
The style seems to be different. This avoids a modified schema after
running rake db:migrate.
2021-05-21 11:50:34 +10:00
filipefurtad0
2f842bcbdd Adds file and fixture path to test product import
Adds file and fixture path to test product import

Reverts changes on context and it descriptions
2021-05-20 20:08:47 +01:00
Matt-Yorkley
336a8b5825 Merge pull request #7671 from Matt-Yorkley/licence
Add Spree copyright notice
2021-05-20 18:56:16 +02:00
Andy Brett
d2f54f5bd2 Merge pull request #7666 from mkllnk/codecov
Stop Codecov failing good pull requests
2021-05-20 09:18:34 -07:00
Pau Pérez Fabregat
8c81c14c8d Merge pull request #7580 from apricot12/Remove-LineItems-N+1
Removed N+1 queries while counting line_items
2021-05-20 11:42:14 +02:00
Matt-Yorkley
1f6d872fa5 Add Spree copyright notice 2021-05-20 10:25:48 +01:00
Jean-Baptiste Bellet
ae1b9b8dd5 Update all locales with the latest Transifex translations 2021-05-20 10:12:46 +02:00
Maikel
1e1706d371 Merge pull request #7280 from Matt-Yorkley/atomic
Remove atomic gem
2021-05-20 17:53:36 +10:00
Maikel Linke
5ccaa521cf Stop Codecov failing good pull requests
Something doesn't quite work with our Codecov setup. It somehow thinks
that the coverage is decreasing even though it's either not changing or
even increasing.

Until those problems are resolved, let's not mark pull requests as
failed so that we can rely on the pull's overall status report.
2021-05-20 14:18:43 +10:00
Maikel Linke
90bb9870ab Bump Codecov from 1.3.1 to 1.5.0 2021-05-20 14:17:36 +10:00
Andy Brett
70ac719725 Merge pull request #7649 from andrewpbrett/payments-when-out-of-stock
Check stock before doing anything related to admin payments
2021-05-19 14:45:38 -07:00
Andy Brett
08d540a761 Merge pull request #7648 from Matt-Yorkley/redis
Switch cache store from memcached to redis
2021-05-19 10:36:20 -07:00
Andy Brett
304a3804bc Merge pull request #7594 from luisramos0/update_attributes
[Rails 6.1] Replace AR's update_attributes! with update! (and rename order.update! and adjustment.update! in the process)
2021-05-19 10:34:12 -07:00
Luis Ramos
f7726e552a Adapt code coming from master to the new order api with update_order! 2021-05-19 10:09:42 -07:00
Luis Ramos
a1ac4e85ed Replace update_attributes with update 2021-05-19 09:54:25 -07:00
Luis Ramos
f8e5370b0b Replace update_attributes with update 2021-05-19 09:54:25 -07:00
Luis Ramos
fb560089b9 Replace usages of update_attributes! with usage of update! 2021-05-19 09:54:25 -07:00
Luis Ramos
341f6c9f62 Now that adjustment.update! has been renamed to adjustment.update_adjustment! we can use AR's update! on adjustment 2021-05-19 09:54:25 -07:00
Luis Ramos
b2e97fe1d2 Rename order.update! to order.update_order! and adjustment.update! to adjustment.update_adjustment! 2021-05-19 09:54:22 -07:00
Andy Brett
e73584fef7 remove setters from DefaultCountry service 2021-05-19 09:42:52 -07:00
Andy Brett
45ad4bbcf1 remove setting of Spree::Config country code 2021-05-19 09:33:02 -07:00
Matt-Yorkley
096847ea07 Merge pull request #7618 from openfoodfoundation/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.8 to 2.8.9
2021-05-19 13:51:01 +02:00
Pau Pérez Fabregat
faf6a37c9f Merge pull request #7631 from openfoodfoundation/dependabot/bundler/ddtrace-0.49.0
Bump ddtrace from 0.48.0 to 0.49.0
2021-05-19 12:32:52 +02:00
Pau Pérez Fabregat
d4ec1bda54 Merge pull request #7652 from openfoodfoundation/dependabot/bundler/webmock-3.13.0
Bump webmock from 3.12.2 to 3.13.0
2021-05-19 12:32:08 +02:00
Jean-Baptiste Bellet
325b97b683 Add tests around invoice printing in PDF
- use PDF Reader to read pdf and get its content
 - check with we print the payment description information section with the right value
2021-05-19 11:55:46 +02:00
Jean-Baptiste Bellet
7ab065e8cd Add section at the bottom of invoice: Payment Description at Checkout
- If there is any payments, we use the last one to retrieve the payment method description
Use the first completed payment to display payment description
Completed is state = "checkout" or state = "completed"
Squash w/ "Add section at the bottom of invoice: Payment Description at Checkout"

Squash w "Add section at the bottom of invoice: Payment Description a"
2021-05-19 11:55:38 +02:00
Jean-Baptiste Bellet
aea0670268 Add method payment_method to get the payment method from a payment
- Method `payment_method_name` now use `payment_method`
2021-05-19 11:55:38 +02:00
Pau Pérez Fabregat
5560a99423 Merge pull request #7663 from openfoodfoundation/transifex
Transifex
2021-05-19 11:50:02 +02:00
Matt-Yorkley
0c4e191f3b Render enterprise rows as a collection
Note: this is a bit like an N+1 query, but for rendering. If there are 30 enterprises, the partial file would be loaded and parsed 30 times; but if we render it as a collection it'll load the partial once and substantially improve the performance.
2021-05-19 08:48:25 +01:00
Shen Sat
cb914e4729 Change wording in create_admin_user to be more descriptive 2021-05-19 08:45:40 +01:00
Shen Sat
ab027d6af6 Change money initializer to use ENV vars instead of Spree::Config 2021-05-19 08:44:55 +01:00
Shen Sat
6a8ee544e8 Change readme to strong encourage running setup script 2021-05-19 08:44:10 +01:00
Andy Brett
2bb38619ea Merge pull request #7656 from openfoodfoundation/dependabot/bundler/rubocop-1.15.0
Bump rubocop from 1.14.0 to 1.15.0
2021-05-18 13:36:56 -07:00
Andy Brett
4b352da402 Merge pull request #7630 from apricot12/persistent_flash_after_reload
Persistent flash after reload
2021-05-18 12:55:37 -07:00
Transifex-Openfoodnetwork
75243b8e6a Updating translations for config/locales/en_US.yml 2021-05-19 05:54:38 +10:00
Andy Brett
7df2915fbd add DefaultCountry service 2021-05-18 12:44:53 -07:00
Matt-Yorkley
6427a3846b Merge pull request #7651 from openfoodfoundation/dependabot/bundler/activerecord-import-1.1.0
Bump activerecord-import from 1.0.8 to 1.1.0
2021-05-18 20:06:21 +02:00
Andy Brett
5169ee91ea add comment for before_action 2021-05-18 10:42:19 -07:00
Andy Brett
5917accdd2 refactor using Extract Method 2021-05-18 10:38:35 -07:00
Matt-Yorkley
5dd24623f7 Merge pull request #7479 from Matt-Yorkley/payment-callbacks
Update Payment after_save callback
2021-05-18 16:19:29 +02:00
Matt-Yorkley
befb6f632f Merge pull request #7659 from openfoodfoundation/dependabot/bundler/nokogiri-1.11.4
Bump nokogiri from 1.11.3 to 1.11.4
2021-05-18 11:14:32 +02:00
dependabot[bot]
92e0f8349c Bump nokogiri from 1.11.3 to 1.11.4
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.3 to 1.11.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.3...v1.11.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-18 08:37:29 +00:00
dependabot[bot]
ffbba01c41 Bump rubocop from 1.14.0 to 1.15.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.14.0 to 1.15.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.14.0...v1.15.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-18 05:24:48 +00:00
Pau Pérez Fabregat
5f9679655c Merge pull request #7645 from Matt-Yorkley/stripe-payment-processing
Stripe payment processing
2021-05-17 16:17:21 +02:00
dependabot[bot]
6ded80d2c6 Bump webmock from 3.12.2 to 3.13.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.12.2 to 3.13.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.12.2...v3.13.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 05:51:55 +00:00
dependabot[bot]
eb3c33b091 Bump activerecord-import from 1.0.8 to 1.1.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.0.8 to 1.1.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.0.8...v1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 05:51:01 +00:00
Matt-Yorkley
794216713a Ensure payment is processed if order is in completed state 2021-05-16 23:03:07 +01:00
Matt-Yorkley
a2862e604c Find relevant payment that matches the payment intent, not the last payment 2021-05-16 23:00:31 +01:00
Matt-Yorkley
8429da3d2a Remove unused argument from ProcessPaymentIntent 2021-05-16 22:19:01 +01:00
Matt-Yorkley
381b0e78d5 Improve ProcessPaymentIntent specs 2021-05-16 20:14:14 +01:00
Matt-Yorkley
2e63cd8116 Add explanatory comment on payment processing flow 2021-05-16 20:11:45 +01:00
Matt-Yorkley
52e0d84238 Reload in-memory payment before checking it's new state
The state should have changed in the database if the payment was processed successfully, and the memoized version here will not know that without a reload.
2021-05-16 20:11:45 +01:00
Matt-Yorkley
5725535715 Fix payment state checking 2021-05-16 20:11:45 +01:00
Matt-Yorkley
05ed98aa0c Use :order_with_totals in ProcessPaymentIntent
If we just use the :order factory here, it has no line items and no total, which means when we try to push it into complete state, the #requires_payment? check fails because the order total is zero, which means the call to #process_payments is ignored
2021-05-16 20:11:45 +01:00
Matt-Yorkley
fd021d4778 Refactor payment intent status checking and return "ok" if the payment has already been processed successfully in a previous request
If the page is reloaded after the payment has already gone through, we can skip the processing and give a non-error response; the payment is already completed and Stripe's response confirms it was successful.
2021-05-16 20:11:45 +01:00
Matt-Yorkley
2b9f9fce86 Fix flash session memory-effect when showing errors after payment processing
We're not doing a redirect after setting this flash message, so we need to ensure it's discarded after the current page load.
2021-05-16 20:11:45 +01:00
Matt-Yorkley
81aac442f2 Improve conditional in raise_if_not_in_capture_state 2021-05-16 20:11:45 +01:00
Matt-Yorkley
16e3af9b49 Update OrderController spec 2021-05-16 20:11:45 +01:00
Matt-Yorkley
227bdd7d4c Update ProcessPaymentIntent spec 2021-05-16 12:55:48 +01:00
Matt-Yorkley
471a7903f6 Update PaymentIntentValidator spec 2021-05-16 12:19:04 +01:00
Matt-Yorkley
37177e7207 Add test coverage to StripeSCA spec 2021-05-16 12:19:04 +01:00
Matt-Yorkley
5805104d13 Tidy up controller and add explanatory comment 2021-05-16 12:19:04 +01:00
Matt-Yorkley
e686a4f627 Move raising of errors when payment intent state != "requires_capture" out of PaymentIntentValidator service
When we're fetching the payment intent via PaymentIntentValidator in StripeSCA#purhcase (to capture it), we want it to fail loudly if it's not in "requires_capture" state. We're now also re-using the same PaymentIntentValidator service to check if payment processing was *successful*, in which case we need it *not* to fail loudly if the state == "succeeded", eg != "requires_capture".
2021-05-16 12:19:04 +01:00
Andy Brett
c7f80d86a8 Merge pull request #7638 from Matt-Yorkley/dead-code-order-distribution
Delete dead code in OrdersController#update_distribution
2021-05-15 12:40:25 -07:00
Andy Brett
19187583e1 Merge pull request #7643 from openfoodfoundation/dependabot/bundler/test-prof-1.0.5
Bump test-prof from 1.0.3 to 1.0.5
2021-05-15 12:28:22 -07:00
Andy Brett
f2c3b096a0 Merge pull request #7566 from luisramos0/erb
[Rails 6.0] Fix problem in erb template by explicitly setting format to js
2021-05-15 10:45:01 -07:00
Andy Brett
816d752dc8 Merge pull request #7439 from openfoodfoundation/dependabot/bundler/jwt-2.2.3
Bump jwt from 2.2.2 to 2.2.3
2021-05-15 10:36:13 -07:00
Andy Brett
0a880a2bf3 flip conditional order for performance 2021-05-15 07:08:07 -07:00
Matt-Yorkley
d6b3b0a3d3 Ensure a basic level of fault-tolerance on Redis connections
The default for reconnect_attempts is 0, which is not helpful! 1 is generally considered to be enough.
2021-05-15 11:36:19 +01:00
Andy Brett
ca38948e21 check stock before doing anything related to admin payments 2021-05-14 17:42:37 -07:00
Andy Brett
fe67c01e57 guard against no database, but not against .connected?
Similar to b22ce43efe
2021-05-14 12:56:24 -07:00
Matt-Yorkley
37053239c0 Switch cache store from memcached to redis 2021-05-14 20:46:13 +01:00
dependabot[bot]
2bb5a4b11f Bump test-prof from 1.0.3 to 1.0.5
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.3 to 1.0.5.
- [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.3...v1.0.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 05:17:23 +00:00
Maikel Linke
cea3ee4ef9 Transifex updates 2021-05-14 10:06:31 +10:00
Luis Ramos
90db52e5f5 Fix route 2021-05-14 00:14:02 +01:00
Luis Ramos
b1896733ca Fix routes 2021-05-14 00:08:20 +01:00
Luis Ramos
a949422ac9 Adapt view spec stubs to rails 6 2021-05-13 23:28:35 +01:00
Luis Ramos
0243e5cbb8 Fix route in order view 2021-05-13 23:08:50 +01:00
Andy Brett
ebdbfe0027 Merge pull request #7639 from drummer83/patch-1
Remove Ruby version from WIKI
2021-05-13 13:26:34 -07:00
Konrad
b680697af6 Remove Ruby version
Let's remove the Ruby version from the text. It changes regularly and have the link where to find it right behind it.
2021-05-13 21:16:02 +02:00
Matt-Yorkley
2e248744c0 Merge pull request #7520 from Matt-Yorkley/shipment-controller
Shipment controller: test coverage and improvements
2021-05-13 20:26:51 +02:00
Matt-Yorkley
82a6befce7 Delete dead code in OrdersController#update_distribution
I can't see any evidence that these params ever get sent to this action...
2021-05-13 15:29:53 +01:00
Mathieu Lovato Stumpf Guntz
ccef65039a Remove all material related to Zeus 2021-05-13 12:21:58 +02:00
dependabot[bot]
e4a670da5a Bump ddtrace from 0.48.0 to 0.49.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.48.0 to 0.49.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.48.0...v0.49.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 05:24:45 +00:00
Nihal Mohammed
c930b2ee60 Fix persistet flash after /cart page reload 2021-05-13 05:57:25 +05:30
Matt-Yorkley
4932e1dcb5 Merge pull request #7628 from viktorsmari/remove-distributer-sample-data
Remove distributer from sample_data
2021-05-12 23:53:13 +02:00
Viktor Smari
536281ec80 Remove distributer from sample_data
Closes #7625
2021-05-12 23:01:08 +02:00
Nihal Mohammed
367cee593f Move eager loading line_items to controller 2021-05-13 01:12:13 +05:30
Matt-Yorkley
99cf23df26 Merge pull request #7530 from Matt-Yorkley/email-after-commit
Email after commit
2021-05-12 21:22:55 +02:00
Matt-Yorkley
f49d4592a0 Merge pull request #7506 from guidoDutra/5546-prevent-deleting-only-item-in-confirmed-order
prevent deleting only item in confirmed order
2021-05-12 21:10:09 +02:00
Pau Pérez Fabregat
7f27544acb Merge pull request #7612 from openfoodfoundation/dependabot/bundler/actionpack-action_caching-1.2.2
Bump actionpack-action_caching from 1.2.1 to 1.2.2
2021-05-12 16:24:25 +02:00
Pau Pérez Fabregat
2aac44d95e Merge pull request #7620 from openfoodfoundation/transifex
Transifex
2021-05-12 15:50:25 +02:00
Pau Pérez Fabregat
8f921b8b08 Merge pull request #7593 from viktorsmari/add-bullet-footer
Add bullet footer
2021-05-12 15:47:54 +02:00
Transifex-Openfoodnetwork
dfe485b079 Updating translations for config/locales/ru.yml 2021-05-12 17:49:31 +10:00
dependabot[bot]
ad9096b5a8 Bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 23:49:14 +00:00
Matt-Yorkley
e60a513c88 Merge pull request #7571 from coopdevs/make-specs-accurate
Properly mock validator and extend tests
2021-05-11 22:24:01 +02:00
Pau Pérez Fabregat
1f8e731594 Merge pull request #7596 from openfoodfoundation/transifex
Transifex
2021-05-11 11:56:35 +02:00
dependabot[bot]
d69ef31bf9 Bump actionpack-action_caching from 1.2.1 to 1.2.2
Bumps [actionpack-action_caching](https://github.com/rails/actionpack-action_caching) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/rails/actionpack-action_caching/releases)
- [Changelog](https://github.com/rails/actionpack-action_caching/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/actionpack-action_caching/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 05:05:32 +00:00
Andy Brett
9ae7c5efbc Merge pull request #7578 from psychoslave/master
Update things related to some package manager influencing setup process
2021-05-10 17:01:46 -07:00
Matt-Yorkley
902bbf7dc4 Merge pull request #7576 from Matt-Yorkley/bulk-line-items
Add test coverage to BulkLineItemsController actions
2021-05-11 01:47:17 +02:00
Andy Brett
d29ef0d7b1 Merge branch 'master' into make-specs-accurate 2021-05-10 16:10:33 -07:00
Andy Brett
d2a3d9049f Merge pull request #7588 from andrewpbrett/enterprise-permalink-spec
[Rails 6.0] Fix enterprise permalink spec
2021-05-10 15:30:45 -07:00
filipefurtad0
0cd6c53e0d Adds test-case on the inventory import for unit Items 2021-05-10 19:12:41 +01:00
filipefurtad0
5475b79cde Adds test-case on the product import unit Items 2021-05-10 19:07:05 +01:00
filipefurtad0
8e24c655b0 Adds verification of inventory import on inventory page 2021-05-10 19:01:41 +01:00
filipefurtad0
bb5452ad26 Adds verification of product import on products page 2021-05-10 18:57:47 +01:00
Pau Perez
ed6b7f1ab4 Split apt packages list into a name per line
This super long line was hard to read.
2021-05-10 19:57:24 +02:00
Matt-Yorkley
85b8e9b51f Merge pull request #7595 from openfoodfoundation/dependabot/bundler/factory_bot_rails-6.2.0
Bump factory_bot_rails from 6.1.0 to 6.2.0
2021-05-10 19:55:54 +02:00
Pau Perez
4453123944 Compile Ruby with jemalloc 2021-05-10 19:31:04 +02:00
Andy Brett
3239c893ba Merge pull request #7590 from viktorsmari/ransack-search-deprecation
Ransack.search is deprecated. Use .ransack instead
2021-05-10 08:43:09 -07:00
Andy Brett
17a0063b40 Merge pull request #7402 from filipefurtad0/products_spec_add_ons
Adds coverage for product deletion and cloning
2021-05-10 06:26:11 -07:00
Matt-Yorkley
122ba385f7 Move line item rendering to collection in cart page
Improvement from upstream Spree commit. Brings a big performance boost to rendering, especially with larger numbers of items in the cart. 50%+ reduction in rendering times reported.
2021-05-10 11:50:31 +01:00
Transifex-Openfoodnetwork
75dc7af0ed Updating translations for config/locales/en_GB.yml 2021-05-10 18:16:04 +10:00
dependabot[bot]
cb15e28cef Bump factory_bot_rails from 6.1.0 to 6.2.0
Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases)
- [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/master/NEWS.md)
- [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v6.1.0...v6.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 05:55:18 +00:00
Andy Brett
cbefa5f882 Merge pull request #7589 from andrewpbrett/order-adjustments-spec
[Rails 6.0] Fix order adjustments spec
2021-05-09 10:38:19 -07:00
Andy Brett
231f01dad2 fix order adjustments spec 2021-05-09 10:09:22 -07:00
Viktor Smari
c14ccdc21c Add bullet footer
Left corner of the page will show the bullet warnings
2021-05-09 16:49:00 +02:00
Nihal Mohammed
fcf70c242e edit item_count method to shorthand for improved readability 2021-05-09 18:31:26 +05:30
Andy Brett
a0476be2c9 Merge pull request #7568 from andrewpbrett/stripe-mock-js
[Rails 6.0] Use raw to render stripe mock js file
2021-05-08 17:46:24 -07:00
Matt-Yorkley
24a5407c8f Merge pull request #7565 from luisramos0/rails6_success
[Rails 6.0] Replace be_success on test_response with status 200
2021-05-09 02:33:49 +02:00
Andy Brett
66da72ccc2 use raw to render stripe mock js 2021-05-08 17:29:38 -07:00
Viktor Smari
6a342ae368 Ransack.search is deprecated. Use .ransack instead
https://github.com/activerecord-hackery/ransack/pull/975
2021-05-09 01:05:37 +02:00
Andy Brett
dd851edbdc fix enterprise permalink spec 2021-05-08 14:21:45 -07:00
Andy Brett
2910cbf15c Merge pull request #7582 from openfoodfoundation/transifex
Transifex
2021-05-08 13:55:11 -07:00
Transifex-Openfoodnetwork
d24d7fce56 Updating translations for config/locales/de_DE.yml 2021-05-09 05:16:39 +10:00
Nihal Mohammed
e485a4a8ef Remove untested change to payments 2021-05-08 23:51:38 +05:30
Nihal Mohammed
026942dd72 Fix item_count to properly count quantity of every item 2021-05-08 23:45:41 +05:30
Nihal Mohammed
237ebd6ec4 Removed N+1 queries while counting line_items 2021-05-08 21:09:06 +05:30
Mathieu Lovato Stumpf Guntz
a4d6e69309 Replace nmp with yarn, remove newrelic 2021-05-07 21:10:55 +02:00
Mathieu Lovato Stumpf Guntz
29e04dd8c8 Merge branch 'master' of https://github.com/openfoodfoundation/openfoodnetwork 2021-05-07 16:00:08 +02:00
Mathieu Lovato Stumpf Guntz
5a8e271037 Update .node-version to last LTS and drop setup tests 2021-05-07 15:54:15 +02:00
Andy Brett
5a16954bf6 Merge pull request #7572 from openfoodfoundation/transifex
Transifex
2021-05-07 06:46:56 -07:00
Matt-Yorkley
43e41f4980 Add more explicit test coverage to BulkLineItemsController acitons
This spec includes taxes on line items, fees on the order and on line items, taxes on fees (inherited and non-inherited), shipping and payment fees and taxes on shipping. It checks all of these things are correctly updated after the order is changed via BOM.
2021-05-07 11:54:04 +01:00
Matt-Yorkley
39156ec988 Merge pull request #7574 from Matt-Yorkley/dfc-routes
Update DFC routes
2021-05-07 11:27:50 +02:00
Matt-Yorkley
c71d4bce6a Update DFC routes 2021-05-07 09:42:35 +01:00
Pau Pérez Fabregat
8d8abed529 Merge pull request #7496 from jibees/4957-flaky-specs
Uncomment flaky spec on variant_overrides_spec.rb
2021-05-07 10:29:36 +02:00
Transifex-Openfoodnetwork
55018260df Updating translations for config/locales/en_FR.yml 2021-05-07 17:53:34 +10:00
Transifex-Openfoodnetwork
cbdeef064a Updating translations for config/locales/fr.yml 2021-05-07 17:53:20 +10:00
Transifex-Openfoodnetwork
ac2c02a983 Updating translations for config/locales/es.yml 2021-05-07 16:40:26 +10:00
Transifex-Openfoodnetwork
c71a4918a0 Updating translations for config/locales/ca.yml 2021-05-07 16:40:03 +10:00
Pau Perez
fd5e0fd60f Properly mock validator and extend tests
Tests were passing but not due to the expected reason. While at it, we
extended the assertions to be more precise.
2021-05-07 08:35:54 +02:00
Andy Brett
dbd0d4a795 Merge pull request #7570 from openfoodfoundation/release/v3.6.10
Update all locales with the latest Transifex translations
2021-05-06 20:41:25 -07:00
Andy Brett
328381b732 Update all locales with the latest Transifex translations 2021-05-06 20:38:41 -07:00
Luis Ramos
de000228cf Fix problem in erb template by explicitly setting format to js while calling it 2021-05-06 23:52:16 +01:00
Luis Ramos
a2de86c23e Replace be_success on test_reponse with status 200
In rails 6 response.success? is not supported.
2021-05-06 23:51:30 +01:00
Andy Brett
415d86bff0 Merge pull request #7562 from coopdevs/fix-failed-sca-auth
Fix failed SCA authentication on subs. order payment not reflected in OFN
2021-05-06 15:25:16 -07:00
Andy Brett
8b9083d28f Merge pull request #7560 from openfoodfoundation/dependabot/bundler/rails-5.2.6
Bump rails from 5.2.5 to 5.2.6
2021-05-06 15:14:06 -07:00
dependabot[bot]
7f5dddffa0 Bump rails from 5.2.5 to 5.2.6
Bumps [rails](https://github.com/rails/rails) from 5.2.5 to 5.2.6.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v5.2.5...v5.2.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 17:35:58 +00:00
Andy Brett
cfa4bde965 Merge pull request #7559 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.10.1
Bump rubocop-rails from 2.10.0 to 2.10.1
2021-05-06 10:34:20 -07:00
Andy Brett
9e6ede4072 Merge pull request #7561 from openfoodfoundation/dependabot/bundler/rubocop-1.14.0
Bump rubocop from 1.13.0 to 1.14.0
2021-05-06 10:33:40 -07:00
Pau Perez
9a63f38790 I18n-ize error messages. 2021-05-06 16:34:29 +02:00
Pau Perez
69b91ea136 Wait until the end to mark payment as processed
This gives us the opportunity to retry the operation in case the
processing fails.
2021-05-06 16:19:01 +02:00
Pau Perez
dea6a01e61 Handle SCA payments that can't complete 2021-05-06 16:19:01 +02:00
Pau Perez
2147584daf Validate intents against Stripe and display errors
Now the existing validation is redundant. It's Stripe's API who does
that now. It's up to them to decide what's a valid intent.
2021-05-06 16:19:01 +02:00
Pau Perez
b723ed4a98 Skip Stripe logic when no payment data is passed 2021-05-06 16:19:01 +02:00
dependabot[bot]
ccfe352d62 Bump rubocop from 1.13.0 to 1.14.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.13.0 to 1.14.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.13.0...v1.14.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 05:22:38 +00:00
dependabot[bot]
76fb157518 Bump rubocop-rails from 2.10.0 to 2.10.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.0 to 2.10.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.10.0...v2.10.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 05:18:52 +00:00
Andy Brett
a7331efd67 Merge pull request #7477 from luisramos0/require_dependency
Remove require_dependency or use require
2021-05-05 13:24:19 -07:00
Pau Pérez Fabregat
b57755398c Merge pull request #7531 from openfoodfoundation/dependabot/bundler/daemons-1.4.0
Bump daemons from 1.3.1 to 1.4.0
2021-05-05 21:42:25 +02:00
dependabot[bot]
076081929f Bump daemons from 1.3.1 to 1.4.0
Bumps [daemons](https://github.com/thuehlinger/daemons) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/thuehlinger/daemons/releases)
- [Changelog](https://github.com/thuehlinger/daemons/blob/master/Releases)
- [Commits](https://github.com/thuehlinger/daemons/compare/v1.3.1...v1.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 18:07:37 +00:00
Andy Brett
4b183bb6c1 Merge pull request #7555 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.10.0
Bump rubocop-rails from 2.9.1 to 2.10.0
2021-05-05 11:06:43 -07:00
Andy Brett
d2f3cdd6b9 Merge pull request #7546 from openfoodfoundation/dependabot/bundler/activerecord-session_store-2.0.0
Bump activerecord-session_store from 1.1.3 to 2.0.0
2021-05-05 11:06:10 -07:00
Andy Brett
baf3d4b2cd Merge pull request #6488 from openfoodfoundation/dependabot/bundler/pg-1.2.3
Bump pg from 0.21.0 to 1.2.3
2021-05-05 11:05:52 -07:00
Andy Brett
f8f3cb78e3 Merge pull request #7549 from openfoodfoundation/dependabot/bundler/roadie-rails-2.2.0
Bump roadie-rails from 1.3.0 to 2.2.0
2021-05-05 11:05:24 -07:00
dependabot[bot]
18373533e6 Bump roadie-rails from 1.3.0 to 2.2.0
Bumps [roadie-rails](https://github.com/Mange/roadie-rails) from 1.3.0 to 2.2.0.
- [Release notes](https://github.com/Mange/roadie-rails/releases)
- [Changelog](https://github.com/Mange/roadie-rails/blob/master/Changelog.md)
- [Commits](https://github.com/Mange/roadie-rails/compare/v1.3.0...v2.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 17:40:59 +00:00
dependabot[bot]
679ceaead7 Bump pg from 0.21.0 to 1.2.3
Bumps [pg](https://github.com/ged/ruby-pg) from 0.21.0 to 1.2.3.
- [Release notes](https://github.com/ged/ruby-pg/releases)
- [Changelog](https://github.com/ged/ruby-pg/blob/master/History.rdoc)
- [Commits](https://github.com/ged/ruby-pg/compare/v0.21.0...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 17:40:49 +00:00
Pau Pérez Fabregat
64baebd791 Merge pull request #7545 from openfoodfoundation/dependabot/bundler/ransack-2.4.1
Bump ransack from 2.3.0 to 2.4.1
2021-05-05 19:39:42 +02:00
dependabot[bot]
31adbdbf7a Bump activerecord-session_store from 1.1.3 to 2.0.0
Bumps [activerecord-session_store](https://github.com/rails/activerecord-session_store) from 1.1.3 to 2.0.0.
- [Release notes](https://github.com/rails/activerecord-session_store/releases)
- [Commits](https://github.com/rails/activerecord-session_store/compare/v1.1.3...v2.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 17:15:11 +00:00
Pau Pérez Fabregat
819479f05c Merge pull request #7552 from luisramos0/rails525
Upgrade to rails 5.2.5 with "bundle update rails"
2021-05-05 19:14:04 +02:00
Pau Pérez Fabregat
324999494b Merge pull request #7523 from openfoodfoundation/transifex
Transifex
2021-05-05 18:31:30 +02:00
Andy Brett
82845e1cfc Merge pull request #7528 from Matt-Yorkley/has_many_through
Reorder has_many relationship with :through option
2021-05-05 08:08:15 -07:00
Andy Brett
3e714b1539 Merge pull request #7527 from Matt-Yorkley/dead-code-deleted
Remove #deleted? method from Product and Variant
2021-05-05 08:07:39 -07:00
Andy Brett
002420304d Merge pull request #7526 from Matt-Yorkley/dead-currency
Remove currency from OrderContents
2021-05-05 08:06:53 -07:00
dependabot[bot]
aa90c4f34f Bump rubocop-rails from 2.9.1 to 2.10.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.9.1 to 2.10.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.9.1...v2.10.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 05:14:36 +00:00
Luis Ramos
63e2122593 Upgrade to rails 5.2.5 with a bundle update rails 2021-05-04 21:31:09 +01:00
Andy Brett
35671e2464 Merge pull request #7548 from openfoodfoundation/dependabot/bundler/rspec-rails-5.0.1
Bump rspec-rails from 4.1.2 to 5.0.1
2021-05-04 13:22:48 -07:00
Andy Brett
4b9418ebd6 Merge pull request #7547 from openfoodfoundation/dependabot/bundler/coffee-rails-5.0.0
Bump coffee-rails from 4.2.2 to 5.0.0
2021-05-04 13:02:50 -07:00
dependabot[bot]
ec8f42513b Bump rspec-rails from 4.1.2 to 5.0.1
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 4.1.2 to 5.0.1.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v4.1.2...v5.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-04 19:21:11 +00:00
dependabot[bot]
3ba439ec0d Bump coffee-rails from 4.2.2 to 5.0.0
Bumps [coffee-rails](https://github.com/rails/coffee-rails) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/rails/coffee-rails/releases)
- [Changelog](https://github.com/rails/coffee-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/coffee-rails/compare/v4.2.2...v5.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-04 19:20:07 +00:00
dependabot[bot]
47e79a8d60 Bump ransack from 2.3.0 to 2.4.1
Bumps [ransack](https://github.com/activerecord-hackery/ransack) from 2.3.0 to 2.4.1.
- [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/v2.3.0...2.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-04 19:19:33 +00:00
Transifex-Openfoodnetwork
119fdd9e53 Updating translations for config/locales/en_CA.yml 2021-05-05 03:12:14 +10:00
Matt-Yorkley
00c4a28d22 Extract order-updating logic to Order::Updater 2021-05-04 16:40:10 +01:00
Matt-Yorkley
8e10f7af0e Update payments controller test setup
We need to use a completed order in the test setup here or it doesn't behave correctly. `order.completed_at` is nil, for example.
2021-05-04 16:40:10 +01:00
Matt-Yorkley
135a311c05 Update void payments
Backport from Spree 2.4 stable: 4121992398
2021-05-04 16:40:10 +01:00
Matt-Yorkley
13bb5aa8dd Update Payment after_save callback
Backport from Spree 2.4 stable: 4d652a77fd
2021-05-04 16:40:09 +01:00
Matt-Yorkley
2b1becfd47 Merge pull request #7185 from openfoodfoundation/rails-5-2
Rails 5.2 upgrade
2021-05-04 17:21:03 +02:00
Andy Brett
edc51d1155 Merge pull request #7532 from openfoodfoundation/dependabot/bundler/test-prof-1.0.3
Bump test-prof from 1.0.2 to 1.0.3
2021-05-03 11:31:50 -07:00
filipefurtad0
a476416dc4 Removes html tr tag; Clarifies it block 2021-05-03 17:03:34 +01:00
Transifex-Openfoodnetwork
55b1b860d1 Updating translations for config/locales/en_US.yml 2021-05-04 02:03:25 +10:00
Matt-Yorkley
e2a411c23c Add map helper to RegistrationController
Fixes 3 errors including:

Registration Terms of Service agreement if accepting Terms of Service is not required allows registration as normal
     Failure/Error: super

     ActionView::Template::Error:
       undefined method `using_google_maps?' for #<#<Class:0x00007fd4949c4558>:0x00007fd499dd0ae8>
     # ./app/helpers/application_helper.rb:20:in `method_missing'
     # ./app/views/registration/steps/_details.html.haml:60:in `_app_views_registration_steps__details_html_haml___1911121144363058234_70275472163280'
     # ./app/views/registration/index.html.haml:12:in `block in _app_views_registration_index_html_haml__993897347679518865_70275545598940'
     # ./app/views/registration/index.html.haml:11:in `each'
     # ./app/views/registration/index.html.haml:11:in `_app_views_registration_index_html_haml__993897347679518865_70275545598940'
     # ./lib/open_food_network/rack_request_blocker.rb:36:in `call'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `using_google_maps?' for #<#<Class:0x00007fd4949c4558>:0x00007fd499dd0ae8>
     #   ./app/helpers/application_helper.rb:20:in `method_missing'
2021-05-03 14:17:54 +01:00
Matt-Yorkley
aa013ef76a Update redirect_back syntax for Rails 5
Introduced in 5.0, the old syntax is removed in 5.2
2021-05-03 14:17:54 +01:00
Matt-Yorkley
a645b8c58f Re-apply previous 5.2 commit: Don't reload payments in after_save callback
This causes issues in master, but is needed in the 5.2 branch.
2021-05-03 14:17:54 +01:00
Matt-Yorkley
4888f1cd06 Stub OrderPaymentFinder to return correct object
OrderPaymentFinder was re-fetching the payment object from the database, so the subsequent line that stubs #authorize! on that payment was not being applied to the correct object.
2021-05-03 14:17:54 +01:00
Matt-Yorkley
31fc6201fc Include payment method helper in ApplicationController 2021-05-03 14:17:54 +01:00
Matt-Yorkley
ab65b01fcf Rename payments helper 2021-05-03 14:17:54 +01:00
Matt-Yorkley
1de68d091a Update guard clause in line item callbacks (take two)
The `changed?` method is more accurately replaced by `saved_changes.present?`

In some cases here (where the object had just been saved for the first time) the guard clause was still stopping execution unexpectedly.
2021-05-03 14:17:54 +01:00
Matt-Yorkley
ac53df37d9 Fix callback in LineItem
#changed? here was not working as before, and the code was never getting past this guard in various places where previously it did. This meant the callback was effectively disabled, and order.update! was not being called when it should be.
2021-05-03 14:17:54 +01:00
Luis Ramos
279c15c306 Adapt spec to rails 5.2 2021-05-03 14:17:54 +01:00
Luis Ramos
47a5809100 Fix rspec syntax 2021-05-03 14:17:54 +01:00
Andy Brett
705666ecd0 fix /spec/models/spree/credit_card_spec.rb:301 2021-05-03 14:17:54 +01:00
Luis Ramos
aaf4710694 Fix cart_service_spec to adapt to the actual usage of it from cart_controller, params are now sent inside a Parameters object, not as a hash 2021-05-03 14:17:54 +01:00
Luis Ramos
f5a7ff0f0a Switch from map, that does not exist in ActionController::Parameters, to each 2021-05-03 14:17:54 +01:00
Andy Brett
203dbb7a8b Revert "Switch from map, that does not exist in ActionController::Parameters, to each"
This reverts commit 69a15d4f04.
2021-05-03 14:17:54 +01:00
Andy Brett
ea5f9c6747 Revert "Fix cart_service_spec to adapt to the actual usage of it from cart_controller, params are now sent inside a Parameters object, not as a hash"
This reverts commit bb465b5715.
2021-05-03 14:17:54 +01:00
Andy Brett
d255ca22f5 use new attribute_changed method for taxons take 2 2021-05-03 14:17:54 +01:00
Andy Brett
be0eb5f5f9 ignore nil in payment report spec expectation 2021-05-03 14:17:54 +01:00
Andy Brett
52525dc437 Fix /spec/models/spree/product_spec.rb:118 2021-05-03 14:17:54 +01:00
Andy Brett
d381b2a544 Use saved_change_to prefix to check for changes 2021-05-03 14:17:54 +01:00
Luis Ramos
c08bc743d3 Replace usage of changed? with saved_change_to_ 2021-05-03 14:17:54 +01:00
Luis Ramos
c1402fe4f2 Upgrade state_machines 2021-05-03 14:17:54 +01:00
Matt-Yorkley
e9b6f89ae0 Update params syntax in engine controller specs 2021-05-03 14:17:54 +01:00
Matt-Yorkley
26688dda36 Add angular_form helper
Fixes:

Failure/Error: super

     ActionView::Template::Error:
       undefined method `ng_options_for_select' for #<#<Class:0x00007fbf8e43e310>:0x000055783fbebec0>
       Did you mean?  options_for_select
     # ./app/helpers/application_helper.rb:20:in `method_missing'
     # ./app/helpers/angular_form_builder.rb:26:in `ng_select'
     # ./app/views/admin/enterprise_fees/index.html.haml:34:in `block (2 levels) in _app_views_admin_enterprise_fees_index_html_haml__800455454875182851_46987476952700'
     # ./app/helpers/angular_form_builder.rb:6:in `ng_fields_for'
     # ./app/views/admin/enterprise_fees/index.html.haml:28:in `block in _app_views_admin_enterprise_fees_index_html_haml__800455454875182851_46987476952700'
     # ./app/helpers/application_helper.rb:11:in `ng_form_for'
     # ./app/views/admin/enterprise_fees/index.html.haml:4:in `_app_views_admin_enterprise_fees_index_html_haml__800455454875182851_46987476952700'
     # ./lib/open_food_network/rack_request_blocker.rb:36:in `call'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `ng_options_for_select' for #<#<Class:0x00007fbf8e43e310>:0x000055783fbebec0>
     #   Did you mean?  options_for_select
     #   ./app/helpers/application_helper.rb:20:in `method_missing'
2021-05-03 14:17:54 +01:00
Matt-Yorkley
b7aeceaf67 Add enterprise_fees helper
Fixes:

Failure/Error: super

     ActionView::Template::Error:
       undefined method `angular_id' for #<#<Class:0x00007f57c7126670>:0x00007f57c55754f8>
     # ./app/helpers/application_helper.rb:20:in `method_missing'
     # ./app/views/admin/enterprise_fees/index.html.haml:32:in `block (2 levels) in _app_views_admin_enterprise_fees_index_html_haml__3854507252304647884_70007474860840'
     # ./app/helpers/angular_form_builder.rb:6:in `ng_fields_for'
     # ./app/views/admin/enterprise_fees/index.html.haml:28:in `block in _app_views_admin_enterprise_fees_index_html_haml__3854507252304647884_70007474860840'
     # ./app/helpers/application_helper.rb:11:in `ng_form_for'
     # ./app/views/admin/enterprise_fees/index.html.haml:4:in `_app_views_admin_enterprise_fees_index_html_haml__3854507252304647884_70007474860840'
     # ./lib/open_food_network/rack_request_blocker.rb:36:in `call'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `angular_id' for #<#<Class:0x00007f57c7126670>:0x00007f57c55754f8>
     #   ./app/helpers/application_helper.rb:20:in `method_missing'
2021-05-03 14:17:54 +01:00
Matt-Yorkley
e6a3041f45 Add admin/enterprises helper
Fixes:

Failure/Error: super

     ActionView::Template::Error:
       undefined method `add_check_if_single' for #<#<Class:0x0000564501a3c838>:0x00007f446cdd68e8>
     # ./app/helpers/application_helper.rb:20:in `method_missing'
     # ./app/views/spree/admin/shared/_hubs_sidebar.html.haml:16:in `block in _app_views_spree_admin_shared__hubs_sidebar_html_haml___1973426344114200431_69965928779540'
     # ./app/views/spree/admin/shared/_hubs_sidebar.html.haml:11:in `each'
     # ./app/views/spree/admin/shared/_hubs_sidebar.html.haml:11:in `_app_views_spree_admin_shared__hubs_sidebar_html_haml___1973426344114200431_69965928779540'
     # ./app/views/spree/admin/payment_methods/edit.html.haml:15:in `block in _app_views_spree_admin_payment_methods_edit_html_haml__571217921761730685_69965930474120'
     # ./app/views/spree/admin/payment_methods/edit.html.haml:11:in `_app_views_spree_admin_payment_methods_edit_html_haml__571217921761730685_69965930474120'
     # ./app/controllers/admin/resource_controller.rb:23:in `block (2 levels) in edit'
     # ./lib/spree/core/controller_helpers/respond_with.rb:24:in `respond_with'
     # ./app/controllers/admin/resource_controller.rb:22:in `edit'
     # ./lib/open_food_network/rack_request_blocker.rb:36:in `call'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `add_check_if_single' for #<#<Class:0x0000564501a3c838>:0x00007f446cdd68e8>
     #   ./app/helpers/application_helper.rb:20:in `method_missing'
2021-05-03 14:17:54 +01:00
Matt-Yorkley
b0787e83b2 Add checkout helper
Fixes:

      Failure/Error: super

      ActionView::Template::Error:
        undefined method `checkout_adjustments_for' for #<#<Class:0x000055f4bd847a30>:0x000055f4bd845c30>
      # ./app/helpers/application_helper.rb:20:in `method_missing'
      # ./app/views/spree/admin/orders/_invoice_table.html.haml:26:in `_app_views_spree_admin_orders__invoice_table_html_haml___3617932924646213210_47254819384740'
      # ./app/views/spree/admin/orders/invoice.html.haml:67:in `_app_views_spree_admin_orders_invoice_html_haml__1476001169744481148_47254819971700'
      # ./app/services/invoice_renderer.rb:8:in `render_to_string'
      # ./app/controllers/spree/admin/orders_controller.rb:81:in `invoice'
      # ./spec/support/controller_requests_helper.rb:49:in `process_action_with_route'
      # ./spec/support/controller_requests_helper.rb:23:in `spree_get'
      # ./spec/controllers/spree/admin/orders/invoices_spec.rb:58:in `block (6 levels) in <top (required)>'
      # ------------------
      # --- Caused by: ---
      # NoMethodError:
      #   undefined method `checkout_adjustments_for' for #<#<Class:0x000055f4bd847a30>:0x000055f4bd845c30>
      #   ./app/helpers/application_helper.rb:20:in `method_missing'
2021-05-03 14:17:54 +01:00
Luis Ramos
1b4930de8f Fix mimemagic 036 yank issue 2021-05-03 14:17:54 +01:00
Matt-Yorkley
f874397115 Fix errors in PermittedAttributes::OrderCycle 2021-05-03 14:17:54 +01:00
Matt-Yorkley
5fc60f53ba Update mimemagic gem!
The package maintainer nuked this gem last night as part of a major licence change for the repo, and chaos ensued. It's a dependency for ActiveStorage which is now part of Rails. Versions *above* 0.3.5 are now available, and work. All versions below 0.3.6 have been removed without warning (currently used by ~576,971 repos on Github!) D:
2021-05-03 14:17:54 +01:00
Matt-Yorkley
943c00c924 WIP - Update loading of helpers in controllers
Rails has changed the way helpers are loaded. It's a bit weird. It was throwing lots of errors, and recommended using this setting, but now requires that all helpers are loaded explicitly. I'm not sure about this.
2021-05-03 14:17:54 +01:00
Matt-Yorkley
138f00876b Update Rails to 5.2 2021-05-03 14:17:54 +01:00
Transifex-Openfoodnetwork
b00dcecd52 Updating translations for config/locales/en_GB.yml 2021-05-03 18:16:39 +10:00
dependabot[bot]
d3b3ed3b9c Bump test-prof from 1.0.2 to 1.0.3
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 05:47:40 +00:00
filipefurtad0
19768e1398 adds coverage for product deletion and cloning 2021-05-02 18:33:13 +01:00
Matt-Yorkley
7c2d77a3ee Fix assertion in ModelSet test
The mismatched use of hash attributes as strings and hash attributes as symbols here (attrs['name'] and attrs[:name]) meant that the conditional was not returning the expected results in the test.
2021-05-02 13:42:38 +01:00
Matt-Yorkley
2560757ea2 Change Enterprise after_create callback to after_create_commit
As a general rule, if you're triggering an email job as part of an after create/save callback, it should use after commit instead.

Why? The transaction can't finish until after the record is persisted (the data is committed) which includes the logic in all callbacks. So for example if the transaction fails after the email job has been placed it will be rolled back, but the email job will already be in the queue, and it'll be referencing a record that doesn't actually exist (due to the rollback).
2021-05-02 13:23:31 +01:00
Matt-Yorkley
9d23c0d9e2 Reorder has_many relationship with :through option
If it's using :through it should be defined after the relationship it's connected to
2021-05-01 16:20:36 +01:00
Matt-Yorkley
7948c5943d Remove #deleted? method from Product and Variant
This method is already supplied via the paranoia gem, there's no need to re-implement it here.
2021-05-01 12:54:33 +01:00
Matt-Yorkley
2eb17dbbd1 Remove currency from OrderContents
The currency argument here is not actually used anywhere. The related conditional logic is also not covered in any tests.
2021-05-01 11:10:51 +01:00
Transifex-Openfoodnetwork
0a9fc429ac Updating translations for config/locales/de_DE.yml 2021-05-01 08:32:50 +10:00
Andy Brett
8672969798 Merge pull request #7515 from openfoodfoundation/dependabot/bundler/devise-4.8.0
Bump devise from 4.7.3 to 4.8.0
2021-04-30 11:24:20 -07:00
Andy Brett
1be730fcfb Merge pull request #7512 from Matt-Yorkley/package-refactor
Package update
2021-04-30 08:51:51 -07:00
Transifex-Openfoodnetwork
7fd82540ce Updating translations for config/locales/en_IE.yml 2021-05-01 00:27:53 +10:00
Matt-Yorkley
e290c128bf Fix error in Api::ShipmentController#update with :unlock parameter
This is a generic issue caused by a clash between state machines trying to define (or failing to define) the #open method on adjustments as part of their state changes interface. This method is already defined in Object. For more details, see: bb42e33bf7/lib/state_machines/machine.rb (L323-L350)
2021-04-30 14:13:22 +01:00
Matt-Yorkley
95a73704a2 Add more test coverage to Api::ShipmentController#update 2021-04-30 14:09:32 +01:00
Matt-Yorkley
b843b871f6 Ensure order totals and payment/shipment states are correct when changing shipping method on a completed order.
This used to happen via an after_save callback in Shipment, which called `order.update!`. That has recently been removed. After changing a shipment's selected shipping rate (shipping method), we need to ensure the order's totals and states are updated. We don't need to update all of the order's adjustments though (see previous commit).

FYI Spree handled this issue like this: 24388485ed, but there are lots of things about that commit that are clearly awful, like: params handling in a model, duplication of Order::Updater logic across the codebase, the Shipment class having responsiblity for knowing which things need to be updated on the order, etc. The result is ultimately the same as what we're doing here though.
2021-04-30 12:57:01 +01:00
Matt-Yorkley
925676f136 Split Order::Updater#update into two methods
There are two distinct (and very important) operations happening here. The first is to update all adjustments (which can be *incredibly* expensive) and the second is to ensure the order's totals and shipping/payment states are correct. There are lots of places where we currently do both of these things where in fact we only need to do the latter (and skip the really expensive part).
2021-04-30 12:48:53 +01:00
Matt-Yorkley
d3f41f14c7 Add test coverage for Api::ShipmentsController#update 2021-04-30 12:45:49 +01:00
Matt-Yorkley
045ce73c83 Simplify shipment controller params 2021-04-30 12:20:47 +01:00
Matt-Yorkley
932d000c9d Improve shipping method factory
You can now specify an amount for the flat_rate option.
2021-04-30 12:19:43 +01:00
Matt-Yorkley
c7ce10f998 Handle order objects with no distributor 2021-04-30 11:12:41 +01:00
Matt-Yorkley
5b29243847 Delete unused method Stock::Package#currency 2021-04-30 11:10:20 +01:00
Matt-Yorkley
3897c3af68 Refactor Stock::Package#shipping_methods 2021-04-30 11:10:20 +01:00
Matt-Yorkley
c3c396eaea Add soft-deletion test coverage to Package#shipping_methods 2021-04-30 11:10:19 +01:00
dependabot[bot]
c1d246081e Bump devise from 4.7.3 to 4.8.0
Bumps [devise](https://github.com/plataformatec/devise) from 4.7.3 to 4.8.0.
- [Release notes](https://github.com/plataformatec/devise/releases)
- [Changelog](https://github.com/heartcombo/devise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/plataformatec/devise/compare/v4.7.3...v4.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 05:20:39 +00:00
Guido Oliveira
84285ff985 prevent deleting only item in confirmed order 2021-04-28 17:37:28 -03:00
Jean-Baptiste Bellet
81385b63c7 Uncomment (not so) flaky spec 2021-04-27 15:27:16 +02:00
Luis Ramos
f357c3ff30 Remove require_dependency or use require
See here https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#require-dependency
2021-04-23 19:20:25 +01:00
dependabot[bot]
8b06a735ac Bump jwt from 2.2.2 to 2.2.3
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.2.2...v2.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-20 05:21:34 +00:00
Matt-Yorkley
153ec268b7 Remove RackRequestBlocker 2021-03-30 13:24:44 +01:00
Matt-Yorkley
92eaf5fbaa Remove atomic gem
Bundler says this when installing gems:
```
Post-install message from atomic:
This gem has been deprecated and merged into Concurrent Ruby (http://concurrent-ruby.com).
```
We already have concurrent-ruby 👍
2021-03-30 12:29:48 +01:00
202 changed files with 2824 additions and 1766 deletions

5
.github/codecov.yml vendored Normal file
View File

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

View File

@@ -322,4 +322,4 @@ jobs:
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.3.1
uses: codecov/codecov-action@v1.5.0

View File

@@ -1 +1 @@
5.12.0
14.16.1

View File

@@ -931,7 +931,6 @@ Style/FrozenStringLiteralComment:
- 'app/helpers/spree/admin/base_helper.rb'
- 'app/helpers/spree/admin/general_settings_helper.rb'
- 'app/helpers/spree/admin/orders_helper.rb'
- 'app/helpers/spree/admin/payments_helper.rb'
- 'app/helpers/spree/admin/taxons_helper.rb'
- 'app/helpers/spree/admin/zones_helper.rb'
- 'app/helpers/spree/orders_helper.rb'

View File

@@ -1 +1 @@
2.5.8
2.5.9

View File

@@ -7,7 +7,23 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list
# Install all the requirements
RUN apt-get update && apt-get install -y curl git build-essential software-properties-common wget zlib1g-dev libssl1.0-dev libreadline-dev libyaml-dev libffi-dev libxml2-dev libxslt1-dev wait-for-it imagemagick unzip
RUN apt-get update && apt-get install -y \
curl \
git \
build-essential \
software-properties-common \
wget \
zlib1g-dev \
libreadline-dev \
libyaml-dev \
libffi-dev \
libxml2-dev \
libxslt1-dev \
wait-for-it \
imagemagick \
unzip \
libjemalloc-dev \
libssl-dev
# Setup ENV variables
ENV PATH /usr/local/src/rbenv/shims:/usr/local/src/rbenv/bin:$PATH
@@ -19,11 +35,10 @@ WORKDIR /usr/src/app
COPY .ruby-version .
# Install Rbenv & Ruby
RUN git clone --depth 1 --branch v1.1.2 https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
git clone --depth 1 --branch v20200520 https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
${RBENV_ROOT}/plugins/ruby-build/install.sh && \
RUN git clone --depth 1 https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
git clone --depth 1 https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && \
rbenv install $(cat .ruby-version) && \
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install $(cat .ruby-version) && \
rbenv global $(cat .ruby-version) && \
gem install bundler --version=1.17.3

View File

@@ -6,7 +6,7 @@ This is a general guide to setting up an Open Food Network **development environ
The fastest way to make it work locally is to use Docker, you only need to setup git, see the [Docker setup guide](docker/README.md).
Otherwise, for a local setup you will need:
* Ruby 2.4.4 and bundler (check current Ruby version in [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file)
* Ruby and bundler (check current Ruby version in [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file)
* PostgreSQL database
* Chrome (for testing)
@@ -47,7 +47,11 @@ $ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f0
This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting section](#creating-the-database) for an alternative.
Once done, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot.
Next, it is _strongly recommended_ to run the setup script.
```sh
$ script/setup
```
If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot.
Now, your dreams of spinning up a development server can be realised:
@@ -78,8 +82,6 @@ Note: If your OS is not explicitly supported in the setup guides then not all te
Note: The time zone on your machine should match the one defined in `config/application.yml`.
The project is configured to use [Zeus][zeus] to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page][zeus] for usage instructions.
Once [npm dependencies are installed][karma], AngularJS tests can be run with:
./script/karma run
@@ -119,7 +121,6 @@ If these commands succeed, you should be able to [continue the setup process](#g
[ubuntu]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Ubuntu
[debian]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Debian
[wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki
[zeus]: https://github.com/burke/zeus
[rubocop]: https://rubocop.readthedocs.io/en/latest/
[karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma
[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU

30
Gemfile
View File

@@ -1,21 +1,21 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby "2.5.8"
ruby "2.5.9"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'rails', '~> 5.0.0'
gem 'rails', '~> 5.2'
gem 'activemerchant', '>= 1.78.0'
gem 'angular-rails-templates', '>= 0.3.0'
gem 'awesome_nested_set'
gem 'ransack', '2.3.0'
gem 'ransack', '2.4.1'
gem 'responders'
gem 'sass', '<= 4.7.1'
gem 'sass-rails', '< 6.0.0'
gem 'i18n'
gem 'i18n-js', '~> 3.8.2'
gem 'i18n-js', '~> 3.8.3'
gem 'rails-i18n'
gem 'rails_safe_tasks', '~> 1.0'
@@ -29,7 +29,7 @@ gem "order_management", path: "./engines/order_management"
gem 'web', path: './engines/web'
gem 'activerecord-postgresql-adapter'
gem 'pg', '~> 0.21.0'
gem 'pg', '~> 1.2.3'
gem 'acts_as_list', '1.0.4'
gem 'cancancan', '~> 1.15.0'
@@ -52,7 +52,6 @@ gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
gem 'daemons'
gem 'delayed_job_active_record'
gem 'delayed_job_web'
gem 'kaminari', '~> 1.2.1'
@@ -75,11 +74,17 @@ 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 'rack-rewrite'
gem 'rack-ssl', require: 'rack/ssl'
gem 'roadie-rails', '~> 1.3.0'
gem 'roadie-rails', '~> 2.2.0'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'hiredis'
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem 'combine_pdf'
gem 'wicked_pdf'
@@ -92,7 +97,7 @@ gem 'whenever', require: false
gem 'test-unit', '~> 3.4'
gem 'coffee-rails', '~> 4.2.2'
gem 'coffee-rails', '~> 5.0.0'
gem 'compass-rails'
gem 'mini_racer', '0.4.0'
@@ -126,12 +131,11 @@ end
group :test, :development do
# Pretty printed test output
gem 'atomic'
gem 'awesome_print'
gem 'bullet'
gem 'capybara'
gem 'database_cleaner', require: false
gem "factory_bot_rails", '6.1.0', require: false
gem "factory_bot_rails", '6.2.0', require: false
gem 'fuubar', '~> 2.5.1'
gem 'json_spec', '~> 1.1.4'
gem 'knapsack'
@@ -152,6 +156,7 @@ group :test do
gem 'test-prof'
gem 'webmock'
gem 'rails-controller-testing'
gem 'pdf-reader'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
end
@@ -168,10 +173,5 @@ group :development do
gem "view_component_storybook", require: "view_component/storybook/engine"
# 1.0.9 fixed openssl issues on macOS https://github.com/eventmachine/eventmachine/issues/602
# While we don't require this gem directly, no dependents forced the upgrade to a version
# greater than 1.0.9, so we just required the latest available version here.
gem 'eventmachine', '>= 1.2.3'
gem 'rack-mini-profiler', '< 3.0.0'
end

View File

@@ -47,58 +47,63 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.7.2)
actionpack (= 5.0.7.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
Ascii85 (1.1.0)
actioncable (5.2.6)
actionpack (= 5.2.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.7.2)
actionview (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-action_caching (1.2.1)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actionview (5.0.7.2)
activesupport (= 5.0.7.2)
actionview (5.2.6)
activesupport (= 5.2.6)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (5.0.7.2)
activesupport (= 5.0.7.2)
activejob (5.2.6)
activesupport (= 5.2.6)
globalid (>= 0.3.6)
activemerchant (1.119.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activerecord-import (1.0.8)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activerecord-import (1.1.0)
activerecord (>= 3.2)
activerecord-postgresql-adapter (0.0.1)
pg
activerecord-session_store (1.1.3)
actionpack (>= 4.0)
activerecord (>= 4.0)
activerecord-session_store (2.0.0)
actionpack (>= 5.2.4.1)
activerecord (>= 5.2.4.1)
multi_json (~> 1.11, >= 1.11.2)
rack (>= 1.5.2, < 3)
railties (>= 4.0)
activesupport (5.0.7.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
marcel (~> 1.0.0)
activesupport (5.2.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@@ -109,6 +114,7 @@ GEM
activerecord (>= 4.2)
addressable (2.7.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)
@@ -118,9 +124,8 @@ GEM
railties (>= 3, < 7)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.5.5)
arel (7.1.4)
arel (9.0.0)
ast (2.4.2)
atomic (1.1.101)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
awesome_print (1.9.2)
@@ -155,9 +160,9 @@ GEM
codecov (0.5.2)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
coffee-rails (4.2.2)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
@@ -181,15 +186,16 @@ GEM
sass-rails (< 5.1)
sprockets (< 4.0)
concurrent-ruby (1.1.8)
connection_pool (2.2.5)
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.7.1)
css_parser (1.9.0)
addressable
daemons (1.3.1)
daemons (1.4.0)
dalli (2.7.11)
database_cleaner (1.99.0)
ddtrace (0.48.0)
ddtrace (0.49.0)
ffi (~> 1.0)
msgpack
debugger-linecache (1.2.0)
@@ -198,12 +204,7 @@ GEM
delayed_job_active_record (4.1.6)
activerecord (>= 3.0, < 6.2)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.4.4)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
rack-protection (>= 1.5.5)
sinatra (>= 1.4.4)
devise (4.7.3)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@@ -215,15 +216,16 @@ GEM
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
docile (1.3.5)
e2mmap (0.1.0)
erubi (1.10.0)
erubis (2.7.0)
eventmachine (1.2.7)
et-orbi (1.2.4)
tzinfo
excon (0.79.0)
execjs (2.7.0)
factory_bot (6.1.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (1.3.0)
faraday-net_http (~> 1.0)
@@ -265,6 +267,9 @@ GEM
foundation-rails (5.5.2.1)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
fugit (1.4.5)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
@@ -281,10 +286,12 @@ GEM
temple (>= 0.8.0)
tilt
hashdiff (1.0.1)
hashery (2.1.2)
highline (2.0.3)
hiredis (0.6.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
i18n-js (3.8.2)
i18n-js (3.8.3)
i18n (>= 0.6.6)
immigrant (0.3.6)
activerecord (>= 3.0)
@@ -302,7 +309,7 @@ GEM
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jwt (2.2.2)
jwt (2.2.3)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
@@ -323,17 +330,21 @@ GEM
letter_opener (1.7.0)
launchy (~> 2.2)
libv8-node (15.14.0.0)
loofah (2.9.0)
loofah (2.9.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_mime (1.1.0)
mini_portile2 (2.5.1)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.14.4)
@@ -345,10 +356,8 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.2)
nokogiri (1.11.2)
nio4r (2.5.7)
nokogiri (1.11.4)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oauth2 (1.4.7)
@@ -370,16 +379,20 @@ GEM
parallel (1.20.1)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.0.1.0)
parser (3.0.1.1)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pg (0.21.0)
polyamorous (2.3.0)
activerecord (>= 5.0)
pdf-reader (2.4.2)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
pg (1.2.3)
power_assert (2.0.0)
pry (0.13.1)
coderay (~> 1.1)
@@ -388,6 +401,7 @@ GEM
byebug (~> 11.0)
pry (~> 0.13.0)
public_suffix (4.0.6)
raabro (1.4.0)
racc (1.5.2)
rack (2.2.3)
rack-mini-profiler (2.3.2)
@@ -397,19 +411,20 @@ GEM
rack-rewrite (1.5.1)
rack-ssl (1.4.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
actioncable (= 5.0.7.2)
actionmailer (= 5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
activemodel (= 5.0.7.2)
activerecord (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.0.7.2)
railties (= 5.2.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -424,25 +439,24 @@ GEM
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
rails_safe_tasks (1.0.0)
railties (5.0.7.2)
actionpack (= 5.0.7.2)
activesupport (= 5.0.7.2)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.3)
ransack (2.3.0)
actionpack (>= 5.0)
activerecord (>= 5.0)
activesupport (>= 5.0)
ransack (2.4.1)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
i18n
polyamorous (= 2.3.0)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.2.5)
regexp_parser (2.1.1)
request_store (1.5.0)
rack (>= 1.4)
@@ -450,12 +464,12 @@ GEM
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
roadie (3.5.1)
roadie (4.0.0)
css_parser (~> 1.4)
nokogiri (~> 1.8)
roadie-rails (1.3.0)
railties (>= 3.0, < 5.3)
roadie (~> 3.1)
roadie-rails (2.2.0)
railties (>= 5.1, < 6.2)
roadie (>= 3.1, < 5.0)
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
@@ -471,10 +485,10 @@ GEM
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (4.1.2)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-rails (5.0.1)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
@@ -495,25 +509,27 @@ GEM
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (1.13.0)
rubocop (1.15.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.2.0, < 2.0)
rubocop-ast (>= 1.5.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-rails (2.9.1)
rubocop-ast (1.5.0)
parser (>= 3.0.1.1)
rubocop-rails (2.10.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.90.0, < 2.0)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
@@ -529,17 +545,23 @@ GEM
rubyzip (>= 1.2.2)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
sidekiq (6.2.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-scheduler (3.0.1)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
tilt (>= 1.4.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
spring (2.1.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
@@ -551,22 +573,25 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
state_machines (0.5.0)
state_machines-activemodel (0.7.1)
activemodel (>= 4.1)
state_machines-activemodel (0.8.0)
activemodel (>= 5.1)
state_machines (>= 0.5.0)
state_machines-activerecord (0.6.0)
activerecord (>= 4.1)
state_machines-activemodel (>= 0.5.0)
state_machines-activerecord (0.8.0)
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stringex (2.8.5)
stripe (5.30.0)
temple (0.8.2)
test-prof (1.0.2)
test-unit (3.4.1)
test-prof (1.0.5)
test-unit (3.4.2)
power_assert
thor (0.20.3)
thread_safe (0.3.6)
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)
uglifier (4.2.0)
@@ -582,7 +607,7 @@ GEM
get_process_mem (~> 0)
unicorn (>= 4, < 7)
uniform_notifier (1.14.1)
view_component (2.31.1)
view_component (2.32.0)
activesupport (>= 5.0.0, < 7.0)
view_component_storybook (0.8.0)
view_component (>= 2.2)
@@ -592,11 +617,11 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.12.2)
webmock (3.13.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.6.5)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
@@ -625,7 +650,6 @@ DEPENDENCIES
angular_rails_csrf
angularjs-file-upload-rails (~> 2.4.1)
angularjs-rails (= 1.5.5)
atomic
awesome_nested_set
awesome_print
aws-sdk (= 1.67.0)
@@ -636,7 +660,7 @@ DEPENDENCIES
capybara
catalog!
codecov
coffee-rails (~> 4.2.2)
coffee-rails (~> 5.0.0)
combine_pdf
compass-rails
custom_error_message!
@@ -647,13 +671,11 @@ DEPENDENCIES
ddtrace
debugger-linecache
delayed_job_active_record
delayed_job_web
devise
devise-encryptable
devise-token_authenticatable
dfc_provider!
eventmachine (>= 1.2.3)
factory_bot_rails (= 6.1.0)
factory_bot_rails (= 6.2.0)
ffaker
figaro
flipper
@@ -668,8 +690,9 @@ DEPENDENCIES
good_migrations
haml
highline (= 2.0.3)
hiredis
i18n
i18n-js (~> 3.8.2)
i18n-js (~> 3.8.3)
immigrant
jquery-migrate-rails
jquery-rails (= 4.4.0)
@@ -680,6 +703,7 @@ DEPENDENCIES
kaminari (~> 1.2.1)
knapsack
letter_opener (>= 1.4.1)
mimemagic (> 0.3.5)
mini_racer (= 0.4.0)
monetize (~> 1.11)
oauth2 (~> 1.4.7)
@@ -689,20 +713,22 @@ DEPENDENCIES
paperclip (~> 3.4.1)
paranoia (~> 2.4)
paypal-sdk-merchant (= 1.117.2)
pg (~> 0.21.0)
pdf-reader
pg (~> 1.2.3)
pry
pry-byebug
rack-mini-profiler (< 3.0.0)
rack-rewrite
rack-ssl
rails (~> 5.0.0)
rails (~> 5.2)
rails-controller-testing
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (= 2.3.0)
ransack (= 2.4.1)
redcarpet
redis (>= 4.0)
responders
roadie-rails (~> 1.3.0)
roadie-rails (~> 2.2.0)
roo (~> 2.8.3)
rspec-rails (>= 3.5.2)
rspec-retry
@@ -714,6 +740,8 @@ DEPENDENCIES
select2-rails (~> 3.4.7)
selenium-webdriver
shoulda-matchers
sidekiq
sidekiq-scheduler
simplecov
spring
spring-commands-rspec
@@ -736,7 +764,7 @@ DEPENDENCIES
wkhtmltopdf-binary
RUBY VERSION
ruby 2.5.8p224
ruby 2.5.9p229
BUNDLED WITH
1.17.3

View File

@@ -1,6 +1,7 @@
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter) ->
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, unlocalizeCurrencyFilter) ->
class UnitPrices
@displayableUnitPrice: (price, scale, unit_type, unit_value, variant_unit_name) ->
price = unlocalizeCurrencyFilter(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)
@@ -29,4 +30,4 @@ angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, loca
else if unit_type == "weight"
"kg"
else if unit_type == "volume"
"L"
"L"

View File

@@ -0,0 +1,15 @@
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

@@ -3,7 +3,7 @@ Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout,
$scope.removeEnabled = true
$scope.deleteLineItem = (id) ->
if Cart.has_one_line_item()
if Cart.isOnlyItemInOrder(id)
Messages.error(t 'orders_cannot_remove_the_final_item')
$scope.removeEnabled = false
$timeout (->

View File

@@ -115,8 +115,9 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
@line_items = []
localStorageService.clearAll() # One day this will have to be moar GRANULAR
has_one_line_item: =>
@line_items_finalised.length == 1
isOnlyItemInOrder: (id) =>
deletedItem = @line_items_finalised.find((item) -> item.id == id)
@line_items_finalised.filter((item) -> item.order_id == deletedItem.order_id).length == 1
removeFinalisedLineItem: (id) =>
@line_items_finalised = @line_items_finalised.filter (item) ->

View File

@@ -10,7 +10,7 @@ Darkswarm.service "GmapsGeo", ->
# console.log "Error: #{status}"
geocode: (address, callback) ->
geocoder = new google.maps.Geocoder()
geocoder.geocode {'address': address, 'region': "<%= Spree::Country.find_by(id: Spree::Config[:default_country_id]).iso %>"}, callback
geocoder.geocode {'address': address, 'region': "<%= DefaultCountry.code %>"}, callback
distanceBetween: (src, dst) ->
google.maps.geometry.spherical.computeDistanceBetween @toLatLng(src), @toLatLng(dst)
@@ -20,4 +20,4 @@ Darkswarm.service "GmapsGeo", ->
if locatable.lat?
locatable
else
new google.maps.LatLng locatable.latitude, locatable.longitude
new google.maps.LatLng locatable.latitude, locatable.longitude

View File

@@ -35,7 +35,7 @@ module Admin
if @line_item.update(line_item_params)
order.update_line_item_fees! @line_item
order.update_order_fees!
order.update!
order.update_order!
render body: nil, status: :no_content # No Content, does not trigger ng resource auto-update
else
render json: { errors: @line_item.errors }, status: :precondition_failed

View File

@@ -28,9 +28,7 @@ module Admin
def build_resource
enterprise_group = super
enterprise_group.address = Spree::Address.new
enterprise_group.address.country = Spree::Country.find_by(
id: Spree::Config[:default_country_id]
)
enterprise_group.address.country = DefaultCountry.country
enterprise_group
end

View File

@@ -119,7 +119,7 @@ module Admin
def build_resource
enterprise = super
enterprise.address ||= Spree::Address.new
enterprise.address.country ||= Spree::Country.find_by(id: Spree::Config[:default_country_id])
enterprise.address.country ||= DefaultCountry.country
enterprise
end

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
# Base controller for OFN's API
require_dependency 'spree/api/controller_setup'
require "spree/api/controller_setup"
require "spree/core/controller_helpers/ssl"
module Api

View File

@@ -44,9 +44,9 @@ module Api
authorize! :update, @enterprise
if params[:logo] && @enterprise.update( logo: params[:logo] )
render plain: @enterprise.logo.url(:medium), status: :ok
render html: @enterprise.logo.url(:medium), status: :ok
elsif params[:promo] && @enterprise.update( promo_image: params[:promo] )
render plain: @enterprise.promo_image.url(:medium), status: :ok
render html: @enterprise.promo_image.url(:medium), status: :ok
else
invalid_resource!(@enterprise)
end

View File

@@ -16,7 +16,7 @@ module Api
quantity = params[:quantity].to_i
@shipment = get_or_create_shipment(params[:stock_location_id])
@order.contents.add(variant, quantity, nil, @shipment)
@order.contents.add(variant, quantity, @shipment)
@shipment.refresh_rates
@shipment.save!
@@ -31,10 +31,12 @@ module Api
unlock = params[:shipment].delete(:unlock)
if unlock == 'yes'
@shipment.fee_adjustment.open
@shipment.fee_adjustment.fire_events(:open)
end
@shipment.update(shipment_params[:shipment])
if @shipment.update(shipment_params)
@order.updater.update_totals_and_states
end
if unlock == 'yes'
@shipment.fee_adjustment.close
@@ -68,7 +70,7 @@ module Api
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@order.contents.add(variant, quantity, nil, @shipment)
@order.contents.add(variant, quantity, @shipment)
@order.recreate_all_fees!
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
@@ -94,7 +96,7 @@ module Api
def find_and_update_shipment
@shipment = @order.shipments.find_by!(number: params[:id])
@shipment.update(shipment_params[:shipment]) if shipment_params[:shipment].present?
@shipment.update(shipment_params)
@shipment.reload
end
@@ -113,10 +115,9 @@ module Api
end
def shipment_params
params.permit(
[:id, :order_id, :variant_id, :quantity,
{ shipment: [:tracking, :selected_shipping_rate_id] }]
)
return {} unless params.has_key? :shipment
params.require(:shipment).permit(:tracking, :selected_shipping_rate_id)
end
end
end

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
require_dependency 'spree/authentication_helpers'
require "spree/authentication_helpers"
require "application_responder"
require 'cancan'
require 'spree/core/controller_helpers/auth'
@@ -13,6 +13,20 @@ class ApplicationController < ActionController::Base
self.responder = ApplicationResponder
respond_to :html
helper 'spree/base'
helper 'spree/orders'
helper 'spree/payment_methods'
helper 'shared'
helper 'enterprises'
helper 'order_cycles'
helper 'order'
helper 'shop'
helper 'injection'
helper 'markdown'
helper 'footer_links'
helper 'discourse'
helper 'checkout'
protect_from_forgery
include Spree::Core::ControllerHelpers::Auth

View File

@@ -13,8 +13,6 @@ class BaseController < ApplicationController
include I18nHelper
include OrderCyclesHelper
helper 'spree/base'
before_action :set_locale
before_action :check_order_cycle_expiry

View File

@@ -55,7 +55,7 @@ class CheckoutController < ::BaseController
flash[:error] = I18n.t("checkout.failed")
action_failed(e)
ensure
@order.update!
@order.update_order!
end
# Clears the cached order. Required for #current_order to return a new order

View File

@@ -43,7 +43,7 @@ class LineItemsController < BaseController
order.update_shipping_fees!
order.update_payment_fees!
order.update_order_fees!
order.update!
order.update_order!
order.create_tax_charge!
end
end

View File

@@ -2,9 +2,12 @@ require 'open_food_network/spree_api_key_loader'
class RegistrationController < BaseController
include OpenFoodNetwork::SpreeApiKeyLoader
layout 'registration'
helper 'map'
before_action :load_spree_api_key, only: [:index]
before_action :check_user, except: :authenticate
layout 'registration'
def index
@enterprise_attributes = { sells: 'none' }

View File

@@ -14,7 +14,7 @@ module Spree
def update_order
@order.reload
@order.update!
@order.update_order!
end
def collection

View File

@@ -3,7 +3,15 @@ module Spree
class BaseController < ApplicationController
ssl_required
helper 'shared'
helper 'spree/admin/navigation'
helper 'spree/admin/orders'
helper 'admin/injection'
helper 'admin/orders'
helper 'admin/enterprises'
helper 'enterprise_fees'
helper 'angular_form'
layout '/spree/layouts/admin'
include I18nHelper

View File

@@ -68,20 +68,20 @@ module Spree
rescue Spree::Core::GatewayError => e
flash[:error] = e.message.to_s
ensure
redirect_to :back
redirect_back fallback_location: spree.admin_dashboard_path
end
def resend
Spree::OrderMailer.confirm_email_for_customer(@order.id, true).deliver_later
flash[:success] = t('admin.orders.order_email_resent')
respond_with(@order) { |format| format.html { redirect_to :back } }
respond_with(@order) do |format|
format.html { redirect_back(fallback_location: spree.admin_dashboard_path) }
end
end
def invoice
pdf = InvoiceRenderer.new.render_to_string(@order)
Spree::OrderMailer.invoice_email(@order.id, pdf).deliver_later
Spree::OrderMailer.invoice_email(@order.id).deliver_later
flash[:success] = t('admin.orders.invoice_email_sent')
respond_with(@order) { |format|

View File

@@ -9,6 +9,10 @@ module Spree
before_action :load_payment, only: [:fire, :show]
before_action :load_data
before_action :can_transition_to_payment
# We ensure that items are in stock before all screens if the order is in the Payment state.
# This way, we don't allow someone to enter credit card details for an order only to be told
# that it can't be processed.
before_action :ensure_sufficient_stock_lines
respond_to :html
@@ -142,6 +146,20 @@ module Spree
redirect_to spree.edit_admin_order_customer_url(@order)
end
def ensure_sufficient_stock_lines
return if !@order.payment? || @order.insufficient_stock_lines.blank?
flash[:error] = I18n.t("spree.orders.line_item.insufficient_stock",
on_hand: "0 #{out_of_stock_item_names}")
redirect_to spree.edit_admin_order_url(@order)
end
def out_of_stock_item_names
@order.insufficient_stock_lines.map do |line_item|
line_item.variant.name
end.join(", ")
end
def load_order
@order = Order.find_by!(number: params[:order_id])
authorize! action, @order

View File

@@ -8,7 +8,7 @@ module Spree
def fire
@return_authorization.public_send("#{params[:e]}!")
flash[:success] = Spree.t(:return_authorization_updated)
redirect_to :back
redirect_back fallback_location: spree.admin_dashboard_path
end
protected

View File

@@ -14,7 +14,7 @@ module Spree
respond_to :html
respond_to :json
before_action :update_distribution, only: :update
before_action :set_current_order, only: :update
before_action :filter_order_params, only: :update
before_action :enable_embedded_shopfront
@@ -26,8 +26,8 @@ module Spree
def show
@order = Spree::Order.find_by!(number: params[:id])
ProcessPaymentIntent.new(params["payment_intent"], @order).call!
@order.reload
handle_stripe_response
end
def empty
@@ -62,7 +62,7 @@ module Spree
associate_user
if @order.insufficient_stock_lines.present? || @unavailable_order_variants.present?
flash[:error] = t("spree.orders.error_flash_for_unavailable_items")
flash.now[:error] = t("spree.orders.error_flash_for_unavailable_items")
end
end
end
@@ -95,7 +95,7 @@ module Spree
@order.next_transition.run_callbacks if @order.cart?
redirect_to main_app.checkout_state_path(@order.checkout_steps.first)
elsif @order.complete?
redirect_to order_path(@order)
redirect_to main_app.order_path(@order)
else
redirect_to main_app.cart_path
end
@@ -109,24 +109,8 @@ module Spree
end
end
def update_distribution
def set_current_order
@order = current_order(true)
if params[:commit] == 'Choose Hub'
distributor = Enterprise.is_distributor.find params[:order][:distributor_id]
@order.set_distributor! distributor
flash[:notice] = I18n.t(:order_choosing_hub_notice)
redirect_to request.referer
elsif params[:commit] == 'Choose Order Cycle'
@order.empty! # empty cart
order_cycle = OrderCycle.active.find params[:order][:order_cycle_id]
@order.set_order_cycle! order_cycle
flash[:notice] = I18n.t(:order_choosing_hub_notice)
redirect_to request.referer
end
end
def filter_order_params
@@ -151,11 +135,24 @@ module Spree
else
flash[:error] = I18n.t(:orders_could_not_cancel)
end
redirect_to request.referer || order_path(@order)
redirect_to request.referer || main_app.order_path(@order)
end
private
# Stripe can redirect here after a payment is processed in the backoffice.
# We verify if it was successful here and persist the changes.
def handle_stripe_response
return unless params.key?("payment_intent")
result = ProcessPaymentIntent.new(params["payment_intent"], @order).call!
unless result.ok?
flash.now[:error] = "#{I18n.t("payment_could_not_process")}. #{result.error}"
end
@order.reload
end
def discard_empty_line_items
@order.line_items = @order.line_items.select { |li| li.quantity > 0 }
end
@@ -191,7 +188,7 @@ module Spree
if items.empty?
flash[:error] = I18n.t(:orders_cannot_remove_the_final_item)
redirect_to order_path(order_to_update)
redirect_to main_app.order_path(order_to_update)
end
end

View File

@@ -14,7 +14,7 @@ module Spree
def show
@payments_requiring_action = PaymentsRequiringAction.new(spree_current_user).query
@orders = orders_collection
@orders = orders_collection.includes(:line_items)
customers = spree_current_user.customers
@shops = Enterprise

View File

@@ -1,11 +0,0 @@
module Spree
module Admin
module PaymentsHelper
def payment_method_name(payment)
# hack to allow us to retrieve the name of a "deleted" payment method
id = payment.payment_method_id
Spree::PaymentMethod.find_with_destroyed(id).name
end
end
end
end

View File

@@ -0,0 +1,13 @@
module Spree
module PaymentMethodsHelper
def payment_method(payment)
# hack to allow us to retrieve the name of a "deleted" payment method
id = payment.payment_method_id
Spree::PaymentMethod.find_with_destroyed(id)
end
def payment_method_name(payment)
payment_method(payment).name
end
end
end

View File

@@ -90,13 +90,13 @@ class SubscriptionConfirmJob < ActiveJob::Base
end
def send_confirmation_email(order)
order.update!
order.update_order!
record_success(order)
SubscriptionMailer.confirmation_email(order).deliver_now
end
def send_failed_payment_email(order, error_message = nil)
order.update!
order.update_order!
record_and_log_error(:failed_payment, order, error_message)
SubscriptionMailer.failed_payment_email(order).deliver_now
rescue StandardError => e

View File

@@ -77,7 +77,7 @@ class SubscriptionPlacementJob < ActiveJob::Base
def handle_empty_order(order, changes)
order.reload.all_adjustments.destroy_all
order.update!
order.update_order!
send_empty_email(order, changes)
end

View File

@@ -4,7 +4,7 @@ module Spree
class OrderMailer < BaseMailer
helper 'checkout'
helper SpreeCurrencyHelper
helper Spree::Admin::PaymentsHelper
helper Spree::PaymentMethodsHelper
helper OrderHelper
helper MailerHelper
include I18nHelper
@@ -49,8 +49,10 @@ module Spree
end
end
def invoice_email(order_or_order_id, pdf)
def invoice_email(order_or_order_id)
@order = find_order(order_or_order_id)
pdf = InvoiceRenderer.new.render_to_string(@order)
attach_file("invoice-#{@order.number}.pdf", pdf)
I18n.with_locale valid_locale(@order.user) do
mail(to: @order.email,

View File

@@ -3,7 +3,7 @@ class SubscriptionMailer < Spree::BaseMailer
helper MailerHelper
helper ShopMailHelper
helper OrderHelper
helper Spree::Admin::PaymentsHelper
helper Spree::PaymentMethodsHelper
include I18nHelper
def confirmation_email(order)

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
require 'open_food_network/enterprise_fee_calculator'
module Calculator

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
require 'spree/localized_number'
module Calculator

View File

@@ -1,4 +1,3 @@
require_dependency 'spree/calculator'
require 'spree/localized_number'
class Calculator::FlatPercentPerItem < Spree::Calculator

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
require 'spree/localized_number'
module Calculator

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
require 'spree/localized_number'
module Calculator

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
require 'spree/localized_number'
module Calculator

View File

@@ -1,6 +1,5 @@
# frozen_string_literal: false
require_dependency 'spree/calculator'
# For #to_d method on Ruby 1.8
require 'bigdecimal/util'
require 'spree/localized_number'

View File

@@ -105,7 +105,7 @@ class Enterprise < ApplicationRecord
after_touch :touch_distributors
after_create :set_default_contact
after_create :relate_to_owners_enterprises
after_create :send_welcome_email
after_create_commit :send_welcome_email
after_rollback :restore_permalink

View File

@@ -24,7 +24,7 @@ module Spree
def self.default
country = begin
Spree::Country.find(Spree::Config[:default_country_id])
DefaultCountry.country
rescue StandardError
Spree::Country.first
end

View File

@@ -96,7 +96,7 @@ module Spree
# more than on line items at once via accepted_nested_attributes the order
# object on the association would be in a old state and therefore the
# adjustment calculations would not performed on proper values
def update!(calculable = nil, force: false)
def update_adjustment!(calculable = nil, force: false)
return amount if immutable? && !force
if originator.present?
@@ -127,11 +127,7 @@ module Spree
end
def set_absolute_included_tax!(tax)
# This rubocop issue can now fixed by renaming Adjustment#update! to something else,
# then AR's update! can be used instead of update_attributes!
# rubocop:disable Rails/ActiveRecordAliases
update_attributes! included_tax: tax.round(2)
# rubocop:enable Rails/ActiveRecordAliases
update! included_tax: tax.round(2)
end
def display_included_tax

View File

@@ -147,7 +147,7 @@ module Spree
end
def default_card_needs_updating?
is_default_changed? || gateway_customer_profile_id_changed?
saved_change_to_is_default? || saved_change_to_gateway_customer_profile_id?
end
def ensure_single_default_card

View File

@@ -87,7 +87,7 @@ module Spree
)
refund_transaction_response = provider.refund_transaction(refund_transaction)
if refund_transaction_response.success?
payment.source.update_attributes(
payment.source.update(
refunded_at: Time.now,
refund_transaction_id: refund_transaction_response.RefundTransactionID,
state: "refunded",

View File

@@ -129,7 +129,19 @@ module Spree
payment = fetch_payment(creditcard, gateway_options)
raise Stripe::StripeError, I18n.t(:no_pending_payments) unless payment&.response_code
Stripe::PaymentIntentValidator.new.call(payment.response_code, stripe_account_id)
payment_intent_response = Stripe::PaymentIntentValidator.new.
call(payment.response_code, stripe_account_id)
raise_if_not_in_capture_state(payment_intent_response)
payment.response_code
end
def raise_if_not_in_capture_state(payment_intent_response)
state = payment_intent_response.status
return if state == 'requires_capture'
raise Stripe::StripeError, I18n.t(:invalid_payment_state, state: state)
end
def fetch_payment(creditcard, gateway_options)

View File

@@ -66,7 +66,7 @@ module Spree
end
def update_order
order.update!
order.update_order!
end
end
end

View File

@@ -17,9 +17,9 @@ module Spree
end
def update_adjustments
adjustment_total = adjustments.additional.map(&:update!).compact.sum
included_tax_total = tax_adjustments.inclusive.reload.map(&:update!).compact.sum
additional_tax_total = tax_adjustments.additional.reload.map(&:update!).compact.sum
adjustment_total = adjustments.additional.map(&:update_adjustment!).compact.sum
included_tax_total = tax_adjustments.inclusive.reload.map(&:update_adjustment!).compact.sum
additional_tax_total = tax_adjustments.additional.reload.map(&:update_adjustment!).compact.sum
item.update_columns(
included_tax_total: included_tax_total,

View File

@@ -226,11 +226,11 @@ module Spree
end
def update_order
return unless changed? || destroyed?
return unless saved_changes.present? || destroyed?
# update the order totals, etc.
order.create_tax_charge!
order.update!
order.update_order!
end
def update_inventory_before_destroy

View File

@@ -2,9 +2,9 @@
module Spree
class OptionType < ApplicationRecord
has_many :products, through: :product_option_types
has_many :option_values, -> { order(:position) }, dependent: :destroy
has_many :product_option_types, dependent: :destroy
has_many :products, through: :product_option_types
validates :name, :presentation, presence: true
default_scope -> { order("#{table_name}.position") }

View File

@@ -212,7 +212,7 @@ module Spree
@updater ||= OrderManagement::Order::Updater.new(self)
end
def update!
def update_order!
updater.update
end
@@ -748,8 +748,8 @@ module Spree
def update_adjustment!(adjustment)
return if adjustment.finalized?
adjustment.update!(force: true)
update!
adjustment.update_adjustment!(force: true)
update_order!
end
# object_params sets the payment amount to the order total, but it does this

View File

@@ -2,7 +2,7 @@
module Spree
class OrderContents
attr_accessor :order, :currency
attr_accessor :order
def initialize(order)
@order = order
@@ -10,9 +10,9 @@ module Spree
# Get current line item for variant if exists
# Add variant qty to line_item
def add(variant, quantity = 1, currency = nil, shipment = nil)
def add(variant, quantity = 1, shipment = nil)
line_item = order.find_line_item_by_variant(variant)
add_to_line_item(line_item, variant, quantity, currency, shipment)
add_to_line_item(line_item, variant, quantity, shipment)
end
# Get current line item for variant
@@ -29,20 +29,14 @@ module Spree
private
def add_to_line_item(line_item, variant, quantity, currency = nil, shipment = nil)
def add_to_line_item(line_item, variant, quantity, shipment = nil)
if line_item
line_item.target_shipment = shipment
line_item.quantity += quantity.to_i
line_item.currency = currency unless currency.nil?
else
line_item = order.line_items.new(quantity: quantity, variant: variant)
line_item.target_shipment = shipment
if currency
line_item.currency = currency unless currency.nil?
line_item.price = variant.price_in(currency).amount
else
line_item.price = variant.price
end
line_item.price = variant.price
end
line_item.save

View File

@@ -50,6 +50,7 @@ module Spree
scope :failed, -> { with_state('failed') }
scope :valid, -> { where('state NOT IN (?)', %w(failed invalid)) }
scope :authorization_action_required, -> { where.not(cvv_response_message: nil) }
scope :with_payment_intent, ->(code) { where(response_code: code) }
# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details)
state_machine initial: :checkout do
@@ -144,6 +145,10 @@ module Spree
I18n.t('payment_method_fee')
end
def mark_as_processed
update_attribute(:cvv_response_message, nil)
end
private
# Don't charge fees for invalid or failed payments.
@@ -201,7 +206,7 @@ module Spree
end
def update_order
order.reload.update!
OrderManagement::Order::Updater.new(order).after_payment_update(self)
end
# Necessary because some payment gateways will refuse payments with

View File

@@ -266,13 +266,6 @@ module Spree
duplicator.duplicate
end
# use deleted? rather than checking the attribute directly. this
# allows extensions to override deleted? if they want to provide
# their own definition.
def deleted?
!!deleted_at
end
# split variants list into hash which shows mapping of opt value onto matching variants
# eg categorise_variants_from_option(color) => {"red" -> [...], "blue" -> [...]}
def categorise_variants_from_option(opt_type)
@@ -433,7 +426,7 @@ module Spree
end
def update_units
return unless variant_unit_changed?
return unless saved_change_to_variant_unit?
option_types.delete self.class.all_variant_unit_option_types
option_types << variant_unit_option_type if variant_unit.present?
@@ -449,9 +442,9 @@ module Spree
end
def remove_previous_primary_taxon_from_taxons
return unless primary_taxon_id_changed? && primary_taxon_id_was
return unless saved_change_to_primary_taxon_id? && primary_taxon_id_before_last_save
taxons.destroy(primary_taxon_id_was)
taxons.destroy(primary_taxon_id_before_last_save)
end
def ensure_standard_variant
@@ -465,7 +458,7 @@ module Spree
# Spree creates a permalink already but our implementation fixes an edge case.
def sanitize_permalink
return unless permalink.blank? || permalink_changed?
return unless permalink.blank? || saved_change_to_permalink? || permalink_changed?
requested = permalink.presence || permalink_was.presence || name.presence || 'product'
self.permalink = create_unique_permalink(requested.parameterize)

View File

@@ -66,7 +66,7 @@ module Spree
order.shipped_shipments.collect{ |s| s.inventory_units.to_a }.flatten
end
# Used when Adjustment#update! wants to update the related adjustment
# Used when Adjustment#update_adjustment! wants to update the related adjustment
def compute_amount(*_args)
-amount.abs
end
@@ -105,7 +105,7 @@ module Spree
)
order.return if inventory_units.all?(&:returned?)
order.update!
order.update_order!
end
def allow_receive?

View File

@@ -50,7 +50,7 @@ module Spree
category = TaxCategory.includes(:tax_rates).find_by(is_default: true)
return 0 unless category
address ||= Address.new(country_id: Spree::Config[:default_country_id])
address ||= Address.new(country_id: DefaultCountry.id)
rate = category.tax_rates.detect { |tax_rate| tax_rate.zone.include? address }.try(:amount)
rate || 0

View File

@@ -166,13 +166,6 @@ module Spree
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle).fees_by_type_for self
end
# use deleted? rather than checking the attribute directly. this
# allows extensions to override deleted? if they want to provide
# their own definition.
def deleted?
deleted_at
end
def option_value(opt_name)
option_values.detect { |o| o.option_type.name == opt_name }.try(:presentation)
end

View File

@@ -1,5 +1,5 @@
class Api::LineItemSerializer < ActiveModel::Serializer
attributes :id, :quantity, :max_quantity, :price
attributes :id, :quantity, :max_quantity, :price, :order_id
has_one :variant, serializer: Api::VariantSerializer
end

View File

@@ -22,7 +22,7 @@ module Api
end
def item_count
object.line_items.sum(:quantity)
object.line_items.sum(&:quantity)
end
def completed_at

View File

@@ -0,0 +1,13 @@
class DefaultCountry
def self.id
country.id
end
def self.code
country.iso
end
def self.country
Spree::Country.find_by(iso: ENV["DEFAULT_COUNTRY_CODE"]) || Spree::Country.first
end
end

View File

@@ -2,9 +2,8 @@
# by setting entries on the Spree Config
# and initializing Spree:MailSettings that uses the Spree::Config.
class MailConfiguration
# @param entries [Hash] Spree Config entries
def self.entries=(entries)
entries.each do |name, value|
def self.apply!
configuration.each do |name, value|
Spree::Config[name] = value
end
apply_mail_settings
@@ -12,6 +11,21 @@ class MailConfiguration
private
def self.configuration
{
mail_host: ENV.fetch('MAIL_HOST'),
mail_domain: ENV.fetch('MAIL_DOMAIN'),
mail_port: ENV.fetch('MAIL_PORT'),
mail_auth_type: ENV.fetch('MAIL_AUTH_TYPE', 'login'),
smtp_username: ENV.fetch('SMTP_USERNAME'),
smtp_password: ENV.fetch('SMTP_PASSWORD'),
secure_connection_type: ENV.fetch('MAIL_SECURE_CONNECTION', 'None'),
mails_from: ENV.fetch('MAILS_FROM', "no-reply@#{ENV.fetch('MAIL_DOMAIN')}"),
mail_bcc: ENV.fetch('MAIL_BCC', ''),
intercept_email: ''
}
end
def self.apply_mail_settings
Spree::Core::MailSettings.init
end

View File

@@ -13,7 +13,7 @@ class OrderCheckoutRestart
clear_shipments
clear_payments
order.reload.update!
order.reload.update_order!
end
private

View File

@@ -24,7 +24,7 @@ class OrderFeesHandler
order.updater.persist_totals
end
order.update!
order.update_order!
end
def create_line_item_fees!
@@ -43,13 +43,13 @@ class OrderFeesHandler
def update_line_item_fees!(line_item)
line_item.adjustments.enterprise_fee.each do |fee|
fee.update!(line_item, force: true)
fee.update_adjustment!(line_item, force: true)
end
end
def update_order_fees!
order.adjustments.enterprise_fee.where(adjustable_type: 'Spree::Order').each do |fee|
fee.update!(order, force: true)
fee.update_adjustment!(order, force: true)
end
end

View File

@@ -44,7 +44,7 @@ module Permissions
def filtered_orders(orders)
return orders unless filter_orders?
orders.complete.not_state(:canceled).search(search_params).result
orders.complete.not_state(:canceled).ransack(search_params).result
end
def filter_orders?

View File

@@ -35,23 +35,8 @@ module PermittedAttributes
:tag_list,
tags: [:text],
enterprise_fee_ids: [],
variants: permitted_variant_ids
variants: {}
]
end
# In rails 5 we will be able to permit random hash keys simply with :variants => {}
# See https://github.com/rails/rails/commit/e86524c0c5a26ceec92895c830d1355ae47a7034
#
# Until then, we need to create an array of variant IDs in order to permit them
def permitted_variant_ids
variant_ids(@params[:order_cycle][:incoming_exchanges]) +
variant_ids(@params[:order_cycle][:outgoing_exchanges])
end
def variant_ids(exchange_params)
return [] unless exchange_params
exchange_params.map { |exchange| exchange[:variants].map { |key, _value| key } }.flatten
end
end
end

View File

@@ -3,39 +3,82 @@
# When directing a customer to Stripe to authorize the payment, we specify a
# redirect_url that Stripe should return them to. When checking out, it's
# /checkout; for admin payments and subscription payemnts it's the order url.
#
# This class confirms that the payment intent matches what's in our database,
# marks the payment as complete, and removes the cvv_response_message field,
# which we use to indicate that authorization is required. It also completes the
# Order, if appropriate.
class ProcessPaymentIntent
class Result
attr_reader :error
def initialize(ok:, error: "")
@ok = ok
@error = error
end
def ok?
@ok
end
end
def initialize(payment_intent, order)
@payment_intent = payment_intent
@order = order
@last_payment = OrderPaymentFinder.new(order).last_payment
@payment = order.payments.pending.with_payment_intent(payment_intent).first
end
def call!
return unless valid?
return Result.new(ok: false) unless payment.present? && ready_for_capture?
return Result.new(ok: true) if already_processed?
last_payment.update_attribute(:cvv_response_message, nil)
OrderWorkflow.new(@order).next
last_payment.complete! if last_payment.can_complete?
process_payment
if payment.reload.completed?
payment.mark_as_processed
Result.new(ok: true)
else
Result.new(ok: false, error: I18n.t("payment_could_not_complete"))
end
rescue Stripe::StripeError => e
Result.new(ok: false, error: e.message)
end
private
attr_reader :order, :payment_intent, :last_payment
attr_reader :order, :payment_intent, :payment
def valid?
order.present? && valid_intent_string? && matches_last_payment?
def process_payment
if order.state == "payment"
# Moves the order to completed, which calls #process_payments!
OrderWorkflow.new(order).next
else
order.process_payments!
end
end
def valid_intent_string?
payment_intent&.starts_with?("pi_")
def ready_for_capture?
payment_intent_status == 'requires_capture'
end
def matches_last_payment?
last_payment&.state == "pending" && last_payment&.response_code == payment_intent
def already_processed?
payment_intent_status == 'succeeded'
end
def payment_intent_status
@payment_intent_status ||= Stripe::PaymentIntentValidator.new.
call(payment_intent, stripe_account_id).
status
end
def stripe_account_id
StripeAccount.find_by(enterprise_id: preferred_enterprise_id).stripe_user_id
end
def preferred_enterprise_id
payment.payment_method.preferred_enterprise_id
end
end

View File

@@ -10,7 +10,7 @@
= "admin.enterprises"
= admin_inject_available_countries(module: 'admin.enterprises')
= admin_inject_json "admin.enterprises", "defaultCountryID", Spree::Config[:default_country_id]
= admin_inject_json "admin.enterprises", "defaultCountryID", DefaultCountry.id
-# Form

View File

@@ -38,7 +38,7 @@
= validated_input t(:postcode), "order.bill_address.zipcode"
.small-6.columns.right
= validated_select t(:country), "order.bill_address.country_id", {}, {"ng-init" => "order.bill_address.country_id = order.bill_address.country_id || #{Spree::Config[:default_country_id]}", "ng-options" => "c.id as c.name for c in countries"}
= validated_select t(:country), "order.bill_address.country_id", {}, {"ng-init" => "order.bill_address.country_id = order.bill_address.country_id || #{DefaultCountry.id}", "ng-options" => "c.id as c.name for c in countries"}
.row
.small-12.columns.text-right

View File

@@ -22,7 +22,7 @@
.small-6.columns
= validated_input t(:postcode), "order.ship_address.zipcode"
.small-6.columns.right
= validated_select t(:country), "order.ship_address.country_id", {}, {"ng-init" => "order.ship_address.country_id = order.ship_address.country_id || #{Spree::Config[:default_country_id]}", "ng-options" => "c.id as c.name for c in countries"}
= validated_select t(:country), "order.ship_address.country_id", {}, {"ng-init" => "order.ship_address.country_id = order.ship_address.country_id || #{DefaultCountry.id}", "ng-options" => "c.id as c.name for c in countries"}
.row
.small-6.columns
= validated_input t(:phone), "order.ship_address.phone"

View File

@@ -53,7 +53,7 @@
.small-12.medium-8.large-8.columns
.field
%label{ for: 'enterprise_country' }= t(".country_field")
%select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{Spree::Config[:default_country_id]})", model: 'enterprise.country', options: 'c as c.name for c in countries' } }
%select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{DefaultCountry.id})", model: 'enterprise.country', options: 'c as c.name for c in countries' } }
%span.error{ ng: { show: "details.country.$error.required && submitted" } }
= t(".country_field_error")

View File

@@ -1,5 +1,5 @@
- if Rails.env.test?
%script{type: "text/javascript"}
= render file: "spec/support/fixtures/stripejs-mock.js"
= raw render file: "spec/support/fixtures/stripejs-mock.js"
- else
%script{src: "https://js.stripe.com/v3/", type: "text/javascript"}

View File

@@ -26,4 +26,4 @@
var shipments = [];
- @order.shipments.each do |shipment|
shipments.push(#{shipment.to_json(:root => false, :include => [:inventory_units, :stock_location]).html_safe});
= render :partial => 'spree/admin/shared/update_order_state', :handlers => [:erb]
= render :partial => 'spree/admin/shared/update_order_state', :handlers => [:erb], :formats => [:js]

View File

@@ -25,8 +25,7 @@
%span.centered.three.columns
= t "spree_admin_enterprises_fees"
%div.sixteen.columns.alpha.list
- @enterprises.each do |enterprise|
= render 'enterprise_row', { enterprise: enterprise }
= render partial: 'enterprise_row', collection: @enterprises, as: :enterprise
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
= t "spree_admin_overview_enterprises_footer"

View File

@@ -11,8 +11,8 @@
= configurations_sidebar_menu_item Spree.t(:tax_settings), edit_admin_tax_settings_path
= configurations_sidebar_menu_item Spree.t(:zones), admin_zones_path
= configurations_sidebar_menu_item Spree.t(:countries), admin_countries_path
- if Spree::Config[:default_country_id]
= configurations_sidebar_menu_item Spree.t(:states), admin_country_states_path(Spree::Config[:default_country_id])
- if DefaultCountry.id
= configurations_sidebar_menu_item Spree.t(:states), admin_country_states_path(DefaultCountry.id)
= configurations_sidebar_menu_item Spree.t(:payment_methods), admin_payment_methods_path
= configurations_sidebar_menu_item Spree.t(:taxonomies), admin_taxonomies_path
= configurations_sidebar_menu_item Spree.t(:shipping_methods), admin_shipping_methods_path

View File

@@ -17,8 +17,7 @@
%th.cart-item-delete-header
%tbody#line_items{"data-hook" => ""}
= order_form.fields_for :line_items do |item_form|
= render :partial => 'line_item', :locals => { :variant => item_form.object.variant, :line_item => item_form.object, :item_form => item_form }
= render partial: 'line_item', collection: order_form.object.line_items, locals: {order_form: order_form}
= render 'bought' if show_bought_items? && @order.cart?

View File

@@ -1,37 +1,39 @@
%tr.line-item{class: "variant-#{variant.id}"}
%td.cart-item-description{'data-hook' => "cart_item_description"}
- variant = line_item.variant
= order_form.fields_for :line_items, line_item do |item_form|
%tr.line-item{class: "variant-#{variant.id}"}
%td.cart-item-description{'data-hook' => "cart_item_description"}
%div.item-thumb-image{"data-hook" => "cart_item_image"}
= render 'spree/shared/variant_thumbnail', variant: variant
%div.item-thumb-image{"data-hook" => "cart_item_image"}
= render 'spree/shared/variant_thumbnail', variant: variant
= render 'spree/shared/line_item_name', line_item: line_item
= render 'spree/shared/line_item_name', line_item: line_item
- if @insufficient_stock_lines.andand.include? line_item
%span.out-of-stock
= variant.in_stock? ? t(".insufficient_stock", :on_hand => variant.on_hand) : t(".out_of_stock")
%br/
- if @insufficient_stock_lines.andand.include? line_item
%span.out-of-stock
= variant.in_stock? ? t(".insufficient_stock", :on_hand => variant.on_hand) : t(".out_of_stock")
%br/
- if @unavailable_order_variants.andand.include? line_item.variant
%span.out-of-stock
= t(".unavailable_item")
%br/
- if @unavailable_order_variants.andand.include? line_item.variant
%span.out-of-stock
= t(".unavailable_item")
%br/
%td.text-right.cart-item-price{"data-hook" => "cart_item_price"}
= line_item.single_display_amount_with_adjustments.to_html
- if feature? :unit_price, spree_current_user
%br
%span.unit-price
= line_item.unit_price_price_and_unit
%td.text-center.cart-item-quantity{"data-hook" => "cart_item_quantity"}
- finalized_quantity = @order.completed? ? line_item.quantity : 0
= item_form.number_field :quantity,
:min => 0, "ofn-on-hand" => "#{variant.on_demand && 9999 || variant.on_hand}",
"finalizedquantity" => finalized_quantity, :class => "line_item_quantity", :size => 5,
"ng-model" => "line_item_#{line_item.id}",
"validate-stock-quantity" => true
%td.cart-item-total.text-right{"data-hook" => "cart_item_total"}
= line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil?
%td.text-right.cart-item-price{"data-hook" => "cart_item_price"}
= line_item.single_display_amount_with_adjustments.to_html
- if feature? :unit_price, spree_current_user
%br
%span.unit-price
= line_item.unit_price_price_and_unit
%td.text-center.cart-item-quantity{"data-hook" => "cart_item_quantity"}
- finalized_quantity = @order.completed? ? line_item.quantity : 0
= item_form.number_field :quantity,
:min => 0, "ofn-on-hand" => "#{variant.on_demand && 9999 || variant.on_hand}",
"finalizedquantity" => finalized_quantity, :class => "line_item_quantity", :size => 5,
"ng-model" => "line_item_#{line_item.id}",
"validate-stock-quantity" => true
%td.cart-item-total.text-right{"data-hook" => "cart_item_total"}
= line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil?
%td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"}
%a.delete{href: "#", id: "delete_#{dom_id(line_item)}"}
%i.delete.ofn-i_026-trash
%td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"}
%a.delete{href: "#", id: "delete_#{dom_id(line_item)}"}
%i.delete.ofn-i_026-trash

View File

@@ -12,7 +12,7 @@
- if order.changes_allowed?
.columns.show-for-medium-up.medium-3 &nbsp;
.columns.small-12.medium-3
= link_to cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do
= link_to main_app.cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do
%i.ofn-i_009-close
= t(:cancel_order)
.columns.small-12.medium-3

View File

@@ -41,7 +41,7 @@
= t(:orders_changeable_orders_alert_html, oc_close: l(order.order_cycle.orders_close_at, format: "%b %d, %Y %H:%M"))
%a.close{ "ng-click" => "close()" } &times;
= form_for order, url: order_path(order), html: {id: 'update-order', name: 'update_order_form' } do |order_form|
= form_for order, url: main_app.order_path(order), html: {id: 'update-order', name: 'update_order_form' } do |order_form|
- if order.changes_allowed?
= render 'spree/orders/form', order_form: order_form
-else

View File

@@ -13,3 +13,8 @@
= t :email_payment_summary
- if @order.payments.any?
= render partial: 'spree/shared/payments_list', locals: { payments: @order.payments }
- if last_payment_method(@order).present?
%p.callout{style: "margin-top: 40px"}
%strong
= t :email_payment_description
%p{style: "margin: 5px"}= last_payment_method(@order).description

View File

@@ -75,13 +75,6 @@ module Openfoodnetwork
initializer 'ofn.spree_locale_settings', before: 'spree.promo.environment' do |app|
Spree::Config['checkout_zone'] = ENV['CHECKOUT_ZONE']
Spree::Config['currency'] = ENV['CURRENCY']
if ActiveRecord::Base.connected? && Spree::Country.table_exists?
country = Spree::Country.find_by(iso: ENV['DEFAULT_COUNTRY_CODE'])
Spree::Config['default_country_id'] = country.id if country.present?
else
Spree::Config['default_country_id'] = 12 # Australia
end
end
# Register Spree calculators
@@ -196,7 +189,9 @@ module Openfoodnetwork
config.active_support.escape_html_entities_in_json = true
config.active_job.queue_adapter = :delayed_job
config.active_job.queue_adapter = :sidekiq
config.action_controller.include_all_helpers = false
config.generators.template_engine = :haml
end

View File

@@ -66,5 +66,3 @@ SMTP_PASSWORD: 'f00d'
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS: ofn@example.com,superadmin@example.com
MEMCACHED_VALUE_MAX_MEGABYTES: '4'

View File

@@ -11,7 +11,13 @@ Openfoodnetwork::Application.configure do
config.cache_classes = !!ENV["PROFILE"]
# :file_store is used by default when no cache store is specifically configured.
config.cache_store = :memory_store if !!ENV["PROFILE"]
if !!ENV["PROFILE"]
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/0"),
expires_in: 90.minutes
}
end
config.eager_load = false

View File

@@ -42,9 +42,11 @@ Openfoodnetwork::Application.configure do
config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
# Use a different cache store in production
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024
config.cache_store = :mem_cache_store, { value_max_bytes: memcached_value_max_bytes }
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6380/0"),
reconnect_attempts: 1
}
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View File

@@ -42,9 +42,11 @@ Openfoodnetwork::Application.configure do
config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }
# Use a different cache store in production
memcached_value_max_megabytes = ENV.fetch("MEMCACHED_VALUE_MAX_MEGABYTES", 1).to_i
memcached_value_max_bytes = memcached_value_max_megabytes * 1024 * 1024
config.cache_store = :mem_cache_store, { value_max_bytes: memcached_value_max_bytes }
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6380/0"),
reconnect_attempts: 1
}
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View File

@@ -50,11 +50,6 @@ Openfoodnetwork::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
# To block requests before running the database cleaner
require 'open_food_network/rack_request_blocker'
# Make sure the middleware is inserted first in middleware chain
config.middleware.insert_before(ActionDispatch::Static, RackRequestBlocker)
config.active_job.queue_adapter = :test
end

View File

@@ -3,6 +3,7 @@
if defined?(Bullet) && ENV.fetch("ENABLE_BULLET", false)
Rails.application.config.after_initialize do
Bullet.enable = true
Bullet.add_footer = true
Bullet.bullet_logger = true
Bullet.rails_logger = true
end

View File

@@ -1,4 +1,3 @@
Delayed::Worker.logger = Logger.new(Rails.root.join('log', 'delayed_job.log'))
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.max_run_time = 15.minutes

View File

@@ -1,2 +1,2 @@
Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN
Money.default_currency = Money::Currency.new(Spree::Config[:currency])
Money.default_currency = Money::Currency.new(ENV.fetch('CURRENCY'))

View File

@@ -0,0 +1,11 @@
if Rails.env.production? || Rails.env.staging?
redis_jobs_url = ENV.fetch("OFN_REDIS_JOBS_URL", "redis://localhost:6381/0")
Sidekiq.configure_server do |config|
config.redis = { url: redis_jobs_url, network_timeout: 5 }
end
Sidekiq.configure_client do |config|
config.redis = { url: redis_jobs_url, network_timeout: 5 }
end
end

View File

@@ -18,6 +18,8 @@ Spree::Gateway.class_eval do
end
Spree.config do |config|
config.site_url = ENV['SITE_URL'] if ENV['SITE_URL']
config.site_name = ENV['SITE_NAME'] if ENV['SITE_NAME']
config.shipping_instructions = true
config.address_requires_state = true
config.admin_interface_logo = '/default_images/ofn-logo.png'
@@ -31,6 +33,10 @@ Spree.config do |config|
config.s3_protocol = ENV.fetch('S3_PROTOCOL', 'https')
end
# Read mail configuration from ENV vars at boot time and ensure the values are
# applied correctly in Spree::Config.
MailConfiguration.apply!
# Attachments settings
Spree::Image.set_attachment_attribute(:path, ENV['ATTACHMENT_PATH']) if ENV['ATTACHMENT_PATH']
Spree::Image.set_attachment_attribute(:url, ENV['ATTACHMENT_URL']) if ENV['ATTACHMENT_URL']

View File

@@ -317,6 +317,8 @@ ca:
height: "Alçada"
width: "Amplada"
depth: "Profunditat"
payment_could_not_process: "No s'ha pogut processar el pagament"
payment_could_not_complete: "No s'ha pogut completar el pagament"
actions:
create_and_add_another: "Crea i afegeix-ne una altra"
create: "Crear"
@@ -1569,6 +1571,7 @@ ca:
email_order_summary_includes_tax: "(inclou impostos):"
email_payment_paid: PAGAT
email_payment_not_paid: 'NO PAGAT '
email_payment_description: Descripció del pagament de la comanda
email_payment_summary: Resum del pagament
email_payment_method: "Pagament a través de:"
email_so_placement_intro_html: "Tens una nova comanda amb <strong> %{distributor}</strong>"

View File

@@ -50,7 +50,7 @@ de_DE:
variant_override:
count_on_hand:
using_producer_stock_settings_but_count_on_hand_set: "muss leer sein, da die Einstellungen des Produzentenbestands verwendet werden"
on_demand_but_count_on_hand_set: "muss leer sein, wenn die Produktion auf Anfrage erfolgt"
on_demand_but_count_on_hand_set: "muss leer sein, wenn unbegrenzt verfügbar oder die Produktion auf Bestellung erfolgt"
limited_stock_but_no_count_on_hand: "muss angegeben werden, da nur begrenzte Lagerbestände verfügbar sind"
activemodel:
attributes:
@@ -163,7 +163,7 @@ de_DE:
confirmation_instructions:
subject: "Bitte bestätigen Sie die E-Mail-Adresse von %{enterprise} im Open Food Network"
welcome:
subject: "%{enterprise} ist jetzt im Open Food Network"
subject: "%{enterprise} ist jetzt Teil des Open Food Network"
email_welcome: "Willkommen"
email_registered: "ist jetzt Teil des"
email_userguide_html: "Das Benutzerhandbuch mit detaillierter Unterstützung für die Einrichtung Ihres Profils, Produzentenladens oder Hubs finden Sie hier: %{link}"
@@ -317,6 +317,8 @@ de_DE:
height: "Höhe"
width: "Breite"
depth: "Tiefe"
payment_could_not_process: "Die Zahlung konnte nicht verarbeitet werden"
payment_could_not_complete: "Die Zahlung konnte nicht abgeschlossen werden"
actions:
create_and_add_another: "Erstellen und weitere hinzufügen"
create: "Neu"
@@ -345,8 +347,8 @@ de_DE:
ends_on: Endet am
name: Name
on_hand: Verfügbar
on_demand: Auf Anfrage
on_demand?: Auf Anfrage?
on_demand: Unbegrenzt/auf Bestellung
on_demand?: Unbegrenzt/auf Bestellung
order_cycle: Bestellzyklus
payment: Zahlung
payment_method: Zahlungsart
@@ -708,7 +710,7 @@ de_DE:
name: Name der Gebühr
fee_type: Art der Gebühr
manage_fees: Unternehmensgebühren verwalten
no_fees_yet: Sie haben noch keine Unternehmensgebühren.
no_fees_yet: Sie erheben noch keine Unternehmensgebühren.
create_button: Jetzt erstellen
images:
logo: Logo
@@ -733,7 +735,7 @@ de_DE:
name: Name der Zahlungsart
applies: Aktiv?
manage: Zahlungsarten verwalten
no_method_yet: Sie haben noch keine Zahlungsarten. Bitte erstellen Sie eine.
no_method_yet: Sie haben noch keine Zahlungsart angelegt. Bitte erstellen Sie eine.
create_button: Neue Zahlungsart
create_one_button: Jetzt erstellen
primary_details:
@@ -766,7 +768,7 @@ de_DE:
manage: "Lieferoptionen verwalten"
create_button: "Neue Lieferoption"
create_one_button: "Jetzt erstellen"
no_method_yet: "Sie haben noch keine Lieferoptionen angelegt."
no_method_yet: "Sie haben noch keine Lieferoption angelegt. Bitte erstellen Sie eine."
shop_preferences:
shopfront_requires_login: "Öffentlich sichtbarer Laden?"
shopfront_requires_login_tip: "Wählen Sie aus, ob sich Kunden einloggen müssen, um den Laden zu sehen oder ob er für alle sichtbar ist."
@@ -792,7 +794,7 @@ de_DE:
shopfront_message: "'Willkommen'-Nachricht im Laden"
shopfront_message_placeholder: >
Eine optionale Nachricht, um Kunden willkommen zu heißen und zu erklären,
wie Sie bei Ihnen einkaufen können. Wenn hier Text eingegeben wird,
wie sie bei Ihnen einkaufen können. Wenn hier Text eingegeben wird,
wird dieser auf einer Startseite in Ihrem Laden angezeigt, wenn Kunden
ihn zum ersten Mal besuchen.
shopfront_message_link_tooltip: "Link einfügen/bearbeiten"
@@ -860,7 +862,7 @@ de_DE:
shipping_methods: Lieferoptionen
shipping_methods_tip: Dieses Unternehmen hat Lieferoptionen.
enterprise_fees: Unternehmensgebühren
enterprise_fees_tip: Dieses Unternehmen hat keine Gebühren.
enterprise_fees_tip: Dieses Unternehmen erhebt keine Gebühren.
admin_index:
name: Name
role: Rolle
@@ -984,7 +986,7 @@ de_DE:
add: Koordinatorgebühr hinzufügen
filters:
search_by_order_cycle_name: "Suche nach Name des Bestellzyklus ..."
involving: "Betrifft"
involving: "Unternehmen"
any_enterprise: "Alle Unternehmen"
any_schedule: "Alle Zeitpläne"
form:
@@ -1042,7 +1044,7 @@ de_DE:
enterprises_hubs_tabs:
has_no_payment_methods: "%{enterprise} hat keine Zahlungsarten."
has_no_shipping_methods: "%{enterprise} hat keine Lieferoptionen."
has_no_enterprise_fees: "%{enterprise} hat keine Gebühren."
has_no_enterprise_fees: "%{enterprise} erhebt keine Gebühren."
enterprise_issues:
create_new: Erstellen
resend_email: E-Mail erneut senden
@@ -1206,7 +1208,7 @@ de_DE:
enterprise_logo:
destroy_attachment_does_not_exist: "Logo existiert nicht"
enterprise_promo_image:
destroy_attachment_does_not_exist: "Werbebild existiert nicht."
destroy_attachment_does_not_exist: "Hintergrundbild existiert nicht."
enterprise_terms_and_conditions:
destroy_attachment_does_not_exist: "AGB-Datei existiert nicht."
orders:
@@ -1235,10 +1237,10 @@ de_DE:
mailers:
powered_by:
open_food_network: "Open Food Network"
powered_html: "Dieser Einkauf wurde ermöglicht durch das %{open_food_network}."
powered_html: "Ermöglicht durch das %{open_food_network}."
menu:
cart:
cart: "Warenkorb"
cart: "Warenkorb/Kasse"
cart_sidebar:
checkout: "Zur Kasse"
edit_cart: "Warenkorb bearbeiten"
@@ -1250,7 +1252,7 @@ de_DE:
signed_in:
profile: "Profil"
mobile_menu:
cart: "Warenkorb"
cart: "Warenkorb/Kasse"
register_call:
selling_on_ofn: "Sie möchten selbst im Open Food Network verkaufen?"
register: "Hier registrieren!"
@@ -1367,7 +1369,7 @@ de_DE:
country: Land
unauthorized: Nicht autorisiert
terms_of_service: "AGB"
on_demand: Auf Anfrage
on_demand: Unbegrenzt/auf Bestellung
none: Keine
not_allowed: Nicht erlaubt
no_shipping: keine Lieferoptionen
@@ -1470,7 +1472,7 @@ de_DE:
brandstory_part2: "Kaufen Sie ein in Hofläden, auf Bauernmärkten, in Food-Hubs oder schließen Sie sich zu Einkaufsgemeinschaften, Kooperativen, Genossenschaften oder einer solidarischen Landwirtschaft zusammen."
brandstory_part3: "Die Anbieter bilden gemeinsam ein regionales Netzwerk, in dem sich Käufer und Verkäufer wieder kennen und mit Vertrauen wertschätzend umgegangen wird."
brandstory_part4: "Der Programmcode dieser Internet-Plattform ist öffentlich frei verfügbar (Open Source), sie gehört also auch Ihnen und ist unverkäuflich. Alle Einnahmen werden wieder in die Weiterentwicklung des Netzwerks investiert!"
brandstory_part5_strong: "Wir nennen es Open Food Network."
brandstory_part5_strong: "Das ist das Open Food Network."
brandstory_part6: "Sie lieben Ihr Essen! Jetzt können Sie auch Ihr regionales Lebensmittelsystem lieben!"
learn_body: "Erkunden Sie Modelle, Geschichten und Ressourcen, um Sie bei der Entwicklung Ihres Fair-Food-Geschäfts oder Ihrer Organisation zu unterstützen. Finden Sie Schulungen, Veranstaltungen und andere Möglichkeiten, um von Gleichgesinnten zu lernen."
learn_cta: "Lassen Sie sich inspirieren"
@@ -1482,7 +1484,7 @@ de_DE:
system_step2: "2. Welche regionalen Lebensmittel kann ich online kaufen?"
system_step2_text: "Im Online-Shop des Ladens finden Sie ein großes Sortiment regionaler und saisonaler Produkte. Von Obst und Gemüse über Eier, Milch, Käse, Wurst und Fleisch bis hin zu Backwaren, Süßigkeiten und Fertiggerichten werden Sie fündig. Nutzen Sie die Suche oder die Filter nach Kategorien und Eigenschaften, wie bio, unverpackt oder fair gehandelt."
system_step3: "3. Wie kommen regionale Lebensmittel zu mir nach Hause?"
system_step3_text: "Jeder Laden kann seine Lieferoptionen selbst festlegen. Viele bieten einen Lieferservice an, oft ist auch die Abholung vor Ort oder an einer Abholstation möglich. Wählen Sie die gewünschte Option einfach beim Abschluss der Bestellung aus. Im Open Food Network kennt man sich - auch das Abstellen der Lieferung auf der Terrasse oder im Gartenhaus lässt sich sicher organisieren. "
system_step3_text: "Jeder Laden kann seine Lieferoptionen selbst festlegen. Viele bieten einen Lieferservice an, oft ist auch die Abholung vor Ort oder an einer Abholstation möglich. Wählen Sie die gewünschte Option einfach beim Abschluss der Bestellung aus. Im Open Food Network kennt man sich - auch das Vereinbaren eines Ablageortes lässt sich sicher organisieren. "
cta_headline: "Machen Sie die Welt mit Ihrem Einkauf ein kleines bisschen besser."
cta_label: "Jetzt regional einkaufen"
stats_headline: "Wir erschaffen ein neues Ernährungssystem."
@@ -1550,7 +1552,7 @@ de_DE:
email_social: "Verbinden Sie sich mit uns:"
email_contact: "Schreiben Sie uns eine E-Mail:"
email_signoff: "Viele Grüße,"
email_signature: "das Team vom Open Food Network"
email_signature: "das Team des Open Food Network"
email_confirm_customer_greeting: "Hallo %{name},"
email_confirm_customer_intro_html: "vielen Dank für Ihren Einkauf bei <strong>%{distributor}</strong>!"
email_confirm_customer_number_html: "<strong>Bestellbestätigung #%{number}</strong>"
@@ -1568,6 +1570,7 @@ de_DE:
email_order_summary_includes_tax: "(inkl. Steuern):"
email_payment_paid: BEZAHLT
email_payment_not_paid: NICHT BEZAHLT
email_payment_description: 'Hinweise zur Zahlung '
email_payment_summary: Zahlungsübersicht
email_payment_method: "Zahlungsart:"
email_so_placement_intro_html: "Sie haben eine neue Bestellung bei <strong>%{distributor}</strong> erhalten!"
@@ -1761,7 +1764,7 @@ de_DE:
sell_user_guide: "Erfahren Sie mehr in unserem Benutzerhandbuch."
sell_listing_price: "Die Aufnahme ins Open Food Network ist kostenlos. Das Eröffnen und Betreiben eines Online-Shops ist für Unternehmen mit einem monatlichen Umsatz unter 500 € kostenlos. Bei höherem Umsatz erlauben wir uns nach einer 3-monatigen kostenlosen Testphase die Berechnung von 3 % Gebühr, um unsere Kosten zu decken."
sell_embed: "Wir bieten noch weitere Dienste rund um Ihr Unternehmen an."
sell_ask_services: "Fragen Sie uns nach OFN-Dienstleistungen."
sell_ask_services: "Fragen Sie uns nach Dienstleistungen rund um das Open Food Network."
shops_title: Regional Einkaufen
shops_headline: Wählen Sie einen Laden aus der Liste.
shops_text: Pflanzen wachsen in Zyklen, Landwirte ernten in Zyklen und bei uns bestellen Sie Lebensmittel in Zyklen. Ist ein Bestellzyklus gerade geschlossen, wählen Sie einen anderen Laden oder schauen Sie später wieder vorbei.
@@ -1877,23 +1880,23 @@ de_DE:
steps:
introduction:
registration_greeting: "Herzlich willkommen!"
registration_intro: "Sie können jetzt ein Profil als Produzent oder Hub erstellen!"
registration_intro: "Erstellen Sie zunächst ein Profil um sich oder Ihre Produkte zu präsentieren!"
registration_checklist: "Was brauche ich?"
registration_time: "5-10 Minuten Zeit"
registration_enterprise_address: "Unternehmensadresse"
registration_contact_details: "Kontaktdaten (Ansprechpartner, E-Mail-Adresse, Telefonnummer)"
registration_logo: "Ihr Logo"
registration_promo_image: "Hintergrundbild für Ihr Profil"
registration_about_us: "\"Über uns\" Text"
registration_enterprise_address: "Unternehmensname und -adresse"
registration_contact_details: "Kontaktdaten (Ansprechpartner, E-Mail-Adresse)"
registration_logo: "Ihr Logo (empfohlen)"
registration_promo_image: "Hintergrundbild für Ihr Profil (empfohlen)"
registration_about_us: "\"Über uns\" Text (empfohlen)"
registration_outcome_headline: "Was bekomme ich?"
registration_outcome1_html: "Ihr Profil hilft dabei, Sie im Open Food Network zu <strong>finden</strong> und zu <strong>kontaktieren</strong>."
registration_outcome2: "Nutzen Sie Ihr Profil, um die Geschichte Ihres Unternehmens zu erzählen und verknüpfen Sie Ihren Social-Media- und Web-Auftritt."
registration_outcome3: "Ihr Profil ist auch der erste Schritt, um im Open Food Network Produkte zu handeln oder einen Laden zu eröffnen."
registration_outcome3: "Ihr Profil ist auch der erste Schritt, um im Open Food Network Produkte zu handeln oder einen Online-Shop zu eröffnen."
registration_action: "Los geht's!"
details:
title: "Ihr Unternehmen"
headline: "Ihr Unternehmen"
enterprise: "Woot! Zuerst müssen wir ein wenig über Ihr Unternehmen wissen:"
enterprise: "Nennen Sie uns zunächst bitte den Namen und die Adresse Ihres Unternehmens."
producer: "Nennen Sie uns zunächst bitte den Namen und die Adresse Ihres Betriebs."
enterprise_name_field: "Name des Unternehmens:"
producer_name_field: "Name des Betriebs:"
@@ -1924,80 +1927,80 @@ de_DE:
contact_field: "Hauptansprechpartner"
contact_field_placeholder: "Vorname Nachname"
contact_field_required: "Bitte geben Sie einen Hauptansprechpartner ein."
phone_field: "Telefonnummer"
phone_field: "Telefonnummer (optional)"
phone_field_placeholder: "z. B. 030 1234 5678"
type:
title: "Art"
headline: "Wählen Sie bitte die Profilart von %{enterprise} aus!"
question: "Sind Sie ein Produzent?"
yes_producer: "Ja, ich bin ein Produzent."
no_producer: "Nein, ich bin kein Produzent."
producer_field_error: "Bitte wählen Sie: Sind Sie ein Produzent?"
title: "Art des Profils"
headline: "Wählen Sie bitte die Profilart für %{enterprise} aus!"
question: "Ist das Unternehmen ein Produzent?"
yes_producer: "Ja, es ist ein Produzent."
no_producer: "Nein, es ist kein Produzent."
producer_field_error: "Bitte wählen Sie: Ist das Unternehmen ein Produzent?"
yes_producer_help: "Produzenten stellen leckere Lebensmittel oder Getränke her. Sie sind ein Produzent, wenn Sie anbauen, brauen, backen, fermentieren, melken oder sonst wie Lebenmittel produzieren."
no_producer_help: "Wenn Sie kein Produzent sind, sind Sie wahrscheinlich jemand, der Lebensmittel verkauft und verteilt. Sie könnten ein Foodhub, eine Lebensmittelkooperative, eine Einkaufsgemeinschaft, ein Einzelhändler, Hofladen, Großhändler oder Vergleichbares sein."
no_producer_help: "Wenn Sie kein Produzent sind, sind Sie wahrscheinlich jemand, der Lebensmittel verkauft und verteilt. Sie könnten ein Food Hub, eine Lebensmittelkooperative, eine Einkaufsgemeinschaft, ein Einzelhändler, Hofladen, Großhändler oder Vergleichbares sein."
create_profile: "Profil erstellen"
about:
title: "Über uns"
headline: "Sehr gut!"
message: "Lassen Sie uns nun die Details Ihres Profils bearbeiten:"
headline: "Über uns"
message: "Beschreiben Sie nun "
success: "Sehr gut! %{enterprise} wurde dem Open Food Network hinzugefügt."
registration_exit_message: "Wenn Sie diesen Assistenten zu einem beliebigen Zeitpunkt beenden, können Sie mit der Erstellung Ihres Profils fortfahren, indem Sie in das Menü \"Verwaltung\" gehen."
enterprise_description: "Kurzbeschreibung"
registration_exit_message: "Wenn Sie diesen Assistenten zu einem beliebigen Zeitpunkt beenden, können Sie mit der Erstellung Ihres Profils fortfahren, indem Sie sich einloggen und zum Menü \"Verwaltung\" wechseln."
enterprise_description: "Kurzbeschreibung (empfohlen)"
enterprise_description_placeholder: "Ein kurzer Satz, der Ihr Unternehmen beschreibt."
enterprise_long_desc: "Ausführliche Beschreibung"
enterprise_long_desc: "Ausführliche Beschreibung (empfohlen)"
enterprise_long_desc_placeholder: "Erzählen Sie hier die Geschichte Ihres Unternehmens - was macht Sie anders und wunderbar? Wir empfehlen, die Beschreibung unter 600 Zeichen oder 150 Wörtern zu halten."
enterprise_long_desc_length: "%{num} Zeichen/bis zu 600 empfohlen"
enterprise_abn: "USt-IdNr."
enterprise_abn: "USt-IdNr. (optional für Rechnungserstellung)"
enterprise_abn_placeholder: "z. B. DE999999999"
enterprise_acn: "St.-Nr."
enterprise_acn: "St.-Nr. (optional für Rechnungserstellung)"
enterprise_acn_placeholder: "z. B. 93815/08152"
enterprise_tax_required: "Bitte treffen Sie eine Auswahl."
images:
title: "Bilder"
headline: "Vielen Dank!"
headline: "Bilder"
description: "Laden Sie einige schöne Bilder hoch, um ein ansprechendes Profil zu gestalten!"
uploading: "Wird hochgeladen ..."
continue: "Weiter"
back: "Zurück"
logo:
select_logo: "Schritt 1. Wählen Sie ein Bild als Ihr Logo aus"
select_logo: "Schritt 1: Laden Sie Ihr Logo hoch (empfohlen)"
logo_tip: "Tipp: Am besten funktionieren quadratische Bilder, vorzugsweise mindestens 300 × 300 Pixel."
logo_label: "Wählen Sie ein Logo aus"
logo_label: "Bilddatei auswählen"
logo_drag: "Ziehen Sie Ihr Logo hierher."
review_logo: "Schritt 2. Überprüfen Sie Ihr Logo"
review_logo: "Schritt 2: Überprüfen Sie Ihr Logo"
review_logo_tip: "Tipp: Um das schönste Ergebnis zu erzielen, sollte Ihr Logo den gesamten verfügbaren Platz ausfüllen."
logo_placeholder: "Ihr Logo wird hier zur Überprüfung angezeigt, sobald es hochgeladen wurde."
promo:
select_promo_image: "Schritt 3. Wählen Sie ein Werbebild"
select_promo_image: "Schritt 3: Laden Sie ein Hintergrundbild hoch (empfohlen)"
promo_image_tip: "Tipp: Die als Banner dargestellte bevorzugte Größe beträgt 1200 × 260 Pixel."
promo_image_label: "Wählen Sie ein Werbebild"
promo_image_label: "Bilddatei auswählen"
promo_image_drag: "Ziehen Sie Ihr Bild hierher."
review_promo_image: "Schritt 4. Überprüfen Sie Ihr Werbebild"
review_promo_image_tip: "Tipp: Für ein optimales Ergebnis sollte Ihr Werbebild den verfügbaren Platz ausfüllen."
review_promo_image: "Schritt 4: Überprüfen Sie Ihr Hintergrundbild"
review_promo_image_tip: "Tipp: Für ein optimales Ergebnis sollte Ihr Hintergrundbild den verfügbaren Platz ausfüllen."
promo_image_placeholder: "Ihr Logo wird hier zur Überprüfung angezeigt, sobald es hochgeladen wurde."
social:
title: "Soziale Medien"
enterprise_final_step: "Letzter Schritt!"
enterprise_social_text: "Wie ist %{enterprise} im Internet erreichbar?"
website: "Homepage"
website: "Homepage (empfohlen)"
website_placeholder: "z. B. openfoodnetwork.de"
facebook: "Facebook"
facebook: "Facebook (optional)"
facebook_placeholder: "z. B. www.facebook.com/IhrNameHier"
linkedin: "LinkedIn"
linkedin: "LinkedIn (optional)"
linkedin_placeholder: "z. B. www.linkedin.com/IhrNameHier"
twitter: "Twitter"
twitter: "Twitter (optional)"
twitter_placeholder: "z. B. @twitter_name"
instagram: "Instagram"
instagram: "Instagram (optional)"
instagram_placeholder: "z. B. @instagram_name"
limit_reached:
headline: "Oh nein!"
message: "Sie haben das Limit erreicht!"
text: "Sie haben die maximale Anzahl der Unternehmen erreicht, die Sie besitzen dürfen im"
text: "Sie haben die maximale Anzahl der Unternehmen erreicht, die Sie verwalten dürfen im"
action: "Zurück zur Startseite"
finished:
headline: "Fertig!"
thanks: "Vielen Dank, dass Sie die Details für %{enterprise} ausgefüllt haben."
login: "Sie können die Angaben Ihres Unternehmens jederzeit ändern oder aktualisieren, indem Sie sich bei Open Food Network einloggen und zum Menü \"Verwaltung\" wechseln."
login: "Sie können die Angaben Ihres Unternehmens jederzeit ändern oder aktualisieren, indem Sie sich einloggen und zum Menü \"Verwaltung\" wechseln."
action: "Zur Übersicht der Unternehmen"
back: "Zurück"
continue: "Weiter"
@@ -2727,7 +2730,7 @@ de_DE:
unit_price_tooltip: "Grundpreis: Er ermöglicht einen einfachen Preisvergleich von Produkten, unabhängig von Packungsgröße und -gewicht."
variants:
on_demand:
'yes': "Auf Anfrage"
'yes': "Unbegrenzt/auf Bestellung"
variant_overrides:
on_demand:
use_producer_settings: "Einstellungen des Produzentenbestands verwenden"
@@ -2970,7 +2973,7 @@ de_DE:
back_to_zones_list: "Zurück zur Zonenliste"
card_code: "Kartenprüfnummer (3-stellig)"
card_number: "Kreditkartennummer"
category: "Produktkategorie"
category: "Steuerkategorie"
created_successfully: "Erfolgreich erstellt"
credit: "Guthaben"
editing_tax_category: "Steuerkategorie bearbeiten"
@@ -3019,7 +3022,7 @@ de_DE:
location: "Ort"
count_on_hand: "Verfügbar"
quantity: "Menge"
on_demand: "Unbegrenzt"
on_demand: "Unbegrenzt/auf Bestellung"
on_hand: "Verfügbar"
package_from: "Paket von"
item_description: "Artikelbeschreibung"
@@ -3087,7 +3090,7 @@ de_DE:
display_currency: "Währung anzeigen"
choose_currency: "Währung auswählen"
mail_method_settings: "E-Mail-Methodeneinstellungen"
mail_settings_notice_html: "Einige der folgenden Einstellungen können nicht geändert werden und werden hier nur zu Zwecken der Fehlerbehebung aufgeführt. Änderungen können vorgenommen werden, indem die Einstellungen der deutschen Instanz aktualisiert und mithilfe von <a href='https://github.com/openfoodfoundation/ofn-install'>ofn-install</a> bereitgestellt werden. Wenden Sie sich an das globale OFN-Team, um weitere Informationen zu erhalten."
mail_settings_notice_html: "Einige der folgenden Einstellungen können nicht geändert werden und werden hier nur zu Zwecken der Fehlerbehebung aufgeführt. Änderungen können vorgenommen werden, indem die Einstellungen der deutschen Instanz aktualisiert und mithilfe von <a href='https://github.com/openfoodfoundation/ofn-install'>ofn-install</a> bereitgestellt werden. Wenden Sie sich an das globale Team des Open Food Network, um weitere Informationen zu erhalten."
general: "Allgemeines"
enable_mail_delivery: "E-Mail-Versand aktivieren"
send_mails_as: "E-Mails senden als"
@@ -3338,7 +3341,7 @@ de_DE:
enterprises_header:
ofn_with_tip: Unternehmen sind Produzenten und/oder Hubs und sind die grundlegende Organisationseinheit innerhalb des Open Food Network.
enterprise_row:
has_no_enterprise_fees: "hat keine Unternehmensgebühren"
has_no_enterprise_fees: "erhebt keine Unternehmensgebühren"
has_no_payment_methods: "hat keine Zahlungsarten"
has_no_shipping_methods: "hat keine Lieferoptionen"
products:
@@ -3463,7 +3466,7 @@ de_DE:
unit_price: "Grundpreis"
unit_price_legend: "Berechnet aus Preis und Menge."
on_hand: "Verfügbar"
on_demand: "Unbegrenzt"
on_demand: "Unbegrenzt/auf Bestellung"
product_description: "Produktbeschreibung"
image: "Bild"
or: "oder"

View File

@@ -349,6 +349,8 @@ en:
height: "Height"
width: "Width"
depth: "Depth"
payment_could_not_process: "The payment could not be processed"
payment_could_not_complete: "The payment could not be completed"
actions:
create_and_add_another: "Create and Add Another"
@@ -1667,6 +1669,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
email_order_summary_includes_tax: "(includes tax):"
email_payment_paid: PAID
email_payment_not_paid: NOT PAID
email_payment_description: Payment Description at Checkout
email_payment_summary: Payment summary
email_payment_method: "Paying via:"
email_so_placement_intro_html: "You have a new order with <strong>%{distributor}</strong>"

View File

@@ -1352,6 +1352,12 @@ en_CA:
address2: Address (contd.)
city: City
city_placeholder: eg. Northcote
latitude: Latitude
latitude_placeholder: eg. -37.4713077
latitude_longitude_tip: Latitude and longitude are needed to display your enterprise on the map.
longitude: Longitude
longitude_placeholder: eg. 144.7851531
use_geocoder: Calculate latitude and longitude automatically from address?
postcode: Postal Code
postcode_placeholder: eg. N0B 2L0
suburb: City
@@ -1905,6 +1911,11 @@ en_CA:
state_field_error: "Province required"
country_field: "Country:"
country_field_error: "Please select a country"
map_location: "Map Location"
locate_address: "Locate address on map"
drag_pin: "Drag and drop the pin to the correct location if not accurate."
confirm_address: "I confirm that the indicated position of the enterprise on the map is correct."
drag_map_marker: "Due to many producers operating in rural areas, the accuracy of maps is always being improved on. Help us to understand where youre located better by interacting with the map above to move the pin by clicking or tapping to hold the pin and then dragging to the location that is more accurate based off your knowledge."
contact:
title: "Contact"
who_is_managing_enterprise: "Who is responsible for managing %{enterprise}?"

View File

@@ -317,6 +317,8 @@ en_FR:
height: "Height"
width: "Width"
depth: "Depth"
payment_could_not_process: "The payment could not be processed"
payment_could_not_complete: "The payment could not be completed"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -1566,6 +1568,7 @@ en_FR:
email_order_summary_includes_tax: "(includes tax):"
email_payment_paid: PAID
email_payment_not_paid: NOT PAID
email_payment_description: Payment Description at Checkout
email_payment_summary: Payment summary
email_payment_method: "Paying via:"
email_so_placement_intro_html: "You have a new order with <strong>%{distributor}</strong>"

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