Compare commits

..

157 Commits

Author SHA1 Message Date
Luis Ramos
d162e8c087 Merge pull request #4300 from daningenthron/daningenthron/add-a-new-card
Translation: "Add new credit card"
2019-09-30 13:27:25 +01:00
Luis Ramos
75a56c2be5 Merge pull request #4293 from jasonk357/4031-change-user-email-alert
Improve user email change flash alert message
2019-09-30 13:19:40 +01:00
Luis Ramos
07a5963554 Merge pull request #4311 from mkllnk/rails3-deprecations
Replace deprecated validates_presence_of
2019-09-30 13:19:25 +01:00
luisramos0
a6888cf0be Update all locales with the latest Transifex translations 2019-09-30 13:15:45 +01:00
Luis Ramos
ef35db6db2 Merge pull request #4296 from luisramos0/subs_line_items
Make subscription line items handle soft deleted variants
2019-09-30 13:07:10 +01:00
Pau Pérez Fabregat
49665ae360 Merge pull request #4167 from luisramos0/last_dedeface
Move app_wrapper deface to spree/layouts/admin view
2019-09-27 09:21:28 +02:00
Pau Pérez Fabregat
7e5c194515 Merge pull request #4295 from coopdevs/enable-datadog-analytics
Enable trace & search analytics in Datadog
2019-09-27 09:17:03 +02:00
JASON KNOEPFLER
c46fe7b675 encapsulate new unconfirmed email logic 2019-09-25 19:41:33 -07:00
Luis Ramos
2489a2f5f5 Merge pull request #4294 from openfoodfoundation/transifex
Transifex
2019-09-25 11:22:58 +01:00
Transifex-Openfoodnetwork
a6698230fe Updating translations for config/locales/en_NZ.yml 2019-09-25 20:13:57 +10:00
Luis Ramos
2f3509bf9b Merge pull request #4287 from luisramos0/mini_racer
Replace therubyracer with mini_racer.
2019-09-24 19:48:50 +01:00
Dan Ingenthron
e8f9ace8e6 Correct translation key on add card link 2019-09-24 13:42:31 -05:00
Luis Ramos
04270b6cec Merge pull request #4286 from luisramos0/transpec
Finish transpec
2019-09-24 19:33:26 +01:00
Matt-Yorkley
1155931ea9 Merge pull request #4280 from luisramos0/knapsack
Update knapsack report
2019-09-24 19:26:27 +01:00
Maikel Linke
efd450606e Replace deprecated validates_presence_of
This syntax has been deprecated in Rails 3:
https://guides.rubyonrails.org/3_0_release_notes.html#patches-and-deprecations
2019-09-24 19:16:05 +10:00
Transifex-Openfoodnetwork
a18f6f5b8f Updating translations for config/locales/fr_CA.yml 2019-09-24 01:01:41 +10:00
Transifex-Openfoodnetwork
403653381c Updating translations for config/locales/en_CA.yml 2019-09-24 00:59:20 +10:00
luisramos0
c66e5fe1e9 Make subscription line items handle soft deleted variants
This ensures subscription list page works. The variant can be removed from the subscription by the user in the edit subscription page
2019-09-22 14:59:59 +01:00
JASON KNOEPFLER
4ec8fcd3a6 Assign flash message var from conditional return 2019-09-21 08:10:58 -07:00
Pau Perez
88893a2968 Enable trace & search analytics in Datadog
This will enrich the quality of the reported traces for all web
frameworks in our stack. That means not only memcached as we did in
https://github.com/openfoodfoundation/openfoodnetwork/pull/4266 but
PostgreSQL and Rails too.

After enabling, the Trace Search & Analytics page populates which allows
us to search traces and add APM queries to dashboards.
2019-09-21 14:09:27 +02:00
JASON KNOEPFLER
62599e8dfc Edit user email feature spec 2019-09-20 15:28:25 -07:00
Transifex-Openfoodnetwork
b97c428f72 Updating translations for config/locales/pt_BR.yml 2019-09-21 04:00:00 +10:00
Transifex-Openfoodnetwork
42b074f02e Updating translations for config/locales/pt_BR.yml 2019-09-21 03:56:52 +10:00
JASON KNOEPFLER
07e0951490 Change users#update email change flash alert 2019-09-20 10:35:25 -07:00
luisramos0
9e57807dc2 Replace therubyracer with mini_racer.
This is being replaced to increase the reliability and speed of asset compilation.
2019-09-20 11:22:07 +01:00
luisramos0
052bac196b Fix problem in spec/features/consumer/shopping/shopping_spec introduced with transpec 2019-09-20 10:33:40 +01:00
luisramos0
00e789b95b Force use of expect over should in spec expectations 2019-09-20 10:29:56 +01:00
luisramos0
a004822019 Transpec spec/features/consumer/shopping/shopping_spec 2019-09-20 10:16:08 +01:00
luisramos0
49f7b4c8e2 Transpec spec/features/consumer/shopping/cart_spec.rb 2019-09-20 10:11:02 +01:00
luisramos0
8b503b51ca Fix typo in spec name 2019-09-20 10:03:52 +01:00
luisramos0
4e431ecf18 Transpec spec/features/consumer/shopping/products_spec.rb 2019-09-20 10:02:27 +01:00
luisramos0
81f8b127db Transpec spec/features/consumer/authentication_spec.rb and spec/features/consumer/producers_spec.rb 2019-09-20 09:53:23 +01:00
luisramos0
f9f81086fd Transpec features/consumer/shopping/variant_overrides_spec 2019-09-20 09:02:43 +01:00
Luis Ramos
9807b432f9 Merge pull request #4272 from openfoodfoundation/dependabot/bundler/webmock-3.7.5
Bump webmock from 3.7.4 to 3.7.5
2019-09-20 08:42:12 +01:00
luisramos0
6b0f3cd4f3 Transpec spec/performance/shop_controller_spec 2019-09-19 20:36:33 +01:00
luisramos0
3c412b7b7d Transpec spec/controllers/api/taxonomies_controller_spec, spec/controllers/api/taxons_controller_spec and spec/models/enterprise_spec 2019-09-19 20:34:30 +01:00
luisramos0
c4e6c0af2b Transpec features/consumer/registration_spec 2019-09-19 20:18:24 +01:00
Luis Ramos
746c4f03f6 Merge pull request #4261 from jasonk357/3979-malformed-referer-error
Guard against malformed request referer
2019-09-19 17:29:18 +01:00
Kristina Lim
3535c4d564 Merge pull request #4240 from Matt-Yorkley/backorder_to_the_future_2
Disentangle on_demand and backordered
2019-09-20 00:05:27 +08:00
luisramos0
37abdb7727 Update knapsack report 2019-09-19 16:58:06 +01:00
dependabot-preview[bot]
47056e3cc1 Bump webmock from 3.7.4 to 3.7.5
Bumps [webmock](https://github.com/bblimke/webmock) from 3.7.4 to 3.7.5.
- [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.7.4...v3.7.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-19 13:10:20 +00:00
Kristina Lim
311ee92e84 Update all locales with the latest Transifex translations 2019-09-19 17:08:17 +08:00
Kristina Lim
241e97d938 Merge pull request #4241 from openfoodfoundation/transifex
Transifex
2019-09-19 16:58:57 +08:00
Pau Pérez Fabregat
85b1ba8eae Merge pull request #4263 from coopdevs/index-frequent-spree-orders-query
Index spree_orders on various columns
2019-09-19 10:12:54 +02:00
Pau Pérez Fabregat
baa4783141 Merge pull request #4260 from jasonk357/4184-delivery-report-default-range
Add default date range to Delivery Report
2019-09-19 09:58:06 +02:00
Transifex-Openfoodnetwork
ce40fcaf7b Updating translations for config/locales/fr.yml 2019-09-19 07:44:00 +10:00
Luis Ramos
40438de7fe Merge pull request #4250 from Matt-Yorkley/ruby-2.1.9
Bump Ruby version from 2.1.5 to 2.1.9
2019-09-18 11:39:15 +01:00
Luis Ramos
29dcd96fca Merge pull request #4265 from openfoodfoundation/dependabot/bundler/simplecov-0.17.1
Bump simplecov from 0.17.0 to 0.17.1
2019-09-18 10:25:54 +01:00
Pau Pérez Fabregat
7fd6a7e654 Merge pull request #4270 from openfoodfoundation/dependabot/bundler/webmock-3.7.4
Bump webmock from 3.7.3 to 3.7.4
2019-09-18 10:11:11 +02:00
dependabot-preview[bot]
8f2a80f199 Bump webmock from 3.7.3 to 3.7.4
Bumps [webmock](https://github.com/bblimke/webmock) from 3.7.3 to 3.7.4.
- [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.7.3...v3.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 19:21:37 +00:00
Pau Perez
ea41405209 Index spree_orders on various columns
The following query

```sql
SELECT spree_orders . *
FROM spree_orders
WHERE spree_orders . user_id = ?
AND spree_orders . completed_at IS ?
AND spree_orders . created_by_id = ?
ORDER BY created_at DESC LIMIT ?
```

performs quite badly even though LIMIT is always 1 because:

* ORDER BY requires sorting by a column which is not indexed therefore
a sequential scan is performed.
* Although `completed_at` is indexed, `user_id` and `created_by_id` are
not causing a sequential scan.

To make it worse this query is executed very often in the following
controllers among others also related to checkout:

* CartController#populate
* EnterprisesController#Shop
* LineItemsController#bought
* ShopController#products
* ShopController#order_cycle

In some cases this query alone accounts for 66.8% of the total time
of the endpoint.

Results

See by yourself. We move from 56.643ms to 0.077ms. Pretty neat.

```
openfoodnetwork=> explain analyze SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."user_id" = 1 AND "spree_orders"."completed_at" IS NULL AND "spree_orders"."created_by_id" = 1 ORDER BY created_at DESC LIMIT 1;
                                                        QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=11753.03..11753.04 rows=1 width=195) (actual time=56.580..56.580 rows=0 loops=1)
   ->  Sort  (cost=11753.03..11753.04 rows=1 width=195) (actual time=56.578..56.578 rows=0 loops=1)
         Sort Key: created_at DESC
         Sort Method: quicksort  Memory: 25kB
         ->  Seq Scan on spree_orders  (cost=0.00..11753.02 rows=1 width=195) (actual time=56.571..56.571 rows=0 loops=1)
               Filter: ((completed_at IS NULL) AND (user_id = 1) AND (created_by_id = 1))
               Rows Removed by Filter: 256135
 Planning time: 0.252 ms
 Execution time: 56.643 ms
(9 rows)

openfoodnetwork=> CREATE INDEX ON spree_orders (completed_at, user_id, created_by_id, created_at);
CREATE INDEX
openfoodnetwork=> explain analyze SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."user_id" = 1 AND "spree_orders"."completed_at" IS NULL AND "spree_orders"."created_by_id" = 1 ORDER BY created_at DESC LIMIT 1;
mit  (cost=8.45..8.46 rows=1 width=195) (actual time=0.030..0.030 rows=0 loops=1)
   ->  Sort  (cost=8.45..8.46 rows=1 width=195) (actual time=0.029..0.029 rows=0 loops=1)
         Sort Key: created_at DESC
         Sort Method: quicksort  Memory: 25kB
         ->  Index Scan using spree_orders_completed_at_user_id_created_by_id_created_at_idx on spree_orders  (cost=0.42..8.44 rows=1 width=195) (actual time=0.021..0.021 rows=0 loops=1)
               Index Cond: ((completed_at IS NULL) AND (user_id = 1) AND (created_by_id = 1))
 Planning time: 0.199 ms
 Execution time: 0.077 ms
```
2019-09-17 17:02:14 +02:00
luisramos0
2683efdd3c Add missing update to db/schema by running db:migrate
This was missed in PR 4242
2019-09-17 15:27:56 +01:00
Luis Ramos
ed1c154b78 Merge pull request #4252 from luisramos0/remove_clear_ship_address
On checkout of pickup orders, set ship_address to shipping_address_from_distributor instead of empty Spree::Address.default
2019-09-17 13:18:20 +01:00
Pau Pérez Fabregat
4aba2730f7 Merge pull request #4230 from openfoodfoundation/dependabot/bundler/ddtrace-0.27.0
Bump ddtrace from 0.26.0 to 0.27.0
2019-09-17 13:11:12 +02:00
Pau Pérez Fabregat
07ae51560e Merge pull request #4259 from openfoodfoundation/dependabot/bundler/webmock-3.7.3
Bump webmock from 3.7.2 to 3.7.3
2019-09-17 09:32:21 +02:00
dependabot-preview[bot]
3c5c842bbf Bump simplecov from 0.17.0 to 0.17.1
Bumps [simplecov](https://github.com/colszowka/simplecov) from 0.17.0 to 0.17.1.
- [Release notes](https://github.com/colszowka/simplecov/releases)
- [Changelog](https://github.com/colszowka/simplecov/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colszowka/simplecov/compare/v0.17.0...v0.17.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 21:08:17 +00:00
Luis Ramos
e7e4508555 Merge pull request #4242 from Matt-Yorkley/another_cartastrophe
Soft-delete price objects
2019-09-16 17:18:39 +01:00
Luis Ramos
9a3b5d0700 Merge pull request #4257 from daningenthron/daningenthron/payment-method-translation
Fix typo on 'no payment methods' translation keys
2019-09-16 13:18:46 +01:00
Luis Ramos
46353be9a3 Merge pull request #4237 from coopdevs/unobfuscate-bulk-management-action
Add implicit #bulk_management including filter
2019-09-15 12:15:11 +01:00
JASON KNOEPFLER
91a52ead58 Guard against malformed request referer 2019-09-14 09:13:44 -07:00
JASON KNOEPFLER
0f55049eda OrderCycleManagementReport sets default date range before querying for orders 2019-09-13 17:15:57 -07:00
Luis Ramos
83f1a7a9a9 Merge pull request #4258 from coopdevs/fix-test-example-name
Fix test example name
2019-09-13 23:04:45 +01:00
dependabot-preview[bot]
fac118fce2 Bump webmock from 3.7.2 to 3.7.3
Bumps [webmock](https://github.com/bblimke/webmock) from 3.7.2 to 3.7.3.
- [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.7.2...v3.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-13 19:19:34 +00:00
Dan Ingenthron
5270cdaa32 Fixed typo on 'no payment methods' translation keys
Modified to remove edits to translation files. These will be updated via Transifex webhook.
2019-09-13 13:43:13 -05:00
Luis Ramos
ecf336fe51 Merge pull request #4244 from luisramos0/fix_truncate_data
Adapt db truncate task to ofn v2 by removing db tables from v1
2019-09-13 13:09:07 +01:00
Matt-Yorkley
a3efd13d46 Update existing Spree::InventoryItem records: change backordered state to on_hand. 2019-09-13 13:05:15 +01:00
Matt-Yorkley
2ff0169016 Replace hard-deleted prices with empty (0.00) price records 2019-09-13 12:55:24 +01:00
Pau Perez
08d37bbed7 Fix test example name
The name wasn't reflecting the method being tested.
2019-09-13 12:55:34 +02:00
Transifex-Openfoodnetwork
b71443ccd8 Updating translations for config/locales/ca.yml 2019-09-13 20:45:12 +10:00
Transifex-Openfoodnetwork
8fd3d9e03c Updating translations for config/locales/es.yml 2019-09-13 20:42:43 +10:00
Transifex-Openfoodnetwork
787727872f Updating translations for config/locales/ca.yml 2019-09-13 20:42:04 +10:00
Pau Pérez Fabregat
5bf72ae780 Merge pull request #4234 from coopdevs/remove-hidden-integrity-check
Remove integrity check for deleted variants in OCs
2019-09-13 11:27:41 +02:00
Pau Pérez Fabregat
290d00f17d Merge pull request #4232 from coopdevs/remove-guard
Remove Guard and Guard-related gems
2019-09-13 11:25:29 +02:00
Pau Perez
3d7bbbbb19 Remove unused Guardfile 2019-09-13 08:25:54 +02:00
Sigmund Petersen
fd77f48aca Merge pull request #4253 from openfoodfoundation/RachL-patch-1
Update Slack invite link
2019-09-12 09:17:37 +02:00
Rachel Arnould
9a31b99de6 Update missing second link 2019-09-11 15:52:44 +02:00
Transifex-Openfoodnetwork
d98e302047 Updating translations for config/locales/nb.yml 2019-09-11 19:47:09 +10:00
luisramos0
377b4a3755 Do not add ng-controller if main_ng_ctrl_name is not set 2019-09-11 10:36:19 +01:00
luisramos0
0c809b2911 Remove now unused override app_wrapper 2019-09-11 10:35:39 +01:00
luisramos0
33472014f1 Do not add main_ng_app_name if it is not defined 2019-09-11 10:32:30 +01:00
luisramos0
d038c27f1f Fix app_wrapper_attr code by making the content_for tag be only the name of the ng-app and ng-ctrller 2019-09-11 10:32:30 +01:00
luisramos0
3d718d9738 Move admin layout body contents to a separate partial 2019-09-11 10:32:29 +01:00
Luis Ramos
500ef901fd Merge pull request #4164 from luisramos0/little_de_deface
Remove some unused deface overrides and move some others to their views
2019-09-11 10:26:56 +01:00
Matt-Yorkley
a15db65e69 Reload tested variant and price objects 2019-09-11 04:32:19 +01:00
Matt-Yorkley
64a501ee20 Don't index new deleted_at column for spree_prices 2019-09-11 04:29:02 +01:00
Matt-Yorkley
95fcff8bb1 Add migration to remove broken variants from open carts 2019-09-11 04:29:00 +01:00
Luis Ramos
c0bf7e2e75 Merge pull request #4236 from mkllnk/4222-checkout-paypal-error-handling
4233 Add missing Spree route for Paypal
2019-09-10 12:24:21 +01:00
Luis Ramos
1d177a164b Merge pull request #4247 from mkllnk/4243-inventory-pagination
4243 Restore old pagination API for inventory products
2019-09-10 11:35:04 +01:00
Rachel Arnould
d846c31db9 Update Slack invite link
Updated Slack invite link in README
2019-09-10 09:51:59 +02:00
Maikel Linke
efd01f8c9e Move new inventory spec to existing variant overrides spec
I decided to not share the same data setup with the other parts of the
spec because we don't need as much data and it's slow to create.
2019-09-10 10:05:23 +10:00
luisramos0
fb65c64c68 Keep the ship_address clearing logic (this time reusing the OrderUpdate method) thus making the restart_checkout process work for these cases (because order.ship_address is not empty)
OrderUpdater#shipping_address_from_distributor uses order.address_from_distributor to set order.ship_address when order is not delivery: this will clear the ship address as it was done previously without setting an empty address like Spree::Address.default
2019-09-09 22:05:20 +01:00
Transifex-Openfoodnetwork
b8d8ee4edc Updating translations for config/locales/en_GB.yml 2019-09-10 05:14:09 +10:00
Luis Ramos
936784404e Merge pull request #4112 from luisramos0/convert_shipments_rabl
Convert spree/api/shipments views from rabl to ams
2019-09-09 18:34:02 +01:00
Matt-Yorkley
11ea852211 Add migration to reset negative stock levels to zero 2019-09-09 17:49:58 +01:00
Matt-Yorkley
4656c35f71 Don't change on_demand variant's stock when updating shipments 2019-09-09 17:49:58 +01:00
Matt-Yorkley
254315b79e Don't mark on_demand items and shipments as "backordered" 2019-09-09 17:49:56 +01:00
luisramos0
cc7461e692 Remove clear_ship_address from checkout_controller because it is setting an empty address on order.ship_address which is breaking the reset_checkout process in some cases.
This logic is already repeated in the before_save hook in the OrderUpdater where the distributor address is put into the ship_address on order.finalize

In cases the order is not to be finalized we keep the ship_address sent from the client as we may need it to make the order workflow work properly
2019-09-09 17:48:17 +01:00
luisramos0
c4d5eec7fd Covering restart_checkout code with more tests to clarify behaviour with different order.ship_address objects
The edge case here is when ship_address is present but empty, on the checkout_controller we are going to move from using an empty ship_address to using a non-empty one. We keep the original case where this spec was testing with a nil order.ship_address
2019-09-09 17:48:04 +01:00
Luis Ramos
2dc85463ce Merge pull request #4226 from HugsDaniel/4090-missing-translations-order
Add missing translations for orders
2019-09-09 15:16:47 +01:00
Matt-Yorkley
aa3bd93ad0 Bump Ruby version to 2.1.9 2019-09-09 12:22:20 +01:00
Maikel Linke
24c8bb95cb Restore old pagination API for products
It's still used by the inventory page. This is an easy fix that I can
deploy without risk. A rewrite of the inventory pagination should
follow.
2019-09-09 14:53:04 +10:00
Maikel Linke
2e361baeaa Ignore block length cop for feature and scenario
They are typically long and that's okay, same with `describe` and `it`.
2019-09-09 14:53:04 +10:00
luisramos0
a98a0bd264 Adapt db truncate task to ofn v2 by removing db tables from v1 2019-09-08 14:05:49 +01:00
luisramos0
b4de8ef899 Make enterprises/index_spec a bit more resilient 2019-09-08 12:17:36 +01:00
luisramos0
f0586af1c7 Re-organized api/orders resource routes 2019-09-08 12:17:36 +01:00
luisramos0
e9b5551c0f Adpat shipment controller to move out of Spree namespace 2019-09-08 12:17:36 +01:00
luisramos0
7cec24f1d4 Move shipments route, controller and ctrl spec from spree/api to api 2019-09-08 12:17:36 +01:00
luisramos0
26f5ece7c0 Add a few relevant attributes to shipment serializer and fix some details in shipment controller spec 2019-09-08 12:15:33 +01:00
luisramos0
a21a4aba5d Convert spree/api/shipments from rabl to AMS and adapt its spec 2019-09-08 12:15:33 +01:00
Matt-Yorkley
f413ce2a27 Soft-delete price objects 2019-09-06 17:50:19 +01:00
Transifex-Openfoodnetwork
5847b1a51e Updating translations for config/locales/en_ZA.yml 2019-09-07 01:50:35 +10:00
Transifex-Openfoodnetwork
f51ebc63c3 Updating translations for config/locales/en_AU.yml 2019-09-07 01:47:27 +10:00
Pau Pérez Fabregat
908e1dfcaf Merge pull request #4202 from coopdevs/remove-skylight
Remove Skylight
2019-09-06 17:09:14 +02:00
Matt-Yorkley
5bc2c96248 Add specs for existing on_demand behaviour 2019-09-06 15:47:59 +01:00
Pau Perez
ab8c7bad76 Remove Skylight
Since we adopted Skylight to get response times across endpoints and
instances, we failed to get accurate numbers. Our Rails version is not
supported and thus Skylight fails to provide data for the slowest
endpoints, the ones we care about the most. Even with a supported one we
could potentially hit any limits on tracing and have the same problem.

Recently, we started paying for Datadog's APM and the experience,
although it's still early, has been better. It makes it possible to
correlate between services and other metrics which helps spotting the
underlying issues.

Therefore, having two agents running on the server consumes system
resources so we better get rid of Skylight's one.
2019-09-06 16:25:33 +02:00
Pau Perez
55883a0efc Add implicit #bulk_management including filter
OFN it's hard enough. No need to abuse implicitness making things very
hard to follow.

I've spent around 20min trying to find out where this controller action
was implemented until I realized Rails renders the matching view if no
controller action is defined.

Making it git-greppable makes it a bit easier next time.
2019-09-06 16:02:44 +02:00
Pau Pérez Fabregat
2e519957ec Merge pull request #4231 from openfoodfoundation/dependabot/bundler/webmock-3.7.2
Bump webmock from 3.7.1 to 3.7.2
2019-09-06 13:31:55 +02:00
Pau Pérez Fabregat
cd5b3c7393 Merge pull request #4229 from openfoodfoundation/dependabot/bundler/bugsnag-6.12.1
Bump bugsnag from 6.12.0 to 6.12.1
2019-09-06 13:08:47 +02:00
Maikel Linke
eb9f02f3bd Add missing Spree route for Paypal 2019-09-06 19:07:41 +10:00
Maikel Linke
a1f3e8205f Add spec for failing Paypal checkout
https://github.com/openfoodfoundation/openfoodnetwork/issues/4233
2019-09-06 19:05:59 +10:00
Pau Perez
410e23085e Remove integrity check for deleted variants in OCs
We have no way to see the output of this weird RSpec integrity check
thus, it's pointless. It only adds unnecessary load the server.

However, the issue it checks seems to still be happening although
not very often. UK's server has 70 occurrences the last one being from
early 2019 while FR's server returns 10.
2019-09-06 10:30:26 +02:00
Pau Perez
e2b3ee7b3f Remove Guard and Guard-related gems
Guard and the other Guard-related gems should be removed from our
Gemfile. We think is not worth the extra dependencies given the effort
it requires to keep them up-to-date.

This came up in a PR that was upgrading Guard: #4213.
2019-09-06 10:11:17 +02:00
Maikel Linke
242767dc73 Give variables meaningful names in checkout spec 2019-09-06 12:27:15 +10:00
Maikel Linke
8e8c77c5bd Convert specs to RSpec 3.8.0 syntax with Transpec
This conversion is done by Transpec 3.4.0 with the following command:
    transpec spec/features/consumer/shopping/checkout_spec.rb

* 43 conversions
    from: obj.should
      to: expect(obj).to

* 8 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 3 conversions
    from: == expected
      to: eq(expected)

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2019-09-06 11:32:44 +10:00
Luis Ramos
e3ce2a7486 Merge pull request #4104 from luisramos0/convert_taxons_to_ams
Convert spree/api/taxons views from rabl to AMS
2019-09-06 00:04:10 +01:00
dependabot-preview[bot]
8524f49589 Bump webmock from 3.7.1 to 3.7.2
Bumps [webmock](https://github.com/bblimke/webmock) from 3.7.1 to 3.7.2.
- [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.7.1...v3.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 19:17:24 +00:00
dependabot-preview[bot]
36f9cd9cbf Bump ddtrace from 0.26.0 to 0.27.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.26.0 to 0.27.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.26.0...v0.27.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 19:16:35 +00:00
dependabot-preview[bot]
0fab4a3a8e Bump bugsnag from 6.12.0 to 6.12.1
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.12.0 to 6.12.1.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.12.0...v6.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-05 19:15:41 +00:00
Luis Ramos
722884d8d8 Merge pull request #3895 from luisramos0/fees_based_on_final_weight
Make weight calculator use line_item.final_weight_volume rather than variant.weight
2019-09-05 19:24:56 +01:00
Hugo Daniel
f88d54b862 Add missing translations for orders 2019-09-05 15:13:10 +02:00
luisramos0
192bff4fed Move taxons and taxonomies api routes to api out of spree routes 2019-08-28 22:06:56 +01:00
luisramos0
92a270165e Add missing api taxonomies controller only for the required jstree action 2019-08-28 22:06:56 +01:00
luisramos0
9f5c9916ba Add back required api actions (create, update and destroy) and add AMS serializers for the jstree action 2019-08-28 22:06:56 +01:00
luisramos0
d08de4bdf9 Add extra fields to taxon serializer to be used in the api 2019-08-28 22:06:56 +01:00
luisramos0
45bdb85bf3 Add missing method and skip_authorization_check to taxons controller 2019-08-28 22:06:56 +01:00
luisramos0
ece0652ca3 Adapt spree/admin/shared/_routes.html.erb to new location of the api/taxons routes 2019-08-28 22:06:56 +01:00
luisramos0
7a652fd67b Adapt api/taxons controller to new namespace outside Spree: remove Spree module and add Spree namespace to Taxons and Taxonomy classes 2019-08-28 22:06:56 +01:00
luisramos0
4ca8feeef1 Move api/taxons route and controller out of spree namespace into /api and move the ctrl spec as well 2019-08-28 22:06:56 +01:00
luisramos0
367932a767 Make spree/api/taxons_controller use AMS serializer instead of rabl 2019-08-28 22:06:56 +01:00
luisramos0
e591658f48 Keep only used api/taxons index action, delete all others as not required right now 2019-08-28 22:06:56 +01:00
luisramos0
8a4e5b445f Delete unused frontend auth toekn script override and move the backend one to the head partial 2019-08-18 21:53:56 +01:00
luisramos0
2394eda2ac Remove unused sidebar override 2019-08-18 21:47:21 +01:00
luisramos0
f97a3a030a Remove unused nav_bar sessions route and override 2019-08-18 21:44:22 +01:00
luisramos0
ec645f8fa8 Remove unused login override of nav_bar 2019-08-18 21:43:18 +01:00
luisramos0
56a54db602 Remove admin login_nav override and move it to admin layout file 2019-08-18 21:39:19 +01:00
luisramos0
4c3d15b42b Remove users menu entry override and file and add it directly to the tabs view together with all the other entries 2019-08-18 21:36:50 +01:00
luisramos0
5f4429646d Move override to the view that is now in our code base (from spree_auth_devise originally) 2019-08-18 21:33:23 +01:00
luisramos0
f37db456f8 Delete dead overrides of spree frontend code 2019-08-18 21:32:53 +01:00
luisramos0
006c6e6b7b Add comment to explain method in weight calculator 2019-08-02 21:02:33 +01:00
luisramos0
41aa4ff479 Improve code readability and fix rubocop complexity issue in weight calculator 2019-08-02 20:54:41 +01:00
luisramos0
0e8f167ab9 Fix spec in weight calculator tests 2019-08-02 20:44:11 +01:00
Kristina Lim
e1fce8304d Update weight calculator and add specs 2019-07-23 23:24:00 +08:00
Kristina Lim
0d6ba90ea1 Round off fee from Calculator::Weight to nearest cent 2019-07-24 00:42:42 +10:00
luisramos0
160b535e2f Make weight calculator compute 0 for variants with unit different from weight 2019-06-18 15:21:13 +01:00
luisramos0
e8eeb3d5dc Further improve weight calculator code 2019-06-18 13:28:16 +01:00
luisramos0
4551149532 Improve code of weight calculator 2019-05-31 19:55:39 +01:00
luisramos0
82955b9fe5 Make weight calculator use line_item.final_weight_volume rather than variant.weight for cases where the final weight is set manually in the BOM 2019-05-31 19:55:17 +01:00
130 changed files with 8180 additions and 1449 deletions

View File

@@ -1 +1 @@
2.1.5
2.1.9

12
Gemfile
View File

@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby "2.1.5"
ruby "2.1.9"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'i18n', '~> 0.6.11'
@@ -85,7 +85,6 @@ gem 'paperclip', '~> 3.4.1'
gem 'rack-rewrite'
gem 'rack-ssl', require: 'rack/ssl'
gem 'roadie-rails', '~> 1.1.1'
gem 'skylight', '< 2.0'
gem 'spinjs-rails'
gem 'combine_pdf'
@@ -105,7 +104,10 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1'
gem 'compass-rails'
gem 'therubyracer', '=0.12.0'
gem 'mini_racer', '0.1.15'
# Previously we found that libv8 6.7.288.46.1 breakis the compilation of mini_racer.
# Now we see that we need to set the version explicitly. Nothing else depends on libv8.
gem 'libv8', '6.3.292.48.1'
gem 'uglifier', '>= 1.0.3'
@@ -157,10 +159,6 @@ end
group :development do
gem 'byebug', '~> 9.0.0' # 9.1 requires ruby 2.2
gem 'debugger-linecache'
gem 'guard'
gem 'guard-livereload'
gem 'guard-rails'
gem 'guard-rspec', '~> 4.7.3'
gem 'listen', '3.0.8' # 3.1.0 requires ruby 2.2
gem "newrelic_rpm", "~> 3.0"
gem 'pry-byebug', '>= 3.4.3'

View File

@@ -164,7 +164,7 @@ GEM
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
blockenspiel (0.5.0)
bugsnag (6.12.0)
bugsnag (6.12.1)
concurrent-ruby (~> 1.0)
builder (3.0.4)
byebug (9.0.6)
@@ -223,7 +223,7 @@ GEM
activerecord (>= 3.2.0, < 5.0)
fog (~> 1.0)
rails (>= 3.2.0, < 5.0)
ddtrace (0.26.0)
ddtrace (0.27.0)
msgpack
debugger-linecache (1.2.0)
deface (1.0.2)
@@ -252,9 +252,6 @@ GEM
diffy (3.3.0)
docile (1.3.2)
dry-inflector (0.1.2)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0)
eventmachine (1.2.7)
excon (0.62.0)
@@ -432,34 +429,11 @@ GEM
ruby-progressbar (~> 1.4)
geocoder (1.1.8)
gmaps4rails (1.5.6)
guard (2.15.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-livereload (2.5.2)
em-websocket (~> 0.5)
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
guard-rails (0.7.2)
guard (~> 2.11)
guard-compat (~> 1.0)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
haml (4.0.7)
tilt
hashdiff (1.0.0)
highline (1.6.18)
hike (1.2.3)
http_parser.rb (0.6.0)
httparty (0.16.2)
multi_xml (>= 0.5.2)
i18n (0.6.11)
@@ -491,11 +465,10 @@ GEM
addressable (~> 2.3)
letter_opener (1.7.0)
launchy (~> 2.2)
libv8 (3.16.14.19)
libv8 (6.3.292.48.1)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
lumberjack (1.0.13)
mail (2.5.5)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@@ -503,6 +476,8 @@ GEM
mime-types (1.25.1)
mini_mime (1.0.1)
mini_portile2 (2.1.0)
mini_racer (0.1.15)
libv8 (~> 6.3)
momentjs-rails (2.20.1)
railties (>= 3.1)
money (5.1.1)
@@ -511,15 +486,11 @@ GEM
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
nenv (0.3.0)
net-http-persistent (3.1.0)
connection_pool (~> 2.2)
newrelic_rpm (3.18.1.330)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
oauth2 (1.4.1)
faraday (>= 0.8, < 0.16.0)
jwt (>= 1.0, < 3.0)
@@ -610,7 +581,6 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.5.0)
ref (2.0.0)
request_store (1.4.1)
rack (>= 1.4)
roadie (3.4.0)
@@ -673,10 +643,9 @@ GEM
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
shellany (0.0.1)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
simplecov (0.17.0)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
@@ -685,8 +654,6 @@ GEM
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
skylight (1.7.2)
activesupport (>= 3.0.0)
spinjs-rails (1.4)
rails (>= 3.1)
spreadsheet (1.1.7)
@@ -704,9 +671,6 @@ GEM
stripe (4.24.0)
faraday (~> 0.13)
net-http-persistent (~> 3.0)
therubyracer (0.12.0)
libv8 (~> 3.16.14.0)
ref
thor (0.20.3)
tilt (1.4.1)
timecop (0.9.1)
@@ -739,7 +703,7 @@ GEM
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (~> 3.0)
webmock (3.7.1)
webmock (3.7.5)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -796,10 +760,6 @@ DEPENDENCIES
fuubar (~> 2.4.1)
geocoder
gmaps4rails
guard
guard-livereload
guard-rails
guard-rspec (~> 4.7.3)
haml
i18n (~> 0.6.11)
i18n-js (~> 3.3.0)
@@ -811,7 +771,9 @@ DEPENDENCIES
kaminari (~> 0.14.1)
knapsack
letter_opener (>= 1.4.1)
libv8 (= 6.3.292.48.1)
listen (= 3.0.8)
mini_racer (= 0.1.15)
momentjs-rails
newrelic_rpm (~> 3.0)
nokogiri (>= 1.6.7.1)
@@ -843,7 +805,6 @@ DEPENDENCIES
shoulda-matchers
simple_form!
simplecov
skylight (< 2.0)
spinjs-rails
spree_api!
spree_backend!
@@ -853,7 +814,6 @@ DEPENDENCIES
spring (= 1.7.2)
spring-commands-rspec
stripe
therubyracer (= 0.12.0)
timecop
truncate_html
turbo-sprockets-rails3
@@ -868,7 +828,7 @@ DEPENDENCIES
wkhtmltopdf-binary
RUBY VERSION
ruby 2.1.5p273
ruby 2.1.9p490
BUNDLED WITH
1.17.2

View File

@@ -1,11 +0,0 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|slim)$})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
# Rails Assets Pipeline
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" }
end

View File

@@ -1,6 +1,5 @@
[![Build Status](https://semaphoreci.com/api/v1/openfoodfoundation/openfoodnetwork-2/branches/master/badge.svg)](https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2)
[![Code Climate](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork.png)](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
[![View performance data on Skylight](https://badges.skylight.io/status/EiXQ6sSKij8y.svg)](https://oss.skylight.io/app/applications/EiXQ6sSKij8y)
# Open Food Network
@@ -36,7 +35,7 @@ We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. B
Copyright (c) 2012 - 2019 Open Food Foundation, released under the AGPL licence.
[survey]: https://docs.google.com/a/eaterprises.com.au/forms/d/1zxR5vSiU9CigJ9cEaC8-eJLgYid8CR8er7PPH9Mc-30/edit#
[slack-invite]: https://openfoodnetwork.org/slack-invite
[slack-invite]: https://join.slack.com/t/openfoodnetwork/shared_invite/enQtMzU2Mjk5MDc2MjA5LTM4ZTAzZjIwNzIxMmU5ODFiNWY1MTU2ZWUyNzQwNjdjNTY0N2VhY2UwOGU4ZmVjNzYyZDU2NjY3NzZkZmQwYjk
[contributor-guide]: https://ofn-user-guide.gitbook.io/ofn-contributor-guide/who-are-we
[ofn-install]: https://github.com/openfoodfoundation/ofn-install
[super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide

View File

@@ -0,0 +1,105 @@
require 'open_food_network/scope_variant_to_hub'
module Api
class ShipmentsController < Api::BaseController
respond_to :json
before_filter :find_order
before_filter :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
def create
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@shipment = get_or_create_shipment(params[:stock_location_id])
@order.contents.add(variant, quantity, nil, @shipment)
@shipment.refresh_rates
@shipment.save!
render json: @shipment.reload, serializer: Api::ShipmentSerializer, status: :ok
end
def update
authorize! :read, Spree::Shipment
@shipment = @order.shipments.find_by_number!(params[:id])
params[:shipment] ||= []
unlock = params[:shipment].delete(:unlock)
if unlock == 'yes'
@shipment.adjustment.open
end
@shipment.update_attributes(params[:shipment])
if unlock == 'yes'
@shipment.adjustment.close
end
render json: @shipment.reload, serializer: Api::ShipmentSerializer, status: :ok
end
def ready
authorize! :read, Spree::Shipment
unless @shipment.ready?
if @shipment.can_ready?
@shipment.ready!
else
render(json: { error: I18n.t(:cannot_ready, scope: "spree.api.shipment") },
status: :unprocessable_entity) && return
end
end
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
end
def ship
authorize! :read, Spree::Shipment
unless @shipment.shipped?
@shipment.ship!
end
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
end
def add
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@order.contents.add(variant, quantity, nil, @shipment)
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
end
def remove
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@order.contents.remove(variant, quantity, @shipment)
@shipment.reload if @shipment.persisted?
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
end
private
def find_order
@order = Spree::Order.find_by_number!(params[:order_id])
authorize! :read, @order
end
def find_and_update_shipment
@shipment = @order.shipments.find_by_number!(params[:id])
@shipment.update_attributes(params[:shipment])
@shipment.reload
end
def scoped_variant(variant_id)
variant = Spree::Variant.find(variant_id)
OpenFoodNetwork::ScopeVariantToHub.new(@order.distributor).scope(variant)
variant
end
def get_or_create_shipment(stock_location_id)
@order.shipment || @order.shipments.create(stock_location_id: stock_location_id)
end
end
end

View File

@@ -0,0 +1,12 @@
module Api
class TaxonomiesController < Api::BaseController
respond_to :json
skip_authorization_check only: :jstree
def jstree
@taxonomy = Spree::Taxonomy.find(params[:id])
render json: @taxonomy.root, serializer: Api::TaxonJstreeSerializer
end
end
end

View File

@@ -0,0 +1,71 @@
module Api
class TaxonsController < Api::BaseController
respond_to :json
skip_authorization_check only: [:index, :show, :jstree]
def index
if taxonomy
@taxons = taxonomy.root.children
else
if params[:ids]
@taxons = Spree::Taxon.where(id: params[:ids].split(","))
else
@taxons = Spree::Taxon.ransack(params[:q]).result
end
end
render json: @taxons, each_serializer: Api::TaxonSerializer
end
def jstree
@taxon = taxon
render json: @taxon.children, each_serializer: Api::TaxonJstreeSerializer
end
def create
authorize! :create, Spree::Taxon
@taxon = Spree::Taxon.new(params[:taxon])
@taxon.taxonomy_id = params[:taxonomy_id]
taxonomy = Spree::Taxonomy.find_by_id(params[:taxonomy_id])
if taxonomy.nil?
@taxon.errors[:taxonomy_id] = I18n.t(:invalid_taxonomy_id, scope: 'spree.api')
invalid_resource!(@taxon) && return
end
@taxon.parent_id = taxonomy.root.id unless params[:taxon][:parent_id]
if @taxon.save
render json: @taxon, serializer: Api::TaxonSerializer, status: :created
else
invalid_resource!(@taxon)
end
end
def update
authorize! :update, Spree::Taxon
if taxon.update_attributes(params[:taxon])
render json: taxon, serializer: Api::TaxonSerializer, status: :ok
else
invalid_resource!(taxon)
end
end
def destroy
authorize! :delete, Spree::Taxon
taxon.destroy
render json: taxon, serializer: Api::TaxonSerializer, status: :no_content
end
private
def taxonomy
return if params[:taxonomy_id].blank?
@taxonomy ||= Spree::Taxonomy.find(params[:taxonomy_id])
end
def taxon
@taxon ||= taxonomy.taxons.find(params[:id])
end
end
end

View File

@@ -152,7 +152,7 @@ class CheckoutController < Spree::CheckoutController
end
def update_failed
clear_ship_address
current_order.updater.shipping_address_from_distributor
RestartCheckout.new(@order).call
respond_to do |format|
@@ -165,15 +165,6 @@ class CheckoutController < Spree::CheckoutController
end
end
# When we have a pickup Shipping Method,
# we clone the distributor address into ship_address before_save
# We don't want this data in the form, so we clear it out
def clear_ship_address
unless current_order.shipping_method.andand.require_ship_address
current_order.ship_address = Spree::Address.default
end
end
def load_order
@order = current_order
redirect_to(main_app.shop_path) && return unless @order && @order.checkout_allowed?

View File

@@ -3,7 +3,6 @@ require 'open_food_network/spree_api_key_loader'
Spree::Admin::OrdersController.class_eval do
include OpenFoodNetwork::SpreeApiKeyLoader
helper CheckoutHelper
before_filter :load_spree_api_key, only: :bulk_management
before_filter :load_order, only: %i[show edit update fire resend invoice print print_ticket]
before_filter :load_distribution_choices, only: [:new, :edit, :update]
@@ -27,6 +26,10 @@ Spree::Admin::OrdersController.class_eval do
# within the page then fetches the data it needs from Api::OrdersController
end
def bulk_management
load_spree_api_key
end
def edit
@order.shipments.map &:refresh_rates

View File

@@ -46,7 +46,12 @@ module Spree
@user.spree_roles = roles.reject(&:blank?).collect{ |r| Spree::Role.find(r) }
end
flash.now[:success] = Spree.t(:account_updated)
message = if new_email_unconfirmed?
Spree.t(:email_updated)
else
Spree.t(:account_updated)
end
flash.now[:success] = message
end
render :edit
end
@@ -126,6 +131,10 @@ module Spree
def load_roles
@roles = Spree::Role.scoped
end
def new_email_unconfirmed?
params[:user][:email] != @user.email
end
end
end
end

View File

@@ -1,108 +0,0 @@
require 'open_food_network/scope_variant_to_hub'
module Spree
module Api
class ShipmentsController < Spree::Api::BaseController
respond_to :json
before_filter :find_order
before_filter :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
def create
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@shipment = get_or_create_shipment(params[:stock_location_id])
@order.contents.add(variant, quantity, nil, @shipment)
@shipment.refresh_rates
@shipment.save!
respond_with(@shipment.reload, default_template: :show)
end
def update
authorize! :read, Shipment
@shipment = @order.shipments.find_by_number!(params[:id])
params[:shipment] ||= []
unlock = params[:shipment].delete(:unlock)
if unlock == 'yes'
@shipment.adjustment.open
end
@shipment.update_attributes(params[:shipment])
if unlock == 'yes'
@shipment.adjustment.close
end
@shipment.reload
respond_with(@shipment, default_template: :show)
end
def ready
authorize! :read, Shipment
unless @shipment.ready?
if @shipment.can_ready?
@shipment.ready!
else
render "spree/api/shipments/cannot_ready_shipment", status: :unprocessable_entity
return
end
end
respond_with(@shipment, default_template: :show)
end
def ship
authorize! :read, Shipment
unless @shipment.shipped?
@shipment.ship!
end
respond_with(@shipment, default_template: :show)
end
def add
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@order.contents.add(variant, quantity, nil, @shipment)
respond_with(@shipment, default_template: :show)
end
def remove
variant = scoped_variant(params[:variant_id])
quantity = params[:quantity].to_i
@order.contents.remove(variant, quantity, @shipment)
@shipment.reload if @shipment.persisted?
respond_with(@shipment, default_template: :show)
end
private
def find_order
@order = Spree::Order.find_by_number!(params[:order_id])
authorize! :read, @order
end
def find_and_update_shipment
@shipment = @order.shipments.find_by_number!(params[:id])
@shipment.update_attributes(params[:shipment])
@shipment.reload
end
def scoped_variant(variant_id)
variant = Spree::Variant.find(variant_id)
OpenFoodNetwork::ScopeVariantToHub.new(@order.distributor).scope(variant)
variant
end
def get_or_create_shipment(stock_location_id)
@order.shipment || @order.shipments.create(stock_location_id: stock_location_id)
end
end
end
end

View File

@@ -1,75 +0,0 @@
module Spree
module Api
class TaxonsController < Spree::Api::BaseController
respond_to :json
def index
if taxonomy
@taxons = taxonomy.root.children
else
if params[:ids]
@taxons = Taxon.where(id: params[:ids].split(","))
else
@taxons = Taxon.ransack(params[:q]).result
end
end
respond_with(@taxons)
end
def show
@taxon = taxon
respond_with(@taxon)
end
def jstree
show
end
def create
authorize! :create, Taxon
@taxon = Taxon.new(params[:taxon])
@taxon.taxonomy_id = params[:taxonomy_id]
taxonomy = Taxonomy.find_by_id(params[:taxonomy_id])
if taxonomy.nil?
@taxon.errors[:taxonomy_id] = I18n.t(:invalid_taxonomy_id, scope: 'spree.api')
invalid_resource!(@taxon) && return
end
@taxon.parent_id = taxonomy.root.id unless params[:taxon][:parent_id]
if @taxon.save
respond_with(@taxon, status: 201, default_template: :show)
else
invalid_resource!(@taxon)
end
end
def update
authorize! :update, Taxon
if taxon.update_attributes(params[:taxon])
respond_with(taxon, status: 200, default_template: :show)
else
invalid_resource!(taxon)
end
end
def destroy
authorize! :delete, Taxon
taxon.destroy
respond_with(taxon, status: 204)
end
private
def taxonomy
return if params[:taxonomy_id].blank?
@taxonomy ||= Taxonomy.find(params[:taxonomy_id])
end
def taxon
@taxon ||= taxonomy.taxons.find(params[:id])
end
end
end
end

View File

@@ -38,10 +38,6 @@ module Spree
end
end
def nav_bar
render partial: 'spree/shared/nav_bar'
end
private
def accurate_title

View File

@@ -13,8 +13,43 @@ module Calculator
def compute(object)
line_items = line_items_for object
total_weight = line_items.sum { |li| ((li.variant.andand.weight || 0) * li.quantity) }
total_weight * preferred_per_kg
(total_weight(line_items) * preferred_per_kg).round(2)
end
private
def total_weight(line_items)
line_items.sum do |line_item|
line_item_weight(line_item)
end
end
def line_item_weight(line_item)
if line_item.final_weight_volume.present?
weight_per_final_weight_volume(line_item)
else
weight_per_variant(line_item) * line_item.quantity
end
end
def weight_per_variant(line_item)
line_item.variant.andand.weight || 0
end
def weight_per_final_weight_volume(line_item)
if line_item.variant.product.andand.variant_unit == 'weight'
# Divided by 1000 because grams is the base weight unit and the calculator price is per_kg
line_item.final_weight_volume / 1000.0
else
weight_per_variant(line_item) * quantity_implied_in_final_weight_volume(line_item)
end
end
# Example: 2 (line_item.quantity) wine glasses of 125mL (line_item.variant.unit_value)
# Customer ends up getting 350mL (line_item.final_weight_volume) of wine
# that represent 2.8 (quantity_implied_in_final_weight_volume) glasses of wine
def quantity_implied_in_final_weight_volume(line_item)
(1.0 * line_item.final_weight_volume / line_item.variant.unit_value).round(3)
end
end
end

View File

@@ -100,13 +100,13 @@ module VariantStock
# Here we depend only on variant.total_on_hand and variant.on_demand.
# This way, variant_overrides only need to override variant.total_on_hand and variant.on_demand.
def fill_status(quantity)
if on_hand >= quantity
on_hand = quantity
backordered = 0
else
on_hand = [0, total_on_hand].max
backordered = on_demand ? (quantity - on_hand) : 0
end
on_hand = if total_on_hand >= quantity || on_demand
quantity
else
[0, total_on_hand].max
end
backordered = 0
[on_hand, backordered]
end
@@ -117,6 +117,9 @@ module VariantStock
def move(quantity, originator = nil)
raise_error_if_no_stock_item_available
# Don't change variant stock if variant is on_demand
return if on_demand
# Creates a stock movement: it updates stock_item.count_on_hand and fills backorders
#
# This is the original Spree::StockLocation#move,

View File

@@ -1,7 +1,14 @@
module Spree
Price.class_eval do
acts_as_paranoid without_default_scope: true
after_save :refresh_products_cache
# Allow prices to access associated soft-deleted variants.
def variant
Spree::Variant.unscoped { super }
end
private
def check_price

View File

@@ -91,6 +91,11 @@ Spree::Variant.class_eval do
can_supply?(quantity)
end
# Allow variant to access associated soft-deleted prices.
def default_price
Spree::Price.unscoped { super }
end
def price_with_fees(distributor, order_cycle)
price + fees_for(distributor, order_cycle)
end

View File

@@ -10,6 +10,11 @@ class SubscriptionLineItem < ActiveRecord::Base
(price_estimate || 0) * (quantity || 0)
end
# Ensure SubscriptionLineItem always has access to soft-deleted Variant attribute
def variant
Spree::Variant.unscoped { super }
end
# Used to calculators to estimate fees
alias_method :amount, :total_estimate

View File

@@ -1,6 +0,0 @@
Deface::Override.new(virtual_path: "spree/layouts/admin",
name: "user_admin_tabs",
insert_bottom: "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
partial: "spree/admin/users_tab",
disabled: false,
original: '031652cf5a054796022506622082ab6d2693699f')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(virtual_path: "spree/layouts/admin",
name: "auth_admin_login_navigation_bar",
insert_top: "[data-hook='admin_login_navigation_bar'], #admin_login_navigation_bar[data-hook]",
partial: "spree/layouts/admin/login_nav",
original: '841227d0aedf7909d62237d8778df99100087715')

View File

@@ -1,6 +0,0 @@
Deface::Override.new(virtual_path: "spree/shared/_nav_bar",
name: "auth_shared_login_bar",
insert_before: "li#search-bar",
partial: "spree/shared/login_bar",
disabled: false,
original: 'eb3fa668cd98b6a1c75c36420ef1b238a1fc55ac')

View File

@@ -1,3 +0,0 @@
Deface::Override.new(virtual_path: "spree/shared/_nav_bar",
remove: "#search-bar",
name: "search_removal")

View File

@@ -1,3 +0,0 @@
Deface::Override.new(virtual_path: "spree/shared/_sidebar",
remove: "#sidebar",
name: "sidebar_removal")

View File

@@ -1,5 +0,0 @@
Deface::Override.new(virtual_path: "spree/layouts/admin",
insert_bottom: "[data-hook='admin_inside_head']",
partial: "layouts/auth_token_script",
name: "set_auth_token_in_backend",
original: '6bc2c5de1c8f7542d033548557437c9fe4b3ba02')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(virtual_path: "spree/layouts/spree_application",
insert_bottom: "[data-hook='inside_head']",
partial: "layouts/auth_token_script",
name: "set_auth_token_in_frontend",
original: '5659ac7dbf6ac6469907b005b85285b894677815')

View File

@@ -1,5 +0,0 @@
<!-- surround_contents 'body' -->
<div <%= yield(:app_wrapper_attrs).strip.html_safe %>>
<%= render_original %>
</div>

View File

@@ -1,19 +0,0 @@
/ replace "footer"
-#= render partial: "shared/footer"
%footer
%hr/
-#.row
-#.seven.columns.offset-by-three
-#%center
-#%h1 What is open food network?
-#%p
-#%i
-#Open food network is an online space in which people can connect with, trade and sell food directly with
-#Australian farmers. We aim to reconnect people with their food.
-#%hr/
-#.row
-#.five.columns.secondary.offset-by-seven.secondary
-#All rights reserved. &copy; 2013 Open Food Foundation

View File

@@ -1,8 +0,0 @@
/ replace "#logo"
%figure#logo.columns.eight
- if current_distributor
%h1= link_to current_distributor.name, main_app.enterprise_shop_path(current_distributor)
.change-location= link_to 'Change Location', root_path
- else
%h1= link_to "OPEN FOOD NETWORK", root_path

View File

@@ -1,2 +0,0 @@
/ set_attributes '#top-nav-bar'
/ attributes({:class => "columns eight"})

View File

@@ -1,5 +0,0 @@
/ insert_before "#password-credentials"
- if @unconfirmed_email
%p.alert-box
= t('spree.users.show.unconfirmed_email', unconfirmed_email: @unconfirmed_email)

View File

@@ -0,0 +1,13 @@
module Api
class ShipmentSerializer < ActiveModel::Serializer
attributes :id, :tracking, :number, :order_id, :cost, :shipped_at, :stock_location_name, :state
def order_id
object.order.number
end
def stock_location_name
object.stock_location.name
end
end
end

View File

@@ -0,0 +1,5 @@
module Api
class TaxonJstreeAttributeSerializer < ActiveModel::Serializer
attributes :id, :name
end
end

View File

@@ -0,0 +1,18 @@
module Api
class TaxonJstreeSerializer < ActiveModel::Serializer
attributes :data, :state
has_one :attr, serializer: TaxonJstreeAttributeSerializer
def data
object.name
end
def attr
object
end
def state
"closed"
end
end
end

View File

@@ -2,7 +2,7 @@ class Api::TaxonSerializer < ActiveModel::Serializer
cached
delegate :cache_key, to: :object
attributes :id, :name, :permalink, :icon
attributes :id, :name, :permalink, :icon, :pretty_name, :position, :parent_id, :taxonomy_id
def icon
object.icon(:original)

View File

@@ -73,7 +73,9 @@ class EmbeddedPageService
def current_referer
return if @request.referer.blank?
URI(@request.referer).host.downcase
uri = URI(@request.referer)
return if uri.host.blank?
uri.host.downcase
end
def current_referer_without_www

View File

@@ -9,8 +9,8 @@ class SubscriptionValidator
attr_reader :subscription
validates_presence_of :shop, :customer, :schedule, :shipping_method, :payment_method
validates_presence_of :bill_address, :ship_address, :begins_at
validates :shop, :customer, :schedule, :shipping_method, :payment_method, presence: true
validates :bill_address, :ship_address, :begins_at, presence: true
validate :shipping_method_allowed?
validate :payment_method_allowed?
validate :payment_method_type_allowed?

View File

@@ -2,8 +2,8 @@
%h1.page-title
=t :customers
- content_for :app_wrapper_attrs do
= "ng-app='admin.customers'"
- content_for :main_ng_app_name do
= "admin.customers"
- content_for :page_actions do
%li

View File

@@ -4,8 +4,8 @@
= t('.editing')
= @enterprise.name
- content_for :app_wrapper_attrs do
= "ng-app='admin.enterprises'"
- content_for :main_ng_app_name do
= "admin.enterprises"
- content_for :page_actions do
%li= select :enterprise, :id, options_for_select(editable_enterprises.collect {|e| [e.name, e.id, {:'data-url' => "#{main_app.edit_admin_enterprise_path(e.permalink)}", :'ng-selected' => "selected==#{e.id}"}]}, @enterprise.id ), {}, {:'enterprise-switcher' => '', 'data-initial' => "#{@enterprise.id}", :'ng-init' => "selected='#{@enterprise.id}'", :'ng-model' => 'selected', :id => 'enterprise_switcher', :class => 'select2'}

View File

@@ -1,8 +1,8 @@
- content_for :page_title do
= t('.title')
- content_for :app_wrapper_attrs do
= "ng-app='admin.enterprises'"
- content_for :main_ng_app_name do
= "admin.enterprises"
- content_for :page_actions do
= render 'admin/shared/user_guide_link'

View File

@@ -6,8 +6,8 @@
- content_for :page_actions do
%li= button_link_to t('.back_link'), main_app.admin_enterprises_path, icon: 'icon-arrow-left'
- content_for :app_wrapper_attrs do
= "ng-app='admin.enterprises'"
- content_for :main_ng_app_name do
= "admin.enterprises"
= admin_inject_available_countries(module: 'admin.enterprises')
= admin_inject_json "admin.enterprises", "defaultCountryID", Spree::Config[:default_country_id]

View File

@@ -1,8 +1,8 @@
= content_for :page_title do
= t :admin_order_cycles
- content_for :app_wrapper_attrs do
= "ng-app='admin.orderCycles'"
- content_for :main_ng_app_name do
= "admin.orderCycles"
= content_for :page_actions do
- if subscriptions_enabled?

View File

@@ -1,8 +1,8 @@
- content_for :page_title do
= t('admin.subscriptions.subscriptions')
- content_for :app_wrapper_attrs do
= "ng-app='admin.subscriptions'"
- content_for :main_ng_app_name do
= "admin.subscriptions"
- content_for :page_actions do
%li

View File

@@ -146,13 +146,3 @@
= t '.footer_data_text_without_privacy_policy_html', {cookies_policy: cookies_policy_link.html_safe }
.medium-2.columns.text-center
/ Placeholder
-if ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL'].present?
.row
.small-12.medium-8.medium-offset-2.columns.text-center
%hr.hr-light
%br
.row
.small-12.medium-8.medium-offset-2.columns.text-center
.text.small
= t '.footer_skylight_dashboard_html', {dashboard: link_to('Skylight', ENV['SKYLIGHT_PUBLIC_DASHBOARD_URL'], target: "_blank")}

View File

@@ -1,2 +0,0 @@
- if can? :admin, Spree::User
= tab(:users, url: spree.admin_users_path, icon: 'icon-user')

View File

@@ -2,12 +2,12 @@
- content_for :page_title do
%i.icon-arrow-right
= Spree.t(:adjustments)
= t(:adjustments)
- content_for :page_actions do
%li= button_link_to Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), :icon => 'icon-plus'
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'
%li= button_link_to t(:new_adjustment), new_admin_order_adjustment_url(@order), :icon => 'icon-plus'
%li= button_link_to t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'
= render :partial => 'adjustments_table'
= button_link_to Spree.t(:continue), @order.cart? ? new_admin_order_payment_url(@order) : admin_orders_url, :icon => 'icon-arrow-right'
= button_link_to t(:continue), @order.cart? ? new_admin_order_payment_url(@order) : admin_orders_url, :icon => 'icon-arrow-right'

View File

@@ -8,7 +8,7 @@
= Spree.t("shipment_states.#{shipment.state}")
- if shipment.ready? and can? :update, shipment
= "-"
= link_to 'ship', '#', :class => 'ship button icon-arrow-right', :data => { 'shipment-number' => shipment.number }
= link_to t(:ship), '#', :class => 'ship button icon-arrow-right', :data => { 'shipment-number' => shipment.number }
%table.stock-contents.index{ "data-hook" => "stock-contents" }
%colgroup

View File

@@ -10,7 +10,7 @@
= line_item.single_money.to_html
%td.item-qty-show.align-center
- item.states.each do |state,count|
= "#{count} x #{state.humanize.downcase}"
= "#{count} x #{t(state.humanize.downcase)}"
- unless shipment.shipped?
%td.item-qty-edit.hidden
= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5

View File

@@ -1,5 +1,5 @@
- content_for :app_wrapper_attrs do
= "ng-app='admin.lineItems'"
- content_for :main_ng_app_name do
= "admin.lineItems"
- content_for :page_title do
%h1.page-title

View File

@@ -13,8 +13,8 @@
#select-customer{"data-hook" => ""}
%fieldset.no-border-bottom
%legend{:align => "center"}= Spree.t(:customer_search)
- content_for :app_wrapper_attrs do
= 'ng-app=admin.orders'
- content_for :main_ng_app_name do
= "admin.orders"
= hidden_field_tag :customer_search_override, nil, distributor_id: @order.distributor_id, :class => 'fullwidth title customer-search-override'
= render :partial => "spree/admin/orders/customer_details/autocomplete", :formats => :js

View File

@@ -6,7 +6,7 @@
%li= button_link_to Spree.t(:resend), resend_admin_order_url(@order), :method => :post, :icon => 'icon-email'
%li.links-dropdown#links-dropdown{ links: order_links(@order).to_json }
- if can?(:admin, Spree::Order)
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'
%li= button_link_to t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'
= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Order Details' }

View File

@@ -7,8 +7,11 @@
= render partial: 'spree/admin/shared/order_sub_menu'
- content_for :app_wrapper_attrs do
= "ng-app='admin.orders' ng-controller='ordersCtrl'"
- content_for :main_ng_app_name do
= "admin.orders"
- content_for :main_ng_ctrl_name do
= "ordersCtrl"
- content_for :table_filter_title do
= t(:search)

View File

@@ -2,9 +2,9 @@
%thead
%tr
%th= "#{Spree.t('date')}/#{Spree.t('time')}"
%th= Spree.t(:amount)
%th= Spree.t(:payment_method)
%th= Spree.t(:payment_state)
%th= t(:amount)
%th= t(:payment_method)
%th= t(:payment_state)
%th.actions
%tbody
- payments.each do |payment|
@@ -13,7 +13,7 @@
%td.align-center= payment.display_amount.to_html
%td.align-center= link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment)
%td.align-center
%span{class: "state #{payment.state}"}= Spree.t(payment.state, scope: :payment_states, default: payment.state.capitalize)
%span{class: "state #{payment.state}"}= t(payment.state, scope: :payment_states, default: payment.state.capitalize)
%td.actions
- payment.actions.each do |action|
= link_to_with_icon "icon-#{action}", Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: {action: action}

View File

@@ -3,20 +3,20 @@
- content_for :page_actions do
- if @order.outstanding_balance?
%li#new_payment_section
= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order), icon: 'icon-plus'
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, icon: 'icon-arrow-left'
= button_link_to t(:new_payment), new_admin_order_payment_url(@order), icon: 'icon-plus'
%li= button_link_to t(:back_to_orders_list), admin_orders_path, icon: 'icon-arrow-left'
- content_for :page_title do
%i.icon-arrow-right
= Spree.t(:payments)
= t(:payments)
- if @order.outstanding_balance?
%h5.outstanding-balance
= @order.outstanding_balance < 0 ? Spree.t(:credit_owed) : Spree.t(:balance_due)
= @order.outstanding_balance < 0 ? t(:credit_owed) : t(:balance_due)
\:
%strong= @order.display_outstanding_balance
- if @payments.any?
= render partial: 'list', locals: { payments: @payments }
- else
.alpha.twelve.columns.no-objects-found= Spree.t(:order_has_no_payments)
.alpha.twelve.columns.no-objects-found= t(:order_has_no_payments)

View File

@@ -24,4 +24,6 @@
= render "layouts/bugherd_script"
%link{'data-require' => "font-awesome@*", 'data-semver'=>"4.2.0", 'rel' => "stylesheet", 'href' => "//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css"}
= render "layouts/auth_token_script"
= yield :head

View File

@@ -1,7 +1,7 @@
<script>
Spree.routes = <%== {
:variants_search => spree.admin_search_variants_path(:format => 'json'),
:taxons_search => spree.api_taxons_path(:format => 'json'),
:taxons_search => main_app.api_taxons_path(:format => 'json'),
:user_search => spree.admin_search_users_path(:format => 'json'),
:orders_api => spree.api_orders_path(:format => 'json')
}.to_json %>;

View File

@@ -7,3 +7,5 @@
= tab :enterprises, :url => main_app.admin_enterprises_path
= tab :customers, :url => main_app.admin_customers_path
= tab :enterprise_groups, :url => main_app.admin_enterprise_groups_path, label: 'groups'
- if can? :admin, Spree::User
= tab(:users, url: spree.admin_users_path, icon: 'icon-user')

View File

@@ -0,0 +1,78 @@
= admin_inject_currency_config
= render "layouts/i18n_script"
#wrapper{"data-hook" => ""}
- if flash[:error]
.flash.error= flash[:error]
- if notice
.flash.notice= notice
- if flash[:success]
.flash.success= flash[:success]
#progress
.wrapper
#spinner
.progress-message
= Spree.t(:loading)
\...
= render :partial => 'spree/admin/shared/alert', :collection => session[:alerts]
%header#header{"data-hook" => ""}
.container
%figure.columns.five{"data-hook" => "logo-wrapper"}
= link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_path
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
= render :partial => 'spree/layouts/admin/login_nav'
%nav#admin-menu{"data-hook" => ""}
.container
.sixteen.columns.main-menu-wrapper
%ul.inline-menu.fullwidth-menu{"data-hook" => "admin_tabs"}
= render :partial => 'spree/admin/shared/tabs'
- if content_for?(:sub_menu)
%nav#sub-menu{"data-hook" => ""}
.container
.sixteen.columns
= yield :sub_menu
- if content_for?(:page_title) || content_for?(:page_actions)
#content-header{"data-hook" => ""}
.container
.sixteen.columns
.block-table
- if content_for?(:page_title)
.table-cell
%h1{:class => "page-title"}= yield :page_title
- if content_for?(:page_actions)
.page-actions.table-cell.toolbar{"data-hook" => "toolbar"}
%ul.inline-menu
= yield :page_actions
.container
.row
- content_class = content_for?(:sidebar) ? "with-sidebar" : ""
#content{:class => content_class, "data-hook" => ""}
- if content_for?(:table_filter)
- table_filter_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
#table-filter{:class => table_filter_class, "data-hook" => ""}
%fieldset
%legend{:align => "center"}= yield :table_filter_title
= yield :table_filter
- div_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
%div{:class => div_class}
= yield
- if content_for?(:sidebar)
%aside#sidebar.four.columns{"data-hook" => ""}
- if content_for?(:sidebar_title)
%h5.sidebar-title
%span= yield :sidebar_title
= yield :sidebar
%div{"data-hook" => "admin_footer_scripts"}
= render 'spree/shared/google_analytics'
%script
= raw "Spree.api_key = \"#{try_spree_current_user.try(:spree_api_key).to_s}\";"

View File

@@ -4,80 +4,12 @@
= render :partial => 'spree/admin/shared/head'
%body.admin
= admin_inject_currency_config
= render "layouts/i18n_script"
#wrapper{"data-hook" => ""}
- if flash[:error]
.flash.error= flash[:error]
- if notice
.flash.notice= notice
- if flash[:success]
.flash.success= flash[:success]
#progress
.wrapper
#spinner
.progress-message
= Spree.t(:loading)
\...
= render :partial => 'spree/admin/shared/alert', :collection => session[:alerts]
%header#header{"data-hook" => ""}
.container
%figure.columns.five{"data-hook" => "logo-wrapper"}
= link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_path
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
%nav#admin-menu{"data-hook" => ""}
.container
.sixteen.columns.main-menu-wrapper
%ul.inline-menu.fullwidth-menu{"data-hook" => "admin_tabs"}
= render :partial => 'spree/admin/shared/tabs'
- if content_for?(:sub_menu)
%nav#sub-menu{"data-hook" => ""}
.container
.sixteen.columns
= yield :sub_menu
- if content_for?(:page_title) || content_for?(:page_actions)
#content-header{"data-hook" => ""}
.container
.sixteen.columns
.block-table
- if content_for?(:page_title)
.table-cell
%h1{:class => "page-title"}= yield :page_title
- if content_for?(:page_actions)
.page-actions.table-cell.toolbar{"data-hook" => "toolbar"}
%ul.inline-menu
= yield :page_actions
.container
.row
- content_class = content_for?(:sidebar) ? "with-sidebar" : ""
#content{:class => content_class, "data-hook" => ""}
- if content_for?(:table_filter)
- table_filter_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
#table-filter{:class => table_filter_class, "data-hook" => ""}
%fieldset
%legend{:align => "center"}= yield :table_filter_title
= yield :table_filter
- div_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
%div{:class => div_class}
= yield
- if content_for?(:sidebar)
%aside#sidebar.four.columns{"data-hook" => ""}
- if content_for?(:sidebar_title)
%h5.sidebar-title
%span= yield :sidebar_title
= yield :sidebar
%div{"data-hook" => "admin_footer_scripts"}
= render 'spree/shared/google_analytics'
%script
= raw "Spree.api_key = \"#{try_spree_current_user.try(:spree_api_key).to_s}\";"
- if content_for?(:main_ng_app_name)
- if content_for?(:main_ng_ctrl_name)
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe, "ng-controller" => yield(:main_ng_ctrl_name).strip.html_safe }
= render :partial => 'spree/layouts/admin_body'
- else
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe }
= render :partial => 'spree/layouts/admin_body'
- else
= render :partial => 'spree/layouts/admin_body'

View File

@@ -3,6 +3,10 @@
%br
= f.email_field :email, class: 'title'
- if @unconfirmed_email
%p.alert-box
= t('spree.users.show.unconfirmed_email', unconfirmed_email: @unconfirmed_email)
%div{"id" => "password-credentials"}
%p
= f.label :password, Spree.t(:password)

View File

@@ -16,7 +16,7 @@
.small-12.medium-6.columns
.new_card{ ng: { show: 'CreditCard.visible', class: '{visible: CreditCard.visible}' } }
%h3= t(:add_a_new_card)
%h3= t(:add_new_credit_card)
= render 'new_card_form'
.authorised_shops{ ng: { controller: 'AuthorisedShopsCtrl', hide: 'CreditCard.visible' } }
%h3

View File

@@ -25,13 +25,6 @@ module Openfoodnetwork
end
end
# Activate the Skylight agent in staging. You need to provision the
# SKYLIGHT_AUTHENTICATION env var in your OFN instance for this to work.
#
# Check https://github.com/openfoodfoundation/openfoodnetwork/pull/2070 for
# details
config.skylight.environments += ["staging"]
# Settings dependent on locale
#
# We need to set this config before the promo environment gets loaded and

View File

@@ -48,12 +48,6 @@ SMTP_PASSWORD: 'f00d'
# see: https://developers.google.com/maps/documentation/javascript/get-api-key
# GOOGLE_MAPS_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# optional, see: https://www.skylight.io/oss
# SKYLIGHT_AUTHENTICATION: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Should be set if using Skylight, adds a link to Skylight dashboard to our footer
# SKYLIGHT_PUBLIC_DASHBOARD_URL: "https://oss.skylight.io/app/applications/xxxxxxxxxx"
# Stripe Connect details for instance account
# Find these under 'API keys' and 'Connect' in your Stripe account dashboard -> Account Settings
# Under 'Connect', the Redirect URI should be set to https://YOUR_SERVER_URL/stripe/callbacks (e.g. https://openfoodnetwork.org.uk/stripe/callbacks)

View File

@@ -2,5 +2,6 @@ if ENV['DATADOG_RAILS_APM']
Datadog.configure do |c|
c.use :rails, service_name: 'rails'
c.use :delayed_job, service_name: 'delayed_job'
c.analytics_enabled = true
end
end

View File

@@ -245,6 +245,8 @@ ca:
expired: ha caducat, si us plau, sol·liciteu-ne un de nou
back_to_payments_list: "Torna a la llista de pagaments"
maestro_or_solo_cards: "Targetes Maestro/Solo"
backordered: "Reabastit"
ship: "Enviament"
actions:
create_and_add_another: "Crea i afegeix-ne una altra"
create: "Crear"
@@ -635,7 +637,7 @@ ca:
name: Nom
applies: Aplicar?
manage: Gestiona els mètodes de pagament
not_method_yet: Encara no tens cap mètode de pagament.
no_method_yet: Encara no tens cap mètode de pagament.
create_button: Crea un nou mètode de pagament
create_one_button: Crea'n un ara
primary_details:
@@ -1118,7 +1120,6 @@ ca:
footer_data_text_without_privacy_policy_html: "Tenim cura de les vostres dades. Vegeu la nostra %{cookies_policy}"
footer_data_privacy_policy: "política de privacitat"
footer_data_cookies_policy: "política de cookies"
footer_skylight_dashboard_html: Les dades de rendiment estan disponibles a %{dashboard}.
shop:
messages:
login: "Inicia sessió"
@@ -2633,6 +2634,8 @@ ca:
name_or_sku: "Nom o codi (introduïu com a mínim els primers 4 caràcters del nom del producte)"
resend: Reenviar
back_to_orders_list: Tornar a la llista de comandes
return_authorizations: Autoritzacions de devolució
cannot_create_returns: No es poden crear devolucions ja que aquesta comanda no té cap unitat enviada.
select_stock: "Seleccioneu existències"
location: "Ubicació"
count_on_hand: "Compte disponible"

View File

@@ -243,6 +243,7 @@ de_DE:
reset_password_token: Passwort-Token zurücksetzen
expired: abgelaufen ist, fordern Sie bitte ein neues an
back_to_payments_list: "Zurück zur Zahlungsliste"
ship: "Liefern"
actions:
create_and_add_another: "Erstellen und weitere hinzufügen"
create: "Neu"
@@ -630,7 +631,7 @@ de_DE:
name: Name
applies: Gilt?
manage: Zahlungsarten verwalten
not_method_yet: Sie haben noch keine Zahlungsarten
no_method_yet: Sie haben noch keine Zahlungsarten
create_button: Neue Zahlungsart
create_one_button: Erstelle jetzt eine
primary_details:
@@ -1108,7 +1109,6 @@ de_DE:
footer_data_text_without_privacy_policy_html: "Wir passen auf Ihre Daten auf. Siehe unsere %{cookies_policy}"
footer_data_privacy_policy: "Datenschutz-Bestimmungen"
footer_data_cookies_policy: "Cookie-Richtlinien"
footer_skylight_dashboard_html: Leistungsdaten sind in der %{dashboard} verfügbar.
shop:
messages:
login: "Anmeldung"

View File

@@ -276,6 +276,9 @@ en:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Maestro/Solo cards"
backordered: "Backordered"
on_hand: "On Hand"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
@@ -690,7 +693,7 @@ en:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1187,7 +1190,6 @@ en:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"
@@ -2771,6 +2773,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using
name_or_sku: "Name or SKU (enter at least first 4 characters of product name)"
resend: Resend
back_to_orders_list: Back To Orders List
return_authorizations: Return Authorizations
cannot_create_returns: Cannot create returns as this order has no shipped units.
select_stock: "Select stock"
location: "Location"
count_on_hand: "Count On Hand"
@@ -2939,6 +2943,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
email: Email
# TODO: remove 'account_updated' key once we get to Spree 2.0
account_updated: "Account updated!"
email_updated: "The account will be updated once the new email is confirmed."
my_account: "My account"
date: "Date"
time: "Time"

View File

@@ -245,6 +245,7 @@ en_AU:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Maestro/Solo cards"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -634,7 +635,7 @@ en_AU:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1116,7 +1117,6 @@ en_AU:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"

View File

@@ -243,6 +243,7 @@ en_BE:
reset_password_token: Reset password token
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -630,7 +631,7 @@ en_BE:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1110,7 +1111,6 @@ en_BE:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"

View File

@@ -245,6 +245,8 @@ en_CA:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Maestro/Solo cards"
backordered: "Backordered"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -634,7 +636,7 @@ en_CA:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1116,7 +1118,6 @@ en_CA:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"
@@ -2628,6 +2629,8 @@ en_CA:
name_or_sku: "Name or SKU (enter at least first 4 characters of product name)"
resend: Resend
back_to_orders_list: Back to Orders List
return_authorizations: Return Authoriations
cannot_create_returns: Cannot create returns as this order has no shipped units
select_stock: "Select stock"
location: "Location"
count_on_hand: "Count On Hand"

View File

@@ -245,6 +245,8 @@ en_GB:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Maestro/Solo cards"
backordered: "Backordered"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -634,7 +636,7 @@ en_GB:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1116,7 +1118,6 @@ en_GB:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"
@@ -2634,6 +2635,8 @@ en_GB:
name_or_sku: "Name or SKU (enter at least first 4 characters of product name)"
resend: Resend
back_to_orders_list: Back To Orders List
return_authorizations: Return Authorisations
cannot_create_returns: Cannot create returns as this order has no shipped units.
select_stock: "Select stock"
location: "Location"
count_on_hand: "Count On Hand"

3137
config/locales/en_NZ.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -245,6 +245,7 @@ en_US:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Debit cards"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -634,7 +635,7 @@ en_US:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1116,7 +1117,6 @@ en_US:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"

View File

@@ -245,6 +245,7 @@ en_ZA:
expired: has expired, please request a new one
back_to_payments_list: "Back to Payments List"
maestro_or_solo_cards: "Maestro/Solo cards"
ship: "Ship"
actions:
create_and_add_another: "Create and Add Another"
create: "Create"
@@ -634,7 +635,7 @@ en_ZA:
name: Name
applies: Applies?
manage: Manage Payment Methods
not_method_yet: You don't have any payment methods yet.
no_method_yet: You don't have any payment methods yet.
create_button: Create New Payment Method
create_one_button: Create One Now
primary_details:
@@ -1116,7 +1117,6 @@ en_ZA:
footer_data_text_without_privacy_policy_html: "We take good care of your data. See our %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: Performance data is available on %{dashboard}.
shop:
messages:
login: "login"

View File

@@ -245,6 +245,8 @@ es:
expired: ha expirado, por favor solicite una nueva
back_to_payments_list: "Volver a la lista de pagos"
maestro_or_solo_cards: "Tarjetas Maestro/Solo"
backordered: "Reabastecido"
ship: "Envío"
actions:
create_and_add_another: "Crear y agregar otro"
create: "Crear"
@@ -635,7 +637,7 @@ es:
name: Nombre
applies: ¿Aplicar?
manage: Gestionar los métodos de pago
not_method_yet: Todavía no tienes ningún método de pago.
no_method_yet: Todavía no tienes ningún método de pago.
create_button: Crear un nuevo método de pago
create_one_button: Crear una ahora
primary_details:
@@ -1118,7 +1120,6 @@ es:
footer_data_text_without_privacy_policy_html: "Cuidamos bien tus datos. Consulta nuestra %{cookies_policy}"
footer_data_privacy_policy: "política de privacidad"
footer_data_cookies_policy: "política de cookies"
footer_skylight_dashboard_html: Los datos de rendimiento están disponibles en %{dashboard}.
shop:
messages:
login: "login"
@@ -2634,6 +2635,8 @@ es:
name_or_sku: "Nombre o código SKU (ingrese al menos los primeros 4 caracteres del nombre del producto)"
resend: Reenviar
back_to_orders_list: Volver a la lista de pedidos
return_authorizations: Autorizaciones de devolución
cannot_create_returns: No se pueden crear devoluciones ya que este pedido no tiene unidades enviadas.
select_stock: "Seleccionar stock"
location: "Ubicación"
count_on_hand: "Cuenta de disponibilidad"

View File

@@ -110,7 +110,7 @@ fr:
confirmation_instructions:
subject: "Confirmez l'adresse email pour %{enterprise}"
welcome:
subject: "%{enterprise} est maintenant sur %{sitename}"
subject: "Dernière étape pour créer%{enterprise} sur %{sitename}"
invite_manager:
subject: "%{enterprise} vous a invité comme gestionnaire"
producer_mailer:
@@ -245,6 +245,8 @@ fr:
expired: a expiré, veuillez faire une nouvelle demande.
back_to_payments_list: "Retour à la liste des paiements"
maestro_or_solo_cards: "Cartes Maestro/Solo"
backordered: "(à volonté)"
ship: "Expédier"
actions:
create_and_add_another: "Créer et ajouter nouveau"
create: "Créer"
@@ -582,7 +584,7 @@ fr:
title: Entreprises
new_enterprise: Nouvelle entreprise
producer?: "Producteur?"
package: Pack
package: Type de profil
status: Statut
manage: Gérer
form:
@@ -635,7 +637,7 @@ fr:
name: Nom
applies: Active?
manage: Gérer les méthodes de paiement
not_method_yet: Vous n'avez pas encore de méthode de paiement.
no_method_yet: Vous n'avez pas encore de méthode de paiement.
create_button: Créer une nouvelle méthode de paiement
create_one_button: En créer une maintenant
primary_details:
@@ -670,14 +672,14 @@ fr:
create_one_button: En créer une maintenant
no_method_yet: Vous n'avez pas encore paramétré de méthode de livraison.
shop_preferences:
shopfront_requires_login: "Boutique visible par tous?"
shopfront_requires_login: "Boutique privée (accès contrôlé) ?"
shopfront_requires_login_tip: "Choisissez si les acheteurs doivent être connectés pour voir la boutique ou si la boutique est visible par tout le monde."
shopfront_requires_login_false: "Visible par tous"
shopfront_requires_login_true: "Visible uniquement pour les acheteurs logués"
shopfront_requires_login_false: "Boutique publique (visible par tous)"
shopfront_requires_login_true: "Visible uniquement pour les acheteurs connectés ET figurant sur la liste \"acheteurs\" de la boutique (boutique privée)"
recommend_require_login: "Nous recommandons de demander aux utilisateurs de se connecter si vous souhaitez leur permettre de modifier leur commande."
allow_guest_orders: "Commandes des invités"
allow_guest_orders_tip: "Autoriser la commande en tant qu'invité ou demander que l'acheteur soit logué."
allow_guest_orders_false: "Demander que l'acheteur se logue pour pouvoir commander"
allow_guest_orders_false: "Demander que l'acheteur se connecte pour pouvoir finaliser sa commande"
allow_guest_orders_true: "Autoriser les commandes en mode invité"
allow_order_changes: "Modifier la commande"
allow_order_changes_tip: "Permettre aux acheteurs de modifier leur commande tant que le cycle de vente est ouvert."
@@ -764,23 +766,23 @@ fr:
owner: Gestionnaire principal
producer: Producteur
change_type_form:
producer_profile: Profil producteur
connect_ofn: Gagnez en visibilité via OFFrance
always_free: GRATUIT
producer_description_text: Saisissez votre catalogue produits sur Open Food France, ce qui permettra aux hubs-distributeurs utilisant la plateforme de les proposer dans leurs boutiques (sur votre autorisation).
producer_profile: Profil simple
connect_ofn: Pour apparaître sur la carte et la liste des producteurs
always_free: ' '
producer_description_text: Nous vous invitons à renseigner votre profil de la façon la plus complète possible. Un profil complet et avec des images attire plus ! Vous pourrez mettre des liens pour rediriger les visiteurs vers votre site internet ou espace de vente en ligne le cas échéant. Vous pourrez renseigner votre catalogue produits et le partager avec les circuits courts qui souhaitent vendre vos produits dans leur boutique sur Open Food France.
producer_shop: Boutique Producteur
sell_your_produce: Vendez vos propres produits
producer_shop_description_text: Vendez vos produits en direct aux mangeurs/restaurateurs/etc. via votre propre Boutique Producteur sur Open Food France.
producer_shop_description_text2: Une Boutique Producteur vous permet de vendre uniquement vos propres produits. Si vous voulez vendre d'autres produits, sélectionnez "Hub Producteur"
producer_hub: Hub Producteur
producer_hub_text: Vendez vos produits et ceux d'autres fournisseurs
producer_hub_description_text: Vous vendez non seulement vos produits, mais aussi des produits d'autres producteurs de votre région, artisans, ou distributeurs afin de proposer une offre complète dans votre boutique. Vous soutenez ainsi le développement de votre système alimentaire territorial !
profile: Profil uniquement
get_listing: Référencez votre hub/point de vente
profile_description_text: Les visiteurs peuvent vous trouver sur Open Food France et vous contacter. Votre entreprise sera visible sur la carte.
hub_shop: Boutique Hub
hub_shop_text: Vendez des produits de multiples fournisseurs différents
hub_shop_description_text: Vous proposez des produits de différents producteurs de votre région, artisans, ou distributeurs afin de proposer une offre complète dans votre boutique. Vous soutenez ainsi le développement de votre système alimentaire territorial !
sell_your_produce: Pour vendre vos produits
producer_shop_description_text: Vous pourrez paramétrer votre boutique en ligne selon votre fonctionnement, et partager votre catalogue produits avec dautres circuits courts souhaitant les distribuer dans leur boutique.
producer_shop_description_text2: 'ATTENTION : Si vous vendez via un autre outil en ligne, et nenvisagez pas dutiliser Open Food France pour cet usage, choisissiez “profil simple”. De même, si vous fournissez un circuit court utilisant Open Food France pour vendre, mais ne vendez pas vous-même en direct sur Open Food France, choisissez “profil simple”.'
producer_hub: Boutique multi-producteurs
producer_hub_text: Pour vendre vos produits ainsi que ceux dautres producteurs
producer_hub_description_text: 'Vous pourrez paramétrer votre boutique en ligne selon votre fonctionnement, vendre les produits d''autres producteurs, et partager votre catalogue produits avec dautres circuits courts souhaitant les distribuer dans leur boutique. ATTENTION : Si vous vendez via un autre outil en ligne, et nenvisagez pas dutiliser Open Food France pour cet usage, choisissiez “profil simple”. De même, si vous fournissez un circuit court utilisant Open Food France pour vendre, mais ne vendez pas vous-même en direct sur Open Food France, choisissez “profil simple”.'
profile: Profil simple
get_listing: Pour apparaître sur la carte
profile_description_text: Nous vous invitons à renseigner votre profil de la façon la plus complète possible. Un profil complet et avec des images attire plus ! Vous pourrez mettre des liens pour rediriger les visiteurs vers votre site internet ou espace de vente en ligne le cas échéant.
hub_shop: Boutique multi-producteurs
hub_shop_text: Pour vendre des produits de différents fournisseurs
hub_shop_description_text: 'Vous pourrez paramétrer votre boutique en ligne selon votre fonctionnement, et y proposer les produits de multiples producteurs. ATTENTION : Si vous vendez via un autre outil en ligne, et nenvisagez pas dutiliser Open Food France pour cet usage, choisissiez “profil simple”.'
choose_option: Veuilliez choisir l'une des options ci-dessus.
change_now: Changer
enterprise_user_index:
@@ -790,7 +792,7 @@ fr:
manage: Gérer
manage_link: Paramètres
producer?: "Producteur ?"
package: "Pack"
package: "Type de profil"
status: "Statut"
new_form:
owner: Gestionnaire principal
@@ -815,9 +817,9 @@ fr:
welcome_title: Bienvenue sur Open Food France !
welcome_text: 'Vous avez créé avec succès '
next_step: Etape suivante
choose_starting_point: 'Choisir votre type d''entreprise:'
choose_starting_point: 'Choisir votre type de profil :'
profile: 'Profil'
producer_profile: 'Profil producteur'
producer_profile: 'Profil simple'
invite_manager:
user_already_exists: "Le compte existe déjà"
error: "Un problème est survenu"
@@ -1117,7 +1119,6 @@ fr:
footer_data_text_without_privacy_policy_html: "Nous prenons soin de vos données. Voir notre %{cookies_policy}."
footer_data_privacy_policy: "politique de confidentialité"
footer_data_cookies_policy: "politique de cookies"
footer_skylight_dashboard_html: Les informations de performance sont disponibles sur %{dashboard}.
shop:
messages:
login: "Se connecter"
@@ -1376,20 +1377,20 @@ fr:
products_in: "dans %{oc}"
products_at: "à %{distributor}"
products_elsewhere: "Produits trouvés ailleurs"
email_welcome: "Bienvenue"
email_welcome: "Vous y êtes presque..."
email_confirmed: "Veuillez confirmer votre adresse email."
email_registered: "fait maintenant partie de"
email_userguide_html: "Le Guide Utilisateur expliquant comment mettre en place son profil producteur ou son hub est accessible ici: %{link}"
email_admin_html: "Vous pouvez gérer votre compte en vous connectant ici %{link} ou en cliquant sur la roue en haut à droite de la page d'accueil et en sélectionnant Administration."
email_community_html: "Nous avons aussi un forum de discussion en ligne (en anglais) pour échanger avec la communauté sur des questions liées au logiciel OFN et aux défis de la gestion d'un food hub. Nous vous invitons à y participer. Nous sommes en constante évolution et vos contributions à ce forum vont façonner les prochaines étapes. %{link}"
join_community: "Rejoindre la communauté"
email_registered: "va, dès que vous aurez choisi un type de profil, être créé sur"
email_userguide_html: "Le Guide Utilisateur est là pour vous accompagner dans la prise en main de la plateforme. Vous y trouverez les informations détaillées de paramétrage de votre profil entreprise, de vos produits si vous êtes producteurs, et de votre boutique si vous avez choisi un type de profil comprenant une boutique. Pour accéder au guide en français, cliquez ici : %{link}"
email_admin_html: "Pour choisir le type de profil, rendez-vous sur l%{link}. Vous pouvez aussi y accéder depuis la page daccueil du site, en haut à droite, Profil > Administration. Il vous est alors proposé de choisir le type de profil désiré. Le type de profil peut aussi être choisi via le menu “Entreprises” depuis linterface dadministration, colonne “Type de profil”. Linterface dadministration est lendroit où vous gérez vos entreprises, produits, commandes, etc."
email_community_html: "Nous avons aussi un forum de discussion en ligne pour échanger avec la communauté sur des questions liées à la plateforme ou aux défis de la gestion d'un circuit court. Nous vous invitons à y participer ! %{link}"
join_community: "Accéder au forum"
email_confirmation_activate_account: "Avant de pouvoir activer votre compte, nous devons nous assurer de la validité de votre adresse email."
email_confirmation_greeting: "Bonjour %{contact}!"
email_confirmation_profile_created: "Le profil pour %{name} a été créé avec succès! Pour activer votre Profil nous devons vérifier cette adresse email."
email_confirmation_click_link: "Veuillez cliquer sur le lien ci-dessous pour confirmer votre email et continuer la configuration de votre compte."
email_confirmation_link_label: "Confirmer cette adresse email »"
email_confirmation_help_html: "Après confirmation de votre email, vous pourrez accéder au compte d'administration de cette entreprise. Voir %{link} pour en savoir plus à propos de %{sitename} et commencer à utiliser votre profil et/ou boutique en ligne."
email_confirmation_notice_unexpected: "Vous recevez ce message car vous vous êtes inscrit sur %{sitename}, ou avez été invité à vous inscrire par l'un de vos contacts. Si vous ne comprenez pas pourquoi vous recevez ce message, écrivez à %{contact}."
email_confirmation_notice_unexpected: "Vous recevez ce message car vous vous êtes inscrit sur %{sitename}, ou avez été invité à vous inscrire par l'un de vos contacts. Si vous ne comprenez pas pourquoi vous recevez ce message, écrivez à info@openfoodfrance.org."
email_social: "Nous suivre:"
email_contact: "Nous écrire:"
email_signoff: "Cordialement,"
@@ -1438,18 +1439,18 @@ fr:
email_shipping_collection_time: "Prêt pour retrait:"
email_shipping_collection_instructions: "Instructions de retrait:"
email_special_instructions: "Vos commentaires:"
email_signup_greeting: Bonjour!
email_signup_welcome: "Bienvenue sur %{sitename}!"
email_signup_greeting: Bonjour !
email_signup_welcome: "Bienvenue sur %{sitename} !"
email_signup_confirmed_email: "Merci d'avoir confirmé votre email."
email_signup_shop_html: "Vous pouvez maintenant vous connecter sur %{link}."
email_signup_text: "Merci d'avoir rejoint le réseau. Si vous êtes un client, nous sommes impatients de vous faire découvrir de nombreux agriculteurs fantastiques, de merveilleux hubs de distribution et des plats délicieux! Si vous êtes un producteur ou autre entreprise alimentaire, nous sommes ravis de vous compter parmi les membres du réseau."
email_signup_help_html: "Vos questions et feedbacks sont les bienvenus! Cliquez sur le bouton <em>Envoyer un commentaire</em> sur le site ou envoyez-nous un email à %{email}"
email_signup_text: "Si vous organisez / fournissez un circuit court, nhésitez pas à nous contacter à info@openfoodfrance.org, nous sommes là pour vous accompagner dans la création de votre espace de vente / commande en ligne. Si vous achetez via un circuit court utilisant Open Food France, connectez-vous avant de passer commande pour que vos informations personnelles soient gardées en mémoire, cela vous évitera de les ressaisir à chaque commande ! "
email_signup_help_html: "Des retours à nous faire quant à votre utilisation de la plateforme ? Écrivez-nous à info@openfoodfrance.org."
invite_email:
greeting: "Bonjour!"
greeting: "Bonjour !"
invited_to_manage: "Vous avez été invité(e) à gérer %{enterprise} sur %{instance}."
confirm_your_email: "Vous avez reçu ou allez recevoir prochainement un email avec un lien de validation. Vous n'aurez pas accès au profil de l'entreprise %{enterprise} avant d'avoir cliqué sur ce lien."
set_a_password: "Vous serez ensuite invité(e) à choisir un mot de passe avant de pouvoir accéder et gérer le profil de l'entreprise."
mistakenly_sent: "Vous ne savez pas pourquoi vous recevez cet email? Veuillez contacter %{owner_email} pour plus d'informations."
mistakenly_sent: "Vous ne savez pas pourquoi vous recevez cet email ? Veuillez contacter %{owner_email} pour plus d'informations."
producer_mail_greeting: "Cher(ère)"
producer_mail_text_before: "Nous avons reçu toutes les commandes pour la prochaine livraison."
producer_mail_order_text: "Voilà la liste et les quantités des produits commandés vous concernant:"
@@ -1713,7 +1714,7 @@ fr:
registration:
steps:
introduction:
registration_greeting: "Bonjour!"
registration_greeting: "Bonjour !"
registration_intro: "Vous pouvez maintenant créer votre profil \"Producteur\" ou \"Hub\""
registration_checklist: "De quoi ai-je besoin ?"
registration_time: "5-10 minutes"
@@ -1726,7 +1727,7 @@ fr:
registration_outcome1_html: "Votre profil permet aux gens de vous <strong>trouver</strong> et de vous <strong>contacter</strong> via Open Food France."
registration_outcome2: "Utilisez cet espace pour raconter l'histoire de votre entreprise, et stimuler les visites vers vos points de présence en ligne."
registration_outcome3: "C'est aussi le premier pas vers la vente via Open Food France, ou l'ouverture de votre boutique en ligne."
registration_action: "Démarrons!"
registration_action: "Démarrons !"
details:
title: "Informations"
headline: "Commençons !"
@@ -1752,7 +1753,7 @@ fr:
country_field_error: "Veuillez saisir une Pays"
contact:
title: "Contact"
who_is_managing_enterprise: "Qui gère %{enterprise}?"
who_is_managing_enterprise: "Qui gère %{enterprise} ?"
contact_field: "Personne référente"
contact_field_placeholder: "Nom du contact principal"
contact_field_required: "Vous devez saisir une personne référente"
@@ -1760,7 +1761,7 @@ fr:
phone_field_placeholder: "ex : 06 24 53 26 53"
type:
title: "Catégorie"
headline: "Dernière étape pour ajouter %{enterprise} !"
headline: "Dites-nous en un peu plus sur %{enterprise}"
question: "Etes-vous un producteur ?"
yes_producer: "Oui, je suis un producteur"
no_producer: "Non, je ne suis pas un producteur"
@@ -1770,10 +1771,10 @@ fr:
create_profile: "Créer votre profil"
about:
title: "A propos"
headline: "Bien joué!"
message: "A présent, allons un peu plus dans les détails concernant"
success: "Opération réussie ! %{enterprise} a été ajoutée à Open Food France"
registration_exit_message: "Si vous quittez ce module, vous pourrez continuer la création de votre profil via l'interface d'administration."
headline: "Vous y êtes presque !"
message: "Le profil entreprise est en passe dêtre créé mais il est pour linstant vide :-( Pour apparaître proprement sur la carte, ajoutez les éléments demandés dans les écrans suivants concernant"
success: "ATTENTION ! Le profil de %{enterprise} ne sera visible sur la plateforme que lorsque vous aurez choisi votre type de profil. Vous avez reçu un email avec un lien vers linterface dadministration. Veuillez cliquez sur ce lien et choisir un des types de profils proposés."
registration_exit_message: "Si vous quittez ce module, vous pourrez continuer la création de votre profil à tout moment via linterface dadministration, en vous connectant puis en cliquant sur Profil > Administration."
enterprise_description: "Description (en bref)"
enterprise_description_placeholder: "Une phrase pour décrire votre organisation"
enterprise_long_desc: "Description longue"
@@ -1971,7 +1972,7 @@ fr:
spree_admin_product_category: Catégorie Produit
spree_admin_variant_unit_name: Nom de la pièce (si vendu à la pièce)
unit_name: "Unité"
change_package: "Changer de type de compte"
change_package: "Changer de type de profil"
spree_admin_single_enterprise_hint: "Astuce: Pour permettre aux gens de vous trouver, activez votre visibilité "
spree_admin_eg_pickup_from_school: "ex : \"Retrait des produits à l'Ecole Marimati / Au Café du coin / chez Babette / ...\""
spree_admin_eg_collect_your_order: "ex : \"Veuillez récupérer votre commande au 34 rue Victor Hugo, 75018 Paris\""
@@ -2312,74 +2313,91 @@ fr:
saving: En cours d'enregistrement
enterprise_package:
hub_profile: Profil Hub
hub_profile_cost: "COÛT: CONTRIBUTION LIBRE"
hub_profile_cost: " "
hub_profile_text1: >
Les visiteurs voient votre profil sur la carte, et peuvent vous contacter.
Vous augmentez ainsi votre visibilité.
Votre profil sera visible sur la carte.
hub_profile_text2: >
Créez votre profil et utilisez Open Food France pour vous connecter
à votre système alimentaire territorial.
hub_shop: Boutique Hub
Nous vous invitons à renseigner votre profil de la façon la plus complète
possible. Un profil complet et avec des images attire plus ! Vous pourrez
mettre des liens pour rediriger les visiteurs vers votre site internet
ou espace de vente en ligne le cas échéant.
hub_shop: Boutique multi-producteurs
hub_shop_text1: >
Vous proposez des produits de différents producteurs de votre région,
artisans, ou distributeurs afin de proposer une offre complète dans
votre boutique. Vous soutenez ainsi le développement de votre système
alimentaire territorial !
Vous pourrez paramétrer votre boutique en ligne pour ladapter à vos
besoins : méthodes de paiement et livraison proposées à vos acheteurs,
produits à mettre en vente parmi les catalogues de vos fournisseurs,
rythmes de commande et livraison, etc.
hub_shop_text2: >
Un hub n'a pas de modèle figé, il peut s'agir d'un groupement d'achat,
d'une AMAP, d'une épicerie coopérative, d'une épicerie locale de quartier
ou épicerie en circuit court en ligne, etc.
hub_shop_text3: >
Si vous produisez et voulez également vendre vos propres produits, vous
devez modifier le statut de votre entreprise, elle doit apparaitre en
tant que "producteur".
choose_package: Choisir le type de compte souhaité
hub_shop_text3: >2+
choose_package: Choisir le type de profil souhaité
choose_package_text1: >
Votre entreprise ne sera activée et visible que lorsque vous aurez choisi
le type de compte souhaité parmi les options à gauche.
le type de profil souhaité parmi les options à gauche.
choose_package_text2: >
Cliquez sur une option pour voir le détail du compte proposé, puis une
fois votre choix fait, cliquez sur le bouton rouge ENREGISTRER !
profile_only: Profil uniquement
profile_only_cost: "COÛT: CONTRIBUTION LIBRE"
profile_only: Profil simple
profile_only_cost: " "
profile_only_text1: >
Gagnez en visibilité, racontez votre histoire, et affichez vos coordonnées
pour pouvoir être contactés.
Votre profil sera visible sur la carte, et depuis le menu “producteurs”.
profile_only_text2: >
Si vous souhaitez vous concentrer sur votre activité de production,
et laisser à d'autre le soin de distribuer vos produits, vous n'avez
pas besoin d'une boutique sur Open Food France.
Nous vous invitons à renseigner votre profil de la façon la plus complète
possible. Un profil complet et avec des images attire plus ! Vous pourrez
mettre des liens pour rediriger les visiteurs vers votre site internet
ou espace de vente en ligne le cas échéant.
profile_only_text3: >
Saisissez votre catalogue produits sur Open Food France, ce qui permettra
aux hubs-distributeurs utilisant la plateforme de les proposer dans
leurs boutiques (sur votre autorisation).
Vous pourrez renseigner votre catalogue produits et le partager avec
les circuits courts qui souhaitent vendre vos produits dans leur boutique
sur Open Food France.
producer_shop: Boutique Producteur
producer_shop_text1: >
Vendez vos produits en direct aux mangeurs/restaurateurs/etc. via votre
propre Boutique Producteur sur Open Food France.
Vous pourrez paramétrer votre boutique en ligne pour ladapter à vos
besoins : méthodes de paiement et livraison proposées à vos acheteurs,
produits à mettre en vente parmi ceux de votre catalogue, rythmes de
commande et livraison, etc.
producer_shop_text2: >
Une Boutique Producteur vous permet de vendre uniquement vos propres
produits. Si vous voulez vendre d'autres produits, sélectionnez "Hub
Producteur"
producer_hub: Hub Producteur
Vous pourrez renseigner votre catalogue produits et le partager avec
dautres circuits courts qui souhaitent vendre vos produits dans leur
boutique sur Open Food France.
ATTENTION :
- Si vous vendez via un autre outil en ligne, et nenvisagez pas dutiliser
Open Food France pour organiser vos ventes / commandes, choisissiez
le type de profil “profil simple”.
- Si vous fournissez un circuit court utilisant Open Food France pour
vendre, mais ne vendez pas vous-même en direct sur Open Food France,
choisissez le type de profil “profil simple”.
producer_hub: Boutique multi-producteurs
producer_hub_text1: >
Vous vendez non seulement vos produits, mais aussi des produits d'autres
producteurs de votre région, artisans, ou distributeurs afin de proposer
une offre complète dans votre boutique. Vous soutenez ainsi le développement
de votre système alimentaire territorial !
Vous pourrez paramétrer votre boutique en ligne pour ladapter à vos
besoins : méthodes de paiement et livraison proposées à vos acheteurs,produits
à mettre en vente parmi ceux votre catalogue et ceux des autres producteurs,
rythmes de commande et livraison, etc.
producer_hub_text2: >
Un hub producteur peut prendre différentes formes, une boutique de vente
directe, un magasin de producteurs en ligne, un drive fermier, etc.
Vous pourrez renseigner votre catalogue produits et le partager avec
dautres circuits courts qui souhaitent vendre vos produits dans leur
boutique sur Open Food France.
producer_hub_text3: >
Open Food France soutient tous les modèles de hubs alimentaires, nous
pensons que la résilience du système viendra de la diversité des modèles.
Donc quel que soit votre modèle, nous souhaitons vous apporter les outils
de gestion donc vous avez besoin pour opérer votre circuit court.
get_listing: Référencez votre entreprise
always_free: CONTRIBUTION LIBRE
sell_produce_others: Vendez des produits de multiples fournisseurs différents
sell_own_produce: Vendez vos propres produits
sell_both: Vendez vos produits et ceux d'autres fournisseurs
ATTENTION :
- Si vous vendez via un autre outil en ligne, et nenvisagez pas dutiliser
Open Food France pour organiser vos ventes / commandes, choisissiez
le type de profil “profil simple”.
- Si vous fournissez un circuit court utilisant Open Food France pour
vendre, mais ne vendez pas vous-même en direct sur Open Food France,
choisissez le type de profil “profil simple”.
get_listing: Pour apparaître sur la carte
always_free: ' '
sell_produce_others: Pour vendre des produits de différents fournisseurs
sell_own_produce: Pour vendre vos produits
sell_both: Pour vendre vos produits ainsi que ceux dautres producteurs
enterprise_producer:
producer: Producteur
producer_text1: >
@@ -2640,6 +2658,8 @@ fr:
name_or_sku: "Nom ou Ref Produit (entrer au moins les 4 premiers caractères du nom du produit)"
resend: Renvoyer
back_to_orders_list: Retour à la liste des commandes
return_authorizations: Autorisations de retours
cannot_create_returns: Impossible de créer une autorisation de retour car aucun produit n'a été livré pour cette commande.
select_stock: "Sélectionner le stock"
location: "Localisation"
count_on_hand: "Quantité en stock"
@@ -3057,7 +3077,7 @@ fr:
invalid: invalide
order_mailer:
cancel_email:
customer_greeting: "Bonjour %{name}!"
customer_greeting: "Bonjour %{name} !"
instructions: "Votre commande a été ANNULÉE. Vous trouverez ci-dessous les informations concernant cette commande. "
order_summary_canceled: "Résumé de la commande [ANNULEE]"
subject: "Annulation de Commande"

View File

@@ -243,6 +243,7 @@ fr_BE:
reset_password_token: réinitialisation du mot de passe
expired: a expiré, veuillez en demander un nouveau
back_to_payments_list: "Retour à la liste des paiements"
ship: "Expédier"
actions:
create_and_add_another: "Créer et ajouter un nouveau"
create: "Créer"
@@ -631,7 +632,7 @@ fr_BE:
name: Nom
applies: Active?
manage: Gérer les méthodes de paiement
not_method_yet: Vous n'avez pas encore de méthode de paiement.
no_method_yet: Vous n'avez pas encore de méthode de paiement.
create_button: Créer une nouvelle méthode de paiement
create_one_button: En créer une maintenant
primary_details:
@@ -1111,7 +1112,6 @@ fr_BE:
footer_data_text_without_privacy_policy_html: "Nous prenons soin de vos données. Voir notre %{cookies_policy}."
footer_data_privacy_policy: "politique de confidentialité"
footer_data_cookies_policy: "politique de cookies"
footer_skylight_dashboard_html: Les informations de performance sont disponibles sur %{dashboard}.
shop:
messages:
login: "Se connecter"
@@ -1449,8 +1449,8 @@ fr_BE:
producer_mail_order_text: "Voilà la liste et les quantités des produits commandés vous concernant:"
producer_mail_delivery_instructions: "Modalités de livraison des produits:"
producer_mail_signoff: "Merci et belle fin de journée!"
shopping_oc_closed: La boutique est actuellement fermée
shopping_oc_closed_description: "Veuillez attendre l'ouverture du prochain cycle de vente (ou contactez-nous directement pour voir si nous pouvons accepter une commande tardive)"
shopping_oc_closed: Le comptoir est actuellement fermé
shopping_oc_closed_description: "Veuillez attendre l'ouverture du prochain cycle de vente (ou contactez directement le comptoir pour voir si nous pouvons accepter une commande tardive)."
shopping_oc_last_closed: "Le dernier cycle de vente s'est terminé il y a %{distance_of_time}"
shopping_oc_next_open: "Le prochain cycle de vente ouvrira dans %{distance_of_time}"
shopping_tabs_about: "A propos de %{distributor}"
@@ -1594,7 +1594,7 @@ fr_BE:
sell_groups_detail: "Créer un répertoire sur mesure (regroupant différents producteurs et comptoirs) pour votre région ou votre organisation."
sell_user_guide: "En savoir plus en explorant le guide utilisateur."
sell_listing_price: "L'inscription à l'OFN est libre de contribution. Ouvrir et utiliser un comptoir sur OFN vous permet de gagner jusqu'à 500 $ de ventes mensuelles. Si vous vendez plus, vous pouvez choisir votre contribution communautaire entre 1% et 3% des ventes. Pour plus de détails sur les prix, visitez la section Plateforme logicielle via le lien \"À propos\" de dans le menu supérieur."
sell_embed: "Dici là, vous pouvez également participer au projet. Soit en co-créant la communauté belge, en contribuant à lamélioration des fonctionnalités…  Soit en mettant à disposition : un local pour la démonstration de loutil ou un point relais pour faciliter les livraisons… Soit en le finançant BE41 0682 2264 2410 com: Open Food Network"
sell_embed: "Dici là, vous pouvez également participer au projet. Soit en co-créant la communauté belge, en contribuant à lamélioration des fonctionnalités…  Soit en mettant à disposition : un local pour la démonstration de loutil ou un point relais pour faciliter les livraisons… Soit en le finançant par un don (déductible fiscalement à partir de 40€) versé à Oxfam-Magasins du monde qui coordonne le projet :  BE41 0682 2264 2410 com: Open Food Network Nous consulter sur les services des partenaires OFN."
sell_ask_services: "Nous consulter sur les services des partenaires OFN."
shops_title: Comptoirs
shops_headline: Des achats qui transforment.

View File

@@ -246,6 +246,8 @@ fr_CA:
expired: a expiré, veuillez faire une nouvelle demande.
back_to_payments_list: "Retour à la liste des paiements"
maestro_or_solo_cards: "Cartes Maestro/Solo"
backordered: "à volonté"
ship: "Expédier"
actions:
create_and_add_another: "Créer et ajouter nouveau"
create: "Créer"
@@ -636,7 +638,7 @@ fr_CA:
name: Nom
applies: S'applique?
manage: Gérer les méthodes de paiement
not_method_yet: Vous n'avez pas encore de méthode de paiement.
no_method_yet: Vous n'avez pas encore de méthode de paiement.
create_button: Créer une nouvelle méthode de paiement
create_one_button: En créer une maintenant
primary_details:
@@ -1117,7 +1119,6 @@ fr_CA:
footer_data_text_without_privacy_policy_html: "Nous prenons soin de vos données. Voire notre ."
footer_data_privacy_policy: "politique de confidentialité"
footer_data_cookies_policy: "politique de cookies"
footer_skylight_dashboard_html: 'Les données relatives à la performance sont disponibles sur '
shop:
messages:
login: "se connecter"
@@ -2640,6 +2641,8 @@ fr_CA:
name_or_sku: "Nom ou Ref Produit (entrer au moins les 4 premiers caractères du nom du produit)"
resend: Renvoyer
back_to_orders_list: Retour à la liste des commandes
return_authorizations: Autorisations de retours
cannot_create_returns: Impossible de créer une autorisation de retour car aucun produit n'a été livré pour cette commande.
select_stock: "Sélectionner le stock"
location: "Localisation"
count_on_hand: "Quantité en stock"

View File

@@ -237,6 +237,7 @@ it:
reset_password_token: Token per il reset della password
expired: è scaduto, si prega di richiederne uno nuovo
back_to_payments_list: "Torna alla lista dei pagamenti"
ship: "Spedizione"
actions:
create_and_add_another: "Crea e aggiungi un altro"
create: "Crea"
@@ -622,7 +623,7 @@ it:
name: Nome
applies: Applica?
manage: Gestisci metodi di pagamento
not_method_yet: Non hai ancora nessun metodo di pagamento.
no_method_yet: Non hai ancora nessun metodo di pagamento.
create_button: Crea un nuovo metodo di pagamento
create_one_button: Crea uno ora
primary_details:
@@ -1087,7 +1088,6 @@ it:
footer_data_text_without_privacy_policy_html: "Ci prendiamo cura dei vostri dati. Vedi la nostra %{cookies_policy}"
footer_data_privacy_policy: "privacy policy"
footer_data_cookies_policy: "cookies policy"
footer_skylight_dashboard_html: I dati di rendimento sono disponibili in %{dashboard}.
shop:
messages:
login: "fai il login"

View File

@@ -245,6 +245,8 @@ nb:
expired: er utløpt, vennligst be om en ny
back_to_payments_list: "Tilbake til betalingsliste"
maestro_or_solo_cards: "Maestro/Solo kort"
backordered: "Restbestilte"
ship: "Levere"
actions:
create_and_add_another: "Opprett og legg til en annen"
create: "Opprett"
@@ -634,7 +636,7 @@ nb:
name: Navn
applies: Gjelder?
manage: Administrer Betalingsmetoder
not_method_yet: Du har ingen betalingsmetoder ennå.
no_method_yet: Du har ingen betalingsmetoder ennå.
create_button: Opprett Ny Betalingsmetode
create_one_button: Opprett en nå
primary_details:
@@ -919,7 +921,7 @@ nb:
hidden: SKJULTE
unitsize: ENHETSSTØRRELSE
total: SUM
total_items: ANTALL
total_items: TOTALT ANTALL
supplier_totals: Bestillingsrunde Leverandør Sum
supplier_totals_by_distributor: Bestillingsrunde Leverandør Totaler etter Distributør
totals_by_supplier: Bestillingsrunde Distributør Totaler etter Leverandør
@@ -1116,7 +1118,6 @@ nb:
footer_data_text_without_privacy_policy_html: "Vi tar godt vare på dine data. Se vår %{cookies_policy}"
footer_data_privacy_policy: "personvernpolicy"
footer_data_cookies_policy: "policy informasjonskapsler"
footer_skylight_dashboard_html: Ytelsesdata er tilgjengelig på %{dashboard}.
shop:
messages:
login: "innlogging"
@@ -2627,6 +2628,8 @@ nb:
name_or_sku: "Navn eller SKU (skriv inn minst 4 tegn av produktnavn)"
resend: Send på nytt
back_to_orders_list: Tilbake til Bestillingsliste
return_authorizations: Returautorisasjoner
cannot_create_returns: Kan ikke opprette retur da denne bestillingen ikke har noen sendte elementer.
select_stock: "Velg lager"
location: "Plassering"
count_on_hand: "Antall På Lager"

View File

@@ -243,6 +243,7 @@ nl_BE:
reset_password_token: Reset wachtwoord token
expired: is verlopen, gelieve een nieuwe aan te vragen
back_to_payments_list: "Terug naar Betalingslijst"
ship: "Verzenden"
actions:
create_and_add_another: "Een ander maken en toevoegen"
create: "Maak"
@@ -633,7 +634,7 @@ nl_BE:
name: Naam
applies: Van toepassing?
manage: Beheer betaalmogelijkheden
not_method_yet: Je hebt nog geen betaalmethodes.
no_method_yet: Je hebt nog geen betaalmethodes.
create_button: Creëer een nieuwe betaalmethode
create_one_button: Creëer er nu één
primary_details:
@@ -1113,7 +1114,6 @@ nl_BE:
footer_data_text_without_privacy_policy_html: "We dragen goed zorg voor je gegevens. Neem een kijk naar onze %{cookies_policy}."
footer_data_privacy_policy: "privacy beleid"
footer_data_cookies_policy: "cookie policy"
footer_skylight_dashboard_html: Prestatiegegevens zijn beschikbaar op %{dashboard}.
shop:
messages:
login: "login"

View File

@@ -237,6 +237,7 @@ pt:
reset_password_token: Redefinir palavra-passe
expired: expirou, por favor peça uma nova
back_to_payments_list: "Voltar à lista de pagamentos"
ship: "Enviar"
actions:
create_and_add_another: "Criar e acrescentar outro"
create: "Criar"
@@ -622,7 +623,7 @@ pt:
name: Nome
applies: Aplicável?
manage: Gerir métodos de pagamento
not_method_yet: Não tem nenhum método de pagamento.
no_method_yet: Não tem nenhum método de pagamento.
create_button: Criar Novo Método de Pagamento
create_one_button: 'Criar um agora '
primary_details:
@@ -1092,7 +1093,6 @@ pt:
footer_data_text_without_privacy_policy_html: "Nós tratamos com cuidado dos nosso dados. Veja a nossa %{cookies_policy}"
footer_data_privacy_policy: "politíca de privacidade"
footer_data_cookies_policy: "política de cookies"
footer_skylight_dashboard_html: Dados de performance disponível em %{dashboard}.
shop:
messages:
login: "Entrar"

3139
config/locales/pt_BR.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -99,6 +99,7 @@ sv:
powered_by: Drivs av
blocked_cookies_alert: "Din webbläsare kan blockera cookies som behövs för att använda den här butiken. Klicka nedan för att tillåta cookies och ladda om sidan."
allow_cookies: "Tillåt cookies"
ship: "Frakta"
actions:
create: "Skapa"
cancel: "Avbryt"
@@ -335,7 +336,7 @@ sv:
name: Namn
applies: Gäller?
manage: Bestäm betalningssätt
not_method_yet: Du har ännu inte bestämt betalningssätt
no_method_yet: Du har ännu inte bestämt betalningssätt
create_button: Skapa ett nytt betalningssätt
create_one_button: Skapa en nu
primary_details:

View File

@@ -15,6 +15,19 @@ Openfoodnetwork::Application.routes.draw do
resources :variants, :only => [:index]
resources :orders, only: [:index] do
get :managed, on: :collection
resources :shipments, :only => [:create, :update] do
member do
put :ready
put :ship
put :add
put :remove
end
end
end
resources :enterprises do
post :update_image, on: :member
get :managed, on: :collection
@@ -33,8 +46,6 @@ Openfoodnetwork::Application.routes.draw do
get :accessible, on: :collection
end
resources :orders, only: [:index]
resource :status do
get :job_queue
end
@@ -44,5 +55,18 @@ Openfoodnetwork::Application.routes.draw do
resources :enterprise_fees, only: [:destroy]
post '/product_images/:product_id', to: 'product_images#update_product_image'
resources :taxons, :only => [:index]
resources :taxonomies do
member do
get :jstree
end
resources :taxons do
member do
get :jstree
end
end
end
end
end

View File

@@ -24,12 +24,6 @@ Spree::Core::Engine.routes.draw do
put '/password/change' => 'user_passwords#update', :as => :update_password
end
resource :session do
member do
get :nav_bar
end
end
resource :account, :controller => 'users'
namespace :admin do
@@ -61,29 +55,6 @@ Spree::Core::Engine.routes.prepend do
resources :users do
get :authorise_api, on: :collection
end
resources :orders do
get :managed, on: :collection
resources :shipments, :only => [:create, :update] do
member do
put :ready
put :ship
put :add
put :remove
end
end
end
resources :taxons, :only => [:index]
resources :taxonomies do
resources :taxons do
member do
get :jstree
end
end
end
end
namespace :admin do
@@ -127,6 +98,9 @@ Spree::Core::Engine.routes.prepend do
resources :products
# Used by spree_paypal_express
get '/checkout/:state', :to => 'checkout#edit', :as => :checkout_state
get '/unauthorized', :to => 'home#unauthorized', :as => :unauthorized
get '/content/cvv', :to => 'content#cvv', :as => :cvv
get '/content/*path', :to => 'content#show', :as => :content

View File

@@ -16,10 +16,6 @@ every 1.day, at: '01:00am' do
rake 'ofn:cache:check_products_integrity'
end
every 1.day, at: '12:05am' do
run_file "lib/open_food_network/integrity_checker.rb"
end
every 1.day, at: '2:45am' do
rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET']
end

View File

@@ -0,0 +1,5 @@
class AddDeletedAtToSpreePrices < ActiveRecord::Migration
def change
add_column :spree_prices, :deleted_at, :datetime
end
end

View File

@@ -0,0 +1,6 @@
class ResetNegativeStockLevels < ActiveRecord::Migration
def up
# Reset stock to zero for all on_demand variants that have negative stock
execute "UPDATE spree_stock_items SET count_on_hand = '0' WHERE count_on_hand < 0 AND backorderable IS TRUE"
end
end

View File

@@ -0,0 +1,17 @@
class RemoveBrokenVariantsFromCarts < ActiveRecord::Migration
def up
# Removes line_items from open carts where the variant has a hard-deleted price
variants_without_prices = execute(
'SELECT spree_variants.id FROM spree_variants
LEFT OUTER JOIN spree_prices ON (spree_variants.id = spree_prices.variant_id)
WHERE spree_prices.id IS NULL'
).to_a.map{ |v| v['id'] }
broken_line_items = Spree::LineItem.
joins(:variant).where('spree_variants.id IN (?)', variants_without_prices).
joins(:order).merge(Spree::Order.where(state: 'cart'))
broken_line_items.each(&:destroy)
end
end

View File

@@ -0,0 +1,5 @@
class SetBackorderedInventoryToOnHand < ActiveRecord::Migration
def up
execute("UPDATE spree_inventory_units SET state = 'on_hand' WHERE state = 'backordered'")
end
end

View File

@@ -0,0 +1,11 @@
class ReplaceHardDeletedPrices < ActiveRecord::Migration
def up
ActiveRecord::Base.connection.execute(
"INSERT into spree_prices (variant_id, amount, currency, deleted_at)
SELECT spree_variants.id, '0.00', (SELECT value FROM spree_preferences WHERE key = 'spree/app_configuration/currency'), now()
FROM spree_variants
LEFT OUTER JOIN spree_prices ON (spree_variants.id = spree_prices.variant_id)
WHERE spree_prices.id IS NULL;"
)
end
end

View File

@@ -0,0 +1,9 @@
class AddLongCompoundIndexOnSpreeOrders < ActiveRecord::Migration
def change
add_index(
:spree_orders,
[:completed_at, :user_id, :created_by_id, :created_at],
name: 'spree_orders_completed_at_user_id_created_by_id_created_at_idx'
)
end
end

View File

@@ -0,0 +1,5 @@
class DropCompletedAtIndexOnSpreeOrders < ActiveRecord::Migration
def change
remove_index :spree_orders, :completed_at
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20190701002454) do
ActiveRecord::Schema.define(:version => 20190916110029) do
create_table "adjustment_metadata", :force => true do |t|
t.integer "adjustment_id"
@@ -576,7 +576,7 @@ ActiveRecord::Schema.define(:version => 20190701002454) do
t.integer "created_by_id"
end
add_index "spree_orders", ["completed_at"], :name => "index_spree_orders_on_completed_at"
add_index "spree_orders", ["completed_at", "user_id", "created_by_id", "created_at"], :name => "spree_orders_completed_at_user_id_created_by_id_created_at_idx"
add_index "spree_orders", ["customer_id"], :name => "index_spree_orders_on_customer_id"
add_index "spree_orders", ["number"], :name => "index_orders_on_number"
@@ -649,9 +649,10 @@ ActiveRecord::Schema.define(:version => 20190701002454) do
add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true
create_table "spree_prices", :force => true do |t|
t.integer "variant_id", :null => false
t.decimal "amount", :precision => 8, :scale => 2
t.string "currency"
t.integer "variant_id", :null => false
t.decimal "amount", :precision => 8, :scale => 2
t.string "currency"
t.datetime "deleted_at"
end
add_index "spree_prices", ["variant_id"], :name => "index_spree_prices_on_variant_id"

View File

@@ -1,320 +1,332 @@
{
"spec/features/admin/orders_spec.rb": 235.76097083091736,
"spec/features/admin/variant_overrides_spec.rb": 94.85978269577026,
"spec/features/admin/bulk_order_management_spec.rb": 151.3781042098999,
"spec/features/consumer/shopping/checkout_spec.rb": 118.2651891708374,
"spec/features/admin/payment_method_spec.rb": 54.268134117126465,
"spec/features/consumer/shopping/variant_overrides_spec.rb": 78.91740727424622,
"spec/features/consumer/shopping/shopping_spec.rb": 112.53912425041199,
"spec/features/consumer/shopping/cart_spec.rb": 27.87003493309021,
"spec/features/admin/order_cycles_spec.rb": 230.97479963302612,
"spec/features/admin/customers_spec.rb": 52.75454330444336,
"spec/features/admin/enterprise_fees_spec.rb": 36.99392628669739,
"spec/features/admin/bulk_product_update_spec.rb": 189.61147689819336,
"spec/features/admin/enterprise_relationships_spec.rb": 43.69444513320923,
"spec/features/admin/shipping_methods_spec.rb": 39.06390905380249,
"spec/features/admin/enterprises_spec.rb": 43.391074657440186,
"spec/features/consumer/shopping/orders_spec.rb": 41.26642346382141,
"spec/models/order_cycle_spec.rb": 58.54216384887695,
"spec/helpers/injection_helper_spec.rb": 38.74247694015503,
"spec/controllers/admin/subscriptions_controller_spec.rb": 40.60595989227295,
"spec/models/spree/order_spec.rb": 45.230292081832886,
"spec/lib/open_food_network/order_cycle_permissions_spec.rb": 26.51349425315857,
"spec/features/consumer/cookies_spec.rb": 26.292959928512573,
"spec/features/admin/tag_rules_spec.rb": 29.404080867767334,
"spec/models/spree/line_item_spec.rb": 26.38530206680298,
"spec/controllers/admin/bulk_line_items_controller_spec.rb": 37.692434310913086,
"spec/models/spree/product_spec.rb": 21.244173288345337,
"spec/controllers/spree/orders_controller_spec.rb": 27.444236278533936,
"spec/models/spree/variant_spec.rb": 18.080999851226807,
"spec/mailers/producer_mailer_spec.rb": 22.64667844772339,
"spec/features/consumer/shopping/embedded_shopfronts_spec.rb": 18.30157232284546,
"spec/controllers/api/orders_controller_spec.rb": 45.88059878349304,
"spec/models/exchange_spec.rb": 24.08130693435669,
"spec/features/consumer/shops_spec.rb": 44.24216866493225,
"spec/features/admin/adjustments_spec.rb": 24.634205102920532,
"spec/features/consumer/authentication_spec.rb": 39.03162908554077,
"spec/features/admin/enterprise_roles_spec.rb": 36.11720085144043,
"spec/controllers/line_items_controller_spec.rb": 23.03535532951355,
"spec/lib/open_food_network/products_cache_spec.rb": 25.271536827087402,
"spec/features/consumer/account_spec.rb": 27.02789568901062,
"spec/controllers/spree/api/products_controller_spec.rb": 27.727026224136353,
"spec/models/spree/ability_spec.rb": 25.817420959472656,
"spec/services/order_syncer_spec.rb": 50.39830207824707,
"spec/features/admin/enterprises/images_spec.rb": 23.51345205307007,
"spec/features/admin/enterprise_groups_spec.rb": 12.499099254608154,
"spec/features/admin/products_spec.rb": 26.72684335708618,
"spec/models/spree/adjustment_spec.rb": 13.502050876617432,
"spec/models/enterprise_spec.rb": 9.4689781665802,
"spec/lib/open_food_network/products_renderer_spec.rb": 6.759949207305908,
"spec/features/consumer/producers_spec.rb": 14.347290515899658,
"spec/lib/open_food_network/address_finder_spec.rb": 10.706343650817871,
"spec/lib/open_food_network/permissions_spec.rb": 9.547073364257812,
"spec/requests/checkout/stripe_connect_spec.rb": 10.927155494689941,
"spec/serializers/order_serializer_spec.rb": 4.6526429653167725,
"spec/features/admin/product_import_spec.rb": 82.43362879753113,
"spec/lib/open_food_network/enterprise_fee_calculator_spec.rb": 8.458034038543701,
"spec/features/consumer/shopping/checkout_auth_spec.rb": 12.009632349014282,
"spec/controllers/api/product_images_controller_spec.rb": 10.716242790222168,
"spec/lib/open_food_network/user_balance_calculator_spec.rb": 7.430835247039795,
"spec/features/consumer/multilingual_spec.rb": 9.649072170257568,
"spec/controllers/spree/users_controller_spec.rb": 5.731461763381958,
"spec/lib/open_food_network/order_cycle_form_applicator_spec.rb": 7.663759708404541,
"spec/lib/open_food_network/proxy_order_syncer_spec.rb": 7.425870656967163,
"spec/models/enterprise_relationship_spec.rb": 7.178626775741577,
"spec/controllers/api/logos_controller_spec.rb": 8.094348430633545,
"spec/models/spree/property_spec.rb": 6.901066303253174,
"spec/models/variant_override_spec.rb": 9.191428899765015,
"spec/services/subscription_estimator_spec.rb": 6.809471368789673,
"spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb": 11.12765908241272,
"spec/features/consumer/groups_spec.rb": 10.6190824508667,
"spec/controllers/spree/api/variants_controller_spec.rb": 6.078902959823608,
"spec/features/consumer/registration_spec.rb": 11.338661909103394,
"spec/controllers/enterprises_controller_spec.rb": 2.6997263431549072,
"spec/controllers/spree/admin/reports_controller_spec.rb": 16.883267879486084,
"spec/lib/open_food_network/packing_report_spec.rb": 6.565235614776611,
"spec/lib/open_food_network/bulk_coop_report_spec.rb": 7.004760503768921,
"spec/services/order_factory_spec.rb": 8.499075889587402,
"spec/controllers/admin/enterprises_controller_spec.rb": 4.129201650619507,
"spec/helpers/enterprises_helper_spec.rb": 3.5127899646759033,
"spec/controllers/admin/schedules_controller_spec.rb": 4.543549060821533,
"spec/features/admin/schedules_spec.rb": 6.639188528060913,
"spec/features/admin/enterprises/index_spec.rb": 5.253607988357544,
"spec/lib/open_food_network/subscription_payment_updater_spec.rb": 2.4682815074920654,
"spec/controllers/spree/admin/orders/customer_details_controller_spec.rb": 4.674808502197266,
"spec/controllers/admin/order_cycles_controller_spec.rb": 2.808058261871338,
"spec/controllers/api/promo_images_controller_spec.rb": 3.05167293548584,
"spec/models/spree/image_spec.rb": 3.5584912300109863,
"spec/lib/open_food_network/group_buy_report_spec.rb": 3.9514505863189697,
"spec/features/admin/variants_spec.rb": 9.481645345687866,
"spec/controllers/admin/variant_overrides_controller_spec.rb": 4.023880243301392,
"spec/models/spree/payment_spec.rb": 4.27884316444397,
"spec/features/consumer/shopping/embedded_groups_spec.rb": 5.992724895477295,
"spec/lib/open_food_network/scope_variant_to_hub_spec.rb": 6.08787727355957,
"spec/features/admin/overview_spec.rb": 4.753745794296265,
"spec/models/enterprise_caching_spec.rb": 3.9775142669677734,
"spec/controllers/spree/admin/products_controller_spec.rb": 3.1087279319763184,
"spec/jobs/subscription_placement_job_spec.rb": 17.82094693183899,
"spec/models/product_import/inventory_reset_strategy_spec.rb": 2.6040756702423096,
"spec/lib/open_food_network/scope_variants_to_search_spec.rb": 2.849317789077759,
"spec/controllers/shop_controller_spec.rb": 3.859396457672119,
"spec/lib/open_food_network/customers_report_spec.rb": 2.9132230281829834,
"spec/controllers/cart_controller_spec.rb": 2.133087158203125,
"spec/jobs/order_cycle_notification_job_spec.rb": 5.136486768722534,
"spec/models/enterprise_fee_spec.rb": 6.337928771972656,
"spec/features/admin/authentication_spec.rb": 3.338393211364746,
"spec/features/consumer/shopping/products_spec.rb": 3.962737560272217,
"spec/serializers/admin/exchange_serializer_spec.rb": 2.8799095153808594,
"spec/features/admin/payments_spec.rb": 3.7063188552856445,
"spec/models/concerns/variant_stock_spec.rb": 4.282667875289917,
"spec/controllers/spree/admin/orders_controller_spec.rb": 7.792564153671265,
"spec/controllers/spree/admin/payments_controller_spec.rb": 3.5697567462921143,
"spec/features/admin/multilingual_spec.rb": 1.964205026626587,
"spec/controllers/admin/subscription_line_items_controller_spec.rb": 2.8258471488952637,
"spec/controllers/checkout_controller_spec.rb": 1.9465281963348389,
"spec/models/producer_property_spec.rb": 2.2676165103912354,
"spec/features/consumer/account/cards_spec.rb": 3.388315439224243,
"spec/controllers/admin/customers_controller_spec.rb": 1.3151507377624512,
"spec/controllers/spree/admin/shipping_methods_controller_spec.rb": 1.3816843032836914,
"spec/controllers/admin/inventory_items_controller_spec.rb": 2.704101324081421,
"spec/features/consumer/account/settings_spec.rb": 3.4794163703918457,
"spec/models/spree/shipping_method_spec.rb": 1.717087745666504,
"spec/requests/checkout/failed_checkout_spec.rb": 2.330630302429199,
"spec/features/consumer/footer_links_spec.rb": 2.529261827468872,
"spec/services/cart_service_spec.rb": 1.407466173171997,
"spec/serializers/admin/enterprise_serializer_spec.rb": 2.7000370025634766,
"spec/models/spree/taxon_spec.rb": 1.5338077545166016,
"spec/mailers/order_mailer_spec.rb": 1.3990452289581299,
"spec/serializers/current_order_serializer_spec.rb": 2.3723340034484863,
"spec/controllers/spree/admin/variants_controller_spec.rb": 4.840111494064331,
"spec/controllers/api/order_cycles_controller_spec.rb": 1.5593302249908447,
"spec/requests/shop_spec.rb": 1.2129430770874023,
"spec/services/order_cycle_form_spec.rb": 0.767514705657959,
"spec/features/admin/content_spec.rb": 1.5474770069122314,
"spec/lib/open_food_network/tag_rule_applicator_spec.rb": 1.4562907218933105,
"spec/controllers/spree/admin/payment_methods_controller_spec.rb": 0.8975794315338135,
"spec/features/admin/users_spec.rb": 3.0521957874298096,
"spec/requests/checkout/paypal_spec.rb": 1.7288799285888672,
"spec/models/spree/product_set_spec.rb": 1.2894904613494873,
"spec/features/admin/enterprise_user_spec.rb": 0.9565138816833496,
"spec/serializers/admin/for_order_cycle/supplied_product_serializer_spec.rb": 0.5980274677276611,
"spec/controllers/spree/admin/adjustments_controller_spec.rb": 0.6785888671875,
"spec/models/spree/price_spec.rb": 0.7076306343078613,
"spec/services/subscriptions_count_spec.rb": 0.8449611663818359,
"spec/helpers/admin/subscriptions_helper_spec.rb": 0.7964563369750977,
"spec/requests/embedded_shopfronts_headers_spec.rb": 0.8313610553741455,
"spec/controllers/admin/manager_invitations_controller_spec.rb": 0.9167764186859131,
"spec/controllers/spree/admin/overview_controller_spec.rb": 0.560481071472168,
"spec/models/order_updater_spec.rb": 0.7670226097106934,
"spec/lib/open_food_network/enterprise_fee_applicator_spec.rb": 0.7502515316009521,
"spec/features/admin/caching_spec.rb": 0.9656000137329102,
"spec/models/spree/user_spec.rb": 0.9020359516143799,
"spec/controllers/spree/admin/search_controller_spec.rb": 0.7993369102478027,
"spec/serializers/admin/for_order_cycle/enterprise_serializer_spec.rb": 1.0361318588256836,
"spec/models/spree/classification_spec.rb": 0.7726085186004639,
"spec/models/spree/calculator/price_sack_spec.rb": 0.602428674697876,
"spec/controllers/admin/stripe_accounts_controller_spec.rb": 0.6723847389221191,
"spec/models/subscription_spec.rb": 0.8647208213806152,
"spec/lib/open_food_network/order_and_distributor_report_spec.rb": 0.8442015647888184,
"spec/lib/open_food_network/xero_invoices_report_spec.rb": 0.13793277740478516,
"spec/services/subscription_validator_spec.rb": 1.617713451385498,
"spec/models/spree/option_value_spec.rb": 0.5321366786956787,
"spec/controllers/spree/api/line_items_controller_spec.rb": 0.5649716854095459,
"spec/controllers/api/customers_controller_spec.rb": 0.3856332302093506,
"spec/features/admin/tax_settings_spec.rb": 0.5059962272644043,
"spec/models/spree/product_property_spec.rb": 0.4123075008392334,
"spec/models/concerns/product_stock_spec.rb": 1.365936279296875,
"spec/controllers/user_confirmations_controller_spec.rb": 0.5572206974029541,
"spec/models/spree/option_type_spec.rb": 0.43832898139953613,
"spec/models/customer_spec.rb": 0.37362074851989746,
"spec/helpers/i18n_helper_spec.rb": 0.40643787384033203,
"spec/models/spree/payment_method_spec.rb": 0.5251181125640869,
"spec/helpers/order_cycles_helper_spec.rb": 0.4389002323150635,
"spec/features/admin/external_services_spec.rb": 0.31794238090515137,
"spec/controllers/spree/credit_cards_controller_spec.rb": 0.3527517318725586,
"spec/features/consumer/external_services_spec.rb": 0.4350574016571045,
"spec/lib/open_food_network/users_and_enterprises_report_spec.rb": 0.359036922454834,
"spec/models/enterprise_group_spec.rb": 0.44833922386169434,
"spec/models/tag_rule/filter_shipping_methods_spec.rb": 0.34696006774902344,
"spec/lib/open_food_network/property_merge_spec.rb": 0.29970407485961914,
"spec/features/admin/image_settings_spec.rb": 0.32785749435424805,
"spec/models/exchange_fee_spec.rb": 0.23130130767822266,
"spec/lib/stripe/account_connector_spec.rb": 0.3126180171966553,
"spec/lib/open_food_network/products_cache_refreshment_spec.rb": 0.29149460792541504,
"spec/models/spree/tax_rate_spec.rb": 0.3151886463165283,
"spec/controllers/groups_controller_spec.rb": 0.28598833084106445,
"spec/models/inventory_item_spec.rb": 0.297809362411499,
"spec/serializers/variant_serializer_spec.rb": 0.25783276557922363,
"spec/lib/open_food_network/enterprise_injection_data_spec.rb": 0.29270124435424805,
"spec/serializers/admin/variant_override_serializer_spec.rb": 0.29378700256347656,
"spec/controllers/spree/paypal_controller_spec.rb": 0.3015480041503906,
"spec/controllers/spree/checkout_controller_spec.rb": 0.3235130310058594,
"spec/controllers/stripe/callbacks_controller_spec.rb": 0.35881519317626953,
"spec/controllers/spree/admin/base_controller_spec.rb": 0.28447699546813965,
"spec/controllers/user_registrations_controller_spec.rb": 0.37039661407470703,
"spec/serializers/api/admin/product_serializer_spec.rb": 0.2211611270904541,
"spec/services/search_orders_spec.rb": 0.25273942947387695,
"spec/serializers/spree/variant_serializer_spec.rb": 0.2560765743255615,
"spec/mailers/enterprise_mailer_spec.rb": 0.22377276420593262,
"spec/jobs/products_cache_integrity_checker_job_spec.rb": 0.38372278213500977,
"spec/serializers/enterprise_serializer_spec.rb": 0.24865961074829102,
"spec/models/stripe_account_spec.rb": 0.2764317989349365,
"spec/controllers/admin/stripe_connect_settings_controller_spec.rb": 0.25455760955810547,
"spec/controllers/api/enterprises_controller_spec.rb": 0.2367243766784668,
"spec/models/tag_rule/filter_payment_methods_spec.rb": 0.2608637809753418,
"spec/services/order_cycle_distributed_variants_spec.rb": 0.027887344360351562,
"spec/controllers/admin/tag_rules_controller_spec.rb": 0.2483692169189453,
"spec/models/adjustment_metadata_spec.rb": 0.1961231231689453,
"spec/controllers/shops_controller_spec.rb": 1.6529083251953125,
"spec/models/column_preference_spec.rb": 0.19749212265014648,
"spec/serializers/admin/index_enterprise_serializer_spec.rb": 0.1634202003479004,
"spec/lib/open_food_network/subscription_summary_spec.rb": 0.18712377548217773,
"spec/serializers/admin/customer_serializer_spec.rb": 0.17607975006103516,
"spec/controllers/admin/column_preferences_controller_spec.rb": 0.1870410442352295,
"spec/models/model_set_spec.rb": 0.19138789176940918,
"spec/models/tag_rule/filter_order_cycles_spec.rb": 0.1799607276916504,
"spec/helpers/spree/orders_helper_spec.rb": 0.1408379077911377,
"spec/models/tag_rule/filter_products_spec.rb": 0.17629504203796387,
"spec/controllers/user_passwords_controller_spec.rb": 0.16375088691711426,
"spec/controllers/stripe/webhooks_controller_spec.rb": 0.15069150924682617,
"spec/models/stock/package_spec.rb": 0.14911603927612305,
"spec/models/tag_rule/discount_order_spec.rb": 0.13631701469421387,
"spec/features/consumer/confirm_invitation_spec.rb": 0.25405168533325195,
"spec/lib/spree/product_filters_spec.rb": 0.11962199211120605,
"spec/lib/open_food_network/option_value_namer_spec.rb": 0.13082218170166016,
"spec/mailers/user_mailer_spec.rb": 0.30326128005981445,
"spec/helpers/checkout_helper_spec.rb": 0.2074277400970459,
"spec/models/product_import/settings_spec.rb": 0.13475465774536133,
"spec/models/spree/credit_card_spec.rb": 0.12078642845153809,
"spec/models/coordinator_fee_spec.rb": 0.12605953216552734,
"spec/controllers/registration_controller_spec.rb": 0.09199261665344238,
"spec/lib/open_food_network/subscription_summarizer_spec.rb": 0.059951066970825195,
"spec/lib/open_food_network/sales_tax_report_spec.rb": 0.10369729995727539,
"spec/jobs/refresh_products_cache_job_spec.rb": 0.27120208740234375,
"spec/models/spree/addresses_spec.rb": 0.1175835132598877,
"spec/lib/open_food_network/i18n_config_spec.rb": 0.0969705581665039,
"spec/models/spree/order/checkout_spec.rb": 1.2646453380584717,
"spec/features/consumer/sitemap_spec.rb": 0.09025812149047852,
"spec/helpers/shared_helper_spec.rb": 0.07801532745361328,
"spec/models/spree/gateway/stripe_connect_spec.rb": 0.07303094863891602,
"spec/helpers/shop_helper_spec.rb": 0.058048248291015625,
"spec/serializers/admin/subscription_customer_serializer_spec.rb": 0.060986995697021484,
"spec/lib/open_food_network/cached_products_renderer_spec.rb": 0.07480335235595703,
"spec/models/spree/calculator/flexi_rate_spec.rb": 0.6015393733978271,
"spec/models/spree/preference_spec.rb": 0.05887198448181152,
"spec/lib/stripe/webhook_handler_spec.rb": 0.059610605239868164,
"spec/lib/open_food_network/order_grouper_spec.rb": 0.05851387977600098,
"spec/controllers/spree/user_sessions_controller_spec.rb": 0.051381826400756836,
"spec/helpers/html_helper_spec.rb": 0.05978536605834961,
"spec/helpers/navigation_helper_spec.rb": 0.06995773315429688,
"spec/models/tag_rule_spec.rb": 0.05184459686279297,
"spec/jobs/welcome_enterprise_job_spec.rb": 0.05195975303649902,
"spec/lib/open_food_network/enterprise_issue_validator_spec.rb": 0.14506173133850098,
"spec/jobs/confirm_order_job_spec.rb": 0.04619622230529785,
"spec/models/spree/preferences/file_configuration_spec.rb": 0.05427718162536621,
"spec/models/product_import/reset_absent_spec.rb": 0.04453468322753906,
"spec/models/product_import/entry_processor_spec.rb": 0.04535818099975586,
"spec/services/embedded_page_service_spec.rb": 0.04078173637390137,
"spec/lib/spree/localized_number_spec.rb": 0.05774712562561035,
"spec/lib/open_food_network/reports/report_spec.rb": 0.04312324523925781,
"spec/controllers/spree/store_controller_spec.rb": 0.032500505447387695,
"spec/models/spree/calculator/flat_percent_item_total_spec.rb": 0.5876741409301758,
"spec/controllers/api/statuses_controller_spec.rb": 0.04073929786682129,
"spec/controllers/base_controller_spec.rb": 0.030263423919677734,
"spec/models/subscription_line_item_spec.rb": 0.03436994552612305,
"spec/models/calculator/flat_percent_per_item_spec.rb": 0.030996322631835938,
"spec/lib/open_food_network/referer_parser_spec.rb": 0.027393817901611328,
"spec/services/reset_order_service_spec.rb": 0.028766632080078125,
"spec/models/spree/calculator/per_item_spec.rb": 0.291332483291626,
"spec/jobs/confirm_signup_job_spec.rb": 0.021788835525512695,
"spec/lib/open_food_network/reports/rule_spec.rb": 0.025704622268676758,
"spec/models/calculator/weight_spec.rb": 1.380509376525879,
"spec/requests/large_request_spec.rb": 0.03156089782714844,
"spec/serializers/credit_card_serializer_spec.rb": 0.023131370544433594,
"spec/models/feature_flags_spec.rb": 0.0632791519165039,
"spec/lib/open_food_network/feature_toggle_spec.rb": 0.02283477783203125,
"spec/jobs/heartbeat_job_spec.rb": 0.020235776901245117,
"spec/models/spree/calculator/flat_rate_spec.rb": 0.018027782440185547,
"spec/helpers/groups_helper_spec.rb": 0.016248464584350586,
"spec/helpers/products_helper_spec.rb": 0.018996000289916992,
"spec/services/mail_configuration_spec.rb": 0.01758885383605957,
"spec/helpers/spree/admin/base_helper_spec.rb": 0.008402109146118164,
"spec/lib/open_food_network/error_logger_spec.rb": 0.007436990737915039,
"spec/models/content_configuration_spec.rb": 0.0073282718658447266,
"spec/lib/open_food_network/reports/row_spec.rb": 0.006602764129638672,
"spec/config/application_spec.rb": 0.006625175476074219,
"spec/controllers/admin/proxy_orders_controller_spec.rb": 12.432438373565674,
"spec/controllers/api/enterprise_fees_controller_spec.rb": 0.1020348072052002,
"spec/controllers/spree/admin/reports/enterprise_fee_summaries_controller_spec.rb": 0.7282826900482178,
"spec/controllers/spree/api/shipments_controller_spec.rb": 14.814026355743408,
"spec/features/admin/reports/enterprise_fee_summaries_spec.rb": 17.826215505599976,
"spec/features/admin/reports_spec.rb": 27.360989332199097,
"spec/features/admin/subscriptions_spec.rb": 74.08096742630005,
"spec/helpers/admin/orders_helper_spec.rb": 0.5890231132507324,
"spec/jobs/subscription_confirm_job_spec.rb": 27.758408069610596,
"spec/lib/open_food_network/lettuce_share_report_spec.rb": 2.872073173522949,
"spec/lib/open_food_network/order_cycle_management_report_spec.rb": 3.6512515544891357,
"spec/lib/open_food_network/products_and_inventory_report_spec.rb": 4.582597970962524,
"spec/mailers/subscription_mailer_spec.rb": 17.476669549942017,
"spec/models/concerns/order_shipment_spec.rb": 1.8977851867675781,
"spec/models/product_import/products_reset_strategy_spec.rb": 2.3993682861328125,
"spec/models/product_importer_spec.rb": 49.001238107681274,
"spec/models/proxy_order_spec.rb": 9.741921663284302,
"spec/models/spree/gateway_tagging_spec.rb": 0.5152750015258789,
"spec/models/spree/stock/availability_validator_spec.rb": 6.4449944496154785,
"spec/serializers/api/cached_enterprise_serializer_spec.rb": 1.5803031921386719,
"spec/serializers/api/shipping_method_serializer_spec.rb": 0.3579277992248535,
"spec/services/advance_order_service_spec.rb": 5.4587037563323975,
"spec/services/bulk_invoice_service_spec.rb": 2.845306634902954,
"spec/services/default_stock_location_spec.rb": 0.11547493934631348,
"spec/services/invoice_renderer_spec.rb": 3.9688003063201904,
"spec/services/order_cycle_distributed_products_spec.rb": 2.3592758178710938,
"spec/services/restart_checkout_spec.rb": 0.3222994804382324,
"spec/services/subscription_form_spec.rb": 1.8038544654846191,
"spec/services/subscription_variants_service_spec.rb": 3.130023717880249,
"spec/services/tax_rate_finder_spec.rb": 2.2943179607391357,
"spec/services/upload_sanitizer_spec.rb": 0.006753444671630859,
"spec/services/variants_stock_levels_spec.rb": 2.1153390407562256,
"spec/validators/date_time_string_validator_spec.rb": 0.051422119140625,
"spec/validators/integer_array_validator_spec.rb": 0.0492095947265625
"spec/features/admin/orders_spec.rb": 237.817884683609,
"spec/features/admin/order_cycles_spec.rb": 94.3379921913147,
"spec/features/admin/bulk_product_update_spec.rb": 78.97872257232666,
"spec/features/admin/bulk_order_management_spec.rb": 128.53619170188904,
"spec/features/consumer/shopping/checkout_spec.rb": 126.58671498298645,
"spec/features/consumer/shopping/shopping_spec.rb": 76.83493185043335,
"spec/features/admin/variant_overrides_spec.rb": 136.1164140701294,
"spec/features/admin/product_import_spec.rb": 111.82432579994202,
"spec/features/consumer/shopping/variant_overrides_spec.rb": 91.0473141670227,
"spec/features/admin/subscriptions_spec.rb": 80.61201500892639,
"spec/models/order_cycle_spec.rb": 51.933889865875244,
"spec/features/admin/payment_method_spec.rb": 64.49885392189026,
"spec/features/admin/customers_spec.rb": 41.059948205947876,
"spec/services/order_syncer_spec.rb": 35.46346163749695,
"spec/models/product_importer_spec.rb": 48.392107009887695,
"spec/controllers/api/orders_controller_spec.rb": 37.38580870628357,
"spec/models/spree/order_spec.rb": 43.49769330024719,
"spec/features/consumer/shops_spec.rb": 40.91608905792236,
"spec/features/admin/enterprise_relationships_spec.rb": 48.79179549217224,
"spec/features/admin/enterprises_spec.rb": 68.66470575332642,
"spec/features/consumer/shopping/orders_spec.rb": 50.41251015663147,
"spec/controllers/admin/subscriptions_controller_spec.rb": 33.12591361999512,
"spec/features/admin/shipping_methods_spec.rb": 45.78349208831787,
"spec/features/consumer/authentication_spec.rb": 80.65127658843994,
"spec/helpers/injection_helper_spec.rb": 34.83948469161987,
"spec/controllers/admin/bulk_line_items_controller_spec.rb": 23.70878767967224,
"spec/features/admin/enterprise_fees_spec.rb": 31.250224351882935,
"spec/features/admin/enterprise_roles_spec.rb": 41.325873374938965,
"spec/features/admin/tag_rules_spec.rb": 61.053430795669556,
"spec/features/consumer/shopping/cart_spec.rb": 27.45794367790222,
"spec/jobs/subscription_confirm_job_spec.rb": 27.508367776870728,
"spec/controllers/spree/orders_controller_spec.rb": 24.71937584877014,
"spec/features/admin/reports_spec.rb": 33.325284481048584,
"spec/features/consumer/account_spec.rb": 20.118611574172974,
"spec/features/admin/products_spec.rb": 36.03796911239624,
"spec/lib/open_food_network/order_cycle_permissions_spec.rb": 24.558523654937744,
"spec/models/spree/line_item_spec.rb": 24.942461490631104,
"spec/features/consumer/cookies_spec.rb": 29.341325521469116,
"spec/models/spree/ability_spec.rb": 11.801489353179932,
"spec/lib/open_food_network/products_cache_spec.rb": 13.28692364692688,
"spec/features/admin/adjustments_spec.rb": 23.726555824279785,
"spec/models/exchange_spec.rb": 18.231592655181885,
"spec/features/admin/enterprises/images_spec.rb": 21.89902114868164,
"spec/controllers/line_items_controller_spec.rb": 11.261710166931152,
"spec/mailers/producer_mailer_spec.rb": 19.540743350982666,
"spec/models/spree/product_spec.rb": 19.957887411117554,
"spec/features/consumer/shopping/embedded_shopfronts_spec.rb": 23.64180088043213,
"spec/models/spree/variant_spec.rb": 16.831849813461304,
"spec/features/admin/reports/enterprise_fee_summaries_spec.rb": 16.088922023773193,
"spec/jobs/subscription_placement_job_spec.rb": 17.93425989151001,
"spec/mailers/subscription_mailer_spec.rb": 19.027340412139893,
"spec/controllers/spree/admin/reports_controller_spec.rb": 21.17331314086914,
"spec/features/consumer/producers_spec.rb": 18.497092247009277,
"spec/models/spree/adjustment_spec.rb": 7.688546895980835,
"spec/features/admin/enterprise_groups_spec.rb": 11.997856616973877,
"spec/controllers/admin/proxy_orders_controller_spec.rb": 10.339219331741333,
"spec/features/consumer/shopping/checkout_auth_spec.rb": 16.628108501434326,
"spec/features/consumer/registration_spec.rb": 31.164623498916626,
"spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb": 9.818962812423706,
"spec/requests/checkout/stripe_connect_spec.rb": 8.772961616516113,
"spec/controllers/api/product_images_controller_spec.rb": 6.45292592048645,
"spec/lib/open_food_network/address_finder_spec.rb": 8.793009996414185,
"spec/features/consumer/groups_spec.rb": 26.977667093276978,
"spec/models/proxy_order_spec.rb": 13.104656219482422,
"spec/features/consumer/multilingual_spec.rb": 17.43264937400818,
"spec/lib/open_food_network/permissions_spec.rb": 13.183045625686646,
"spec/features/admin/variants_spec.rb": 17.20117712020874,
"spec/models/enterprise_spec.rb": 10.5332670211792,
"spec/models/variant_override_spec.rb": 7.334490060806274,
"spec/services/order_factory_spec.rb": 11.875489473342896,
"spec/lib/open_food_network/enterprise_fee_calculator_spec.rb": 12.027559757232666,
"spec/controllers/api/logos_controller_spec.rb": 7.298051834106445,
"spec/controllers/spree/admin/orders_controller_spec.rb": 7.250804662704468,
"spec/lib/open_food_network/order_cycle_form_applicator_spec.rb": 9.185548305511475,
"spec/lib/open_food_network/user_balance_calculator_spec.rb": 9.735471725463867,
"spec/lib/open_food_network/proxy_order_syncer_spec.rb": 11.126964092254639,
"spec/models/enterprise_relationship_spec.rb": 9.923192739486694,
"spec/lib/open_food_network/bulk_coop_report_spec.rb": 6.28821325302124,
"spec/models/spree/property_spec.rb": 6.4871885776519775,
"spec/services/subscription_estimator_spec.rb": 6.207820892333984,
"spec/lib/open_food_network/products_renderer_spec.rb": 6.318859338760376,
"spec/features/admin/schedules_spec.rb": 17.760894298553467,
"spec/lib/open_food_network/packing_report_spec.rb": 7.000155925750732,
"spec/models/spree/stock/availability_validator_spec.rb": 6.332439661026001,
"spec/models/enterprise_fee_spec.rb": 6.138005971908569,
"spec/lib/open_food_network/scope_variant_to_hub_spec.rb": 10.594756841659546,
"spec/features/consumer/shopping/embedded_groups_spec.rb": 18.79310703277588,
"spec/controllers/spree/users_controller_spec.rb": 5.807466983795166,
"spec/services/advance_order_service_spec.rb": 6.725487947463989,
"spec/features/admin/enterprises/index_spec.rb": 15.634530067443848,
"spec/jobs/order_cycle_notification_job_spec.rb": 4.208659410476685,
"spec/controllers/spree/admin/variants_controller_spec.rb": 5.583896160125732,
"spec/features/admin/overview_spec.rb": 5.639538526535034,
"spec/controllers/spree/admin/orders/customer_details_controller_spec.rb": 5.8910181522369385,
"spec/lib/open_food_network/products_and_inventory_report_spec.rb": 5.34000563621521,
"spec/controllers/admin/schedules_controller_spec.rb": 2.7360916137695312,
"spec/models/concerns/variant_stock_spec.rb": 4.917129993438721,
"spec/models/spree/payment_spec.rb": 5.25871467590332,
"spec/controllers/admin/enterprises_controller_spec.rb": 5.274713754653931,
"spec/controllers/admin/variant_overrides_controller_spec.rb": 5.423460245132446,
"spec/models/enterprise_caching_spec.rb": 3.049555778503418,
"spec/services/invoice_renderer_spec.rb": 3.769397258758545,
"spec/features/consumer/shopping/products_spec.rb": 6.6356730461120605,
"spec/lib/open_food_network/group_buy_report_spec.rb": 4.001709938049316,
"spec/controllers/shop_controller_spec.rb": 3.901616334915161,
"spec/features/admin/payments_spec.rb": 3.805184841156006,
"spec/lib/open_food_network/order_cycle_management_report_spec.rb": 3.7799723148345947,
"spec/controllers/spree/admin/payments_controller_spec.rb": 3.4514706134796143,
"spec/models/spree/image_spec.rb": 4.41399621963501,
"spec/helpers/enterprises_helper_spec.rb": 3.328219413757324,
"spec/features/consumer/account/settings_spec.rb": 5.9961183071136475,
"spec/features/consumer/account/cards_spec.rb": 3.517259120941162,
"spec/features/admin/authentication_spec.rb": 10.881295204162598,
"spec/services/subscription_variants_service_spec.rb": 3.4830353260040283,
"spec/controllers/spree/admin/products_controller_spec.rb": 4.002648830413818,
"spec/features/admin/users_spec.rb": 5.449582576751709,
"spec/controllers/api/promo_images_controller_spec.rb": 3.74454927444458,
"spec/lib/open_food_network/customers_report_spec.rb": 3.41019868850708,
"spec/lib/open_food_network/lettuce_share_report_spec.rb": 2.7670164108276367,
"spec/lib/open_food_network/scope_variants_to_search_spec.rb": 2.7599198818206787,
"spec/services/bulk_invoice_service_spec.rb": 2.5634195804595947,
"spec/controllers/admin/subscription_line_items_controller_spec.rb": 2.519078254699707,
"spec/controllers/admin/order_cycles_controller_spec.rb": 3.145948648452759,
"spec/controllers/admin/inventory_items_controller_spec.rb": 2.398263454437256,
"spec/controllers/enterprises_controller_spec.rb": 2.2687149047851562,
"spec/models/product_import/inventory_reset_strategy_spec.rb": 2.328801393508911,
"spec/features/consumer/footer_links_spec.rb": 7.389659404754639,
"spec/lib/open_food_network/subscription_payment_updater_spec.rb": 2.519193649291992,
"spec/models/product_import/products_reset_strategy_spec.rb": 2.208404064178467,
"spec/services/order_cycle_distributed_products_spec.rb": 1.9242751598358154,
"spec/requests/checkout/failed_checkout_spec.rb": 2.4253993034362793,
"spec/services/tax_rate_finder_spec.rb": 1.968726396560669,
"spec/models/producer_property_spec.rb": 1.9552044868469238,
"spec/controllers/cart_controller_spec.rb": 1.8240394592285156,
"spec/services/variants_stock_levels_spec.rb": 1.904362440109253,
"spec/features/admin/multilingual_spec.rb": 4.289350509643555,
"spec/controllers/checkout_controller_spec.rb": 1.6279420852661133,
"spec/models/concerns/order_shipment_spec.rb": 1.7712960243225098,
"spec/services/subscription_form_spec.rb": 1.7455992698669434,
"spec/requests/checkout/paypal_spec.rb": 1.5917167663574219,
"spec/models/spree/shipping_method_spec.rb": 2.04691219329834,
"spec/controllers/shops_controller_spec.rb": 1.0743358135223389,
"spec/services/subscription_validator_spec.rb": 1.422741413116455,
"spec/serializers/api/cached_enterprise_serializer_spec.rb": 1.5118434429168701,
"spec/features/admin/content_spec.rb": 1.3384621143341064,
"spec/models/spree/taxon_spec.rb": 1.4807021617889404,
"spec/lib/open_food_network/tag_rule_applicator_spec.rb": 1.3752143383026123,
"spec/services/cart_service_spec.rb": 1.4081895351409912,
"spec/mailers/order_mailer_spec.rb": 7.018088102340698,
"spec/controllers/spree/admin/shipping_methods_controller_spec.rb": 1.3566155433654785,
"spec/models/calculator/weight_spec.rb": 3.7783122062683105,
"spec/models/concerns/product_stock_spec.rb": 1.3806025981903076,
"spec/controllers/admin/customers_controller_spec.rb": 1.0804333686828613,
"spec/models/spree/product_set_spec.rb": 1.5525598526000977,
"spec/models/spree/order/checkout_spec.rb": 1.19655442237854,
"spec/requests/shop_spec.rb": 1.097696304321289,
"spec/features/admin/caching_spec.rb": 0.731848955154419,
"spec/features/admin/enterprise_user_spec.rb": 0.7907397747039795,
"spec/controllers/admin/manager_invitations_controller_spec.rb": 0.9135403633117676,
"spec/models/spree/user_spec.rb": 0.9081456661224365,
"spec/controllers/spree/admin/payment_methods_controller_spec.rb": 0.7309935092926025,
"spec/models/subscription_spec.rb": 0.8055622577667236,
"spec/services/subscriptions_count_spec.rb": 0.8070430755615234,
"spec/lib/open_food_network/order_and_distributor_report_spec.rb": 1.044970989227295,
"spec/requests/embedded_shopfronts_headers_spec.rb": 0.8394205570220947,
"spec/controllers/spree/admin/search_controller_spec.rb": 0.7693119049072266,
"spec/helpers/admin/subscriptions_helper_spec.rb": 0.7205362319946289,
"spec/models/spree/classification_spec.rb": 0.6712856292724609,
"spec/services/order_cycle_form_spec.rb": 0.7938394546508789,
"spec/models/order_updater_spec.rb": 0.605487585067749,
"spec/lib/open_food_network/enterprise_fee_applicator_spec.rb": 0.909766435623169,
"spec/controllers/spree/admin/reports/enterprise_fee_summaries_controller_spec.rb": 0.396237850189209,
"spec/models/spree/price_spec.rb": 0.8924257755279541,
"spec/controllers/spree/admin/adjustments_controller_spec.rb": 0.5939099788665771,
"spec/controllers/admin/stripe_accounts_controller_spec.rb": 0.4869372844696045,
"spec/models/spree/calculator/price_sack_spec.rb": 0.6309628486633301,
"spec/models/spree/calculator/flexi_rate_spec.rb": 0.58841872215271,
"spec/helpers/admin/orders_helper_spec.rb": 0.5381126403808594,
"spec/models/spree/calculator/flat_percent_item_total_spec.rb": 0.659644603729248,
"spec/controllers/spree/admin/overview_controller_spec.rb": 1.4906401634216309,
"spec/controllers/user_confirmations_controller_spec.rb": 0.4401402473449707,
"spec/models/spree/option_value_spec.rb": 0.5641300678253174,
"spec/models/spree/payment_method_spec.rb": 0.6061296463012695,
"spec/models/spree/gateway_tagging_spec.rb": 0.4723038673400879,
"spec/features/admin/tax_settings_spec.rb": 0.47362518310546875,
"spec/models/enterprise_group_spec.rb": 0.36635661125183105,
"spec/helpers/order_cycles_helper_spec.rb": 0.4308586120605469,
"spec/models/spree/option_type_spec.rb": 0.5037732124328613,
"spec/models/spree/product_property_spec.rb": 0.3868262767791748,
"spec/helpers/i18n_helper_spec.rb": 0.42139244079589844,
"spec/controllers/api/customers_controller_spec.rb": 0.3846399784088135,
"spec/jobs/products_cache_integrity_checker_job_spec.rb": 0.1914665699005127,
"spec/models/customer_spec.rb": 0.38435792922973633,
"spec/controllers/user_registrations_controller_spec.rb": 0.15586233139038086,
"spec/lib/open_food_network/users_and_enterprises_report_spec.rb": 0.3169522285461426,
"spec/controllers/stripe/callbacks_controller_spec.rb": 0.22754812240600586,
"spec/serializers/api/shipping_method_serializer_spec.rb": 0.31409788131713867,
"spec/controllers/spree/credit_cards_controller_spec.rb": 0.30093884468078613,
"spec/models/tag_rule/filter_shipping_methods_spec.rb": 0.2832508087158203,
"spec/features/admin/image_settings_spec.rb": 0.2664794921875,
"spec/controllers/spree/checkout_controller_spec.rb": 0.3376595973968506,
"spec/services/restart_checkout_spec.rb": 0.8919713497161865,
"spec/features/admin/external_services_spec.rb": 0.2553997039794922,
"spec/models/spree/tax_rate_spec.rb": 0.29668140411376953,
"spec/lib/stripe/account_connector_spec.rb": 0.31223392486572266,
"spec/mailers/user_mailer_spec.rb": 0.28792262077331543,
"spec/controllers/spree/paypal_controller_spec.rb": 0.28707265853881836,
"spec/lib/open_food_network/property_merge_spec.rb": 0.2984285354614258,
"spec/models/inventory_item_spec.rb": 0.2676277160644531,
"spec/lib/open_food_network/products_cache_refreshment_spec.rb": 0.5341198444366455,
"spec/models/spree/calculator/per_item_spec.rb": 0.31163692474365234,
"spec/controllers/groups_controller_spec.rb": 0.13434839248657227,
"spec/controllers/spree/admin/base_controller_spec.rb": 0.301377534866333,
"spec/models/stripe_account_spec.rb": 0.4118363857269287,
"spec/jobs/refresh_products_cache_job_spec.rb": 0.36127209663391113,
"spec/models/tag_rule/filter_payment_methods_spec.rb": 0.40189361572265625,
"spec/controllers/admin/stripe_connect_settings_controller_spec.rb": 0.34180450439453125,
"spec/features/consumer/confirm_invitation_spec.rb": 0.3606686592102051,
"spec/services/search_orders_spec.rb": 0.5707180500030518,
"spec/controllers/admin/tag_rules_controller_spec.rb": 0.44332337379455566,
"spec/controllers/api/enterprises_controller_spec.rb": 0.8137326240539551,
"spec/models/exchange_fee_spec.rb": 0.33515214920043945,
"spec/mailers/enterprise_mailer_spec.rb": 0.36087584495544434,
"spec/serializers/api/admin/product_serializer_spec.rb": 0.44899654388427734,
"spec/helpers/checkout_helper_spec.rb": 0.15273785591125488,
"spec/models/column_preference_spec.rb": 0.35555553436279297,
"spec/models/adjustment_metadata_spec.rb": 0.36631131172180176,
"spec/models/model_set_spec.rb": 0.3200507164001465,
"spec/lib/open_food_network/subscription_summary_spec.rb": 0.2988402843475342,
"spec/controllers/admin/column_preferences_controller_spec.rb": 0.3077270984649658,
"spec/models/tag_rule/filter_order_cycles_spec.rb": 0.3134000301361084,
"spec/models/tag_rule/filter_products_spec.rb": 0.23253226280212402,
"spec/controllers/user_passwords_controller_spec.rb": 0.15717339515686035,
"spec/controllers/stripe/webhooks_controller_spec.rb": 0.1401364803314209,
"spec/models/stock/package_spec.rb": 0.25682640075683594,
"spec/lib/open_food_network/enterprise_issue_validator_spec.rb": 0.0387272834777832,
"spec/helpers/spree/orders_helper_spec.rb": 0.12387847900390625,
"spec/lib/open_food_network/xero_invoices_report_spec.rb": 0.13364052772521973,
"spec/models/tag_rule/discount_order_spec.rb": 0.1327047348022461,
"spec/models/product_import/settings_spec.rb": 0.16132211685180664,
"spec/lib/open_food_network/option_value_namer_spec.rb": 0.5149452686309814,
"spec/models/coordinator_fee_spec.rb": 0.12866568565368652,
"spec/models/spree/credit_card_spec.rb": 0.2072758674621582,
"spec/lib/spree/product_filters_spec.rb": 0.12201762199401855,
"spec/models/spree/addresses_spec.rb": 0.11647152900695801,
"spec/services/default_stock_location_spec.rb": 0.09911870956420898,
"spec/lib/open_food_network/sales_tax_report_spec.rb": 0.10174679756164551,
"spec/controllers/api/enterprise_fees_controller_spec.rb": 0.11140251159667969,
"spec/lib/open_food_network/i18n_config_spec.rb": 0.09999489784240723,
"spec/controllers/registration_controller_spec.rb": 0.09182143211364746,
"spec/features/consumer/sitemap_spec.rb": 0.10870242118835449,
"spec/helpers/shared_helper_spec.rb": 0.07873010635375977,
"spec/lib/open_food_network/cached_products_renderer_spec.rb": 0.06981682777404785,
"spec/models/spree/gateway/stripe_connect_spec.rb": 0.05915951728820801,
"spec/helpers/navigation_helper_spec.rb": 0.061690330505371094,
"spec/lib/open_food_network/subscription_summarizer_spec.rb": 0.05331063270568848,
"spec/helpers/html_helper_spec.rb": 0.04561138153076172,
"spec/lib/stripe/webhook_handler_spec.rb": 0.05020856857299805,
"spec/models/spree/preference_spec.rb": 0.05530714988708496,
"spec/lib/open_food_network/order_grouper_spec.rb": 0.04380607604980469,
"spec/helpers/shop_helper_spec.rb": 0.056023359298706055,
"spec/lib/spree/localized_number_spec.rb": 0.04551959037780762,
"spec/models/spree/preferences/file_configuration_spec.rb": 0.04132723808288574,
"spec/jobs/welcome_enterprise_job_spec.rb": 0.04942655563354492,
"spec/models/tag_rule_spec.rb": 0.04657173156738281,
"spec/validators/date_time_string_validator_spec.rb": 0.05379605293273926,
"spec/controllers/spree/user_sessions_controller_spec.rb": 0.04584026336669922,
"spec/validators/integer_array_validator_spec.rb": 0.04658031463623047,
"spec/jobs/confirm_order_job_spec.rb": 0.041007280349731445,
"spec/models/product_import/entry_processor_spec.rb": 0.03451251983642578,
"spec/models/product_import/reset_absent_spec.rb": 0.03505396842956543,
"spec/lib/open_food_network/reports/report_spec.rb": 0.03907656669616699,
"spec/services/embedded_page_service_spec.rb": 0.03762197494506836,
"spec/controllers/api/statuses_controller_spec.rb": 0.036696434020996094,
"spec/models/subscription_line_item_spec.rb": 0.025917768478393555,
"spec/controllers/spree/store_controller_spec.rb": 0.03051137924194336,
"spec/requests/large_request_spec.rb": 0.021759748458862305,
"spec/models/calculator/flat_percent_per_item_spec.rb": 0.02252483367919922,
"spec/controllers/base_controller_spec.rb": 0.025274991989135742,
"spec/services/reset_order_service_spec.rb": 0.024686813354492188,
"spec/services/order_cycle_distributed_variants_spec.rb": 0.02391505241394043,
"spec/lib/open_food_network/referer_parser_spec.rb": 0.020322799682617188,
"spec/lib/open_food_network/reports/rule_spec.rb": 0.021949052810668945,
"spec/lib/open_food_network/feature_toggle_spec.rb": 0.020271778106689453,
"spec/jobs/confirm_signup_job_spec.rb": 0.021286725997924805,
"spec/jobs/heartbeat_job_spec.rb": 0.01560068130493164,
"spec/helpers/products_helper_spec.rb": 0.01751542091369629,
"spec/models/spree/calculator/flat_rate_spec.rb": 0.015111207962036133,
"spec/services/mail_configuration_spec.rb": 0.012917757034301758,
"spec/helpers/groups_helper_spec.rb": 0.018085002899169922,
"spec/helpers/spree/admin/base_helper_spec.rb": 0.008218050003051758,
"spec/lib/open_food_network/error_logger_spec.rb": 0.005335807800292969,
"spec/models/content_configuration_spec.rb": 0.006735563278198242,
"spec/services/upload_sanitizer_spec.rb": 0.0061757564544677734,
"spec/config/application_spec.rb": 0.004937887191772461,
"spec/lib/open_food_network/reports/row_spec.rb": 0.004645824432373047,
"spec/controllers/api/products_controller_spec.rb": 31.840720176696777,
"spec/controllers/api/shipments_controller_spec.rb": 23.73399782180786,
"spec/controllers/api/taxonomies_controller_spec.rb": 0.07463383674621582,
"spec/controllers/api/taxons_controller_spec.rb": 0.9186584949493408,
"spec/controllers/api/variants_controller_spec.rb": 17.02829670906067,
"spec/controllers/spree/admin/users_controller_spec.rb": 0.2153482437133789,
"spec/controllers/spree/api/base_controller_spec.rb": 0.1394824981689453,
"spec/features/admin/reports/packing_report_spec.rb": 5.037803411483765,
"spec/features/consumer/shopping/checkout_paypal_spec.rb": 9.92912220954895,
"spec/helpers/serializer_helper_spec.rb": 0.010895967483520508,
"spec/helpers/spree/admin/orders_helper_spec.rb": 0.05771446228027344,
"spec/models/spree/calculator_spec.rb": 3.1673130989074707,
"spec/models/spree/shipment_spec.rb": 1.092050313949585,
"spec/serializers/api/admin/customer_serializer_spec.rb": 0.1630871295928955,
"spec/serializers/api/admin/enterprise_serializer_spec.rb": 2.3938491344451904,
"spec/serializers/api/admin/exchange_serializer_spec.rb": 3.123688220977783,
"spec/serializers/api/admin/for_order_cycle/enterprise_serializer_spec.rb": 0.9490363597869873,
"spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb": 0.6075096130371094,
"spec/serializers/api/admin/index_enterprise_serializer_spec.rb": 0.18369698524475098,
"spec/serializers/api/admin/subscription_customer_serializer_spec.rb": 0.06726932525634766,
"spec/serializers/api/admin/variant_override_serializer_spec.rb": 0.44232988357543945,
"spec/serializers/api/admin/variant_serializer_spec.rb": 1.0454332828521729,
"spec/serializers/api/credit_card_serializer_spec.rb": 0.017533540725708008,
"spec/serializers/api/current_order_serializer_spec.rb": 2.1227188110351562,
"spec/serializers/api/enterprise_serializer_spec.rb": 0.14253616333007812,
"spec/serializers/api/enterprise_shopfront_list_serializer_spec.rb": 0.11119532585144043,
"spec/serializers/api/enterprise_shopfront_serializer_spec.rb": 1.827807903289795,
"spec/serializers/api/group_list_serializer_spec.rb": 0.14617300033569336,
"spec/serializers/api/order_cycle_serializer_spec.rb": 0.09012603759765625,
"spec/serializers/api/order_serializer_spec.rb": 4.509246826171875,
"spec/serializers/api/variant_serializer_spec.rb": 0.2834649085998535,
"spec/services/exchange_variant_bulk_updater_spec.rb": 1.3508999347686768,
"spec/views/spree/admin/orders/edit.html.haml_spec.rb": 2.0251882076263428,
"spec/views/spree/admin/orders/index.html.haml_spec.rb": 0.15261244773864746
}

View File

@@ -1,22 +0,0 @@
require 'rspec/rails'
require 'rspec/autorun'
# This spec file is one part of a two-part strategy to maintain data integrity. The first part
# is to proactively protect data integrity using database constraints (not null, foreign keys,
# etc) and ActiveRecord validations. As a backup to those two techniques, and particularly in
# the cases where it's not possible to model an integrity concern with database constraints,
# we can add a reactive integrity test here.
# These tests are run nightly and the results are emailed to the MAILTO address in
# config/schedule.rb if any failures occur.
# Ref: http://pluralsight.com/training/Courses/TableOfContents/database-your-friend
describe "data integrity" do
it "has no deleted variants in order cycles" do
# When a variant is soft deleted, it should be removed from all order cycles
# via Spree::Product#delete or Spree::Variant#delete.
evs = ExchangeVariant.joins(:variant).where('spree_variants.deleted_at IS NOT NULL')
evs.count.should == 0
end
end

View File

@@ -2,9 +2,10 @@ require 'open_food_network/user_balance_calculator'
module OpenFoodNetwork
class OrderCycleManagementReport
DEFAULT_DATE_INTERVAL = 1.month
attr_reader :params
def initialize(user, params = {}, render_table = false)
@params = params
@params = sanitize_params(params)
@user = user
@render_table = render_table
end
@@ -133,5 +134,12 @@ module OpenFoodNetwork
customer = Customer.where(email: email).first
customer.nil? ? "" : customer.code
end
def sanitize_params(params)
params[:q] ||= {}
params[:q][:completed_at_gt] ||= Time.zone.today - DEFAULT_DATE_INTERVAL
params[:q][:completed_at_lt] ||= Time.zone.today
params
end
end
end

View File

@@ -15,8 +15,6 @@ namespace :ofn do
sql_delete_from "spree_line_items #{where_order_id_in_orders_to_delete}"
sql_delete_from "spree_payments #{where_order_id_in_orders_to_delete}"
sql_delete_from "spree_shipments #{where_order_id_in_orders_to_delete}"
sql_delete_from "billable_periods"
sql_delete_from "account_invoices"
Spree::ReturnAuthorization.delete_all
truncate_order_cycle_data

View File

@@ -1,10 +1,10 @@
require 'spec_helper'
describe Spree::Api::ShipmentsController, type: :controller do
describe Api::ShipmentsController, type: :controller do
render_views
let!(:shipment) { create(:shipment) }
let!(:attributes) { [:id, :tracking, :number, :cost, :shipped_at, :stock_location_name, :order_id, :shipping_rates, :shipping_method, :inventory_units] }
let!(:attributes) { [:id, :tracking, :number, :cost, :shipped_at, :stock_location_name, :order_id] }
let!(:resource_scoping) { { order_id: shipment.order.to_param, id: shipment.to_param } }
let(:current_api_user) { build(:user) }
@@ -53,7 +53,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
spree_post :create, params
expect_valid_response
expect(json_response["inventory_units"].size).to eq 2
expect(order.shipment.reload.inventory_units.size).to eq 2
expect(order.reload.line_items.first.variant.price).to eq(variant.price)
end
@@ -64,7 +64,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
expect(json_response["id"]). to eq(original_shipment_id)
expect_valid_response
expect(json_response["inventory_units"].size).to eq 2
expect(order.shipment.reload.inventory_units.size).to eq 2
expect(order.reload.line_items.first.variant.price).to eq(variant.price)
end
@@ -77,7 +77,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
spree_post :create, params
expect_valid_response
expect(json_response["inventory_units"].size).to eq 2
expect(order.shipment.reload.inventory_units.size).to eq 2
expect(order.reload.line_items.first.price).to eq(variant_override.price)
end
@@ -113,16 +113,17 @@ describe Spree::Api::ShipmentsController, type: :controller do
it 'adds a variant to a shipment' do
api_put :add, variant_id: variant.to_param, quantity: 2
expect(response.status).to eq(200)
expect(json_response['inventory_units'].select { |h| h['variant_id'] == variant.id }.size).to eq(2)
expect(order.shipment.reload.inventory_units.select { |h| h['variant_id'] == variant.id }.size).to eq 2
end
it 'removes a variant from a shipment' do
order.contents.add(variant, 2)
api_put :remove, variant_id: variant.to_param, quantity: 1
expect(response.status).to eq(200)
expect(json_response['inventory_units'].select { |h| h['variant_id'] == variant.id }.size).to eq(1)
expect(order.shipment.reload.inventory_units.select { |h| h['variant_id'] == variant.id }.size).to eq(1)
end
end
@@ -156,7 +157,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
spree_put :add, params
expect_valid_response
expect(inventory_units_for(json_response["inventory_units"], variant).size).to eq 2
expect(inventory_units_for(variant).size).to eq 2
end
it 'returns error code when adding to order contents fails' do
@@ -175,7 +176,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
spree_put :add, params
expect_valid_response
expect(inventory_units_for(json_response["inventory_units"], variant).size).to eq 2
expect(inventory_units_for(variant).size).to eq 2
expect(order.reload.line_items.last.price).to eq(variant_override.price)
end
end
@@ -190,7 +191,7 @@ describe Spree::Api::ShipmentsController, type: :controller do
spree_put :remove, params
expect_valid_response
expect(inventory_units_for(json_response["inventory_units"], variant).size).to eq 0
expect(inventory_units_for(variant).size).to eq 0
end
it 'returns error code when removing from order contents fails' do
@@ -203,14 +204,13 @@ describe Spree::Api::ShipmentsController, type: :controller do
end
end
def inventory_units_for(inventory_units, variant)
inventory_units.select { |unit| unit['variant_id'] == variant.id }
def inventory_units_for(variant)
order.shipment.reload.inventory_units.select { |unit| unit['variant_id'] == variant.id }
end
def expect_valid_response
expect(response.status).to eq 200
attributes.all?{ |attr| json_response.key? attr.to_s }
expect(json_response["shipping_method"]["name"]).to eq order.shipping_method.name
end
def make_order_contents_fail

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