Compare commits

...

743 Commits

Author SHA1 Message Date
Maikel Linke
a64d146bb1 Update translations 2022-10-06 12:31:39 +11:00
Maikel
a43d31a9d5 Merge pull request #9711 from dacook/translation-cleanup
Translation cleanup
2022-10-06 09:51:28 +11:00
Maikel
db2b381c3f Merge pull request #9718 from mkllnk/style
Use standard ApplicationRecord in task class
2022-10-06 09:42:29 +11:00
Konrad
9f0c0208dd Merge branch 'master' into style 2022-10-05 19:59:10 +02:00
Maikel
8072e97579 Merge pull request #9721 from filipefurtad0/fix_flaky_shopping_spec
Addresses flakyness in shopping_spec.rb
2022-10-05 13:19:23 +11:00
filipefurtad0
977916cb11 Adds 2 sec sleep time on other flaky examples 2022-10-04 20:58:30 +01:00
filipefurtad0
f4edfcefa2 Adds 2 sec sleep time 2022-10-04 20:17:14 +01:00
Rachel Arnould
b078d3e0cc Merge pull request #9719 from mkllnk/secrets-config
Simplify config of secret token
2022-10-04 20:36:03 +02:00
Rachel Arnould
611475c48a Merge pull request #9448 from binarygit/cancel-orders-in-bulk
Cancel Orders in Bulk
2022-10-04 19:48:59 +02:00
Rachel Arnould
21ecec894f Merge pull request #9688 from binarygit/order-cycle-closes-during-checkout
Redirect to shopfront when OC closes during checkout
2022-10-04 19:46:38 +02:00
David Cook
0fc8c719fe Scope Enterprise side menu translations
And removed some now-unused global translations, yay! I searched for these in the codebase, eg with regex:
/\bt[\( ]["':]shop_preferences/
2022-10-04 19:39:29 +02:00
David Cook
4c3e20d25a Scope Enterprise form legend translations 2022-10-04 19:39:29 +02:00
David Cook
13d95ecf1d Scope Enterprise Group side menu translations
With it's own lazy scope, we no longer need to define labels separately.
2022-10-04 19:39:29 +02:00
David Cook
7803e5d4ff Scope Enterprise Group form legend translations
Using lazy-lookup builtin scopes, instead of sharing the global translations, as per our guidelines.
2022-10-04 19:39:29 +02:00
David Cook
2e2ff25ef7 DRY up code
Slightly. If we upgrade to Ruby 3.1 with hash value omission, this would be neater.
If we could set a scope in the controller (https://stackoverflow.com/questions/6137960/rails-i18n-default-scope) it would be even neater.
2022-10-04 19:39:29 +02:00
David Cook
3a61cf05ad Remove unused locale message
I can't find any reference to this in the code. The wiki says maybe it's looked up with a variable, but I don't see how it could be used unless this string is defined in code somewhere (we wouldn't translate data from the database, would we?).
Maybe it's used in a gem? In that case, hopefully CI will pick up the error.
2022-10-04 19:39:29 +02:00
Maikel Linke
ef80c3358d Explain how to easily configure other environments locally 2022-10-04 19:35:40 +02:00
Maikel Linke
57a70455a8 Simplify setting of secret token
We define it in the dotenv files already which has the advantage of
being overridable. I adjusted the dotenv files to have the same value as
was set before, 30 times `x`.
2022-10-04 19:35:40 +02:00
Maikel Linke
885e67a39b Ignore Rails secrets
These files are only used in production but sometimes we want to test
production execution on our dev machines, too.
2022-10-04 19:35:40 +02:00
binarygit
25ae10dbe8 Create bulk orders cancellation feature 2022-10-04 16:57:31 +02:00
filipefurtad0
7b592fd80b Adds assertion after page visit to promote page loading 2022-10-04 12:27:58 +01:00
jibees
4b6aced962 Merge pull request #9732 from openfoodfoundation/dependabot/bundler/test-unit-3.5.5
Bump test-unit from 3.5.3 to 3.5.5
2022-10-04 12:15:55 +02:00
dependabot[bot]
e32ad0b436 Bump test-unit from 3.5.3 to 3.5.5
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.5.3 to 3.5.5.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.5.3...3.5.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 09:19:10 +00:00
binarygit
930721bea6 Redirect to shop front when OC closes during checkout 2022-10-03 20:51:41 +02:00
filipefurtad0
8e6f828f66 Splits it cases into respective contexts 2022-10-03 19:30:57 +01:00
filipefurtad0
fa05327342 Adds assertions on clearing searches
Asserts on page contents
2022-10-03 19:12:27 +01:00
filipefurtad0
cafa17ec13 Splits test into two assertions 2022-10-03 19:12:27 +01:00
jibees
b3449137e0 Merge pull request #9728 from openfoodfoundation/dependabot/npm_and_yarn/js-big-decimal-1.3.10
Bump js-big-decimal from 1.3.5 to 1.3.10
2022-10-03 14:56:33 +02:00
dependabot[bot]
da6af22d03 Bump js-big-decimal from 1.3.5 to 1.3.10
Bumps [js-big-decimal](https://github.com/royNiladri/js-big-decimal) from 1.3.5 to 1.3.10.
- [Release notes](https://github.com/royNiladri/js-big-decimal/releases)
- [Commits](https://github.com/royNiladri/js-big-decimal/compare/v1.3.5...v1.3.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 09:05:41 +00:00
Jean-Baptiste Bellet
0468d46241 Update all locales with the latest Transifex translations 2022-09-30 16:37:59 +02:00
jibees
0c64720a9e Merge pull request #9710 from mkllnk/9002-customer-association-updates
Associate and update customer records when ordering
2022-09-30 16:36:01 +02:00
Filipe
4b279d28dd Merge pull request #9262 from cillian/order-cycle-shipping-methods
Let people customise which shipping methods are available to customers on order cycles
2022-09-30 14:36:37 +01:00
Cillian O'Ruanaidh
acd4706890 Set closing time correctly in order_cycles/complex_creating_specific_time_spec.rb 2022-09-30 14:22:11 +01:00
Filipe
f7d21406a1 Merge pull request #9702 from ashwini-seshadri/master
Fix for new subscription dialog
2022-09-30 13:32:42 +01:00
Cillian O'Ruanaidh
f9e29f3a78 Fix Metrics/AbcSize violation in order_cycles/complex_creating_specific_time_spec.rb 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
def87485c0 Don't delete schedules on the order_cycles#update action just because the :schedule_ids was not specified in the parameters
Before this schedules were being deleted when the Checkout Options step of editing order cycles was saved because this step wasn't sending the :schedule_ids parameter. It's more awkard for API users if they always need to explicity send the :schedule_ids parameter even if they don't want to add/remove any of the schedules, for example if they just want to update an order cycle name.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
6542b47e72 Adjust order_cycles/complex_creating_specific_time_spec to take into account that DistributorShippingMethods instead of ShippingMethods are connected to OrderCycles now 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
2827e07da6 Define :oc with let so it is available globally to other methods such as :expect_fees_saved 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
23f6901fb4 Adjust order_cycles/simple_spec.rb to take new Checkout Options step into account
Note, this doesn't test checking/unchecking some distributor shipping methods and not others because that is tested in order_cycles/complex_creating_time_specific_spec.rb.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
db92e9d91c Fix error from OrderCycle#distributor_shipping methods return ActiveRecord::Relation sometimes and Array other times
Now it will return ActiveRecord::Relation consistently.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
5207dbf8c6 OrderCycle#distributor_shipping_methods should return all attachable ones by default per distributor, not per all distributors 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
7e40ad39cb Bring back select all checkboxes on order cycle checkout options form. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a53a3259a8 Connect DistributorShippingMethods to OrderCycles instead of Spree::ShippingMethods
Before if a shipping method was shared between multiple distributors it could only be disabled/enabled on that order cycle for all the distributors which have that shipping method e.g. you couldn't select that shipping method for one distributor but disable it for another.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8c483f2eab Change join table in migration from order cycles to distributor shipping methods instead of order cycles to shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
65ee9e1486 Implement new design with shipping and payment methods on different rows instead of same one, the select all checkboxes still need to be added back later
This is the new design from https://github.com/openfoodfoundation/openfoodnetwork/pull/9262#issuecomment-1206673689
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a73b608f8a Remove 'shared' shipping method sections from order cycle checkout options form, any shared shipping methods are to be displayed for each distributor e.g. if they belong to multiple distributors they will be displayed multiple times 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
4b0b4ad991 Revert "Use a more simple layout on the order cycle checkout options form"
This reverts commit 0dddaa6c2b9f1925adca6ff8deac8181691ae119.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
32d16eacd2 Fix Rubocop Metrics/AbcSize and Layout/LineLength errors in complex_creating_specific_time_spec.rb
Not sure if this is correct but it removes the Rubocop violations.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8e47949260 Check 'Select all' checkboxes on page load if all its checkboxes are checked
This means the code to set the initial value in the view template isn't needed.
2022-09-30 13:13:39 +01:00
Maikel Linke
512394862b Wait for input field before filling it
The spec was failing from time to time. I hope that this will fix it.

```
Failures:

  1)
    As an administrator
    I want to create/update complex order cycles with a specific time
 creating an order cycle with full interface
     Failure/Error: fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time'

     Capybara::ElementNotFound:
       Unable to find field "order_cycle_outgoing_exchange_0_pickup_time" that is not disabled

     # ./spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb:138:in `add_distributor_with_fees'
     # ./spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb:66:in `block (2 levels) in <main>'
     # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <main>'
     # -e:1:in `<main>'
```
2022-09-30 13:13:39 +01:00
Maikel Linke
195f1e1237 Make "Select all" translatable 2022-09-30 13:13:39 +01:00
Maikel Linke
26d5ea6cdc Remove unused input name 2022-09-30 13:13:39 +01:00
Maikel Linke
3518d1ba92 Spec "Select all" shipping methods field 2022-09-30 13:13:39 +01:00
Maikel Linke
c5bb2f52e1 Check "Select all" to start with
Reflect the state of the shipping method checkboxes.
2022-09-30 13:13:39 +01:00
Maikel Linke
758030e81a Test with readable labels instead of ids 2022-09-30 13:13:39 +01:00
Maikel Linke
da2ef3fae2 Give order cycle spec some structure 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
87431c188e Use ShippingMethod :frontend method and drop :backend to avoid ClassLength Rubocop error 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
0673f9a5ae Use a more simple layout on the order cycle checkout options form
Before there was a row for each distributor and a 'shared' row for shipping methods which were shared among more than one distributor. This layout displays a single list of shipping methods with the distributor or distributors it belongs to beside it as suggested by @lin-d-hop
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8cb2767f9a The no shipping/payment method warnings on order cycle checkout options looks better left aligned 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
1a70cc0c4c Don't display no shipping/payment method warnings on order cycle checkout options if the distributor has some that are shared with other distributors 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
464a9b95a4 On order cycle checkout options shipping methods shared between distributors should be checked by default too 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8b59b7a796 Use if exclude instead of if !include in OrderCycleForm
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ad51b41bb3 Use :belongs_to instead of :references in :order_cycles_shipping_methods
Also fix migration class name.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
472bd150bb For consistency with other '<em>' don't strip whitespace.
Although both '%em' and '%em>' are rendering the same markup, perhaps because the tag is on it's own new line.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
af87943fd0 Change 'if !' to 'unless' in OrderCyclesList
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
efb1a326b4 Fix line length in OrderCycleForm spec for Rubocop 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
94b96e18ed Remove OrderCycleForm specs that are no longer necessary
These were added for a previous approach which is no longer used.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
80b7a5d39a Remove OrderCycleShippingMethod model and use a :has_and_belongs_to_many association instead
Before the OrderCycleShippingMethod had a validation which checked the shipping method belonged to the order cycle distributor. Instead of this validation this just ignores shipping methods which don't belong to one of the order cycle's distributors when they are being attached in the OrderCycleForm service. This pattern is already being used in the OrderCycleForm service for ignoring Schedules that the person doesn't own.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
61bbf0714e Remove flag argument anti-pattern from Shop::OrderCyclesList
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
da3eea6005 Fetch shared shipping/payment methods for order cycle checkout options in single query 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
6453bbcc1c Fix :selected_shipping_method_ids param for shared shipping methods. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
541a340dcf If an OrderCycle or Spree::ShippingMethod is destroyed then remove it's associated OrderCycleShippingMethod records too 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
593da4996f A shop won't be shown as open if it doesn't have useable shipping method so these shipping method validations are really necessary 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a3a52a07b7 Build shipping method with a category so it's valid in the test 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ed13ee6cbc Fix association alignment in OrderCycle 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
564e4d802c Don't use :html_safe with payment method name in checkout options in case it contains something malicious
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
747c88fb35 Update the Shop::OrderCyclesList service so it's clearer what kind of order cycles are being fetched
Before the Shop::OrderCyclesList service would return order cycles even if they are not ready for checkout and we had a check before calling the service in BaseController which would return OrderCycle.where('false'). It seems like this check should be part of the service too.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f4a4f7c9ff Remove validations checking order cycle has shipping methods
Instead we will make sure the order cycle is not available on the shopfront if it is doesn't have valid shipping methods. This will preven the issue where if one distributor deletes their shipping method, we don't want to invalidate the order cycle for all other distributors.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
81730f725d Enterprises shouldn't be considered ready for checkout if it only has backend shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
7bd56007bd Don't use :html_safe in case shipping method name contains something malicious in app/views/admin/order_cycles/checkout_options.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
d9de35799d Array difference operator is neater than reject in app/views/admin/order_cycles/checkout_options.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
67d4c38550 Rename :preferred_shipping_methods to :selected_shipping_methods on OrderCycle
It's a clearer name because 'preferred' implies there could be other unpreferred shipping methods available as well.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
cc5daf51b1 Expect to be_valid instead of checking presence of specific error spec/models/spree/shipping_method_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f25de984d2 Use .empty? instead of !exists? in app/models/order_cycle_shipping_method.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9a511e9e94 Rubocop adjustments 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
0671e52a29 Undo changes to tests, now that order cycle returns all shipping methods by default and doesn't explicitly require OrderCycleShippingMethods anymore 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9296686384 Make backend, frontend scopes on Spree::ShippingMethod neater
Co-authored-by: Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f6c754839b Make OrderCycleShippingMethod inherit from ApplicationRecord 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
fc4f951a1a Only require OrderCycleShippingMethod records if people want to override the default shipping methods
It makes things much simpler if we return all shipping methods by default without needing OrderCycleShippingMethod records to be added to the database.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
4e0bf75ecf Get tests broken because of new order cycle shipping method validations working again 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a46b77d10c Ensure hack for showing products on a shop with closed order cycles also works if an order cycle has no shipping methods
If a distributor order cycle has no shipping methods it will be invalid. This is a bit confusing because adding a check for :invalid seems like it would be better if it was done in the Shop::OrderCyclesList service but the hack doesn't work if you put it in there, it seems like something needs a refactor.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
5a4bc79c74 Update sample data task so distributor order cycles have shipping methods attached i.e. are valid 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
bff7650b35 Change :available_shipping_methods helper to use new OrderAvailableShippingMethods service. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
855ec1a708 Add new 'Checkout options' step to the edit order cycle form so people can attach shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
1e817af5aa Validate deleting a shipping method or switching it to backoffice only doesn't invalidate any order cycles 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
48c2e48b24 Update the OrderCycleForm service so it supports attaching shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ca97a7f52d Add :shipping_methods association to OrderCyle and validations 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9a6e8a1113 Add an OrderCycleShippingMethod model to handle attaching shipping methods to order cycles 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
94d71b8dce Remove extra unnecessary :display_on_checkout scope and reuse :frontend scope instead 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a5daee39e3 Extract out a DISPLAY_ON_OPTIONS constant in Spree::ShippingMethod instead of magic strings 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
37617f63ea Remove non-functional :backend scope from Spree::ShippingRate
It finds shipping methods where 'display_on != front_end' but :front_end values were removed in a1317be19b/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb so it will always return true.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9b5f743fa5 Extract out a OrderCycle#simple? method so it can be used in models 2022-09-30 13:13:39 +01:00
Filipe
e85dd99e04 Merge pull request #9633 from binarygit/add-stimulus-reflex
Add StimulusReflex
2022-09-29 17:11:18 +01:00
binarygit
ebe4a3d6ab Add StimulusReflex 2022-09-29 16:03:45 +02:00
jibees
382f8c38f6 Merge pull request #9712 from jibees/solve-uglifier-error
Remove now unnecessary uglifier gem
2022-09-29 16:02:14 +02:00
Jean-Baptiste Bellet
a024d0e5ac Remove uglifier 2022-09-29 15:24:31 +02:00
Rachel Arnould
f8f778eaa1 Merge pull request #9686 from jibees/9684-fix-search-customer-in-order-creation-for-super-admin
Admin, New Order, Search customer: As a super admin, search for customer within all enterprises
2022-09-29 14:35:18 +02:00
Maikel Linke
8011d85968 Clarify updating only pre-existing customers 2022-09-29 12:06:06 +02:00
Maikel Linke
a7de56460d Further simplify Order by outsourcing to service class 2022-09-29 12:06:06 +02:00
Maikel Linke
1f19642dad Simplify Order by outsourcing to service class
This is work in progress and calling the service will be simplified in a
few commits.
2022-09-29 12:06:06 +02:00
Maikel Linke
33d6454dd3 Simplify with guard clause 2022-09-29 12:06:06 +02:00
Maikel Linke
a0260c4ff7 Move customer update logic to own service file
The Order class is too big already. We can move more code in the next
commits.
2022-09-29 12:06:06 +02:00
Maikel Linke
cec81a3ae6 Clarify condition to create customer record 2022-09-29 12:06:06 +02:00
Maikel Linke
37eac5ed49 Remove dead code branch in customer check
We only try to create a customer when none is present. So the check for
validating the customer always returned false because we didn't have a
customer.
2022-09-29 12:06:06 +02:00
Maikel Linke
b232fa3d0c Deal with conflicting customer entries 2022-09-29 12:06:06 +02:00
Maikel Linke
f6ac02dce5 Update customer's email after user changed it
This may fail if there's already a customer record with the same email
address for the same enterprise. I will fix that in the next commit.
2022-09-29 12:06:06 +02:00
Maikel Linke
9dbba35019 Find customers by user id as well as email
Also fixing up a spec which became brittle due to too much mocking.
2022-09-29 12:06:06 +02:00
Maikel Linke
cf634d8d9b Simplify customer association 2022-09-29 12:06:06 +02:00
Maikel Linke
5fefd3b14b Remove useless customer loading and clarify name
The method `associate_customer` only loads a customer but doesn't
actually associate one. So the deleted line doesn't have any effect.

The intention was to reset the customer after switching shops but the
before_validation logic on the order model takes care of that already.

I'm renaming this private method here for clarity.
2022-09-29 12:06:06 +02:00
Maikel Linke
93da64f466 Spec for duplicate customers after changing email 2022-09-29 12:06:06 +02:00
Maikel Linke
0d1f48ac0d Simplify order-customer logic 2022-09-29 12:06:06 +02:00
Maikel Linke
ccbf20a73b Replace spec of customer's internal logic
Specs should test public methods. Private methods should be able to
change without specs breaking.

The specs were also just mirroring the code and didn't really have any
meaning. So I wrote new ones which are hopefully clearer.

There's actually a case which I don't quite understand. Why don't we
require a customer for a new complete order? It means that we don't have
a customer creating it but then it's added when updating the order.
Seems inconsistent.
2022-09-29 12:06:06 +02:00
jibees
5dc4a859f7 Merge pull request #9717 from openfoodfoundation/dependabot/bundler/view_component-2.74.0
Bump view_component from 2.73.0 to 2.74.0
2022-09-29 10:19:23 +02:00
jibees
9323931a21 Merge pull request #9715 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.3
Bump @babel/preset-env from 7.19.1 to 7.19.3
2022-09-29 09:33:28 +02:00
Maikel Linke
d81037d658 Simplify branching logic in SearchesController 2022-09-29 09:30:21 +02:00
Maikel Linke
12d7db3dd6 More efficient enterprise access check 2022-09-29 09:30:21 +02:00
Jean-Baptiste Bellet
cdf71b419f Search within all enterprises if user is the super admin 2022-09-29 09:30:21 +02:00
dependabot[bot]
6f6b1ce9e6 Bump view_component from 2.73.0 to 2.74.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.73.0 to 2.74.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.73.0...v2.74.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-29 07:02:17 +00:00
Maikel
2c2d244c56 Merge pull request #9716 from filipefurtad0/fix_reports_spec
Fixes invert columns logic on reports spec
2022-09-29 17:00:38 +10:00
Maikel Linke
c8cfbbb0b2 Use standard ApplicationRecord in task class
It's best practice to use the ApplicationRecord. But when Rake is
loaded, our application is not loaded yet and the ApplicationRecord
class wasn't available yet. Requiring within the task solves the problem
because Rake loads the Rails environment before executing this task.

I also removed the unused highline loading.
2022-09-29 11:56:10 +10:00
Maikel
c000c0dd5d Merge pull request #9709 from openfoodfoundation/dependabot/bundler/view_component-2.73.0
Bump view_component from 2.72.0 to 2.73.0
2022-09-29 08:23:09 +10:00
Filipe
958c6fe8f3 Merge pull request #9685 from filipefurtad0/remove_js_tracking_code
Removes matomo JS tracking code
2022-09-28 23:15:23 +01:00
Filipe
9cc2d30920 Merge pull request #9642 from mkllnk/9002-customer-association
Delete duplicate customer entries
2022-09-28 17:17:23 +01:00
filipefurtad0
e00a59212c Fixes invert columns logic on reports spec 2022-09-28 11:49:20 +01:00
dependabot[bot]
e783594385 Bump @babel/preset-env from 7.19.1 to 7.19.3
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.1 to 7.19.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.3/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-28 09:03:57 +00:00
Ashwini Seshadri
edee5c693b Changed new subscription dialog to use tom-select from select2
fixed z-index, text-alignment in the dropdown menu to left in new subscription modal, replaced click_link with page.find().click in subscription specs, removed href in subscription index
2022-09-28 10:47:39 +02:00
dependabot[bot]
fea78884e7 Bump view_component from 2.72.0 to 2.73.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.72.0 to 2.73.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.72.0...v2.73.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-28 07:23:18 +00:00
jibees
4f290b5bc5 Merge pull request #9707 from filipefurtad0/remove_visible_true_label
Removes "visible: true" from system specs
2022-09-28 09:21:19 +02:00
Maikel
52c38428e8 Merge pull request #9624 from filipefurtad0/add_vcr_to_the_stack
Add VCR to the stack
2022-09-28 10:48:59 +10:00
filipefurtad0
538844a1fb Removes _visible: true_ from system specs 2022-09-27 17:32:25 +01:00
filipefurtad0
4690cb102b Adds sets-up the cassettes correctly and other configs
deletes unecessary files

Reverts helper option to turn VCR off
2022-09-27 07:26:26 +01:00
Maikel Linke
4e33bd2713 Avoid trying to delete address referenced elsewhere 2022-09-27 13:14:51 +10:00
Maikel Linke
286dade66f Don't enforce ApplicationRecord in migrations
We shouldn't use app code in migrations because app code changes while
migrations should always do the same to enable old servers to upgrade.

We have some existing migrations which use ApplicationRecord but I found
that changing them retrospectively breaks them already. So let's leave
them alone.
2022-09-27 13:14:51 +10:00
Maikel Linke
591f901935 Delete duplicate customer entries 2022-09-27 13:14:49 +10:00
Maikel Linke
aec28e0807 Simplify customer model requiring enterprise 2022-09-27 13:14:18 +10:00
Maikel Linke
be31b9a897 Document purpose of customer model 2022-09-27 13:14:18 +10:00
Maikel
6783e7f74c Fix typo 2022-09-27 12:37:08 +10:00
Maikel
19c9eccffe Merge pull request #9704 from openfoodfoundation/dependabot/bundler/geocoder-1.8.1
Bump geocoder from 1.8.0 to 1.8.1
2022-09-27 12:09:12 +10:00
Maikel
561aa0e291 Merge pull request #9701 from sashashura/patch-6
GitHub Workflows security hardening
2022-09-27 11:56:25 +10:00
dependabot[bot]
e45decf14e Bump geocoder from 1.8.0 to 1.8.1
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/alexreisner/geocoder/releases)
- [Changelog](https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alexreisner/geocoder/compare/v1.8.0...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 09:32:31 +00:00
jibees
b851aba81a Merge pull request #9699 from filipefurtad0/localization_number_settings
Adds tests to decimal, thousands and localization number settings
2022-09-26 10:57:28 +02:00
jibees
45040ca702 Merge pull request #9696 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.2.0
Bump @hotwired/turbo from 7.1.0 to 7.2.0
2022-09-26 10:56:55 +02:00
jibees
126da75167 Merge pull request #9694 from openfoodfoundation/dependabot/bundler/spring-4.1.0
Bump spring from 4.0.0 to 4.1.0
2022-09-26 10:55:51 +02:00
jibees
71b24ef8b9 Merge pull request #9690 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.7
Bump sidekiq from 6.5.6 to 6.5.7
2022-09-26 10:54:42 +02:00
jibees
4ae93113f0 Merge pull request #9670 from dacook/generate-erd
Script to generate ERD
2022-09-26 10:33:06 +02:00
Alex
8ce82a9ad6 build: harden mapi.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:52:16 +02:00
Alex
bd6bf9315a build: harden linters.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:51:33 +02:00
filipefurtad0
7b33405530 Replaces translation with actual string
DRY: creates update_and_assert_message
2022-09-23 13:00:39 +01:00
filipefurtad0
6e3c0858c1 Adds decimal and thousands separator test 2022-09-23 12:47:18 +01:00
filipefurtad0
fb8d2827d2 Adds number localization preferences test 2022-09-23 12:03:18 +01:00
dependabot[bot]
ae8d505367 Bump @hotwired/turbo from 7.1.0 to 7.2.0
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.1.0 to 7.2.0.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.1.0...v7.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-23 09:03:43 +00:00
Jean-Baptiste Bellet
cba9779168 Update all locales with the latest Transifex translations 2022-09-22 16:35:32 +02:00
dependabot[bot]
17e9dbc0f7 Bump spring from 4.0.0 to 4.1.0
Bumps [spring](https://github.com/rails/spring) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v4.0.0...v4.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 09:16:42 +00:00
filipefurtad0
e798277cbf Adds real requests with concealed secret key 2022-09-21 12:32:49 +01:00
filipefurtad0
3e97433920 Adds VCR config file into support folder
...with additional options to vcr_setup
2022-09-21 12:32:49 +01:00
filipefurtad0
038b93fdf6 Adds VCR to the stack
...And sets gems in alphabetical order
2022-09-21 12:32:49 +01:00
Rachel Arnould
e98d4af630 Merge pull request #9659 from saunmanoj888/fix-bulk-product-update-unit-value
Allow to change unit value for numbers with a comma separator on bulk product update
2022-09-21 13:04:08 +02:00
dependabot[bot]
79374ce5d7 Bump sidekiq from 6.5.6 to 6.5.7
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.6 to 6.5.7.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.6...v6.5.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-21 09:07:14 +00:00
jibees
e0aa94e6af Merge pull request #9689 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.2
Bump @floating-ui/dom from 1.0.1 to 1.0.2
2022-09-21 09:21:46 +02:00
Maikel
a4de128a76 Merge pull request #9674 from filipefurtad0/wicked_pdf_config
Makes wicked-pdf config ENV-dependent
2022-09-21 13:16:41 +10:00
David Cook
96d1616b70 Update for compatibility with macOS (BSD grep)
The --max-count option tells grep to stop reading lines after the first matching line. We're looking for the line AFTER the first matching line.
2022-09-21 12:22:21 +10:00
David Cook
086cde83db Script to easily generate ERD
The generated date is included for reference.
Stored in new 'doc/' directory.
2022-09-21 12:21:49 +10:00
David Cook
4abe677cc6 Add rails-erd gem
Only in development environment.
2022-09-21 12:21:46 +10:00
Maikel
fe2e510fdc Merge pull request #9621 from filipefurtad0/invoice_spec_to_account_for_tax_ordering
Invoice spec to account for tax ordering
2022-09-21 10:14:07 +10:00
dependabot[bot]
ae152fd94f Bump @floating-ui/dom from 1.0.1 to 1.0.2
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.2/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-20 09:04:55 +00:00
Maikel
5173ddb7a0 Merge pull request #9675 from filipefurtad0/split_build_consumer_tests
Makes build run all specs; fixes failing specs
2022-09-20 11:20:52 +10:00
Filipe
bd698f5d81 Merge pull request #9683 from filipefurtad0/customer_query_superadmin_spec
Spec reproducing failing customer query, as superadmin
2022-09-19 15:53:07 +01:00
filipefurtad0
136a4df4d9 Removes matomo JS tracking code 2022-09-19 15:26:07 +01:00
filipefurtad0
7e168fad02 Spec reproduing failing customer query, as superadmin 2022-09-19 14:11:13 +01:00
jibees
c574b2d8ba Merge pull request #9634 from binarygit/remove-angular-from-shipping-methods
Remove shipping methods controller
2022-09-19 14:16:07 +02:00
jibees
502abfdfce Merge pull request #9681 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.16.1
Bump rubocop-rails from 2.16.0 to 2.16.1
2022-09-19 14:13:22 +02:00
jibees
c714204877 Merge pull request #9673 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.1
Bump @babel/preset-env from 7.19.0 to 7.19.1
2022-09-19 14:13:08 +02:00
dependabot[bot]
cb84f6671a Bump @babel/preset-env from 7.19.0 to 7.19.1
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.0 to 7.19.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.1/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 08:38:38 +00:00
jibees
20c393e4e9 Merge pull request #9680 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.2.0
Bump shoulda-matchers from 5.1.0 to 5.2.0
2022-09-19 10:38:01 +02:00
jibees
8e3cd4653d Merge pull request #9669 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.12
Bump @storybook/addon-docs from 6.5.10 to 6.5.12
2022-09-19 10:33:59 +02:00
jibees
b4deb19d8e Merge pull request #9667 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.12
Bump @storybook/addon-controls from 6.5.10 to 6.5.12
2022-09-19 10:33:41 +02:00
dependabot[bot]
e30ebd3671 Bump rubocop-rails from 2.16.0 to 2.16.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.16.0...v2.16.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 07:58:34 +00:00
dependabot[bot]
b7f8422f30 Bump shoulda-matchers from 5.1.0 to 5.2.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v5.1.0...v5.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 07:56:59 +00:00
dependabot[bot]
b3d628551e Bump @storybook/addon-controls from 6.5.10 to 6.5.12
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/addons/controls)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 07:55:08 +00:00
dependabot[bot]
70e39174d2 Bump @storybook/addon-docs from 6.5.10 to 6.5.12
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 07:54:54 +00:00
jibees
b03cfa163a Merge pull request #9672 from openfoodfoundation/dependabot/bundler/view_component-2.72.0
Bump view_component from 2.71.0 to 2.72.0
2022-09-19 09:54:38 +02:00
jibees
4c32548e83 Merge pull request #9668 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.12
Bump @storybook/server from 6.5.10 to 6.5.12
2022-09-19 09:53:47 +02:00
Jean-Baptiste Bellet
7186526dc6 Fix block too long warnings 2022-09-19 09:26:34 +02:00
filipefurtad0
8c8b262ea1 Sets examples pending and dry running with xit 2022-09-16 15:24:51 +01:00
filipefurtad0
6ae741936f Scrolls down the page to enable finding element 2022-09-16 15:24:39 +01:00
Jean-Baptiste Bellet
cf8bab97e8 Fix spec by not raising the error image not found
`GET http://localhost:3000/throbber.gif 404 (Not Found)`

In the meantime, open an issue to remove jquery.jstree from this page: 9677
2022-09-16 11:04:08 +02:00
Jean-Baptiste Bellet
ba2ad4a0c4 Since #9126, replacing Paperclip with ActiveStorage, some methods changed 2022-09-16 10:51:04 +02:00
Jean-Baptiste Bellet
4a8dc37b40 Since #9087, we don't use a boolean but an enum, 'public' or 'hidden' 2022-09-16 10:02:27 +02:00
Jean-Baptiste Bellet
3942c4d808 Fix failing spec: since #9606 we use tom-select 2022-09-16 09:32:34 +02:00
filipefurtad0
ba8162c1d0 Splits consumer specs into two parallel runs 2022-09-15 17:34:01 +01:00
filipefurtad0
bf1fc736b9 Removes _spec.rb ending from admin specs on build.yml 2022-09-15 17:32:48 +01:00
filipefurtad0
bc1ae01eb6 Updates invoice_spec to A3 page size setting
Separates display_as in assertion to prevent line break failures
2022-09-15 14:34:15 +01:00
filipefurtad0
e4cceffd5c Makes wicked-pdf config env dependent 2022-09-15 12:12:47 +01:00
Maikel Linke
887f886110 Update translations 2022-09-15 16:25:33 +10:00
dependabot[bot]
78fa44739f Bump view_component from 2.71.0 to 2.72.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.71.0 to 2.72.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.71.0...v2.72.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-15 06:22:01 +00:00
Maikel
1f00ddeb3b Merge pull request #9654 from openfoodfoundation/dependabot/bundler/rswag-specs-2.6.0
Bump rswag-specs from 2.5.1 to 2.6.0
2022-09-15 16:17:41 +10:00
dependabot[bot]
46c19580bc Bump @storybook/server from 6.5.10 to 6.5.12
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/app/server)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 09:04:51 +00:00
filipefurtad0
e54acf3ca0 Changes tax parcels into the correct order
This should fail now, adding pending example on next commit

Wraps failing assertions around pending block

Addresses rubocop Style/LineEndConcatenation convention

Removes pending blocks
2022-09-14 08:02:45 +01:00
saunmanoj888
498d003684 Add unit specs for the js changes for unit_value 2022-09-13 23:28:27 +05:30
binarygit
90f4b1328b Remove angular from shipping methods tab in enterprise/edit 2022-09-13 15:20:33 +05:45
dependabot[bot]
0c81ec0202 Bump rswag-specs from 2.5.1 to 2.6.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 00:44:05 +00:00
Maikel
584430d64b Merge pull request #9655 from openfoodfoundation/dependabot/bundler/rswag-ui-2.6.0
Bump rswag-ui from 2.5.1 to 2.6.0
2022-09-13 10:42:41 +10:00
Maikel
8334923a5c Merge pull request #9653 from openfoodfoundation/dependabot/bundler/rswag-api-2.6.0
Bump rswag-api from 2.5.1 to 2.6.0
2022-09-13 10:42:00 +10:00
Maikel
61784ed174 Merge pull request #9656 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.16.0
Bump rubocop-rails from 2.15.2 to 2.16.0
2022-09-13 10:40:00 +10:00
Maikel
906bfc5ae8 Merge pull request #9657 from openfoodfoundation/dependabot/bundler/rails-6.1.7
Bump rails from 6.1.6.1 to 6.1.7
2022-09-13 10:37:32 +10:00
jibees
5a4b38ec55 Merge pull request #9536 from jibees/9145-Splitcheckout,-add-error-message-when-no-shipping-methods-are-available-to-the-customer
Split Checkout: add error message when no shipping methods are available to the customer
2022-09-12 15:22:11 +02:00
saunmanoj888
6917125173 Allow to change unit value for numbers with a comma separator 2022-09-12 15:55:03 +05:30
dependabot[bot]
65506769ab Bump rails from 6.1.6.1 to 6.1.7
Bumps [rails](https://github.com/rails/rails) from 6.1.6.1 to 6.1.7.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.6.1...v6.1.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:17:01 +00:00
dependabot[bot]
9909e84cb9 Bump rubocop-rails from 2.15.2 to 2.16.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.15.2 to 2.16.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.15.2...v2.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:16:36 +00:00
dependabot[bot]
e00ee364ea Bump rswag-ui from 2.5.1 to 2.6.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:16:16 +00:00
dependabot[bot]
479c895a59 Bump rswag-api from 2.5.1 to 2.6.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:14:43 +00:00
Jean-Baptiste Bellet
86cb86e8b5 Add a flash error where no available shipping methods to the customer
+ update specs as well
2022-09-12 09:42:26 +02:00
Jean-Baptiste Bellet
9dd3a8bc5a Store all distributors shipping methods to one array 2022-09-12 09:42:26 +02:00
Maikel
68256346e7 Merge pull request #9644 from filipefurtad0/fix_flaky_search
Splits tests into existing/non-existing shops
2022-09-12 14:05:49 +10:00
Maikel
44bf63137a Merge pull request #9606 from binarygit/remove-angular-from-address
Remove Angular from Address Tab
2022-09-12 13:49:54 +10:00
Maikel
e9ad573bcd Merge pull request #9641 from mkllnk/prod-schema
Synchronise db schema with (AU) production
2022-09-12 13:40:57 +10:00
filipefurtad0
215f3e97ad Splits tests into existing/non-existing shops
Sets failing tests as pending for issues #9649 and #5467
2022-09-09 13:08:45 +01:00
Jean-Baptiste Bellet
49f78f3706 Update all locales with the latest Transifex translations 2022-09-08 16:40:17 +02:00
jibees
9563dd6c51 Merge pull request #9497 from jibees/9493-fix-issues-around-rounding-in-imperial-metric-system
Avoid floating rounded errors when using imperial or metric system
2022-09-08 16:34:12 +02:00
Rachel Arnould
aa36986d66 Merge pull request #9521 from jibees/create-new-report-revenues-by-hub
Create a new report that shows revenues (incl. or excl. taxes) by hub only available for super-admin
2022-09-08 16:10:14 +02:00
jibees
9843e0e450 Merge pull request #9640 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.0
Bump @babel/preset-env from 7.18.10 to 7.19.0
2022-09-08 09:07:02 +02:00
Jean-Baptiste Bellet
53978de632 Create a new report that show revenues (incl. or excl. taxes) by hub
+ Create spec
2022-09-08 09:04:44 +02:00
Maikel
d9f5f7995d Merge pull request #9611 from mkllnk/9605-tax-total
Index tax totals correctly for invoice display
2022-09-08 12:04:19 +10:00
Maikel
f201b9fd11 Merge pull request #9631 from mkllnk/9153-tax-recalculation
[Split Checkout] Recalculate tax on summary step
2022-09-08 11:39:44 +10:00
Jean-Baptiste Bellet
d53b2b94b9 When creating new product via /admin/products/new use BigDecimal
to avoid bad rounded multiplication

example here:
700*0.001 = 0.7000000000000001

+ update specs as well
2022-09-07 09:17:46 +02:00
Jean-Baptiste Bellet
4452ad2c51 Use BigDecimal to avoir multiplication/division floating errors
Like 28.35 * 12 / 12 = 28.350000000000005

+ in js, use parseFloat() to format `12.00` as `12`
2022-09-07 09:17:46 +02:00
Jean-Baptiste Bellet
6594419b22 Add js-big-decimal to work with division and multiplication
Use a lib instead of Math.round((value*100)/100)
2022-09-07 09:17:46 +02:00
Maikel Linke
4ba008f31b Synchronise db schema with production
Rails seems to have changed the options in schema.rb at some point to
include more specifics but we didn't record this in our tracked
schema.rb. As a result, production shows changes in that file after
running migrations.

Sometimes I also use production dumps in development, for example to
test migrations. Then the schema is changed for the migration and for
these syntax changes. Synching the schema with migration should
standardise all our setups and and make git diffs clearer.
2022-09-07 16:02:51 +10:00
Maikel
dd2e77a244 Merge pull request #9557 from jibees/9555-update-the-build-env
Update the build env. from ubuntu-18.04 to ubuntu-20.04
2022-09-07 13:43:42 +10:00
dependabot[bot]
be561d1032 Bump @babel/preset-env from 7.18.10 to 7.19.0
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.10 to 7.19.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-06 09:04:41 +00:00
Jean-Baptiste Bellet
24fc941b4c Update the build env. from ubuntu-18.04 to ubuntu-20.04 2022-09-06 10:28:26 +02:00
Maikel
21054c1a8a Merge pull request #9594 from binarygit/remove-angular-from-primary-details
Remove Angular from Primary Details Tab
2022-09-06 10:17:14 +10:00
Maikel
0778c5f550 Merge pull request #9607 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.6
Bump sidekiq from 6.5.4 to 6.5.6
2022-09-06 10:16:39 +10:00
Maikel Linke
1d04510365 Update totals on summary step 2022-09-05 15:54:33 +10:00
Maikel Linke
6c7a089527 Recalculate tax on summary step 2022-09-05 15:14:08 +10:00
binarygit
abbb61b943 Remove country controller from enterprises/new and Business Details tab 2022-09-05 09:52:27 +05:45
binarygit
36b5cb3b49 Replace country controller with dependent select in address tab 2022-09-05 09:52:27 +05:45
binarygit
0cfe842bd6 Fix typo: dependant to dependent in dependent-select controller 2022-09-05 09:52:27 +05:45
Maikel Linke
eaca953106 Create only required test data for speed
It reduced the execution time by 5% on my machine (2-3 seconds).
2022-09-05 13:42:47 +10:00
Maikel Linke
cc5125f49e Apply related db assertions in tax spec
Somehow the helper methods were testing two different orders even though
each spec is using only one order, the one which is currently being
checked out by the user.

So I brought the code closer into the example to easier see what is
related and tested.

I also changed the assertions for the pending spec but can't really
verify them yet until I have completely working code.
2022-09-05 11:40:47 +10:00
Maikel Linke
3f2b3b88eb Re-use in-memory test objects
And reduce code by referring to objects instead of just ids.
2022-09-05 10:59:15 +10:00
Maikel
7101bacc8c Merge pull request #9620 from openfoodfoundation/dependabot/bundler/rubocop-1.36.0
Bump rubocop from 1.35.1 to 1.36.0
2022-09-05 10:30:05 +10:00
Maikel
d76b274d25 Merge pull request #9617 from openfoodfoundation/dependabot/bundler/view_component-2.71.0
Bump view_component from 2.69.0 to 2.71.0
2022-09-02 16:56:59 +10:00
dependabot[bot]
8d7f39941a Bump view_component from 2.69.0 to 2.71.0
Bumps [view_component](https://viewcomponent.org) from 2.69.0 to 2.71.0.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 06:33:40 +00:00
Maikel
95839f88f2 Merge pull request #9623 from mkllnk/fix-storybook
Load storybook only in development
2022-09-02 16:32:19 +10:00
Maikel Linke
728eee6d3f Load storybook after view_component has been loaded automatically 2022-09-02 16:10:19 +10:00
Maikel Linke
7089bd597e Avoid loading view_component engine manually
We load view_component in the application config and it should be
automatic anyway.
2022-09-02 16:08:09 +10:00
Maikel Linke
2aade10aaf Load storybook only in development
The gem is not available in other environments an the app fails to boot.
2022-09-02 16:07:25 +10:00
Maikel
4057df5b93 Merge pull request #9586 from openfoodfoundation/dependabot/bundler/stripe-7.1.0
Bump stripe from 7.0.0 to 7.1.0
2022-09-02 13:34:11 +10:00
Filipe
8270a3f386 Merge pull request #9513 from filipefurtad0/matomo_tag_on_register_page
Add matomo_tag to /register pages
2022-09-01 10:19:54 +01:00
dependabot[bot]
a2aa5f2607 Bump rubocop from 1.35.1 to 1.36.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.35.1 to 1.36.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.35.1...v1.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 09:07:43 +00:00
Maikel Linke
30a9e80024 Update translations 2022-09-01 11:55:03 +10:00
Maikel
612001fc3f Merge pull request #9600 from mkllnk/rubocop
Update rubocop config to avoid deprecation
2022-09-01 11:42:15 +10:00
Maikel
2a93968370 Merge pull request #9599 from mkllnk/load-storybook
Avoid storybook deprecation warning
2022-09-01 11:41:27 +10:00
Maikel
b0a4fcdc26 Merge pull request #9598 from mkllnk/spec-typos
Correct typo in spec which lead to flakiness
2022-09-01 11:39:38 +10:00
Maikel Linke
326b0af35f Sort tax total by percentage on invoice 2022-09-01 11:19:02 +10:00
Maikel Linke
91eaa522cf Simplify tax totals helper 2022-08-31 16:47:04 +10:00
Maikel Linke
2a57dc9766 Index tax totals correctly for invoice display 2022-08-31 16:47:04 +10:00
Maikel Linke
f37b681fac Allow more tax data in the summary
I converted the value to a hash so that we can put all information in
there and we won't need the current hash key as percentage any more.
2022-08-31 16:47:04 +10:00
Maikel Linke
f4466b1aad Spec problem with tax rate summary display 2022-08-31 16:47:04 +10:00
Maikel Linke
33feb7f63f Test for explicit values, not reusing faulty code 2022-08-31 16:47:04 +10:00
binarygit
02e3184945 Replace angular tooltips in Primary Details tab 2022-08-31 11:51:51 +05:45
Maikel
04778c6fa8 Merge pull request #9597 from saunmanoj888/fix-account-setting-headers-alignment
Fix alignment for header Developer settings under Accounts settings
2022-08-31 16:01:41 +10:00
binarygit
8861b6d077 Replace permalinks angular ctrl with stimulus 2022-08-31 10:06:51 +05:45
binarygit
52b1f40acb Replace select2 with tom-select in primary details tab 2022-08-31 10:06:51 +05:45
Filipe
8ace56956b Merge pull request #9560 from binarygit/replace-tooltip
Replace tooltip on Enterprise Settings /contact page
2022-08-30 16:23:09 +01:00
dependabot[bot]
7718f7c0fc Bump sidekiq from 6.5.4 to 6.5.6
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.4 to 6.5.6.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.4...v6.5.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 09:04:24 +00:00
Maikel
b74c368de2 Merge pull request #9602 from filipefurtad0/fix_flaky_invoice_spec
Adds specific tax rates to each type of cost
2022-08-30 09:47:53 +10:00
filipefurtad0
e0a20bf8af Adds specific tax rates to each type of cost 2022-08-29 17:36:39 +01:00
Maikel Linke
17afdb5912 Update rubocop config to avoid deprecation 2022-08-29 15:31:18 +10:00
Maikel Linke
d55a43d4b1 Avoid storybook deprecation warning
Loading the engine directly is deprecated and I followed the current
documentation to load storybook in the app. This avoids a warning:

> DEPRECATION WARNING: This manually engine loading is deprecated and will be removed in v1.0.0. Remove `require "view_component/storybook/engine"`. (called from <top (required)> at config/application.rb:30)
2022-08-29 14:57:14 +10:00
Maikel Linke
bf3da0531e Correct grammar in spec description 2022-08-29 14:43:43 +10:00
Maikel Linke
3a365b6dc6 Remove useless braces 2022-08-29 14:42:11 +10:00
Maikel Linke
ee7dc821ca Correct typo in spec which lead to flakiness
I'm not sure why this spec passed on CI when it was retried but it was
obviously wrong. Correcting that copy&paste error seems to make the spec
pass.
2022-08-29 14:39:43 +10:00
Maikel
07018370e0 Merge pull request #9595 from openfoodfoundation/dependabot/bundler/jwt-2.5.0
Bump jwt from 2.4.1 to 2.5.0
2022-08-29 11:43:27 +10:00
Maikel
bba665e2e1 Merge pull request #9577 from filipefurtad0/invoice-spec
Moves invoice_spec.rb into /system; sets :rack_test as webdriver
2022-08-29 11:34:20 +10:00
saunmanoj888
5e69320ff5 Fix header alignmnet 2022-08-27 15:31:19 +05:30
dependabot[bot]
d0242d28d2 Bump jwt from 2.4.1 to 2.5.0
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.4.1...v2.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-26 09:04:29 +00:00
Maikel
9dbdcc9181 Merge pull request #9592 from openfoodfoundation/dependabot/bundler/redis-4.8.0
Bump redis from 4.7.1 to 4.8.0
2022-08-25 09:55:45 +10:00
Maikel
7819495d57 Merge pull request #9590 from openfoodfoundation/dependabot/bundler/puma-5.6.5
Bump puma from 5.6.4 to 5.6.5
2022-08-25 09:54:50 +10:00
Maikel
8723520848 Merge pull request #9585 from mkllnk/revert-stripe-update
Restore ability to check out with Stripe while storing a new card
2022-08-25 09:51:59 +10:00
binarygit
b76d9045ce Replace power-tip in enterprises/edit/<name>/contact with floatingUI 2022-08-24 13:31:45 +05:45
Maikel
b42d6cf2ac Merge pull request #9587 from openfoodfoundation/dependabot/bundler/valid_email2-4.0.4
Bump valid_email2 from 4.0.3 to 4.0.4
2022-08-24 16:52:13 +10:00
Maikel
f78e72af0d Merge pull request #9588 from openfoodfoundation/dependabot/bundler/rubocop-1.35.1
Bump rubocop from 1.35.0 to 1.35.1
2022-08-24 16:51:14 +10:00
dependabot[bot]
5e021b76b5 Bump valid_email2 from 4.0.3 to 4.0.4
Bumps [valid_email2](https://github.com/micke/valid_email2) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/micke/valid_email2/releases)
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v4.0.3...v4.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-24 06:50:55 +00:00
Maikel
d03a5458ff Merge pull request #9582 from openfoodfoundation/dependabot/bundler/view_component-2.69.0
Bump view_component from 2.68.0 to 2.69.0
2022-08-24 16:49:45 +10:00
dependabot[bot]
3aef0b4029 Bump stripe from 7.0.0 to 7.1.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v7.0.0...v7.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-24 06:48:28 +00:00
Maikel
cd5a83e814 Merge pull request #9581 from openfoodfoundation/dependabot/bundler/webmock-3.18.1
Bump webmock from 3.17.1 to 3.18.1
2022-08-24 16:47:45 +10:00
dependabot[bot]
a943d2fee6 Bump redis from 4.7.1 to 4.8.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.7.1 to 4.8.0.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.7.1...v4.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-24 06:47:28 +00:00
Maikel
b016ebd5b4 Merge pull request #9567 from openfoodfoundation/dependabot/bundler/bullet-7.0.3
Bump bullet from 7.0.2 to 7.0.3
2022-08-24 16:47:07 +10:00
Maikel
314459df92 Merge pull request #9566 from openfoodfoundation/dependabot/bundler/test-prof-1.0.10
Bump test-prof from 1.0.9 to 1.0.10
2022-08-24 16:46:29 +10:00
dependabot[bot]
eb0051c033 Bump puma from 5.6.4 to 5.6.5
Bumps [puma](https://github.com/puma/puma) from 5.6.4 to 5.6.5.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.6.4...v5.6.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-23 09:04:05 +00:00
dependabot[bot]
ca9a7d255e Bump rubocop from 1.35.0 to 1.35.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.35.0 to 1.35.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.35.0...v1.35.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 09:06:17 +00:00
Maikel Linke
7cb74f2452 Revert "Merge pull request #9456 from openfoodfoundation/dependabot/bundler/activemerchant-1.126.0"
This reverts commit 82f38c9aea, reversing
changes made to 689720b749.
2022-08-22 15:31:57 +10:00
dependabot[bot]
8f42c6fbed Bump view_component from 2.68.0 to 2.69.0
Bumps [view_component](https://viewcomponent.org) from 2.68.0 to 2.69.0.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-19 09:05:47 +00:00
dependabot[bot]
bb233c5656 Bump webmock from 3.17.1 to 3.18.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.17.1 to 3.18.1.
- [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.17.1...v3.18.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-19 09:05:12 +00:00
filipefurtad0
be021f4697 Removes spec/features from the build-run 🎉 2022-08-17 23:25:02 +01:00
filipefurtad0
f47d86c15b Sets cuprite as default; sets rack_test in before/after blocks 2022-08-17 23:25:02 +01:00
Filipe
ae391f8af4 Merge pull request #9414 from Philwi/user-generates-api-key
Let users view and regenerates api key
2022-08-17 21:36:13 +01:00
Filipe
f28c52342c Merge pull request #9532 from jibees/9492-translate-404,-500,-422-errors-pages
Translate 404, 500, 422 errors pages
2022-08-17 21:12:04 +01:00
Filipe
d3f1d4a5f9 Merge pull request #9529 from Philwi/make-the-shop-url-clickable
Make the shop url clickable
2022-08-17 20:47:07 +01:00
Filipe
cedfa35a98 Merge pull request #9341 from jibees/9336-redirect-to-login_path-if-user-is-disabled
Disabled_at logic: redirect to login path if user is disabled
2022-08-17 20:33:57 +01:00
Filipe
c11b7ed268 Merge pull request #9407 from Philwi/handle-for-invalid-referer-for-embedded-page-service
Handle for invalid referer for embedded page service
2022-08-17 18:40:43 +01:00
Filipe
b992daa1d8 Merge pull request #9510 from binarygit/convert-enterprises/edit-page-to-stimulus
Convert enterprises/edit page to stimulus
2022-08-17 18:11:59 +01:00
Filipe
10aa534f52 Merge pull request #9554 from apricot12/9179-Note-on-invoices
Add order note at the end of both invoices following current UI patterns.
2022-08-17 17:41:23 +01:00
Filipe
de990b906d Merge pull request #9563 from aintluks/bulk-coop-report-csv
Disable header row bulk_coop report
2022-08-17 16:43:37 +01:00
Maikel Linke
41ef2a4ea5 Run invoice spec as feature spec 2022-08-17 16:30:57 +10:00
filipefurtad0
077479346e Moves invoice_print_spec into system 2022-08-17 16:21:54 +10:00
binarygit
19c33e4050 Add floating UI 2022-08-17 11:39:13 +05:45
Maikel
1ff3d4a534 Merge pull request #9571 from openfoodfoundation/dependabot/bundler/view_component-2.68.0
Bump view_component from 2.64.0 to 2.68.0
2022-08-17 15:06:46 +10:00
dependabot[bot]
8ae6a36b33 Bump bullet from 7.0.2 to 7.0.3
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.0.2...7.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-17 04:59:40 +00:00
dependabot[bot]
d8687f30cd Bump test-prof from 1.0.9 to 1.0.10
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.9 to 1.0.10.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.9...v1.0.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-17 04:58:49 +00:00
Maikel
bff2ddb8db Merge pull request #9565 from openfoodfoundation/dependabot/bundler/rubocop-1.35.0
Bump rubocop from 1.33.0 to 1.35.0
2022-08-17 14:56:36 +10:00
Lucas da Costa
2a9db0eea4 Disable header row bulk_coop report 2022-08-16 16:32:19 -03:00
Filipe
5c41022f76 Merge pull request #9165 from filipefurtad0/tax_split_checkout
[Split Checkout] Adds spec to test Tax charges (repoducing issue #9153)
2022-08-16 19:30:32 +01:00
dependabot[bot]
a9dec41cc1 Bump view_component from 2.64.0 to 2.68.0
Bumps [view_component](https://viewcomponent.org) from 2.64.0 to 2.68.0.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-16 09:04:18 +00:00
Maikel
918cbb8d92 Merge pull request #9570 from mkllnk/bundle-lock
Clean up Gemfile.lock after manual change
2022-08-16 16:16:19 +10:00
Maikel Linke
7cc7de7a5f Clean up Gemfile.lock
It was manually edited before which introduced a couple inconsistencies.
I'm fixing this up here by running `bundle` and restoring the bundler
version.
2022-08-16 16:10:30 +10:00
Maikel Linke
56d8d1eaf7 Scope helper methods to relevant test cases
Global methods are usually not a good idea.
2022-08-15 17:34:21 +01:00
dependabot[bot]
b57685e9d5 Bump rubocop from 1.33.0 to 1.35.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.33.0 to 1.35.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.33.0...v1.35.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 07:36:07 +00:00
Maikel
a3fa4a0d3e Merge pull request #9543 from filipefurtad0/remove_selenium_webdriver
Removes selenium-webdriver and webdriver gems; updates spec_helper
2022-08-15 17:34:46 +10:00
Maikel Linke
d86aeaa22a Remove unnecessary after-spec code 2022-08-15 16:51:53 +10:00
filipefurtad0
97f18d7b86 Changes names from helpers to prevent leak between specs 2022-08-15 16:13:37 +10:00
filipefurtad0
bded15a869 Updates spec for inclusive; adds pending related to epic 7540 2022-08-15 16:13:37 +10:00
filipefurtad0
fff5927cdf Changes pick-up into delivery shipping method
On line 62 we set the dependency on the shipping address to calculate taxes. Therefore, we might be better off mocking a delivery-shipping method instead of a pick-up shipping method and assuring the customers shipping address is used for this accordingly.
2022-08-15 16:13:37 +10:00
filipefurtad0
f9881b9af5 Removes if blocks from assert_db_
Initianlly, I thought it would be agood idea to have both setups - for included and added tax - in the same file. Hence, the private section would need to cover all cases. The PR has now two separate files, each one for the two tax types, so it seems unecessary to have these if blocks there. I think it is more readable this way.
2022-08-15 16:13:37 +10:00
filipefurtad0
79182a2d32 Removes test on 9131; moves test on 9153 into respective context 2022-08-15 16:13:37 +10:00
Jean-Baptiste Bellet
77eec6e6f3 Check step params and redirect if step is inconsistent to order state 2022-08-15 16:13:37 +10:00
filipefurtad0
a6e3f43344 Adds bug reproducing steps 2022-08-15 16:13:36 +10:00
filipefurtad0
f525a9f5da Adds inclusive tax-spec 2022-08-15 16:13:36 +10:00
filipefurtad0
2427bfa6ea Spec tax charging on legacy and split checkout 2022-08-15 16:13:36 +10:00
Maikel Linke
7eea4fdd1c Adds zone_with_state_member to zone factory
And make zone factories more flexible.
2022-08-15 16:13:36 +10:00
Filipe
dde4bd39b2 Merge pull request #9351 from vsmay98/9338-redirect-disabled-user-to-homepage
Redirect to homepage with flash error when disabled user trying to access any page
2022-08-12 13:52:19 +01:00
Maikel Linke
091c271237 Spec API key changes more precisely 2022-08-12 15:44:59 +10:00
Philipp Winkler
141a2a507d Make shop url clickable 2022-08-11 22:14:51 +02:00
Jean-Baptiste Bellet
36aabbb5b6 Update all locales with the latest Transifex translations 2022-08-11 18:14:48 +02:00
Filipe
82f38c9aea Merge pull request #9456 from openfoodfoundation/dependabot/bundler/activemerchant-1.126.0
Bump activemerchant from 1.123.0 to 1.126.0
2022-08-11 17:10:31 +01:00
Filipe
689720b749 Merge pull request #9437 from jibees/8897-preselect-default-card-and-do-not-allow-to-charge-if-no-card-is-marked-as-default
User account, Credit cards: Do not allow to check "Allow charges" if no credit cards marked as default
2022-08-11 16:34:42 +01:00
Filipe
50600b9d00 Merge pull request #9462 from openfoodfoundation/dependabot/bundler/pagy-5.10.1
Bump pagy from 5.1.2 to 5.10.1
2022-08-11 16:20:03 +01:00
filipefurtad0
232088f3a2 Adds the tag matomo code to the darkswarm template 2022-08-11 15:40:15 +01:00
filipefurtad0
66b9679a7c Adds matomo_tag to /register pages template 2022-08-11 14:07:02 +01:00
filipefurtad0
42753d85c7 Creates new file for matomo tag code 2022-08-11 14:07:02 +01:00
filipefurtad0
3eca13e2bc Renames general tracking code file; updates darkswarm 2022-08-11 14:07:02 +01:00
Rachel Arnould
abdef21381 Update FUNDING.yml 2022-08-11 14:45:42 +02:00
filipefurtad0
1fd09617cb Changes cookies_spec from feature to system spec 2022-08-11 10:44:22 +01:00
filipefurtad0
e5eb74f077 Updates spec_helper 2022-08-11 10:44:22 +01:00
Jean-Baptiste Bellet
f474947d2d Do not remove 500.html file since it is used by nxginx
in case of critical problems when application cannot respond
2022-08-11 11:41:39 +02:00
filipefurtad0
d1b90193a4 Removes selenium-webdriver & webdrivers gems 2022-08-11 10:34:24 +01:00
Nihal Mohammed
53ee5c32eb Add order note at the end of both invoices following current UI patterns
Add translation for note title in invoice

Update invoice spec to also test for order note
2022-08-10 23:02:13 +05:30
binarygit
79ba223e12 Delete angular code for side_menu 2022-08-10 15:14:15 +05:45
binarygit
27552c99b8 Render enterprise groups #edit and #new page using stimulus 2022-08-10 15:14:09 +05:45
binarygit
6b56a8df0a Display/hide side-menu items when values in primary details change 2022-08-10 15:11:53 +05:45
binarygit
e18a242b90 Render admin/enterprises/<name>/edit page using stimulus 2022-08-10 15:08:59 +05:45
jibees
4a3bd510a7 Merge pull request #9544 from jibees/upgrade-yarn-
Upgrade `yarn.lock` since it seemed to be derived
2022-08-10 09:06:16 +02:00
jibees
bb85473eba Merge pull request #9550 from openfoodfoundation/dependabot/bundler/webmock-3.17.1
Bump webmock from 3.17.0 to 3.17.1
2022-08-10 08:57:39 +02:00
jibees
d5fa5e298e Merge pull request #9551 from openfoodfoundation/dependabot/bundler/debug-1.6.2
Bump debug from 1.6.1 to 1.6.2
2022-08-10 08:57:08 +02:00
Jean-Baptiste Bellet
dab4939819 Upgrade yarn.lock since it seemed to be derived 2022-08-10 08:45:24 +02:00
jibees
43b29af922 Merge pull request #9545 from Philwi/control-capybara-headless-mode-via-environment-variable
Control capybara headless mode for testing via environment variable
2022-08-10 08:05:26 +02:00
dependabot[bot]
2c1acc14e6 Bump debug from 1.6.1 to 1.6.2
Bumps [debug](https://github.com/ruby/debug) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.6.1...v1.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 06:02:35 +00:00
dependabot[bot]
84f9da4a23 Bump webmock from 3.17.0 to 3.17.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.17.0 to 3.17.1.
- [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.17.0...v3.17.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 06:00:05 +00:00
jibees
d817319aa4 Merge pull request #9539 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.4
Bump sidekiq from 6.5.3 to 6.5.4
2022-08-10 07:58:25 +02:00
Philipp Winkler
093b851395 Control headless mode for testing via environment variable 2022-08-09 20:57:52 +02:00
Filipe
e3a150226e Merge pull request #9507 from openfoodfoundation/dependabot/bundler/stripe-7.0.0
Bump stripe from 5.42.0 to 7.0.0
2022-08-09 12:33:36 +01:00
Rachel Arnould
5122ed9af4 Update FUNDING.yml 2022-08-09 10:11:17 +02:00
Rachel Arnould
ac5a3beb15 Update FUNDING.yml 2022-08-09 10:10:44 +02:00
dependabot[bot]
19481fc55e Bump sidekiq from 6.5.3 to 6.5.4
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.3...v6.5.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 06:48:01 +00:00
Maikel Linke
c8cab8aae5 Update mocked responses to get a ListObject 2022-08-09 15:13:16 +10:00
dependabot[bot]
d7428015ac Bump stripe from 5.42.0 to 7.0.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.42.0 to 7.0.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.42.0...v7.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 15:13:16 +10:00
Maikel
700f91efb5 Merge pull request #9449 from filipefurtad0/packing_report
Updates specs on Packing and Payment Reports
2022-08-09 14:56:22 +10:00
Maikel
43e4047447 Merge pull request #9495 from filipefurtad0/invoice_print_spec
Invoice print spec: added tax
2022-08-09 14:54:23 +10:00
Maikel
892e843e9e Merge pull request #9533 from filipefurtad0/remove_bye_bug
Removes byebug and pry-byebug; keeps pry 🧹
2022-08-09 10:39:21 +10:00
filipefurtad0
85904f57b8 Removes byebug and pry-byebug; keeps pry 2022-08-08 15:22:45 +01:00
Jean-Baptiste Bellet
60a5bf682b Handle errors page through controller ErrorsController 2022-08-08 15:36:46 +02:00
Jean-Baptiste Bellet
47c07831c1 Create an ErrorsController that handle errors thrown application 2022-08-08 15:36:23 +02:00
jibees
b5e23717f2 Merge pull request #9531 from mkllnk/awesome-print
Remove unnecessary awesome_print gem
2022-08-08 14:21:11 +02:00
jibees
d8d99c930e Merge pull request #9530 from openfoodfoundation/dependabot/bundler/webmock-3.17.0
Bump webmock from 3.15.0 to 3.17.0
2022-08-08 14:09:48 +02:00
filipefurtad0
ce96094f49 Adds around block with time.freeze 2022-08-08 12:23:11 +01:00
Maikel Linke
6c655e6fbc Remove unnecessary awesome_print gem
Most people don't know it and it has now been superseeded by new
versions of irb and debug.
2022-08-08 15:39:59 +10:00
Maikel Linke
2d1483febb Remove misleading comment
That comment was in the original commit of this source code and was
related to another gem which has long been removed.
2022-08-08 15:38:30 +10:00
Maikel
42d7383ff0 Merge pull request #9446 from jibees/add-prettier
Add prettier linter for stimulusjs files
2022-08-08 14:41:47 +10:00
Maikel Linke
df4ddf45c4 Only check, not fix in pre-commit hook 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
e0b40222dd add pre-commit hook
with husky and pretty-quick
2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
61928cbc05 Run prettier formatter 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
c6884f96e1 Add prettier as a GH action 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
f0b5a04f6b Ignore everything but js files related to stimulusjs 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
b8ffddb533 Add prettier to our stack 2022-08-08 14:40:58 +10:00
dependabot[bot]
71536767b5 Bump webmock from 3.15.0 to 3.17.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.15.0 to 3.17.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.15.0...v3.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 04:18:03 +00:00
Maikel
938056d1d8 Merge pull request #9453 from openfoodfoundation/dependabot/bundler/angular_rails_csrf-5.0.0
Bump angular_rails_csrf from 4.5.0 to 5.0.0
2022-08-08 14:16:56 +10:00
Maikel
63d2d69d08 Clarify copying of test build URL
And removing an unused translation step
2022-08-08 12:47:28 +10:00
Maikel
78ec086111 Merge pull request #9501 from Michaelcode2/master
Added file "uk.yml" to directory openfoodnetwork/config/locales/
2022-08-08 12:34:01 +10:00
Philipp Winkler
bf53a02270 Add api key toggle view checkbox 2022-08-07 09:48:49 +02:00
filipefurtad0
2aded5b459 Clarifies pending examples 2022-08-05 17:43:02 +01:00
filipefurtad0
5aa6b14756 Fixes tax values 2022-08-05 16:41:35 +01:00
filipefurtad0
07bd84ffbb Tests added tax - legacy and alternative invoices 2022-08-05 16:41:35 +01:00
filipefurtad0
d2794f328f Tests included tax - legacy and alternative invoices 2022-08-05 16:41:35 +01:00
filipefurtad0
8b146fc72a Adds included_in_price trait on broken specs 2022-08-05 16:41:35 +01:00
filipefurtad0
0c491a6651 Adds test case for added tax 2022-08-05 16:41:35 +01:00
filipefurtad0
e8529754f1 Updates order and product factory to consider added tax 2022-08-05 16:41:35 +01:00
dependabot[bot]
d95dc84c34 Bump pagy from 5.1.2 to 5.10.1
Bumps [pagy](https://github.com/ddnexus/pagy) from 5.1.2 to 5.10.1.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/5.1.2...5.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 14:59:59 +00:00
Filipe
b61ee0211f Merge pull request #9525 from filipefurtad0/adds_debug_gem
Adds debug gem to the stack
2022-08-05 15:58:45 +01:00
filipefurtad0
c777a00874 Adds debug gem to the stack, bundled with 2.1.4 2022-08-05 14:01:47 +01:00
jibees
a0a2dab44f Merge pull request #9523 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.3
Bump sidekiq from 6.5.1 to 6.5.3
2022-08-05 11:31:58 +02:00
jibees
f0aa7f44a5 Merge pull request #9524 from openfoodfoundation/dependabot/bundler/rubocop-1.33.0
Bump rubocop from 1.32.0 to 1.33.0
2022-08-05 11:31:18 +02:00
dependabot[bot]
a51940937a Bump rubocop from 1.32.0 to 1.33.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.32.0 to 1.33.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.32.0...v1.33.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 09:06:01 +00:00
dependabot[bot]
f1e401070a Bump sidekiq from 6.5.1 to 6.5.3
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.1 to 6.5.3.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.1...v6.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 09:05:41 +00:00
Jean-Baptiste Bellet
999b04ef99 Update all locales with the latest Transifex translations 2022-08-05 09:18:05 +02:00
Maikel
da5e8fcb9f Merge pull request #9130 from georgethoppil/remove-from-customerlist
Update orders and delete subscriptions when customer deleted
2022-08-05 10:35:07 +10:00
Rachel Arnould
e22b9997fe Update README.md 2022-08-04 16:58:51 +02:00
dependabot[bot]
609cbe2893 Bump angular_rails_csrf from 4.5.0 to 5.0.0
Bumps [angular_rails_csrf](https://github.com/jsanders/angular_rails_csrf) from 4.5.0 to 5.0.0.
- [Release notes](https://github.com/jsanders/angular_rails_csrf/releases)
- [Changelog](https://github.com/jsanders/angular_rails_csrf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsanders/angular_rails_csrf/compare/v4.5.0...v5.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 12:15:53 +00:00
jibees
425970aba2 Merge pull request #9519 from openfoodfoundation/dependabot/bundler/view_component-2.64.0
Bump view_component from 2.63.0 to 2.64.0
2022-08-04 14:14:32 +02:00
jibees
ace5151afa Merge pull request #9518 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.10
Bump @storybook/addon-docs from 6.5.9 to 6.5.10
2022-08-04 14:14:14 +02:00
jibees
3b652581b5 Merge pull request #9517 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.10
Bump @storybook/server from 6.5.9 to 6.5.10
2022-08-04 14:14:06 +02:00
jibees
17692e722a Merge pull request #9516 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.10
Bump @storybook/addon-controls from 6.5.9 to 6.5.10
2022-08-04 14:13:56 +02:00
jibees
a2826b0fdf Merge pull request #9515 from openfoodfoundation/dependabot/bundler/angular-rails-templates-1.2.0
Bump angular-rails-templates from 1.1.0 to 1.2.0
2022-08-04 14:13:43 +02:00
dependabot[bot]
d766f6c0b2 Bump view_component from 2.63.0 to 2.64.0
Bumps [view_component](https://github.com/github/view_component) from 2.63.0 to 2.64.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.63.0...v2.64.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:06:59 +00:00
dependabot[bot]
0f715e531c Bump @storybook/addon-docs from 6.5.9 to 6.5.10
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:54 +00:00
dependabot[bot]
fba83f847b Bump @storybook/server from 6.5.9 to 6.5.10
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/app/server)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:41 +00:00
dependabot[bot]
5603745744 Bump @storybook/addon-controls from 6.5.9 to 6.5.10
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/controls)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:26 +00:00
dependabot[bot]
2b2f9c205e Bump angular-rails-templates from 1.1.0 to 1.2.0
Bumps [angular-rails-templates](https://github.com/pitr/angular-rails-templates) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/pitr/angular-rails-templates/releases)
- [Changelog](https://github.com/pitr/angular-rails-templates/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pitr/angular-rails-templates/compare/v1.1.0...v1.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:14 +00:00
jibees
feff2b726b Merge pull request #9430 from openfoodfoundation/dependabot/bundler/rspec-rails-5.1.2
Bump rspec-rails from 5.0.2 to 5.1.2
2022-08-04 09:51:54 +02:00
Maikel Linke
8b3d513aa2 Don't upgrade rspec-mocks which seems to be buggy
One of our specs failed even though it was correct:

- spec/controllers/spree/admin/base_controller_spec.rb
2022-08-04 15:54:43 +10:00
Filipe
dd17f98edb Merge pull request #9196 from jibees/8912-change-order-creation-form-steps-order
Admin, Order creation: Change steps ordering
2022-08-03 09:09:43 +01:00
Maikel
c9adcd1479 Merge pull request #9406 from filipefurtad0/oaf_reports_specs
Orders and fulfilments report specs improvement (cont. #9350)
2022-08-03 15:25:38 +10:00
jibees
29c8b0b1a5 Merge pull request #9504 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.10
Bump @babel/preset-env from 7.18.9 to 7.18.10
2022-08-02 15:13:04 +02:00
jibees
6404c7427c Merge pull request #9503 from openfoodfoundation/dependabot/bundler/webmock-3.15.0
Bump webmock from 3.14.0 to 3.15.0
2022-08-02 15:12:39 +02:00
jibees
85eab5b436 Merge pull request #9502 from openfoodfoundation/dependabot/bundler/view_component-2.63.0
Bump view_component from 2.62.0 to 2.63.0
2022-08-02 15:12:08 +02:00
Michael
912713a0c9 added Ukrainian lang. file uk.yml, corrected uk:Ukrainian 2022-08-02 13:22:17 +03:00
dependabot[bot]
ca3b9f8085 Bump @babel/preset-env from 7.18.9 to 7.18.10
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.9 to 7.18.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.10/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:08:43 +00:00
dependabot[bot]
ac00a20639 Bump webmock from 3.14.0 to 3.15.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.14.0 to 3.15.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.14.0...v3.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:07:46 +00:00
dependabot[bot]
139c994e06 Bump view_component from 2.62.0 to 2.63.0
Bumps [view_component](https://github.com/github/view_component) from 2.62.0 to 2.63.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.62.0...v2.63.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:05:18 +00:00
Michael
3621616f7c Delete en_UA.yml 2022-08-02 11:53:17 +03:00
Michael
41ddd653a0 Added file "uk.yml" to openfoodnetwork/config/locales/
Added file "uk.yml" to directory openfoodnetwork/config/locales/
Ukrainian language translation (UA)
2022-08-02 11:52:36 +03:00
Michael
d8c7c0141a added Ukrainian translation file en_UA.yml 2022-08-02 11:34:12 +03:00
Rachel Arnould
3fa2dd4772 Merge pull request #9496 from saunmanoj888/change-translation-calculator-to-fees
Change translation for calculator section from Calculator to Fees
2022-08-02 10:10:23 +02:00
Rachel Arnould
cf26c465cc Merge pull request #9390 from binarygit/feature/update-orders-table
Feature/update orders table
2022-08-02 10:10:03 +02:00
Rachel Arnould
1bc50fd7cb Merge pull request #9404 from jibees/9384-reports-format-all-money-as-number
Admin, Reports: format all currency columns as numerical values (and no as currency value)
2022-08-02 10:09:22 +02:00
Maikel
719724de0b Merge pull request #9440 from mkllnk/webp
Support WEBP images again
2022-08-02 17:19:24 +10:00
saunmanoj888
804ed81acb Change translation for calculator section from Calculator to Fees 2022-07-31 01:04:02 +05:30
jibees
e980f8882c Merge pull request #9476 from openfoodfoundation/dependabot/bundler/bootsnap-1.13.0
Bump bootsnap from 1.12.0 to 1.13.0
2022-07-29 17:07:40 +02:00
dependabot[bot]
73f910e90c Bump bootsnap from 1.12.0 to 1.13.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.12.0...v1.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-29 09:03:09 +00:00
jibees
5135d32cd8 Merge pull request #9472 from openfoodfoundation/dependabot/bundler/dotenv-rails-2.8.1
Bump dotenv-rails from 2.7.6 to 2.8.1
2022-07-28 15:12:19 +02:00
jibees
91d87c887b Merge pull request #9469 from openfoodfoundation/dependabot/bundler/pdf-reader-2.10.0
Bump pdf-reader from 2.5.0 to 2.10.0
2022-07-28 15:10:52 +02:00
georgethoppil
786fe55fc8 Removing dependent destroy on order 2022-07-28 13:41:15 +02:00
georgethoppil
b202678a6b Delete proxy orders when subscription is deleted 2022-07-28 13:41:14 +02:00
GeorgeThoppil
0e8d2d307b Clearer translation wording for has_associated_subscriptions 2022-07-28 13:41:14 +02:00
GeorgeThoppil
832b8caa8b Update spec when deleting customer with subscription and remove unused translation key 2022-07-28 13:41:14 +02:00
GeorgeThoppil
a50b75659f Update orders and delete subscriptions when customer deleted 2022-07-28 13:41:14 +02:00
dependabot[bot]
df44898557 Bump dotenv-rails from 2.7.6 to 2.8.1
Bumps [dotenv-rails](https://github.com/bkeepers/dotenv) from 2.7.6 to 2.8.1.
- [Release notes](https://github.com/bkeepers/dotenv/releases)
- [Changelog](https://github.com/bkeepers/dotenv/blob/master/Changelog.md)
- [Commits](https://github.com/bkeepers/dotenv/compare/v2.7.6...v2.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 09:04:46 +00:00
dependabot[bot]
5a70985e0e Bump rspec-rails from 5.0.2 to 5.1.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.2 to 5.1.2.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v5.0.2...v5.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 08:50:45 +00:00
Jean-Baptiste Bellet
4791b570e4 Update specs ; Expect customer creation later when creating order
The terms are a bit confusing. Updating "Customer Details" updates attributes of the order which will later be used to create a customer.
Customers are not created while the order is in `cart` state. That happens later when the order advances automatically.
2022-07-28 09:52:37 +02:00
Jean-Baptiste Bellet
f087b7184c Update specs to reflect order steps changes 2022-07-28 09:31:42 +02:00
Jean-Baptiste Bellet
fa9c2b24f2 Select Customer Details as step title for Set Distribution step 2022-07-28 09:31:42 +02:00
Jean-Baptiste Bellet
e3683d25ca Change second step order: Customer Details instead of Order Details
This second step comes from a first one, which is Set Distribution
2022-07-28 09:31:42 +02:00
dependabot[bot]
21c0baa965 Bump activemerchant from 1.123.0 to 1.126.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.123.0 to 1.126.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.123.0...v1.126.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 01:10:42 +00:00
Maikel Linke
75a8d9caf0 Update translations 2022-07-28 11:09:29 +10:00
Maikel
1089a66fff Merge pull request #9465 from openfoodfoundation/dependabot/bundler/rails-6.1.6.1
Bump rails from 6.1.6 to 6.1.6.1
2022-07-28 11:08:39 +10:00
jibees
1feb7b4065 Merge pull request #9457 from openfoodfoundation/dependabot/bundler/i18n-1.12.0
Bump i18n from 1.8.10 to 1.12.0
2022-07-27 16:12:45 +02:00
dependabot[bot]
e7cbcf2b51 Bump pdf-reader from 2.5.0 to 2.10.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.5.0 to 2.10.0.
- [Release notes](https://github.com/yob/pdf-reader/releases)
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.5.0...v2.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 14:12:07 +00:00
jibees
7b7c6ec7d7 Merge pull request #9467 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.22
Bump combine_pdf from 1.0.21 to 1.0.22
2022-07-27 16:09:38 +02:00
jibees
db99ecf255 Merge pull request #9466 from openfoodfoundation/dependabot/bundler/json-2.6.2
Bump json from 2.6.1 to 2.6.2
2022-07-27 16:09:23 +02:00
dependabot[bot]
87846529a2 Bump combine_pdf from 1.0.21 to 1.0.22
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.21 to 1.0.22.
- [Release notes](https://github.com/boazsegev/combine_pdf/releases)
- [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.21...v1.0.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:01:48 +00:00
dependabot[bot]
e50f298a0a Bump i18n from 1.8.10 to 1.12.0
Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.8.10 to 1.12.0.
- [Release notes](https://github.com/ruby-i18n/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ruby-i18n/i18n/compare/v1.8.10...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:00:22 +00:00
dependabot[bot]
bbc54d4467 Bump json from 2.6.1 to 2.6.2
Bumps [json](https://github.com/flori/json) from 2.6.1 to 2.6.2.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v2.6.1...v2.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:00:22 +00:00
Jean-Baptiste Bellet
006bcd2cf8 Add Symbol class allowed for YAML deserialization 2022-07-27 15:00:19 +02:00
jibees
e56c803610 Merge pull request #9464 from openfoodfoundation/dependabot/bundler/bootsnap-1.12.0
Bump bootsnap from 1.10.1 to 1.12.0
2022-07-27 14:58:56 +02:00
jibees
5a9ff58bcf Merge pull request #9463 from openfoodfoundation/dependabot/bundler/active_storage_validations-0.9.8
Bump active_storage_validations from 0.9.7 to 0.9.8
2022-07-27 11:27:48 +02:00
Jean-Baptiste Bellet
7747f2592e Add BigDecimal classe allowed for YAML deserialization
The soft enforcement of the Rails 6.1.6.1 security update in picked up
one more classes that were serialized in the database with YAML: BigDecimal
2022-07-27 11:26:42 +02:00
dependabot[bot]
59504c3d84 Bump rails from 6.1.6 to 6.1.6.1
Bumps [rails](https://github.com/rails/rails) from 6.1.6 to 6.1.6.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.6...v6.1.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 07:29:49 +00:00
dependabot[bot]
57535af982 Bump bootsnap from 1.10.1 to 1.12.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.10.1 to 1.12.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.10.1...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 07:29:10 +00:00
dependabot[bot]
66358240dc Bump active_storage_validations from 0.9.7 to 0.9.8
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 0.9.7 to 0.9.8.
- [Release notes](https://github.com/igorkasyanchuk/active_storage_validations/releases)
- [Changelog](https://github.com/igorkasyanchuk/active_storage_validations/blob/master/CHANGES.md)
- [Commits](https://github.com/igorkasyanchuk/active_storage_validations/commits/0.9.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 07:28:51 +00:00
jibees
a283a7fe49 Merge pull request #9451 from openfoodfoundation/dependabot/bundler/rubocop-1.32.0
Bump rubocop from 1.22.2 to 1.32.0
2022-07-27 09:27:23 +02:00
jibees
42cdfe3c1e Merge pull request #9455 from openfoodfoundation/dependabot/bundler/test-unit-3.5.3
Bump test-unit from 3.5.0 to 3.5.3
2022-07-27 09:26:52 +02:00
jibees
806dd6254b Merge pull request #9461 from openfoodfoundation/dependabot/bundler/valid_email2-4.0.3
Bump valid_email2 from 4.0.0 to 4.0.3
2022-07-27 09:26:34 +02:00
jibees
40b53442a8 Merge pull request #9460 from openfoodfoundation/dependabot/bundler/capybara-3.37.1
Bump capybara from 3.36.0 to 3.37.1
2022-07-27 09:26:01 +02:00
dependabot[bot]
7662d3fd6a Bump rubocop from 1.22.2 to 1.32.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.22.2 to 1.32.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.22.2...v1.32.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:29:18 +00:00
dependabot[bot]
e4ea9d8cd1 Bump test-unit from 3.5.0 to 3.5.3
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.5.0 to 3.5.3.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.5.0...3.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:29:16 +00:00
dependabot[bot]
c6374555b9 Bump valid_email2 from 4.0.0 to 4.0.3
Bumps [valid_email2](https://github.com/micke/valid_email2) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/micke/valid_email2/releases)
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v4.0.0...v4.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:28:36 +00:00
dependabot[bot]
bda5ca33d9 Bump capybara from 3.36.0 to 3.37.1
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.36.0 to 3.37.1.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.36.0...3.37.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:28:11 +00:00
jibees
7a10037de8 Merge pull request #9459 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.15.2
Bump rubocop-rails from 2.13.2 to 2.15.2
2022-07-27 08:27:58 +02:00
jibees
a8d5fede17 Merge pull request #9458 from openfoodfoundation/dependabot/bundler/view_component-2.62.0
Bump view_component from 2.57.1 to 2.62.0
2022-07-27 08:27:01 +02:00
dependabot[bot]
daa2bd5127 Bump rubocop-rails from 2.13.2 to 2.15.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.13.2 to 2.15.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.13.2...v2.15.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 02:08:59 +00:00
dependabot[bot]
506574aefd Bump view_component from 2.57.1 to 2.62.0
Bumps [view_component](https://github.com/github/view_component) from 2.57.1 to 2.62.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.57.1...v2.62.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 02:08:12 +00:00
Maikel
4f099da58f Merge pull request #9452 from openfoodfoundation/dependabot/bundler/rswag-specs-2.5.1
Bump rswag-specs from 2.4.0 to 2.5.1
2022-07-27 12:06:50 +10:00
Maikel Linke
59c9f0957b Simplify default card logic 2022-07-27 11:14:18 +10:00
jibees
6baa36cdaa Merge pull request #9454 from openfoodfoundation/dependabot/bundler/rails-i18n-7.0.5
Bump rails-i18n from 7.0.1 to 7.0.5
2022-07-26 17:15:10 +02:00
jibees
e0a8b320a9 Merge pull request #9450 from openfoodfoundation/dependabot/bundler/timecop-0.9.5
Bump timecop from 0.9.4 to 0.9.5
2022-07-26 17:12:24 +02:00
filipefurtad0
116f503cf6 Updates Payments reports spec 2022-07-26 16:07:29 +01:00
filipefurtad0
023ebe1909 Asserts on pre-filling of dates; removes manual date selection 2022-07-26 16:07:29 +01:00
dependabot[bot]
d54eb48662 Bump rswag-specs from 2.4.0 to 2.5.1
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:13:06 +00:00
dependabot[bot]
542e8e22bf Bump rails-i18n from 7.0.1 to 7.0.5
Bumps [rails-i18n](https://github.com/svenfuchs/rails-i18n) from 7.0.1 to 7.0.5.
- [Release notes](https://github.com/svenfuchs/rails-i18n/releases)
- [Changelog](https://github.com/svenfuchs/rails-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/svenfuchs/rails-i18n/commits/v7.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:12:46 +00:00
dependabot[bot]
e0426d6dc0 Bump timecop from 0.9.4 to 0.9.5
Bumps [timecop](https://github.com/travisjeffery/timecop) from 0.9.4 to 0.9.5.
- [Release notes](https://github.com/travisjeffery/timecop/releases)
- [Changelog](https://github.com/travisjeffery/timecop/blob/master/History.md)
- [Commits](https://github.com/travisjeffery/timecop/compare/v0.9.4...v0.9.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:10:19 +00:00
jibees
a09900c98d Merge pull request #9433 from openfoodfoundation/dependabot/bundler/rswag-api-2.5.1
Bump rswag-api from 2.4.0 to 2.5.1
2022-07-26 16:10:15 +02:00
jibees
f563fcad7f Merge pull request #9434 from openfoodfoundation/dependabot/bundler/letter_opener-1.8.1
Bump letter_opener from 1.7.0 to 1.8.1
2022-07-26 16:09:56 +02:00
jibees
34b76f8683 Merge pull request #9401 from openfoodfoundation/dependabot/bundler/selenium-webdriver-4.3.0
Bump selenium-webdriver from 4.0.3 to 4.3.0
2022-07-26 16:09:42 +02:00
jibees
ec82bdda97 Merge pull request #9376 from openfoodfoundation/dependabot/bundler/jwt-2.4.1
Bump jwt from 2.3.0 to 2.4.1
2022-07-26 16:09:32 +02:00
jibees
e4c2df4989 Merge pull request #9326 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.1
Bump sidekiq from 6.3.1 to 6.5.1
2022-07-26 16:09:22 +02:00
jibees
a1f577dc01 Merge pull request #9400 from openfoodfoundation/dependabot/bundler/rswag-ui-2.5.1
Bump rswag-ui from 2.4.0 to 2.5.1
2022-07-26 16:09:11 +02:00
jibees
edbf92424d Merge pull request #9377 from openfoodfoundation/dependabot/bundler/paranoia-2.6.0
Bump paranoia from 2.4.3 to 2.6.0
2022-07-26 16:08:58 +02:00
jibees
35c18664fc Merge pull request #9389 from jibees/9388-handle-plural-in-order-selection-component
Handle plural (and 0) on orders selection component
2022-07-26 15:57:58 +02:00
jibees
be568cdfa6 Update config/locales/en.yml
Co-authored-by: Maikel <maikel@email.org.au>
2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
0bb90d764c Allow charges is disabled if no saved cards marked as default 2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
34c8748b9c Mark the next credit cards with payment profile as default 2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
875c22346e Add a tooltip on <td /> when input is disabled, ie no default saved cards
Co-Authored-By: Maikel <maikel@email.org.au>
2022-07-26 14:42:54 +02:00
filipefurtad0
c57d5a2408 Updates spec to smoke-test Pack by Product 2022-07-26 12:49:08 +01:00
Maikel
825058472b Merge pull request #9425 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.1.0
Bump stimulus from 3.0.1 to 3.1.0
2022-07-26 16:49:33 +10:00
Maikel Linke
b419f063dc Support WEBP images again
We introduced a list of formats we support and forgot to add webp. Now I
added that as allowed format again and modified the error message.

I removed the first sentence from the error message because it's very
similar to the default error which is shown as well.
2022-07-26 11:09:41 +10:00
Maikel Linke
0ebc803e22 Simplify reports SQL query 2022-07-26 11:05:41 +10:00
dependabot[bot]
cd2119707a Bump rswag-ui from 2.4.0 to 2.5.1
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:56:05 +00:00
dependabot[bot]
8c27406a7a Bump paranoia from 2.4.3 to 2.6.0
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.4.3 to 2.6.0.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/2.4.3...v2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:49 +00:00
dependabot[bot]
b6defc76a8 Bump jwt from 2.3.0 to 2.4.1
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.3.0...v2.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:29 +00:00
dependabot[bot]
50529d7ab3 Bump sidekiq from 6.3.1 to 6.5.1
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.3.1 to 6.5.1.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.3.1...v6.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:12 +00:00
dependabot[bot]
b695f3d47f Bump selenium-webdriver from 4.0.3 to 4.3.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.0.3 to 4.3.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits/selenium-4.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:54:43 +00:00
dependabot[bot]
90ce61fa47 Bump letter_opener from 1.7.0 to 1.8.1
Bumps [letter_opener](https://github.com/ryanb/letter_opener) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/ryanb/letter_opener/releases)
- [Changelog](https://github.com/ryanb/letter_opener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ryanb/letter_opener/compare/v1.7.0...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:13:23 +00:00
dependabot[bot]
7c2352f2d6 Bump rswag-api from 2.4.0 to 2.5.1
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:13:07 +00:00
dependabot[bot]
ef7194af85 Bump stimulus from 3.0.1 to 3.1.0
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/stimulusjs/stimulus/releases)
- [Changelog](https://github.com/hotwired/stimulus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stimulusjs/stimulus/compare/v3.0.1...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:12:14 +00:00
Jean-Baptiste Bellet
09adc8f690 In Enterprise Fees Summary report, SUM column should be numeric
+ update specs as well
2022-07-25 15:08:39 +02:00
filipefurtad0
86b448445f Adds test cases on Distributor Totals by Supplier 2022-07-22 14:05:33 +01:00
filipefurtad0
ba9ba7da95 Adds test cases to OC Supplier Totals by Distributor 2022-07-22 14:05:33 +01:00
filipefurtad0
f02e1ea04a Adds test cases to Order Cycle Supplier Totals 2022-07-22 14:05:33 +01:00
filipefurtad0
f88b31ec67 Adds assertion on table headers for different sub-report types 2022-07-22 14:05:33 +01:00
filipefurtad0
6906dd47e8 Changes I18n to strings and cleans up Order Cycle Customer Totals 2022-07-22 14:04:58 +01:00
Jean-Baptiste Bellet
2a35c48498 Do not format price as currency, but as number
for all the `Packing Reports`, ie
Pack By Customer
Pack By Supplier
Pack By Product
2022-07-22 09:28:36 +02:00
Jean-Baptiste Bellet
ce0031934a Do not format sum_total as currency, but as number
For the `Bulk Co-op Supplier Report` report
2022-07-22 09:27:52 +02:00
Jean-Baptiste Bellet
4766c7a00b Update all locales with the latest Transifex translations 2022-07-21 17:42:52 +02:00
jibees
9d470c7a18 Merge pull request #9416 from aintluks/fix-label-button-terms-of-service
Fix button labels on terms of service
2022-07-21 17:38:28 +02:00
jibees
9cb0d66f39 Merge pull request #9426 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.9
Bump @babel/preset-env from 7.18.6 to 7.18.9
2022-07-21 17:38:07 +02:00
dependabot[bot]
7ba6f8c04b Bump @babel/preset-env from 7.18.6 to 7.18.9
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.6 to 7.18.9.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.9/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 15:03:18 +00:00
jibees
19ff6d011a Merge pull request #9415 from saunmanoj888/fix-for-shipping-method-radio-button
Fix text alignment for category radio button under shipping method
2022-07-21 17:02:29 +02:00
jibees
9b1dcdcc78 Merge pull request #9412 from binarygit/optimize-notes-and-tracking-workflow
Optimize notes and tracking workflow
2022-07-21 17:02:03 +02:00
jibees
5eb3c486b2 Merge pull request #9383 from jibees/9382-can-send-invoice-if-ABN-is-not-required
Can send invoice if ABN is not required
2022-07-21 17:01:41 +02:00
jibees
20ee0d5009 Merge pull request #9301 from mkllnk/3975-unsupported-image
Allow SVG images for products and show errors when uploading unsupported file
2022-07-21 16:56:11 +02:00
Jean-Baptiste Bellet
a3cb1e6ecc Can Allow charges only if one card is marked as default 2022-07-21 14:42:36 +02:00
jibees
89d68c7708 Merge pull request #9374 from openfoodfoundation/dependabot/bundler/spring-4.0.0
Bump spring from 3.0.0 to 4.0.0
2022-07-21 08:56:33 +02:00
jibees
371d517436 Merge pull request #9432 from mkllnk/mayhem
Run Mayhem for API only when triggered manually
2022-07-21 08:51:12 +02:00
jibees
17a016eca5 Merge pull request #9431 from mkllnk/roo
Bump roo from old master to 2.9.0
2022-07-21 08:46:06 +02:00
Jean-Baptiste Bellet
2b67a0fa80 Specify a list of content-types
Then remove specific image format that aren't handled by a web browser (such as `image/x+xcf)`

+ List allowed image formats for enterprises and groups
2022-07-21 08:42:17 +02:00
Maikel Linke
84fcc8f1ac Upgrade spring binstubs
I ran `bundle exec spring binstub --all` after reading about the update
in the changelog.
2022-07-21 10:55:31 +10:00
Maikel
baefe37d0b Merge pull request #9367 from openfoodfoundation/dependabot/bundler/activerecord-import-1.4.0
Bump activerecord-import from 1.3.0 to 1.4.0
2022-07-21 10:45:56 +10:00
Maikel Linke
1e13d579ba Run Mayhem for API only when triggered manually
It currently always fails and we are not using it. We may use it in the
future though and the results can be interesting. So I'm keeping it but
it's not triggered on every pull request. How to trigger:

https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow
2022-07-21 10:37:58 +10:00
Maikel Linke
becfb09b3c Bump roo from old master to 2.9.0
This release doesn't include the latest two pull requests but we don't
need those features and it's an upgrade already. Dependabot will now
pick up new releases instead of every new commit to the master branch of
the gem source. That should be less work for us.
2022-07-21 10:29:45 +10:00
Filipe
4767030035 Merge pull request #9429 from filipefurtad0/matomo_tag_change
Adds js window element to container code
2022-07-20 10:27:16 +01:00
filipefurtad0
b20385db95 Moves matomo tag to upper position within head section 2022-07-20 09:38:37 +01:00
jibees
019911068a Merge pull request #9402 from openfoodfoundation/dependabot/bundler/oauth2-1.4.10
Bump oauth2 from 1.4.7 to 1.4.10
2022-07-20 09:36:19 +02:00
jibees
da266fed40 Merge pull request #9428 from openfoodfoundation/dependabot/npm_and_yarn/terser-4.8.1
Bump terser from 4.8.0 to 4.8.1
2022-07-20 09:35:39 +02:00
Maikel Linke
dd6c066f5a DRY view with JS translation 2022-07-20 17:01:10 +10:00
dependabot[bot]
9de939c1b1 Bump terser from 4.8.0 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 05:48:56 +00:00
Lucas da Costa
35030bfd02 Fix button labels on terms of service 2022-07-19 22:53:30 -03:00
Maikel
3833fb6e52 Merge pull request #9394 from jibees/9167-api-v1,-customers-endpoint-region-and-country-as-object
API v1: Provide customer address with region and country objects including id code
2022-07-20 09:41:11 +10:00
filipefurtad0
0a03c0a0fb Adds js window element to container code 2022-07-19 19:29:02 +01:00
binarygit
0599acbcb8 Refactor shipments.js 2022-07-19 13:37:05 +05:45
binarygit
97dcd44662 Display alert box before deleting note/tracking info 2022-07-19 13:37:05 +05:45
binarygit
1165c997bc Add styles on notes/tracking info when hoving over their delete buttons 2022-07-19 13:36:58 +05:45
binarygit
1d54777d72 Replace view with status column in past orders table 2022-07-19 13:30:11 +05:45
Maikel
0144e940c4 Remove release step to merge Transifex PR 2022-07-19 17:38:37 +10:00
Jean-Baptiste Bellet
753a643bf1 Simplify main method by creating two private methods
Include some unit tests
2022-07-19 09:50:06 +10:00
Maikel Linke
19018c2564 Split address transformation for easier reading 2022-07-19 09:49:42 +10:00
Maikel Linke
c8a65d2fac Simplify with customer accessor 2022-07-19 09:49:42 +10:00
Maikel Linke
6c0d4cffe5 Allow customer's address update with country code
The customer endpoint now serves 2-letter ISO codes for countries and
accepts these for updates. It also serves and accepts region codes
(abbreviations) like VIC for Victoria.

Updates treat these fields as case-insensitive and either code or name
have to be present.

This commit also updates the Swagger documentation.
2022-07-19 09:49:42 +10:00
binarygit
6b042e4a17 Display notes field in admin/orders/new only after an item has been added 2022-07-18 16:15:37 +05:45
binarygit
ae2c56b29d Omit tracking info row from shipping email when empty 2022-07-18 14:55:36 +05:45
saunmanoj888
55feb7648d Fix text alignment for category radio button under shipping method 2022-07-16 23:17:06 +05:30
Jean-Baptiste Bellet
cc135c8190 API V1, Customer endpoint: region and country as object 2022-07-15 14:54:33 +02:00
binarygit
2f01351ad2 Enable users to delete only non-empty tracking info/notes 2022-07-15 11:34:37 +05:45
Maikel Linke
3d6842db80 Update translations 2022-07-14 11:54:23 +10:00
Maikel
e1dd92b406 Merge pull request #9395 from openfoodfoundation/transifex
Transifex
2022-07-14 11:50:18 +10:00
Maikel
a8160aac8a Merge pull request #9399 from binarygit/feature/update-note/tracking
Update note and tracking fields workflow
2022-07-14 11:49:09 +10:00
binarygit
5e7bfc05d2 Remove link from order number in open/past orders table 2022-07-13 20:10:45 +05:45
binarygit
3c741f0686 Add flash after an order is cancelled 2022-07-13 18:45:43 +05:45
Jean-Baptiste Bellet
afa40ea82f Authorize product and not @product 2022-07-13 14:26:11 +02:00
Transifex-Openfoodnetwork
6a9fcd0b30 Updating translations for config/locales/en_GB.yml 2022-07-13 04:17:52 +10:00
Jean-Baptiste Bellet
a80cf37fa6 Handle errors message formatting 2022-07-12 18:29:28 +02:00
Jean-Baptiste Bellet
073bad2118 Allow svg images to be resized/cropped 2022-07-12 15:53:32 +02:00
binarygit
6ad0749ce8 Refactor: create parent_node var to find child elements 2022-07-12 14:11:53 +05:45
Transifex-Openfoodnetwork
5a40ccb7df Updating translations for config/locales/it.yml 2022-07-12 18:07:07 +10:00
binarygit
a56375eaf8 Spec: can delete note/tracking info on an order 2022-07-12 13:33:34 +05:45
Philipp Winkler
6291e3c587 Handle invalid referer for embedded page service 2022-07-11 22:07:00 +02:00
Transifex-Openfoodnetwork
5221e776da Updating translations for config/locales/de_DE.yml 2022-07-11 20:44:12 +10:00
Transifex-Openfoodnetwork
a290779ef7 Updating translations for config/locales/en_FR.yml 2022-07-11 19:31:07 +10:00
Transifex-Openfoodnetwork
ac2b8e1ebe Updating translations for config/locales/fr.yml 2022-07-11 19:28:51 +10:00
jibees
a1adcadd6c Merge pull request #9371 from openfoodfoundation/dependabot/bundler/devise-4.8.1
Bump devise from 4.8.0 to 4.8.1
2022-07-11 11:26:43 +02:00
dependabot[bot]
4a53c818fd Bump oauth2 from 1.4.7 to 1.4.10
Bumps [oauth2](https://github.com/oauth-xx/oauth2) from 1.4.7 to 1.4.10.
- [Release notes](https://github.com/oauth-xx/oauth2/releases)
- [Changelog](https://github.com/oauth-xx/oauth2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/oauth-xx/oauth2/compare/v1.4.7...v1.4.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 09:06:54 +00:00
dependabot[bot]
fa59117fd5 Bump devise from 4.8.0 to 4.8.1
Bumps [devise](https://github.com/heartcombo/devise) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/heartcombo/devise/releases)
- [Changelog](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heartcombo/devise/compare/v4.8.0...v4.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 08:52:18 +00:00
jibees
3b6b2ea936 Merge pull request #9372 from openfoodfoundation/dependabot/bundler/rack-timeout-0.6.3
Bump rack-timeout from 0.6.0 to 0.6.3
2022-07-11 10:51:00 +02:00
jibees
ef4a71c048 Merge pull request #9375 from openfoodfoundation/dependabot/bundler/redis-4.7.1
Bump redis from 4.7.0 to 4.7.1
2022-07-11 10:50:35 +02:00
jibees
bc82401c24 Merge pull request #9393 from openfoodfoundation/dependabot/bundler/awesome_nested_set-3.5.0
Bump awesome_nested_set from 3.4.0 to 3.5.0
2022-07-11 10:49:54 +02:00
jibees
849ceeaa96 Merge pull request #9392 from openfoodfoundation/dependabot/npm_and_yarn/moment-2.29.4
Bump moment from 2.29.3 to 2.29.4
2022-07-11 10:49:35 +02:00
jibees
77bac0c24e Merge pull request #9396 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.1.0
Bump tom-select from 2.0.3 to 2.1.0
2022-07-11 09:17:15 +02:00
binarygit
227220e2a6 Add focus to tracking when edit tracking is clicked 2022-07-09 14:40:04 +05:45
binarygit
b88c85555e Add delete tracking feature 2022-07-09 14:39:20 +05:45
binarygit
b7a49ced39 Add focus to note when edit note is clicked 2022-07-09 14:33:01 +05:45
binarygit
dc31ebebb1 Add delete note feature 2022-07-09 13:23:38 +05:45
Filipe
2f550725e3 Merge pull request #9368 from jibees/9178-add-note-on-order
Admin, Edit order: Can add note on order
2022-07-08 12:13:18 +01:00
Filipe
3834724d45 Merge pull request #9236 from AgriculturaFamiliar/add-map-whatsapp-link
Show whatsapp link on contact modal on map
2022-07-08 12:10:18 +01:00
dependabot[bot]
ce39f3c119 Bump tom-select from 2.0.3 to 2.1.0
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.0.3...v2.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-08 09:05:33 +00:00
Transifex-Openfoodnetwork
7aaa31b137 Updating translations for config/locales/en_FR.yml 2022-07-08 11:27:15 +10:00
Transifex-Openfoodnetwork
656143db48 Updating translations for config/locales/fr.yml 2022-07-08 11:24:09 +10:00
Filipe
decfbc9658 Merge pull request #9356 from jibees/9248-add-tags-to-a-producer-only-order-cycle
Add tags to producer-only order cycle interface
2022-07-07 23:45:02 +01:00
Filipe
e91a87d83b Merge pull request #9295 from filipefurtad0/destroy_order_state_confirmation
Restarts checkout flow, when emptying the cart
2022-07-07 22:47:44 +01:00
Filipe
040422c6c0 Merge pull request #9380 from jibees/9068-bulk-product-update-creating-new-on_demand-variant
Admin, Products list: fix variant creation when unit is not well formatted and on_demand is checked or on_hand is filled
2022-07-07 22:39:23 +01:00
dependabot[bot]
7535883416 Bump moment from 2.29.3 to 2.29.4
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 08:10:37 +00:00
Jean-Baptiste Bellet
f71c84cea5 Handle save method as it should be: return false if any errors occurs 2022-07-07 09:56:14 +02:00
Maikel Linke
1586320115 Update translations 2022-07-07 13:56:55 +10:00
Maikel
13f81ca20e Merge pull request #9350 from filipefurtad0/adds_reports_specs
Adds system specs on orders and fulfillment reports
2022-07-07 13:51:12 +10:00
dependabot[bot]
25b5b66ae1 Bump awesome_nested_set from 3.4.0 to 3.5.0
Bumps [awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/collectiveidea/awesome_nested_set/releases)
- [Changelog](https://github.com/collectiveidea/awesome_nested_set/blob/master/CHANGELOG)
- [Commits](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...v3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:45:48 +00:00
dependabot[bot]
f2b02f6c6b Bump activerecord-import from 1.3.0 to 1.4.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/zdennis/activerecord-import/releases)
- [Changelog](https://github.com/zdennis/activerecord-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zdennis/activerecord-import/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:45:13 +00:00
dependabot[bot]
3139ba7ad0 Bump rack-timeout from 0.6.0 to 0.6.3
Bumps [rack-timeout](https://github.com/zombocom/rack-timeout) from 0.6.0 to 0.6.3.
- [Release notes](https://github.com/zombocom/rack-timeout/releases)
- [Changelog](https://github.com/zombocom/rack-timeout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zombocom/rack-timeout/compare/v0.6.0...v0.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:45:12 +00:00
Maikel
1ab1e20bb7 Merge pull request #9378 from openfoodfoundation/dependabot/bundler/rails-6.1.6
Bump rails from 6.1.4.4 to 6.1.6
2022-07-07 13:43:58 +10:00
Maikel
f3806ea5ea Merge pull request #9381 from openfoodfoundation/transifex
Transifex
2022-07-07 13:39:23 +10:00
Maikel
182a7f0f93 Merge pull request #9352 from filipefurtad0/price_breakdown_spec
Adds price breakdown assertion
2022-07-07 13:36:45 +10:00
Jean-Baptiste Bellet
6f228781d4 Check for product_set errors
+ update specs: can't save variant that is not well filled. Now display errors (instead of a generic one)
2022-07-06 10:46:54 +02:00
Jean-Baptiste Bellet
c39b00b6c2 do not set on_demand and on_hand if variant has errors
+ update specs

Co-Authored-By: Maikel <maikel@email.org.au>
2022-07-06 10:46:54 +02:00
Jean-Baptiste Bellet
06b1c9aa40 Handle plural (and 0) on orders selection component 2022-07-06 09:48:12 +02:00
lauriewayne
75b71738df Update FUNDING.yml
took away @
2022-07-05 07:02:03 -07:00
lauriewayne
8cb07c4a37 Update FUNDING.yml 2022-07-05 06:59:27 -07:00
lauriewayne
4cbd520cb9 Create FUNDING.yml
added @ofnusa to Open Collective line
2022-07-05 06:56:44 -07:00
Jean-Baptiste Bellet
b2a0310e6f Handle the case when errors is a string 2022-07-05 15:48:31 +02:00
jibees
d71994189c Creating new variants specs
Co-Authored-By: Filipe <49817236+filipefurtad0@users.noreply.github.com>
2022-07-05 10:21:48 +02:00
Jean-Baptiste Bellet
89809aed5f Add counter on note input 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
de8c71d098 Create a controller that handle a counter for an input text 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
576faff3d7 Spec: can edit/save note on an order 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
90af6bd22d Handle note saving with a new action on existing API controller 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
3f1099d968 Add edit note line on an order 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
7fbe893927 Add note to spree_orders object 2022-07-05 10:09:20 +02:00
Transifex-Openfoodnetwork
c6ab9f8a6a Updating translations for config/locales/it.yml 2022-07-05 16:42:36 +10:00
Vishal Jain
3143cc9d92 skip disabled user check for session controller 2022-07-05 11:35:11 +05:30
Jean-Baptiste Bellet
e4be757d96 use the can_invoice method that check both ABN and configuration boolean
+ specs Specify an empty ABN number
+ update specs
2022-07-04 15:35:49 +02:00
filipefurtad0
e44845c327 Creates system spec for orders and fulfilment report; adds existing test cases to this file 2022-07-04 11:08:54 +01:00
filipefurtad0
c8cab86b0c Stubs order and adds assertions 2022-07-04 11:07:00 +01:00
Transifex-Openfoodnetwork
a3cbe8e878 Updating translations for config/locales/en_FR.yml 2022-07-04 19:52:28 +10:00
Transifex-Openfoodnetwork
727c74907d Updating translations for config/locales/fr.yml 2022-07-04 19:51:29 +10:00
Transifex-Openfoodnetwork
04c38a3c1d Updating translations for config/locales/de_DE.yml 2022-07-02 08:22:44 +10:00
Jean-Baptiste Bellet
9b51f85e9a Create a context around "creating new variants"
Reproducing bug #9068
2022-07-01 16:42:04 +02:00
Jean-Baptiste Bellet
90fe3fc66c Update all locales with the latest Transifex translations 2022-07-01 14:26:24 +02:00
Filipe
5a2aee6d79 Merge pull request #9349 from openfoodfoundation/transifex
Transifex
2022-07-01 12:06:53 +01:00
dependabot[bot]
544377a624 Bump rails from 6.1.4.4 to 6.1.6
Bumps [rails](https://github.com/rails/rails) from 6.1.4.4 to 6.1.6.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4.4...v6.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 11:06:24 +00:00
Filipe
2a49b91a8b Merge pull request #9347 from openfoodfoundation/dependabot/bundler/view_component-2.57.1
Bump view_component from 2.41.0 to 2.57.1
2022-07-01 12:05:42 +01:00
Filipe
8abd636b68 Merge pull request #9342 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.11.1
Bump view_component_storybook from 0.10.1 to 0.11.1
2022-07-01 12:05:28 +01:00
Filipe
244cce7392 Merge pull request #9365 from mkllnk/ch
Add Swiss language files
2022-07-01 12:04:57 +01:00
Filipe
9d39efdd7b Merge pull request #9318 from saunmanoj888/translation-missing-order-cycle-status
Add translation for order-cycle-status on new order creation from admin
2022-07-01 12:03:45 +01:00
Filipe
a0531ca356 Merge pull request #9332 from openfoodfoundation/dependabot/bundler/geocoder-1.8.0
Bump geocoder from 1.7.0 to 1.8.0
2022-07-01 12:00:02 +01:00
Filipe
8cac98ceb4 Merge pull request #9321 from leopengilley/master
Styled text colour of admin order dropdown menu #9296
2022-07-01 10:48:11 +01:00
Filipe
3d5d9d1191 Merge pull request #9353 from saunmanoj888/fix-password-prefilled-issue
Disable auto fill option for password on /admin/users/[ID] page
2022-07-01 10:41:29 +01:00
dependabot[bot]
a5f6773a4d Bump redis from 4.7.0 to 4.7.1
Bumps [redis](https://github.com/redis/redis-rb) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.7.0...v4.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 09:34:11 +00:00
Filipe
e563de0248 Merge pull request #9330 from openfoodfoundation/dependabot/bundler/roadie-rails-3.0.0
Bump roadie-rails from 2.2.0 to 3.0.0
2022-07-01 10:33:11 +01:00
Filipe
81d2e63d6f Merge pull request #9357 from jibees/9180-close-mobile-menu-on-click-anywhere
Close menu on click outside the menu and outside the hamburger icon
2022-07-01 10:16:43 +01:00
dependabot[bot]
43b09640a9 Bump spring from 3.0.0 to 4.0.0
Bumps [spring](https://github.com/rails/spring) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v3.0.0...v4.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 08:47:51 +00:00
Filipe
9b2ae41392 Merge pull request #9359 from openfoodfoundation/dependabot/bundler/sidekiq-scheduler-4.0.2
Bump sidekiq-scheduler from 3.1.0 to 4.0.2
2022-07-01 09:46:00 +01:00
Arthur Vieira
066879fe62 Add icons to whatsapp links
Uses the font awesome 4 WhatsApp icon in .svg format (which is under the
Open Font License) in the pages where an enterprise's WhatsApp number
appears as an hyperlink.
2022-06-30 19:19:10 -03:00
Arthur
54ec4e5016 Update app/views/shopping_shared/tabs/_contact.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-06-30 19:19:10 -03:00
Arthur Vieira
e483ef8ccd Fix whatsapp phone tooltip in registration
The tooltip on the contact step of the registration form now displays
the proper text, which has been added in the source language file.
2022-06-30 19:19:10 -03:00
Arthur Vieira
0deb3cd782 Replace url generation with 'whatsapp_url' method
As suggested by mkllnk's following comment:
1eda7d8a4c (r890656117)
2022-06-30 19:19:10 -03:00
Arthur Vieira
624485ff25 Add whatsapp link to contact tab view 2022-06-30 19:19:10 -03:00
Arthur Vieira
cace62a718 Add producer whatsapp link to producers list
Adds WhatsApp number with wa.me link between phone number and e-mail
address in the producers list profile.
2022-06-30 19:19:10 -03:00
Arthur Vieira
77360f41af Show WhatsApp link on contact modal on map
Strips '+' and ' ' characters from the phone number for the generated
link, but doesn't guarantee the link is valid because the number
registered isn't validated for now.
2022-06-30 19:19:10 -03:00
Arthur Vieira
79e762a815 Add whatsapp number to registration form
Creates a field  on the contact step of the enterprise registration form
to create an enterprise with a WhatsApp phone number, with corresponding
i18n keys for the field's name and placeholder text.
2022-06-30 19:19:10 -03:00
Arthur Vieira
62ee3c2de1 Add admin view field for whatsapp number
Creates a field and tooltip in
/admin/enterprises/<enterprise>/edit#!/contact for updating the
enterprise's WhatsApp phone number, with corresponding i18n keys for the
name of the field, placeholder and tooltip text.
2022-06-30 19:19:10 -03:00
Arthur Vieira
b565b6ba4d Add whatsapp_phone to permitted attributes
Allows creating and updating the enterprise's WhatsApp phone number in
the registration form and contact edit views.
2022-06-30 19:19:10 -03:00
Arthur Vieira
a2bc61475b Add whatsapp_phone column to enterprises 2022-06-30 19:19:06 -03:00
Transifex-Openfoodnetwork
8052e8b775 Updating translations for config/locales/en_FR.yml 2022-06-30 17:39:47 +10:00
Transifex-Openfoodnetwork
e4d290d59c Updating translations for config/locales/fr.yml 2022-06-30 17:39:36 +10:00
jibees
96df2cb307 Merge pull request #9370 from openfoodfoundation/dependabot/bundler/rack-mini-profiler-2.3.4
Bump rack-mini-profiler from 2.3.3 to 2.3.4
2022-06-30 08:34:18 +02:00
Maikel
1bc13215a2 Merge pull request #9360 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.114.0
Bump aws-sdk-s3 from 1.113.0 to 1.114.0
2022-06-30 11:45:05 +10:00
dependabot[bot]
a09b1ce54c Bump rack-mini-profiler from 2.3.3 to 2.3.4
Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.3.3 to 2.3.4.
- [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases)
- [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.3.3...v2.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-29 18:22:46 +00:00
Filipe
122421be0f Merge pull request #9340 from openfoodfoundation/dependabot/bundler/wicked_pdf-2.6.3
Bump wicked_pdf from 2.1.0 to 2.6.3
2022-06-29 19:21:35 +01:00
Filipe
899a796896 Merge pull request #9348 from jibees/9315-add-boolean-to-set-enterprise-phone-number-mandatory-or-not
Add boolean to specify if enterprise  number (ABN, GST, SIRET, ...) is mandatory or not to generate invoices
2022-06-29 19:07:55 +01:00
Filipe
deb22d788f Merge pull request #9363 from jibees/9316-new-action-dropdown-for-bulk-invoice-printing
Admin, Orders list: new actions dropdown for bulk invoice printing
2022-06-29 18:20:32 +01:00
Jean-Baptiste Bellet
77d12a3e54 Can add tags on simple order_cycle: specs
Simple order cycle: enterprise users selling only their own produce
2022-06-29 09:51:15 +02:00
jibees
d245609b16 Merge pull request #9366 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.1.0
Bump shoulda-matchers from 5.0.0 to 5.1.0
2022-06-29 08:49:06 +02:00
dependabot[bot]
b806e08624 Bump shoulda-matchers from 5.0.0 to 5.1.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v5.0.0...v5.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-29 03:54:32 +00:00
Maikel
b902de652a Merge pull request #9358 from openfoodfoundation/dependabot/bundler/redis-4.7.0
Bump redis from 4.5.1 to 4.7.0
2022-06-29 13:53:33 +10:00
Maikel Linke
0afd0fe2f1 Add Swiss language files
We usually don't do this manually but these files haven't been
completely translated yet and Mikel is keen to use them.
2022-06-29 10:49:49 +10:00
Jean-Baptiste Bellet
8ba59079b3 Reverse per_page and actions components left <-> right 2022-06-28 18:12:47 +02:00
Jean-Baptiste Bellet
8d66f33230 per_page control can now be set on the right of the page 2022-06-28 18:12:20 +02:00
Jean-Baptiste Bellet
77e384ab71 Replace button by a drop-down
+ update specs as well
2022-06-28 17:39:41 +02:00
Jean-Baptiste Bellet
7a1bd660c4 Prepare ofn-drop-down to have a "disabled" state and a "prepend" element 2022-06-28 17:39:41 +02:00
jibees
0ed56a46af Merge pull request #9362 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.6
Bump @babel/preset-env from 7.18.2 to 7.18.6
2022-06-28 15:23:01 +02:00
Jean-Baptiste Bellet
fdba33baa3 Pass the form, and re-init() on object change
I can't make angularjs directive synchronized to scope object, this seems to be a hack, but it works.

Also add form in the scope (which was not added...)
2022-06-28 15:05:11 +02:00
Jean-Baptiste Bellet
6f303a5244 Add tags interface for a producer only order cycle
Add tags for first (and unique) outgoing exchange for a simple OC

Order Cycle can have tags
2022-06-28 15:05:11 +02:00
Transifex-Openfoodnetwork
850ad5165c Updating translations for config/locales/ko.yml 2022-06-28 21:25:14 +10:00
dependabot[bot]
85e3111e75 Bump @babel/preset-env from 7.18.2 to 7.18.6
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.2 to 7.18.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.6/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 09:04:51 +00:00
Jean-Baptiste Bellet
5ad09a6fab Check if user can/can't print invoice in case of company number mandatory or present 2022-06-28 09:58:34 +02:00
Jean-Baptiste Bellet
bb6298d06d Check for enterprise_number_required_on_invoices boolean
if true, then can edit invoice ;

if false, then print a confirm alert popup to specify that a enterprise number must be set for this enterprise
2022-06-28 09:53:46 +02:00
Jean-Baptiste Bellet
3a1fde40c5 Add a Spree config option: enterprise_number_required_on_invoices 2022-06-28 09:50:12 +02:00
filipefurtad0
43b6ab5dc5 Updates spec after merging #9325 2022-06-28 07:37:08 +01:00
Maikel
ee464ca457 Merge pull request #9334 from openfoodfoundation/dependabot/bundler/bullet-7.0.2
Bump bullet from 6.1.5 to 7.0.2
2022-06-28 12:25:53 +10:00
dependabot[bot]
c27f35ee6e Bump aws-sdk-s3 from 1.113.0 to 1.114.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.113.0 to 1.114.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 02:25:51 +00:00
Maikel
79cc8b6f3e Merge pull request #9331 from openfoodfoundation/dependabot/bundler/devise-i18n-1.10.2
Bump devise-i18n from 1.10.0 to 1.10.2
2022-06-28 12:24:59 +10:00
dependabot[bot]
1676dba9da Bump sidekiq-scheduler from 3.1.0 to 4.0.2
Bumps [sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) from 3.1.0 to 4.0.2.
- [Release notes](https://github.com/moove-it/sidekiq-scheduler/releases)
- [Changelog](https://github.com/sidekiq-scheduler/sidekiq-scheduler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moove-it/sidekiq-scheduler/compare/v3.1.0...v4.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 02:02:17 +00:00
dependabot[bot]
e26e6bb855 Bump redis from 4.5.1 to 4.7.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.5.1 to 4.7.0.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.5.1...v4.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 02:01:57 +00:00
Maikel
c2c8e8dfcd Merge pull request #9343 from openfoodfoundation/dependabot/bundler/arel-helpers-2.14.0
Bump arel-helpers from 2.12.1 to 2.14.0
2022-06-28 12:01:33 +10:00
Maikel
61f0b433aa Merge pull request #9345 from openfoodfoundation/dependabot/bundler/test-prof-1.0.9
Bump test-prof from 1.0.7 to 1.0.9
2022-06-28 12:01:05 +10:00
Jean-Baptiste Bellet
e2e455533e Close menu on click outside the menu and outside the hambuger icon 2022-06-27 18:57:40 +02:00
filipefurtad0
2ba9d250f2 Adds assertion on price breakdown modal 2022-06-27 11:24:57 +01:00
Maikel
79bf8f0053 Merge pull request #9354 from mkllnk/time-spec
Fix time in reports spec
2022-06-27 17:41:20 +10:00
Maikel Linke
721fc0fd3f Fix time in reports spec
Some specs were starting to fail because I created an order in the past
while the default report is for the last month only. It didn't include
that order any more.

I now defined the dates everywhere to remove this variable of the
current date.
2022-06-27 17:07:56 +10:00
Maikel
6a80cb8bfa Merge pull request #9313 from filipefurtad0/some_clean_ups_on_report_specs
Updating system specs after reports overhaul
2022-06-27 16:33:56 +10:00
saunmanoj888
8d5616b351 Disable auto fill option for password on /admin/users/[ID] page 2022-06-26 23:45:18 +05:30
Filipe
45214ed923 Merge pull request #9325 from jibees/8899-shopfront-display-fee-name-in-the-tooltip-of-a-price-product-
In the shopfront, display fee name in the tooltip of a price product breakdown
2022-06-24 20:49:32 +01:00
Vishal Jain
84b711e130 redirect disabled user to homepage 2022-06-24 18:09:15 +05:30
Transifex-Openfoodnetwork
e28905b176 Updating translations for config/locales/en_GB.yml 2022-06-24 05:24:50 +10:00
filipefurtad0
d63aca3129 Removes 'pending' after #9229 merge 2022-06-23 10:40:11 +01:00
filipefurtad0
be7d44a603 Updates payments_report_spec.rb 2022-06-23 10:24:20 +01:00
filipefurtad0
98eecb1b3e Updates packing report spec 2022-06-23 10:24:20 +01:00
filipefurtad0
db8eb52359 Updates enterprise_summary_fee spec 2022-06-23 10:24:20 +01:00
filipefurtad0
b0d29c6dbc Updates spec settings to address timeout error 2022-06-23 10:24:20 +01:00
filipefurtad0
54bcd75f3f Corrects namespace; adds pending on failing examples - payment_r 2022-06-23 10:24:20 +01:00
filipefurtad0
32e247bf75 Removes spree namespace; adds pending on failing examples - packing_r 2022-06-23 10:24:20 +01:00
filipefurtad0
5892eab4e3 Removes spree namespace; adds pending on failing examples - enterprise_fee_r 2022-06-23 10:24:20 +01:00
dependabot[bot]
9da7bcb134 Bump view_component from 2.41.0 to 2.57.1
Bumps [view_component](https://github.com/github/view_component) from 2.41.0 to 2.57.1.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.41.0...v2.57.1)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 04:11:33 +00:00
Maikel
0ce5718b2b Merge pull request #9329 from openfoodfoundation/dependabot/bundler/web-console-4.2.0
Bump web-console from 4.1.0 to 4.2.0
2022-06-23 14:10:25 +10:00
dependabot[bot]
d12754fe83 Bump roadie-rails from 2.2.0 to 3.0.0
Bumps [roadie-rails](https://github.com/Mange/roadie-rails) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/Mange/roadie-rails/releases)
- [Changelog](https://github.com/Mange/roadie-rails/blob/master/Changelog.md)
- [Commits](https://github.com/Mange/roadie-rails/compare/v2.2.0...v3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:58:49 +00:00
dependabot[bot]
00f3a698f4 Bump test-prof from 1.0.7 to 1.0.9
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.7 to 1.0.9.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.7...v1.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:30:07 +00:00
saunmanoj888
12eff626f4 Add translation for statuses in order_controller.js.coffee 2022-06-23 01:33:51 +05:30
dependabot[bot]
eee7075d9d Bump arel-helpers from 2.12.1 to 2.14.0
Bumps [arel-helpers](https://github.com/camertron/arel-helpers) from 2.12.1 to 2.14.0.
- [Release notes](https://github.com/camertron/arel-helpers/releases)
- [Changelog](https://github.com/camertron/arel-helpers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/camertron/arel-helpers/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 13:55:57 +00:00
dependabot[bot]
f12d62604b Bump view_component_storybook from 0.10.1 to 0.11.1
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.10.1 to 0.11.1.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Changelog](https://github.com/jonspalmer/view_component_storybook/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/jonspalmer/view_component_storybook/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 13:55:25 +00:00
Jean-Baptiste Bellet
4007b17b1e Redirect to login path also if user is disabled
+ update spec as well
2022-06-22 15:51:11 +02:00
dependabot[bot]
d77c693829 Bump wicked_pdf from 2.1.0 to 2.6.3
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 2.1.0 to 2.6.3.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/compare/2.1.0...2.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 09:02:28 +00:00
dependabot[bot]
5e5ade9681 Bump bullet from 6.1.5 to 7.0.2
Bumps [bullet](https://github.com/flyerhzm/bullet) from 6.1.5 to 7.0.2.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/6.1.5...7.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 01:27:27 +00:00
dependabot[bot]
4c0d7c039f Bump geocoder from 1.7.0 to 1.8.0
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/alexreisner/geocoder/releases)
- [Changelog](https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alexreisner/geocoder/compare/v1.7.0...v1.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:35:04 +00:00
dependabot[bot]
5da9ec7dc2 Bump devise-i18n from 1.10.0 to 1.10.2
Bumps [devise-i18n](https://github.com/tigrish/devise-i18n) from 1.10.0 to 1.10.2.
- [Release notes](https://github.com/tigrish/devise-i18n/releases)
- [Changelog](https://github.com/tigrish/devise-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tigrish/devise-i18n/compare/v1.10.0...v1.10.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:34:22 +00:00
dependabot[bot]
edf1dd52eb Bump web-console from 4.1.0 to 4.2.0
Bumps [web-console](https://github.com/rails/web-console) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/rails/web-console/releases)
- [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/rails/web-console/compare/v4.1.0...v4.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:33:16 +00:00
Jean-Baptiste Bellet
400a490ec5 Display fee name instead of fee type
+ update specs as well
2022-06-21 16:08:45 +02:00
Jean-Baptiste Bellet
3c05fc3c80 Add fees name for a variant to its serializer 2022-06-21 14:42:22 +02:00
Jean-Baptiste Bellet
976e326bbd Add method fees_name_by_type_for that returns fees name for a variant 2022-06-21 14:20:59 +02:00
LioPeng
fd4409c24d Styled text colour of admin order dropdown menu 2022-06-20 12:15:13 +10:00
saunmanoj888
85a1a3627a Add translation for order-cycle-status on new order creation from admin 2022-06-16 23:28:11 +05:30
filipefurtad0
9ab672d0b1 Restarts checkout flow for state 'confirmation' 2022-06-15 10:35:40 +01:00
filipefurtad0
f3ff835902 Adds a spec to assert on the order state change 2022-06-14 08:58:54 +01:00
Maikel Linke
004c7eef9e Show SVG product images 2022-06-14 15:35:55 +10:00
Maikel Linke
f3f0a84915 Display image upload error as alert
Not the nicest UX but better than nothing.
2022-06-14 15:11:26 +10:00
Maikel Linke
5f11b6a650 Respond with errors if image upload fails 2022-06-14 15:06:17 +10:00
Maikel Linke
6b733ad7e2 Increase readability of image controller spec
Best viewed without whitespace changes.

- Decrease indent.
- Move `let` to top like in other specs.
- Avoid `let!` to speed up the specs.
2022-06-14 14:56:40 +10:00
Maikel Linke
831aa3aae0 Simplify ProductImagesController 2022-06-14 14:50:55 +10:00
384 changed files with 21471 additions and 5342 deletions

View File

@@ -1,7 +1,11 @@
# ENV vars for the development environment
# Override locally with `.env.development.local`
#
# You may also want to use this when testing other environments locally:
#
# cp .env.development .env.local
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

View File

@@ -1,6 +1,8 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
STRIPE_SECRET_TEST_API_KEY="bogus_key"
STRIPE_CUSTOMER="bogus_customer"
SITE_URL="test.host"

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: openfoodfoundation
patreon: # Replace with a single Patreon username
open_collective: #
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -10,7 +10,6 @@ assignees: ''
## Preparation on Thursday
- [ ] Merge pull requests in the [Ready To Go] column
- [ ] Merge [Transifex pull request]
- [ ] Include translations: `tx pull --force`
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
- [ ] Notify [#instance-managers] of user-facing changes.
@@ -18,24 +17,12 @@ assignees: ''
## Testing
- [ ] [Find build] of the release commit and copy it below.
- [ ] Move this issue to Test Ready and notify testers.
- [ ] Test: :warning: link to the build of the release commit https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master
- [ ] Move this issue to Test Ready.
- [ ] Notify testers.
- [ ] Test build: <!-- paste build link here, e.g. https://semaphore...builds/1234 -->
## Finish on Tuesday
- [ ] Update translations unless content has been removed from config/locales/en.yml between this release draft and current master.
<details><summary>Command line instructions</summary>
<pre>
git checkout master # same version as the release draft
git fetch upstream
git diff upstream/master -- config/locales/en.yml
tx pull --force # if no changes or only additions in the locale
git checkout --detach # if we need to commit new translations
git commit -a -m "Update translations"
git tag vx.y.z # put the release number in here
git push upstream vx.y.z
</pre>
</details>
- [ ] Publish and notify [#global-community]:
> The next release is ready: https://github.com/openfoodfoundation/openfoodnetwork/releases/latest
- [ ] Deploy the new release to all managed instances.

View File

@@ -17,7 +17,7 @@ permissions:
jobs:
rspec:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
@@ -36,13 +36,13 @@ jobs:
specs:
- "spec/controllers"
- "spec/models"
- "spec/features/admin/[a-o0-9]*_spec.rb"
- "spec/lib"
- "spec/migrations"
- "spec/serializers"
- "spec/system/admin/[a-o0-9]*_spec.rb"
- "spec/system/admin/[p-z]*_spec.rb"
- "spec/system/consumer"
- "spec/system/admin/[a-o0-9]*"
- "spec/system/admin/[p-z]*"
- "spec/system/consumer/[a-o0-9]*"
- "spec/system/consumer/[p-z]*"
- "engines/*/spec"
fail-fast: false
steps:
@@ -78,7 +78,7 @@ jobs:
if-no-files-found: ignore
test-the-rest:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10

View File

@@ -1,5 +1,7 @@
name: Linters
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rubocop:
name: runner / rubocop
@@ -16,3 +18,16 @@ jobs:
reporter: github-pr-check
level: error
fail_on_error: true
prettier:
name: runner / prettier
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: error
fail_on_error: true

View File

@@ -1,7 +1,12 @@
name: 'Mayhem for API'
on: [push]
on: workflow_dispatch
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test:
permissions:
contents: read # to fetch code (actions/checkout)
security-events: write # to upload SARIF results (github/codeql-action/upload-sarif)
if: ${{ github.repository_owner == 'openfoodfoundation' }}
runs-on: ubuntu-latest
strategy:

3
.gitignore vendored
View File

@@ -57,3 +57,6 @@ coverage
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/config/credentials.yml.enc
/config/master.key

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn pretty-quick --check --staged

21
.prettierignore Normal file
View File

@@ -0,0 +1,21 @@
# Basically, ignore everythings expect app/webpacker/controllers/*.js and app/webpacker/packs/*.js
*.css
*.scss
*.md
*.yml
*.yaml
*.json
*.html
babel.config.js
postcss.config.js
.storybook/
/app/assets/
/config/
/coverage/
/engines/
/public/
/spec/
/tmp/
/vendor/

1
.prettierrc.json Normal file
View File

@@ -0,0 +1 @@
{}

View File

@@ -23,7 +23,7 @@ Metrics:
Enabled: true
Metrics/BlockLength:
IgnoredMethods: [
AllowedMethods: [
"class_eval",
"collection",
"context",
@@ -41,8 +41,14 @@ Metrics/BlockLength:
"resources",
"scenario",
"shared_examples",
"xdescribe",
]
Rails/ApplicationRecord:
Exclude:
# Migrations should not contain application code:
- "db/migrate/*.rb"
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"

View File

@@ -1,13 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400`
# on 2022-03-29 16:07:39 UTC using RuboCop version 1.22.2.
# on 2022-08-29 05:26:26 UTC using RuboCop version 1.35.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Cop supports --auto-correct.
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
@@ -25,20 +25,13 @@ Gemspec/RequiredRubyVersion:
- 'engines/web/web.gemspec'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Layout/ClosingParenthesisIndentation:
Exclude:
- 'lib/reporting/queries/joins.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'spec/lib/reports/report_loader_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
@@ -47,15 +40,15 @@ Layout/EmptyLinesAroundBlockBody:
- 'spec/system/admin/order_cycles/list_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'spec/system/admin/enterprises_spec.rb'
# Offense count: 856
# Cop supports --auto-correct.
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 862
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
@@ -68,7 +61,6 @@ Layout/LineLength:
- 'app/controllers/admin/subscriptions_controller.rb'
- 'app/controllers/api/v0/order_cycles_controller.rb'
- 'app/controllers/payment_gateways/paypal_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/user_confirmations_controller.rb'
- 'app/helpers/angular_form_builder.rb'
@@ -85,7 +77,6 @@ Layout/LineLength:
- 'app/models/concerns/variant_stock.rb'
- 'app/models/customer.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/product_import/spreadsheet_entry.rb'
- 'app/models/product_import/unit_converter.rb'
@@ -111,23 +102,15 @@ Layout/LineLength:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'engines/order_management/spec/services/order_management/order/updater_spec.rb'
- 'engines/web/app/helpers/web/cookies_policy_helper.rb'
- 'engines/web/spec/features/consumer/cookies_spec.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/enterprise_fee_applicator.rb'
- 'lib/open_food_network/enterprise_fee_calculator.rb'
- 'lib/open_food_network/enterprise_issue_validator.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/open_food_network/scope_variants_for_search.rb'
- 'lib/reporting/line_items.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/reporting/reports/orders_and_fulfillment/distributor_totals_by_supplier_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/products_and_inventory/lettuce_share_report.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/spree/localized_number.rb'
- 'lib/tasks/data.rake'
@@ -145,12 +128,10 @@ Layout/LineLength:
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
- 'spec/controllers/api/v0/base_controller_spec.rb'
- 'spec/controllers/api/v0/enterprises_controller_spec.rb'
- 'spec/controllers/api/v0/exchange_products_controller_spec.rb'
- 'spec/controllers/api/v0/logos_controller_spec.rb'
- 'spec/controllers/api/v0/order_cycles_controller_spec.rb'
- 'spec/controllers/api/v0/orders_controller_spec.rb'
- 'spec/controllers/api/v0/product_images_controller_spec.rb'
- 'spec/controllers/api/v0/products_controller_spec.rb'
- 'spec/controllers/api/v0/promo_images_controller_spec.rb'
- 'spec/controllers/api/v0/terms_and_conditions_controller_spec.rb'
@@ -164,7 +145,6 @@ Layout/LineLength:
- 'spec/controllers/spree/admin/orders/invoices_spec.rb'
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/reports_controller_spec.rb'
- 'spec/controllers/spree/admin/variants_controller_spec.rb'
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
- 'spec/controllers/spree/orders_controller_spec.rb'
@@ -187,13 +167,9 @@ Layout/LineLength:
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
- 'spec/lib/reports/customers_report_spec.rb'
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
- 'spec/lib/reports/order_grouper_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
- 'spec/lib/reports/packing/packing_report_spec.rb'
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/lib/reports/xero_invoices_report_spec.rb'
- 'spec/lib/stripe/authorize_response_patcher_spec.rb'
- 'spec/mailers/order_mailer_spec.rb'
- 'spec/mailers/producer_mailer_spec.rb'
- 'spec/mailers/subscription_mailer_spec.rb'
@@ -201,7 +177,6 @@ Layout/LineLength:
- 'spec/models/concerns/calculated_adjustments_spec.rb'
- 'spec/models/concerns/order_shipment_spec.rb'
- 'spec/models/concerns/product_stock_spec.rb'
- 'spec/models/enterprise_group_spec.rb'
- 'spec/models/enterprise_relationship_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/models/exchange_spec.rb'
@@ -227,7 +202,6 @@ Layout/LineLength:
- 'spec/models/tag_rule/filter_payment_methods_spec.rb'
- 'spec/models/tag_rule/filter_products_spec.rb'
- 'spec/models/tag_rule/filter_shipping_methods_spec.rb'
- 'spec/models/terms_of_service_file_spec.rb'
- 'spec/models/variant_override_spec.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
@@ -287,6 +261,7 @@ Layout/LineLength:
- 'spec/system/admin/variant_overrides_spec.rb'
- 'spec/system/consumer/authentication_spec.rb'
- 'spec/system/consumer/caching/shops_caching_spec.rb'
- 'spec/system/consumer/cookies_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/checkout_auth_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
@@ -300,35 +275,20 @@ Layout/LineLength:
- 'spec/views/spree/admin/payment_methods/index.html.haml_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/MultilineBlockLayout:
Exclude:
- 'spec/lib/reports/report_renderer_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'lib/reporting/queries/joins.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Layout/MultilineMethodCallIndentation:
Exclude:
- 'lib/reporting/reports/customers/customers_report.rb'
# Offense count: 20
# Cop supports --auto-correct.
# Offense count: 22
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
- 'spec/system/admin/enterprises_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/shipping_methods_spec.rb'
- 'spec/system/flatpickr_spec.rb'
@@ -357,6 +317,7 @@ Lint/DuplicateMethods:
- 'lib/discourse/single_sign_on.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/DuplicateRequire:
Exclude:
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
@@ -378,9 +339,8 @@ Lint/IneffectiveAccessModifier:
Exclude:
- 'app/models/spree/user.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
Lint/RedundantSafeNavigation:
@@ -388,6 +348,7 @@ Lint/RedundantSafeNavigation:
- 'app/models/spree/payment.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!, in?
Lint/SafeNavigationChain:
@@ -396,22 +357,21 @@ Lint/SafeNavigationChain:
- 'app/models/spree/stock/availability_validator.rb'
# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/reporting/queries/query_interface.rb'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: AllowComments.
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
Exclude:
- 'app/controllers/spree/user_registrations_controller.rb'
- 'app/models/spree/gateway.rb'
# Offense count: 38
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
# Offense count: 28
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -433,20 +393,14 @@ Metrics/AbcSize:
- 'app/models/spree/return_authorization.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/customers/customers_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/orders_and_distributors/orders_and_distributors_report.rb'
- 'lib/reporting/reports/packing/customer.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/tasks/enterprises.rake'
- 'spec/services/order_checkout_restart_spec.rb'
# Offense count: 43
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
# Offense count: 42
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
- 'app/models/spree/order/checkout.rb'
@@ -474,7 +428,6 @@ Metrics/BlockLength:
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/swagger_helper.rb'
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
# Offense count: 1
@@ -483,7 +436,7 @@ Metrics/BlockNesting:
Exclude:
- 'app/models/spree/payment/processing.rb'
# Offense count: 50
# Offense count: 45
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
@@ -502,7 +455,6 @@ Metrics/ClassLength:
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/models/enterprise.rb'
@@ -529,16 +481,13 @@ Metrics/ClassLength:
- 'engines/order_management/app/services/order_management/order/updater.rb'
- 'lib/open_food_network/enterprise_fee_calculator.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/permissions.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/open_food_network/permissions.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
# Offense count: 39
# Configuration parameters: IgnoredMethods, Max.
# Offense count: 35
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -565,18 +514,14 @@ Metrics/CyclomaticComplexity:
- 'app/models/spree/zone.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/enterprise_issue_validator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/customers/customers_report.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/spree/core/controller_helpers/respond_with.rb'
- 'lib/spree/localized_number.rb'
- 'spec/models/product_importer_spec.rb'
# Offense count: 32
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
# Offense count: 26
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/MethodLength:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -593,15 +538,12 @@ Metrics/MethodLength:
- 'app/models/spree/preferences/preferable_class_methods.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/tasks/sample_data/product_factory.rb'
# Offense count: 54
# Offense count: 51
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
@@ -641,9 +583,6 @@ Metrics/ModuleLength:
- 'spec/lib/reports/customers_report_spec.rb'
- 'spec/lib/reports/enterprise_fee_summary/authorizer_spec.rb'
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
- 'spec/lib/reports/order_grouper_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/customer_totals_report_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/models/spree/adjustment_spec.rb'
@@ -670,8 +609,8 @@ Metrics/ParameterLists:
- 'spec/support/controller_requests_helper.rb'
- 'spec/system/admin/reports_spec.rb'
# Offense count: 7
# Configuration parameters: IgnoredMethods, Max.
# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
Metrics/PerceivedComplexity:
Exclude:
- 'app/controllers/spree/admin/taxons_controller.rb'
@@ -679,10 +618,8 @@ Metrics/PerceivedComplexity:
- 'app/models/enterprise_relationship.rb'
- 'app/models/spree/ability.rb'
- 'app/models/spree/order/checkout.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
# Offense count: 9
# Offense count: 8
Naming/AccessorMethodName:
Exclude:
- 'app/controllers/spree/admin/taxonomies_controller.rb'
@@ -716,8 +653,8 @@ Naming/MethodParameterName:
Exclude:
- 'app/services/process_payment_intent.rb'
# Offense count: 30
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
# Offense count: 28
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
@@ -725,7 +662,6 @@ Naming/VariableNumber:
- 'app/controllers/spree/orders_controller.rb'
- 'app/models/content_configuration.rb'
- 'app/models/preference_sections/main_links_section.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 'spec/controllers/spree/admin/search_controller_spec.rb'
- 'spec/factories/stock_location_factory.rb'
@@ -741,13 +677,13 @@ Rails/ActiveRecordOverride:
- 'app/models/spree/product.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationController:
Exclude:
- 'engines/dfc_provider/app/controllers/dfc_provider/api/base_controller.rb'
# Offense count: 6
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationJob:
Exclude:
- 'app/jobs/bulk_invoice_job.rb'
@@ -758,19 +694,13 @@ Rails/ApplicationJob:
- 'app/jobs/subscription_placement_job.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/spree/base_mailer.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationRecord:
Exclude:
- 'lib/tasks/data/remove_transient_data.rb'
# Offense count: 5
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
Rails/Blank:
Exclude:
@@ -796,7 +726,7 @@ Rails/FilePath:
- 'spec/models/content_configuration_spec.rb'
- 'spec/support/downloads_helper.rb'
# Offense count: 11
# Offense count: 12
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
@@ -804,6 +734,7 @@ Rails/HasAndBelongsToMany:
- 'app/models/concerns/payment_method_distributors.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/order_cycle.rb'
- 'app/models/spree/line_item.rb'
- 'app/models/spree/option_value.rb'
- 'app/models/spree/role.rb'
@@ -812,7 +743,7 @@ Rails/HasAndBelongsToMany:
- 'app/models/spree/variant.rb'
- 'app/models/spree/zone.rb'
# Offense count: 47
# Offense count: 45
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
@@ -838,9 +769,8 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/spree/taxonomy.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
- 'app/models/subscription.rb'
# Offense count: 59
# Offense count: 62
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
@@ -881,7 +811,7 @@ Rails/InverseOf:
# Offense count: 38
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/admin/enterprise_groups_controller.rb'
@@ -904,10 +834,9 @@ Rails/LexicallyScopedActionFilter:
- 'app/controllers/spree/admin/zones_controller.rb'
- 'app/controllers/spree/users_controller.rb'
# Offense count: 19
# Offense count: 18
Rails/OutputSafety:
Exclude:
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/helpers/angular_form_helper.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/reports_helper.rb'
@@ -922,7 +851,7 @@ Rails/OutputSafety:
- 'spec/system/admin/order_print_ticket_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RelativeDateConstant:
Exclude:
- 'lib/tasks/data/remove_transient_data.rb'
@@ -936,7 +865,7 @@ Rails/SkipsModelValidations:
- 'spec/models/spree/line_item_spec.rb'
# Offense count: 5
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Rails/TimeZone:
@@ -971,20 +900,20 @@ Security/Open:
- 'app/services/image_importer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Style/BlockComments:
Exclude:
- 'spec/system/admin/tag_rules_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnConstant.
Style/CaseEquality:
Exclude:
- 'spec/models/spree/payment_spec.rb'
# Offense count: 3
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CaseLikeIf:
Exclude:
- 'app/controllers/admin/order_cycles_controller.rb'
@@ -992,7 +921,7 @@ Style/CaseLikeIf:
- 'app/models/spree/payment/processing.rb'
# Offense count: 25
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
@@ -1027,13 +956,14 @@ Style/ClassVars:
- 'lib/spree/core/delegate_belongs_to.rb'
# Offense count: 2
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns, IgnoredMethods.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
@@ -1041,7 +971,7 @@ Style/FrozenStringLiteralComment:
- '.simplecov'
# Offense count: 6
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:
Exclude:
- 'lib/tasks/data.rake'
@@ -1050,8 +980,8 @@ Style/GlobalStdStream:
- 'lib/tasks/subscriptions/debug.rake'
- 'lib/tasks/subscriptions/test.rake'
# Offense count: 39
# Configuration parameters: MinBodyLength.
# Offense count: 40
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -1085,8 +1015,8 @@ Style/HashLikeCase:
- 'app/models/enterprise.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'spec/system/flatpickr_spec.rb'
@@ -1098,22 +1028,8 @@ Style/MissingRespondToMissing:
- 'app/models/spree/gateway.rb'
- 'app/models/spree/preferences/configuration.rb'
# Offense count: 1
Style/MixinUsage:
Exclude:
- 'lib/reporting/reports/orders_and_fulfillment/orders_and_fulfillment_report.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/reporting/report_template.rb'
- 'lib/reporting/reports/packing/base.rb'
# Offense count: 22
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Style/NestedModifier:
Exclude:
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
@@ -1127,7 +1043,7 @@ Style/NestedModifier:
- 'spec/system/admin/payments_stripe_spec.rb'
- 'spec/system/admin/reports_spec.rb'
# Offense count: 26
# Offense count: 17
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
@@ -1139,7 +1055,6 @@ Style/OptionalBooleanParameter:
- 'app/models/enterprise_relationship.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/spree/order_contents.rb'
- 'app/models/spree/preferences/file_configuration.rb'
- 'app/models/spree/shipment.rb'
- 'engines/order_management/app/services/order_management/stock/estimator.rb'
- 'lib/spree/core/controller_helpers/order.rb'
@@ -1147,7 +1062,7 @@ Style/OptionalBooleanParameter:
- 'spec/support/request/web_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
@@ -1155,13 +1070,13 @@ Style/PreferredHashMethods:
- 'app/controllers/api/v0/shipments_controller.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
# Offense count: 205
# Offense count: 209
Style/Send:
Exclude:
- 'app/controllers/split_checkout_controller.rb'
@@ -1195,17 +1110,16 @@ Style/Send:
- 'spec/services/cart_service_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/variant_units/option_value_namer_spec.rb'
- 'spec/spec_helper.rb'
- 'spec/support/localized_number_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SingleArgumentDig:
Exclude:
- 'app/services/checkout/form_data_adapter.rb'
# Offense count: 4
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'app/helpers/spree/admin/navigation_helper.rb'
@@ -1213,8 +1127,8 @@ Style/SlicingWithRange:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'lib/discourse/single_sign_on.rb'
# Offense count: 28
# Cop supports --auto-correct.
# Offense count: 29
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:

19
Gemfile
View File

@@ -97,14 +97,15 @@ gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem "cable_ready", "5.0.0.pre3"
gem "cable_ready", "5.0.0.pre9"
gem "stimulus_reflex", "3.5.0.pre9"
gem 'combine_pdf'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'immigrant'
gem 'roo', github: "roo-rb/roo" # master is currently needed for Ruby 3.x (awaiting new release)
gem 'roo'
gem 'spreadsheet_architect'
gem 'whenever', require: false
@@ -115,7 +116,6 @@ gem 'coffee-rails', '~> 5.0.0'
gem 'mini_racer', '0.4.0'
gem 'uglifier', '>= 1.0.3'
gem 'angular_rails_csrf'
@@ -131,7 +131,7 @@ gem 'flipper'
gem 'flipper-active_record'
gem 'flipper-ui'
gem "view_component", require: "view_component/engine"
gem "view_component"
group :production, :staging do
gem 'ddtrace'
@@ -140,8 +140,6 @@ group :production, :staging do
end
group :test, :development do
# Pretty printed test output
gem 'awesome_print'
gem 'bullet'
gem 'capybara'
gem 'cuprite'
@@ -154,18 +152,17 @@ group :test, :development do
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry'
gem 'rswag-specs'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'webdrivers'
gem 'debug', '>= 1.0.0'
end
group :test do
gem 'byebug'
gem 'pdf-reader'
gem 'rails-controller-testing'
gem 'simplecov', require: false
gem 'test-prof'
gem 'vcr'
gem 'webmock'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
@@ -173,17 +170,17 @@ end
group :development do
gem 'debugger-linecache'
gem 'rails-erd'
gem 'foreman'
gem 'listen'
gem 'pry', '~> 0.13.0'
gem 'pry-byebug', '~> 3.9.0'
gem 'rubocop'
gem 'rubocop-rails'
gem 'spring'
gem 'spring-commands-rspec'
gem 'web-console'
gem "view_component_storybook", require: "view_component/storybook/engine"
gem "view_component_storybook"
gem 'rack-mini-profiler', '< 3.0.0'
end

View File

@@ -24,14 +24,6 @@ GIT
sass-rails
thor (>= 0.14)
GIT
remote: https://github.com/roo-rb/roo.git
revision: 709464c77623be2bc09b2103405d90ded7604a75
specs:
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
PATH
remote: engines/catalog
specs:
@@ -59,67 +51,67 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
actioncable (6.1.7)
actionpack (= 6.1.7)
activesupport (= 6.1.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailbox (6.1.7)
actionpack (= 6.1.7)
activejob (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
mail (>= 2.7.1)
actionmailer (6.1.4.4)
actionpack (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailer (6.1.7)
actionpack (= 6.1.7)
actionview (= 6.1.7)
activejob (= 6.1.7)
activesupport (= 6.1.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.4)
actionview (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionpack (6.1.7)
actionview (= 6.1.7)
activesupport (= 6.1.7)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actiontext (6.1.4.4)
actionpack (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actiontext (6.1.7)
actionpack (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
nokogiri (>= 1.8.5)
actionview (6.1.4.4)
activesupport (= 6.1.4.4)
actionview (6.1.7)
activesupport (= 6.1.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
active_storage_validations (0.9.7)
active_storage_validations (0.9.8)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
activejob (6.1.4.4)
activesupport (= 6.1.4.4)
activejob (6.1.7)
activesupport (= 6.1.7)
globalid (>= 0.3.6)
activemerchant (1.123.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (6.1.4.4)
activesupport (= 6.1.4.4)
activerecord (6.1.4.4)
activemodel (= 6.1.4.4)
activesupport (= 6.1.4.4)
activerecord-import (1.3.0)
activemodel (6.1.7)
activesupport (= 6.1.7)
activerecord (6.1.7)
activemodel (= 6.1.7)
activesupport (= 6.1.7)
activerecord-import (1.4.0)
activerecord (>= 4.2)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -129,14 +121,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activesupport (= 6.1.4.4)
marcel (~> 1.0.0)
activestorage (6.1.7)
actionpack (= 6.1.7)
activejob (= 6.1.7)
activerecord (= 6.1.7)
activesupport (= 6.1.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.4)
activesupport (6.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -146,59 +138,63 @@ GEM
activerecord (>= 5.0, < 6.2)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
angular-rails-templates (1.1.0)
railties (>= 4.2, < 7)
angular-rails-templates (1.2.0)
railties (>= 5.0, < 7.1)
sprockets (>= 3.0, < 5)
sprockets-rails
tilt
angular_rails_csrf (4.5.0)
railties (>= 3, < 7)
angular_rails_csrf (5.0.0)
railties (>= 3, < 8)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.8.0)
arel-helpers (2.12.1)
activerecord (>= 3.1.0, < 7)
arel-helpers (2.14.0)
activerecord (>= 3.1.0, < 8)
ast (2.4.2)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
awesome_print (1.9.2)
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.570.0)
aws-sdk-core (3.130.0)
aws-partitions (1.601.0)
aws-sdk-core (3.131.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.55.0)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.57.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.113.0)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
aws-sigv4 (1.5.0)
aws-eventstream (~> 1, >= 1.0.2)
axlsx_styler (1.1.0)
activesupport (>= 3.1)
caxlsx (>= 2.0.2)
bcrypt (3.1.16)
bcrypt (3.1.18)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.10.1)
bootsnap (1.13.0)
msgpack (~> 1.2)
bugsnag (6.24.2)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (6.1.5)
bullet (7.0.3)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cable_ready (5.0.0.pre3)
rails (>= 5.2)
cable_ready (5.0.0.pre9)
actioncable (>= 5.2)
actionpack (>= 5.2)
actionview (>= 5.2)
activerecord (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.36.0)
capybara (3.37.1)
addressable
matrix
mini_mime (>= 0.1.3)
@@ -212,7 +208,7 @@ GEM
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
childprocess (4.1.0)
choice (0.2.0)
chronic (0.10.2)
cliver (0.3.2)
coderay (1.1.3)
@@ -223,14 +219,15 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
combine_pdf (1.0.21)
combine_pdf (1.0.22)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
connection_pool (2.3.0)
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.9.0)
css_parser (1.11.0)
addressable
cuprite (0.13)
capybara (>= 2.1, < 4)
@@ -245,8 +242,11 @@ GEM
debase-ruby_core_source (= 0.10.12)
msgpack
debase-ruby_core_source (0.10.12)
debug (1.6.2)
irb (>= 1.3.6)
reline (>= 0.3.1)
debugger-linecache (1.2.0)
devise (4.8.0)
devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@@ -254,21 +254,20 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-i18n (1.10.0)
devise-i18n (1.10.2)
devise (>= 4.8.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
diff-lcs (1.5.0)
digest (3.1.0)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
dry-inflector (0.2.1)
e2mmap (0.1.0)
erubi (1.10.0)
et-orbi (1.2.4)
erubi (1.11.0)
et-orbi (1.2.7)
tzinfo
excon (0.81.0)
execjs (2.7.0)
@@ -277,15 +276,10 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
faraday (2.3.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
faraday-net_http (2.0.3)
ferrum (0.11)
addressable (~> 2.5)
cliver (~> 0.3)
@@ -319,13 +313,13 @@ GEM
nokogiri (>= 1.5.11, < 2.0.0)
foreman (0.87.2)
formatador (0.2.5)
fugit (1.4.5)
et-orbi (~> 1.1, >= 1.1.8)
fugit (1.5.3)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.7.0)
geocoder (1.8.1)
globalid (1.0.0)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
@@ -340,7 +334,7 @@ GEM
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
i18n (1.8.10)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
i18n (>= 0.6.6)
@@ -349,7 +343,10 @@ GEM
ruby-vips (>= 2.0.17, < 3)
immigrant (0.3.6)
activerecord (>= 3.0)
io-console (0.5.11)
ipaddress (0.8.3)
irb (1.4.1)
reline (>= 0.3.0)
jmespath (1.6.1)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
@@ -357,7 +354,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (2.6.1)
json (2.6.2)
json-schema (2.8.1)
addressable (>= 2.4)
json_spec (1.1.5)
@@ -365,13 +362,13 @@ GEM
rspec (>= 2.0, < 4.0)
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.3.0)
jwt (2.5.0)
knapsack (4.0.0)
rake
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
libv8-node (15.14.0.1)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
@@ -395,41 +392,41 @@ GEM
mini_portile2 (2.8.0)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.16.1)
minitest (5.16.3)
monetize (1.12.0)
money (~> 6.12)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.4.2)
msgpack (1.5.4)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.13.6)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
oauth2 (1.4.10)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
pagy (5.1.2)
pagy (5.10.1)
activesupport
paper_trail (12.1.0)
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.21.0)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.1.0.0)
parallel (1.22.1)
paranoia (2.6.0)
activerecord (>= 5.1, < 7.1)
parser (3.1.2.1)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.5.0)
pdf-reader (2.10.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -440,16 +437,13 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
public_suffix (4.0.6)
puma (5.6.4)
public_suffix (5.0.0)
puma (5.6.5)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.0)
rack (2.2.3.1)
rack-mini-profiler (2.3.3)
rack (2.2.4)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
@@ -458,23 +452,23 @@ GEM
rack-rewrite (1.5.1)
rack-ssl (1.4.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.6.0)
rails (6.1.4.4)
actioncable (= 6.1.4.4)
actionmailbox (= 6.1.4.4)
actionmailer (= 6.1.4.4)
actionpack (= 6.1.4.4)
actiontext (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activemodel (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
rack-test (2.0.2)
rack (>= 1.3)
rack-timeout (0.6.3)
rails (6.1.7)
actioncable (= 6.1.7)
actionmailbox (= 6.1.7)
actionmailer (= 6.1.7)
actionpack (= 6.1.7)
actiontext (= 6.1.7)
actionview (= 6.1.7)
activejob (= 6.1.7)
activemodel (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
bundler (>= 1.15.0)
railties (= 6.1.4.4)
railties (= 6.1.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -483,17 +477,22 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-erd (1.7.2)
activerecord (>= 4.2)
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rails-i18n (7.0.1)
rails-i18n (7.0.5)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
rails_safe_tasks (1.0.0)
railties (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
railties (6.1.7)
actionpack (= 6.1.7)
activesupport (= 6.1.7)
method_source
rake (>= 0.13)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
@@ -505,37 +504,42 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.5.1)
regexp_parser (2.2.0)
redis (4.8.0)
regexp_parser (2.5.0)
reline (0.3.1)
io-console (~> 0.5)
request_store (1.5.0)
rack (>= 1.4)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
roadie (4.0.0)
roadie (5.0.1)
css_parser (~> 1.4)
nokogiri (~> 1.8)
roadie-rails (2.2.0)
railties (>= 5.1, < 6.2)
roadie (>= 3.1, < 5.0)
roadie-rails (3.0.0)
railties (>= 5.1, < 7.1)
roadie (~> 5.0)
rodf (1.1.1)
builder (>= 3.0)
dry-inflector (~> 0.1)
rubyzip (>= 1.0)
roo (2.9.0)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-core (3.10.2)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rspec-expectations (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.2)
rspec-rails (5.1.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -545,38 +549,41 @@ GEM
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.2)
rswag-api (2.4.0)
railties (>= 3.1, < 7.0)
rswag-specs (2.4.0)
activesupport (>= 3.1, < 7.0)
rspec-support (3.10.3)
rswag-api (2.6.0)
railties (>= 3.1, < 7.1)
rswag-specs (2.6.0)
activesupport (>= 3.1, < 7.1)
json-schema (~> 2.2)
railties (>= 3.1, < 7.0)
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (1.22.2)
railties (>= 3.1, < 7.1)
rswag-ui (2.6.0)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.36.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.20.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-rails (2.13.2)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
rubocop-rails (2.16.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop (>= 1.33.0, < 2.0)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.4)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (3.7.0)
rufus-scheduler (3.8.1)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
sass-rails (5.0.8)
@@ -586,23 +593,17 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
selenium-webdriver (4.0.3)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
shoulda-matchers (5.0.0)
shoulda-matchers (5.2.0)
activesupport (>= 5.2.0)
sidekiq (6.3.1)
connection_pool (>= 2.2.2)
sidekiq (6.5.7)
connection_pool (>= 2.2.5)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq-scheduler (4.0.2)
redis (>= 4.2.0)
sidekiq-scheduler (3.1.0)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
sidekiq (>= 4)
tilt (>= 1.4.0)
simplecov (0.21.2)
docile (~> 1.1)
@@ -614,7 +615,7 @@ GEM
axlsx_styler (>= 1.0.0, < 2)
caxlsx (>= 2.0.2, < 4)
rodf (>= 1.0.0, < 2)
spring (3.0.0)
spring (4.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
@@ -631,45 +632,52 @@ GEM
state_machines-activerecord (0.8.0)
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stimulus_reflex (3.5.0.pre9)
actioncable (>= 5.2)
actionpack (>= 5.2)
actionview (>= 5.2)
activesupport (>= 5.2)
cable_ready (>= 5.0.0.pre9)
nokogiri
rack
railties (>= 5.2)
redis
stringex (2.8.5)
stripe (5.42.0)
stripe (7.1.0)
temple (0.8.2)
test-prof (1.0.7)
test-unit (3.5.0)
test-prof (1.0.10)
test-unit (3.5.5)
power_assert
thor (1.2.1)
thread-local (1.1.0)
thwait (0.2.0)
e2mmap
tilt (2.0.10)
timecop (0.9.4)
tilt (2.0.11)
timecop (0.9.5)
ttfunk (1.7.0)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.1.0)
uniform_notifier (1.14.2)
valid_email2 (4.0.0)
unicode-display_width (2.3.0)
uniform_notifier (1.16.0)
valid_email2 (4.0.4)
activemodel (>= 3.2)
mail (~> 2.5)
view_component (2.41.0)
vcr (6.1.0)
activesupport (>= 5.0.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
view_component_storybook (0.10.1)
view_component (2.74.0)
activesupport (>= 5.0.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
view_component_storybook (0.11.1)
view_component (>= 2.36)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.1.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.14.0)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -683,7 +691,7 @@ GEM
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
wicked_pdf (2.1.0)
wicked_pdf (2.6.3)
activesupport
wkhtmltopdf-binary (0.12.6.5)
xml-simple (1.1.8)
@@ -710,14 +718,12 @@ DEPENDENCIES
angularjs-rails (= 1.8.0)
arel-helpers (~> 2.12)
awesome_nested_set
awesome_print
aws-sdk-s3
bigdecimal (= 3.0.2)
bootsnap
bugsnag
bullet
byebug
cable_ready (= 5.0.0.pre3)
cable_ready (= 5.0.0.pre9)
cancancan (~> 1.15.0)
capybara
catalog!
@@ -727,6 +733,7 @@ DEPENDENCIES
database_cleaner
db2fog!
ddtrace
debug (>= 1.0.0)
debugger-linecache
devise
devise-encryptable
@@ -776,7 +783,6 @@ DEPENDENCIES
pdf-reader
pg (~> 1.2.3)
pry (~> 0.13.0)
pry-byebug (~> 3.9.0)
puma
rack-mini-profiler (< 3.0.0)
rack-rewrite
@@ -784,6 +790,7 @@ DEPENDENCIES
rack-timeout
rails (>= 6.1.4)
rails-controller-testing
rails-erd
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (= 2.4.2)
@@ -792,7 +799,7 @@ DEPENDENCIES
responders
rexml
roadie-rails
roo!
roo
rspec-rails (>= 3.5.2)
rspec-retry
rswag-api
@@ -802,7 +809,6 @@ DEPENDENCIES
rubocop-rails
sd_notify
select2-rails!
selenium-webdriver
shoulda-matchers
sidekiq
sidekiq-scheduler
@@ -811,18 +817,18 @@ DEPENDENCIES
spring
spring-commands-rspec
state_machines-activerecord
stimulus_reflex (= 3.5.0.pre9)
stringex (~> 2.8.5)
stripe
test-prof
test-unit (~> 3.5)
timecop
uglifier (>= 1.0.3)
valid_email2
vcr
view_component
view_component_storybook
web!
web-console
webdrivers
webmock
webpacker (~> 5)
whenever

View File

@@ -39,7 +39,7 @@ We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. B
## Licence
Copyright (c) 2012 - 2021 Open Food Foundation, released under the AGPL licence.
Copyright (c) 2012 - 2022 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://join.slack.com/t/openfoodnetwork/shared_invite/zt-9sjkjdlu-r02kUMP1zbrTgUhZhYPF~A

View File

@@ -105,6 +105,8 @@
//= require moment/locale/tr.js
//= require moment/locale/pl.js
//= require js-big-decimal/dist/web/js-big-decimal.min.js
// foundation
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js

View File

@@ -256,10 +256,10 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.packVariant = (product, variant) ->
if variant.hasOwnProperty("unit_value_with_description")
match = variant.unit_value_with_description.match(/^([\d\.]+(?= |$)|)( |)(.*)$/)
match = variant.unit_value_with_description.match(/^([\d\.\,]+(?= |$)|)( |)(.*)$/)
if match
product = BulkProducts.find product.id
variant.unit_value = parseFloat(match[1])
variant.unit_value = parseFloat(match[1].replace(",", "."))
variant.unit_value = null if isNaN(variant.unit_value)
variant.unit_value *= product.variant_unit_scale if variant.unit_value && product.variant_unit_scale
variant.unit_description = match[3]

View File

@@ -39,9 +39,9 @@ angular.module("ofn.admin").directive "ofnDisplayAs", (OptionValueNamer) ->
# get relevant variant properties
variant = scope.$eval(attrs.ofnDisplayAs) # Like this so we can switch between 'master' and 'variant'
if variant.unit_value_with_description?
match = variant.unit_value_with_description.match(/^([\d\.]+(?= |$)|)( |)(.*)$/)
match = variant.unit_value_with_description.match(/^([\d\.\,]+(?= |$)|)( |)(.*)$/)
if match
unit_value = parseFloat(match[1])
unit_value = parseFloat(match[1].replace(",", "."))
unit_value = null if isNaN(unit_value)
unit_value *= variant_unit_scale if unit_value && variant_unit_scale
unit_description = match[3]

View File

@@ -10,6 +10,7 @@
scope.$emit "offClick"
element.click (event) ->
return if event.target.closest(".ofn-drop-down").classList.contains "disabled" || event.target.classList.contains "disabled"
if !scope.expanded
event.stopPropagation()
scope.deregistrationCallback = scope.$on "offClick", ->

View File

@@ -1,15 +0,0 @@
angular.module("admin.enterprise_groups")
.controller "sideMenuCtrl", ($scope, SideMenu) ->
$scope.menu = SideMenu
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-user" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'contact', label: t('admin_enterprise_groups_contact'), icon_class: "icon-phone" }
{ name: 'web', label: t('admin_enterprise_groups_web'), icon_class: "icon-globe" }
]
$scope.select(0)

View File

@@ -1,20 +0,0 @@
# Used in enterprise new and edit forms to reset the state when the country is changed
angular.module("admin.enterprises").controller 'countryCtrl', ($scope, $timeout, availableCountries) ->
$scope.address_type = "address"
$scope.countries = availableCountries
$scope.countriesById = $scope.countries.reduce (obj, country) ->
obj[country.id] = country
obj
, {}
$timeout ->
$scope.$watch 'Enterprise.' + $scope.address_type + '.country_id', (newID, oldID) ->
$scope.clearState() unless $scope.addressStateMatchesCountry()
$scope.clearState = ->
$scope.Enterprise[$scope.address_type].state_id = null
$scope.addressStateMatchesCountry = ->
$scope.countriesById[$scope.Enterprise[$scope.address_type].country_id].states.some (state) ->
state.id == $scope.Enterprise[$scope.address_type].state_id

View File

@@ -1,9 +1,8 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage, RequestMonitor) ->
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, SideMenu, StatusMessage, RequestMonitor) ->
$scope.Enterprise = enterprise
$scope.Enterprises = Enterprises
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear
$scope.menu = SideMenu
$scope.newManager = { id: null, email: (t('add_manager')) }

View File

@@ -1,27 +0,0 @@
angular.module("admin.enterprises")
.controller "permalinkCtrl", ($scope, PermalinkChecker) ->
# locals
initialPermalink = $scope.Enterprise.permalink
pendingRequest = null
# variables on $scope
$scope.availablility = ""
$scope.checking = false
$scope.$watch "Enterprise.permalink", (newValue, oldValue) ->
if newValue == initialPermalink
$scope.availability = ""
return
$scope.checking = true
pendingRequest = PermalinkChecker.check(newValue)
pendingRequest.then (data) ->
if data.permalink == initialPermalink
$scope.availability = ""
else
$scope.availability = data.available
$scope.Enterprise.permalink = data.permalink
$scope.checking = false
, (data) ->
# Do nothing (this is hopefully an aborted request)

View File

@@ -1,49 +0,0 @@
angular.module("admin.enterprises")
.controller "sideMenuCtrl", ($scope, $parse, enterprise, SideMenu, enterprisePermissions) ->
$scope.Enterprise = enterprise
$scope.menu = SideMenu
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-home" }
{ name: 'address', label: t('address'), icon_class: "icon-map-marker" }
{ name: 'contact', label: t('contact'), icon_class: "icon-phone" }
{ name: 'social', label: t('social'), icon_class: "icon-twitter" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'business_details', label: t('business_details'), icon_class: "icon-briefcase" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'properties', label: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
{ name: 'shipping_methods', label: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: 'payment_methods', label: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: 'enterprise_fees', label: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: 'enterprise_permissions', label: t('enterprise_permissions'), icon_class: "icon-plug" }
{ name: 'inventory_settings', label: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
{ name: 'tag_rules', label: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
{ name: 'shop_preferences', label: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
]
SideMenu.init()
$scope.showItem = (item) ->
if item.show?
$parse(item.show)($scope)
else
true
$scope.showProperties = ->
!!$scope.Enterprise.is_primary_producer
$scope.showShippingMethods = ->
enterprisePermissions.can_manage_shipping_methods && $scope.Enterprise.sells != "none"
$scope.showPaymentMethods = ->
enterprisePermissions.can_manage_payment_methods && $scope.Enterprise.sells != "none"
$scope.showEnterpriseFees = ->
enterprisePermissions.can_manage_enterprise_fees && ($scope.Enterprise.sells != "none" || $scope.Enterprise.is_primary_producer)
$scope.enterpriseIsShop = ->
$scope.Enterprise.sells != "none"
$scope.menu.redirect_function('enterprise_permissions', '/admin/enterprise_relationships')

View File

@@ -1,20 +0,0 @@
angular.module("admin.enterprises")
.factory "EnterpriseShippingMethods", (enterprise, ShippingMethods) ->
new class EnterpriseShippingMethods
shippingMethods: ShippingMethods.all
constructor: ->
for shipping_method in @shippingMethods
shipping_method.selected = shipping_method.id in enterprise.shipping_method_ids
displayColor: ->
if @shippingMethods.length > 0 && @selectedCount() > 0
"blue"
else
"red"
selectedCount: ->
@shippingMethods.reduce (count, shipping_method) ->
count++ if shipping_method.selected
count
, 0

View File

@@ -0,0 +1,14 @@
angular.module("admin.orders").controller "bulkCancelCtrl", ($scope, $http, $timeout) ->
$scope.cancelOrder = (orderIds, sendEmailCancellation, restock_items) ->
$http(
method: 'post'
url: "/admin/orders/bulk_cancel?order_ids=#{orderIds}&send_cancellation_email=#{sendEmailCancellation}&restock_items=#{restock_items}" ).then(->
window.location.reload()
)
$scope.cancelSelectedOrders = ->
ofnCancelOrderAlert((confirm, sendEmailCancellation, restock_items) ->
if confirm
$scope.cancelOrder $scope.selected_orders, sendEmailCancellation, restock_items
)

View File

@@ -20,7 +20,7 @@ angular.module("admin.orders").controller "orderCtrl", ($scope, shops, orderCycl
$scope.distributor_id && $scope.order_cycle_id
for oc in $scope.orderCycles
oc.name_and_status = "#{oc.name} (#{oc.status})"
oc.name_and_status = "#{oc.name} (#{t("admin.order_cycles.status.#{oc.status}")})"
for shop in $scope.shops
shop.disabled = !$scope.distributorHasOrderCycles(shop)

View File

@@ -32,7 +32,7 @@ angular.module("admin.products")
if match
$scope.product.master.unit_value = PriceParser.parse(match[1])
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_value = window.bigDecimal.multiply($scope.product.master.unit_value, $scope.product.variant_unit_scale, 2) if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_description = match[3]
else
value = $scope.product.master.unit_value

View File

@@ -23,10 +23,10 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
$scope.updateValue = ->
unit_value_human = angular.element('#unit_value_human').val()
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
$scope.unit_value = bigDecimal.multiply(PriceParser.parse(unit_value_human), $scope.scale, 2)
variant_unit_value = angular.element('#variant_unit_value').val()
$scope.unit_value_human = variant_unit_value / $scope.scale
$scope.unit_value_human = parseFloat(bigDecimal.divide(variant_unit_value, $scope.scale, 2))
$timeout -> $scope.processUnitPrice()
$timeout -> $scope.updateValue()

View File

@@ -13,3 +13,9 @@ angular.module("ofn.admin").factory "ProductImageService", (FileUploader, SpreeA
@imageUploader.onSuccessItem = (image, response) =>
product.thumb_url = response.thumb_url
product.image_url = response.image_url
@imageUploader.onErrorItem = (image, response) =>
if Array.isArray(response.errors)
message = response.errors.join("\n")
else
message = response.error.toString()
alert(message)

View File

@@ -1,3 +0,0 @@
angular.module("admin.shippingMethods").controller "shippingMethodsCtrl", ($scope, ShippingMethods) ->
$scope.findShippingMethodByID = (id) ->
$scope.ShippingMethod = ShippingMethods.byID[id]

View File

@@ -39,25 +39,94 @@ $(document).ready(function() {
}
$('[data-hook=admin_order_edit_form] a.save-method').click(handle_shipping_method_save);
//handle tracking edit click
//handle tracking info edit/delete
// Show the input field to edit the tracking info
// And hide the input field when cancel is clicked
$('a.edit-tracking').click(toggleTrackingEdit);
$('a.cancel-tracking').click(toggleTrackingEdit);
handle_tracking_save = function(){
var link = $(this);
var shipment_number = link.data('shipment-number');
var tracking = link.parents('tbody').find('input#tracking').val();
var url = Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number + ".json");
saveTrackingInfo = function(){
let shipmentNumber = $(this).data('shipment-number');
let tracking = document.getElementById('tracking').value
makeApiCall(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } } )
}
deleteTrackingInfo = function(){
let shipmentNumber = $(this).data('shipment-number');
let tracking = ''
confirmDelete(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } })
}
trackingUrl = function(shipmentNumber){
return Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipmentNumber + ".json");
}
$('[data-hook=admin_order_edit_form] a.save-tracking').click(saveTrackingInfo);
$('[data-hook=admin_order_edit_form] a.delete-tracking').click(deleteTrackingInfo);
// handle note edit/delete
// Show the input field to edit the note
// And hide the input field when cancel is clicked
$('a.edit-note.icon-edit').click(toggleNoteEdit);
$('a.cancel-note').click(toggleNoteEdit);
saveNote = function(){
let note = document.getElementById('note').value
makeApiCall(getNoteUrl(), { note: note })
}
deleteNote = function(){
let note = ''
confirmDelete(getNoteUrl(), { note: note })
}
getNoteUrl = function(){
return Spree.url( Spree.routes.orders_api + "/" + order_number);
}
confirmDelete = function(url, params){
displayDeleteAlert(function(confirmation) {
if (confirmation) {
makeApiCall(url, params)
}
});
}
$('[data-hook=admin_order_edit_form] a.save-note').click(saveNote);
$('[data-hook=admin_order_edit_form] a.delete-note').click(deleteNote);
// Makes API call for notes/tracking info
makeApiCall = function(url, params) {
$.ajax({
type: "PUT",
url: url,
data: { shipment: { tracking: tracking } }
data: params
}).done(function( msg ) {
window.location.reload();
}).error(function( msg ) {
console.log(msg);
});
}
$('[data-hook=admin_order_edit_form] a.save-tracking').click(handle_tracking_save);
displayDeleteAlert = function(callback) {
i18nKey = "are_you_sure";
$('#custom-confirm .message').html(
` ${t(i18nKey)}
<div class="form">
</div>`);
$('#custom-confirm button.confirm').unbind( "click" ).click(() => {
$('#custom-confirm').hide();
callback(true);
});
$('#custom-confirm button.cancel').click(() => {
$('#custom-confirm').hide();
callback(false)
});
$('#custom-confirm').show();
}
});

View File

@@ -141,8 +141,26 @@ doAdjustItems = function(shipment_number, variant_id, quantity, inventory_units,
toggleTrackingEdit = function(){
var link = $(this);
link.parents('tbody').find('tr.edit-tracking').toggle();
link.parents('tbody').find('tr.show-tracking').toggle();
var parent_node = link.parents('tbody')
let input = parent_node.find('#tracking')[0]
parent_node.find('tr.edit-tracking').toggle();
// Set focus on input and
// put cursor at it's end
input.focus()
input.setSelectionRange(-1, -1)
parent_node.find('tr.show-tracking').toggle();
}
toggleNoteEdit = function(){
var link = $(this);
var parent_node = link.parents('tbody')
let input = parent_node.find('#note')[0]
parent_node.find('tr.edit-note').toggle();
// Set focus on input and
// put cursor at it's end
input.focus()
input.setSelectionRange(-1, -1)
parent_node.find('tr.show-note').toggle();
}
toggleMethodEdit = function(){

View File

@@ -1,29 +0,0 @@
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($rootScope, $compile, $window, $templateCache, DialogDefaults, shops) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
scope.submitted = false
scope.shops = shops
scope.shop_id = null
scope.newSubscription = ->
scope.new_subscription_form.$setPristine()
scope.submitted = true
if scope.shop_id?
$window.location.href = "/admin/subscriptions/new?subscription[shop_id]=#{scope.shop_id}"
return
# Compile modal template
template = $compile($templateCache.get('admin/new_subscription_dialog.html'))(scope)
# Set Dialog options
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
if shops.length == 1
scope.shop_id = shops[0].id
scope.newSubscription()
else
template.dialog('open')
$rootScope.$evalAsync()

View File

@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
templateUrl: "admin/tags_input.html"
scope:
object: "="
form: "="
tagsAttr: "@?"
tagListAttr: "@?"
findTags: "&"
@@ -18,7 +19,15 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
scope.limitReached = scope.object[scope.tagsAttr].length >= scope.max if scope.max != undefined
scope.object[scope.tagListAttr] = (tag.text for tag in scope.object[scope.tagsAttr]).join(",")
scope.$watch "object", (newObject) ->
scope.object = newObject
init()
$timeout ->
init()
init = ->
return unless scope.object
# Initialize properties if necessary
scope.tagsAttr ||= "tags"
scope.tagListAttr ||= "tag_list"

View File

@@ -5,15 +5,16 @@ angular.module("admin.utils").factory "ErrorsParser", ->
return defaultContent unless errors?
errorsString = ""
if errors.length > 0
if Array.isArray(errors)
# it is an array of errors
errorsString = errors.join("\n") + "\n"
else
else if typeof errors == "object"
# it is a hash of errors
keys = Object.keys(errors)
for key in keys
errorsString += errors[key].join("\n") + "\n"
else # string
errorsString = errors
this.defaultIfEmpty(errorsString, defaultContent)
defaultIfEmpty: (content, defaultContent) =>

View File

@@ -20,3 +20,6 @@ angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, $http, Credit
).finally ->
window.location.reload()
$scope.hasOneDefaultSavedCards = () ->
$scope.savedCreditCards.some((card) -> card.is_default)

View File

@@ -26,4 +26,8 @@ angular.module('mm.foundation.offcanvas').directive 'offCanvasWrap', ($window) -
# Bind hiding of the off-canvas that only happens when screen width is over 1024px.
win.bind 'resize.body', ->
isolatedScope.hide() if $(window).width() > 1024
win.bind 'click.body', (e) ->
if e.target.closest(".left-off-canvas-menu") == null && e.target.closest(".left-off-canvas-toggle") == null
isolatedScope.hide()
}

View File

@@ -1,14 +0,0 @@
#new-subscription-dialog
.text-normal.margin-bottom-30.text-center
= t('js.admin.subscriptions.new.please_select_a_shop')
%form{ name: 'new_subscription_form', novalidate: true, ng: { submit: "newSubscription()" }}
.text-center.margin-bottom-30
%input.ofn-select2.fullwidth#new_subscription_shop_id{ ng: { model: 'shop_id' }, required: true, name: 'shop_id', data: 'shops' }
%div{ ng: { show: "submitted && new_subscription_form.$pristine" } }
.error{ ng: { show: "new_subscription_form.shop_id.$error.required" } }
= t('js.admin.subscriptions.new.please_select_a_shop')
.text-center
%input.button.red.icon-plus{ type: 'submit', value: t('continue') }

View File

@@ -1,8 +1,12 @@
%div.contact-container
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone"}
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone || enterprise.whatsapp_phone"}
%p.modal-header {{'contact' | t}}
%p{"ng-if" => "::enterprise.phone", "ng-bind" => "::enterprise.phone"}
%p{"ng-if" => "::enterprise.whatsapp_phone"}
%img{ src: image_path("/map_icons/social-logos/whatsapp.svg") }
%a{"ng-href" => "{{::enterprise.whatsapp_url}}", target: "_blank", "ng-bind" => "::enterprise.whatsapp_phone"}
%p{"ng-if" => "::enterprise.email_address"}
%a{"ng-href" => "{{::enterprise.email_address | stripUrl}}", target: "_blank", mailto: true}
%span.obfuscatedEmail.email{"ng-bind" => "::enterprise.email_address | stripUrl"}

View File

@@ -9,19 +9,19 @@
%span{"ng-bind" => "::'item_cost' | t"}
%li{"ng-if" => "::variant.fees.admin"}
.right {{ ::variant.fees.admin | localizeCurrency }}
%span{"ng-bind" => "::'admin_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.admin"}
%li{"ng-if" => "::variant.fees.sales"}
.right {{ ::variant.fees.sales | localizeCurrency }}
%span{"ng-bind" => "::'sales_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.sales"}
%li{"ng-if" => "::variant.fees.packing"}
.right {{ ::variant.fees.packing | localizeCurrency }}
%span{"ng-bind" => "::'packing_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.packing"}
%li{"ng-if" => "::variant.fees.transport"}
.right {{ ::variant.fees.transport | localizeCurrency }}
%span{"ng-bind" => "::'transport_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.transport"}
%li{"ng-if" => "::variant.fees.fundraising"}
.right {{ ::variant.fees.fundraising | localizeCurrency }}
%span{"ng-bind" => "::'fundraising_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.fundraising"}
%li
%strong
.right = {{ ::variant.price_with_fees | localizeCurrency }}

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end

View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :session_id, :current_user
def connect
# initializes Warden after a cold start, in case you're visitor #1
env["warden"].authenticated?
# the problem with only using session is that users often login on multiple devices
self.current_user = env["warden"].user
# the problem with only using user is that sometimes you might want to use SR before you login
self.session_id = request.session.id
# and so, we recommend using both
# this assumes that you want to enable SR for unauthenticated users
reject_unauthorized_connection unless current_user || session_id
# if you want to disable SR for unauthenticated users,
# comment out the line above and uncomment the line below
# reject_unauthorized_connection unless current_user
end
end
end

View File

@@ -7,6 +7,7 @@ require 'open_food_network/order_cycle_permissions'
module Admin
class EnterprisesController < Admin::ResourceController
include GeocodeEnterpriseAddress
include CablecarResponses
# These need to run before #load_resource so that @object is initialised with sanitised values
prepend_before_action :override_owner, only: :create
@@ -44,7 +45,12 @@ module Admin
def edit
@object = Enterprise.where(permalink: params[:id]).
includes(users: [:ship_address, :bill_address]).first
super
if params[:stimulus]
@enterprise.is_primary_producer = params[:is_primary_producer]
@enterprise.sells = params[:enterprise_sells]
render operations: cable_car.morph("#side_menu", partial("admin/shared/side_menu"))
.morph("#permalink", partial("admin/enterprises/form/permalink"))
end
end
def welcome

View File

@@ -19,6 +19,7 @@ module Admin
:enable_invoices?,
:invoice_style2?,
:enable_receipt_printing?,
:enterprise_number_required_on_invoices?,
)
end
end

View File

@@ -2,10 +2,10 @@
module Admin
class OrderCyclesController < Admin::ResourceController
include OrderCyclesHelper
include ::OrderCyclesHelper
include PaperTrailLogging
prepend_before_action :set_order_cycle_id, only: [:incoming, :outgoing]
prepend_before_action :set_order_cycle_id, only: [:incoming, :outgoing, :checkout_options]
before_action :load_data_for_index, only: :index
before_action :require_coordinator, only: :new
before_action :remove_protected_attrs, only: [:update]
@@ -67,10 +67,12 @@ module Admin
update_nil_subscription_line_items_price_estimate(@order_cycle)
respond_to do |format|
flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1'
format.html { redirect_back(fallback_location: root_path) }
format.html { redirect_to_after_update_path }
format.json { render json: { success: true } }
end
else
elsif request.format.html?
render :checkout_options
elsif request.format.json?
render json: { errors: @order_cycle.errors.full_messages }, status: :unprocessable_entity
end
end
@@ -190,6 +192,16 @@ module Admin
end
end
def redirect_to_after_update_path
if params[:context] == "checkout_options" && params[:save]
redirect_to main_app.admin_order_cycle_checkout_options_path(@order_cycle)
elsif params[:context] == "checkout_options" && params[:save_and_back_to_list]
redirect_to main_app.admin_order_cycles_path
else
redirect_back(fallback_location: root_path)
end
end
def require_coordinator
@order_cycle.coordinator =
permitted_coordinating_enterprises_for(@order_cycle).find_by(id: params[:coordinator_id])

View File

@@ -26,6 +26,13 @@ module Api
}
end
def update
authorize! :admin, order
order.update!(order_params)
render json: order, serializer: Api::OrderDetailedSerializer, current_order: order
end
def ship
authorize! :admin, order
@@ -72,6 +79,10 @@ module Api
includes(line_items: { variant: [:product, :stock_items, :default_price] }).
first!
end
def order_params
params.permit(:note)
end
end
end
end

View File

@@ -6,20 +6,21 @@ module Api
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
product = Spree::Product.find(params[:product_id])
authorize! :update, product
if @product.images.first.nil?
@image = Spree::Image.create(
attachment: params[:file],
viewable_id: @product.master.id,
viewable_type: 'Spree::Variant'
)
render json: @image, serializer: ImageSerializer, status: :created
image = product.images.first || Spree::Image.new(
viewable_id: product.master.id,
viewable_type: 'Spree::Variant'
)
success_status = image.persisted? ? :ok : :created
if image.update(attachment: params[:file])
render json: image, serializer: ImageSerializer, status: success_status
else
@image = @product.images.first
@image.update(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
error_json = { errors: image.errors.full_messages }
render json: error_json, status: :unprocessable_entity
end
end
end

View File

@@ -5,9 +5,10 @@ require 'open_food_network/permissions'
module Api
module V1
class CustomersController < Api::V1::BaseController
include AddressTransformation
skip_authorization_check only: :index
before_action :set_customer, only: [:show, :update, :destroy]
before_action :authorize_action, only: [:show, :update, :destroy]
def index
@@ -17,44 +18,44 @@ module Api
end
def show
render json: Api::V1::CustomerSerializer.new(@customer, include_options)
render json: Api::V1::CustomerSerializer.new(customer, include_options)
end
def create
authorize! :update, Enterprise.find(customer_params[:enterprise_id])
@customer = Customer.new(customer_params)
customer = Customer.new(customer_params)
if @customer.save
render json: Api::V1::CustomerSerializer.new(@customer), status: :created
if customer.save
render json: Api::V1::CustomerSerializer.new(customer), status: :created
else
invalid_resource! @customer
invalid_resource! customer
end
end
def update
if @customer.update(customer_params)
render json: Api::V1::CustomerSerializer.new(@customer)
if customer.update(customer_params)
render json: Api::V1::CustomerSerializer.new(customer)
else
invalid_resource! @customer
invalid_resource! customer
end
end
def destroy
if @customer.destroy
render json: Api::V1::CustomerSerializer.new(@customer)
if customer.destroy
render json: Api::V1::CustomerSerializer.new(customer)
else
invalid_resource! @customer
invalid_resource! customer
end
end
private
def set_customer
@customer = Customer.find(params[:id])
def customer
@customer ||= Customer.find(params[:id])
end
def authorize_action
authorize! action_name.to_sym, @customer
authorize! action_name.to_sym, customer
end
def search_customers
@@ -77,7 +78,8 @@ module Api
:phone, :latitude, :longitude,
:first_name, :last_name,
:street_address_1, :street_address_2,
:postal_code, :locality, :region, :country,
:postal_code, :locality,
{ region: [:name, :code], country: [:name, :code] },
]
).to_h
@@ -89,39 +91,6 @@ module Api
attributes
end
def transform_address!(attributes, from, to)
return unless attributes.key?(from)
address = attributes.delete(from)
if address.nil?
attributes[to] = nil
return
end
address.transform_keys! do |key|
{
phone: :phone, latitude: :latitude, longitude: :longitude,
first_name: :firstname, last_name: :lastname,
street_address_1: :address1, street_address_2: :address2,
postal_code: :zipcode,
locality: :city,
region: :state_name,
country: :country,
}.with_indifferent_access[key]
end
if address[:state_name].present?
address[:state] = Spree::State.find_by(name: address[:state_name])
end
if address[:country].present?
address[:country] = Spree::Country.find_by(name: address[:country])
end
attributes["#{to}_attributes"] = address
end
def editable_enterprises
OpenFoodNetwork::Permissions.new(current_api_user).editable_enterprises.select(:id)
end

View File

@@ -165,8 +165,9 @@ class ApplicationController < ActionController::Base
return unless current_spree_user.disabled
flash[:success] = nil
flash.now[:error] = I18n.t("devise.failure.disabled")
flash[:error] = I18n.t("devise.failure.disabled")
sign_out current_spree_user
redirect_to main_app.root_path
end
end

View File

@@ -16,12 +16,7 @@ class BaseController < ApplicationController
private
def set_order_cycles
unless @distributor.ready_for_checkout?
@order_cycles = OrderCycle.where('false')
return
end
@order_cycles = Shop::OrderCyclesList.new(@distributor, current_customer).call
@order_cycles = Shop::OrderCyclesList.ready_for_checkout_for(@distributor, current_customer)
set_order_cycle
end

View File

@@ -0,0 +1,48 @@
# frozen_string_literal: true
# Our internal data structures are different to the API data strurctures.
module AddressTransformation
extend ActiveSupport::Concern
def transform_address!(attributes, from, to)
return unless attributes.key?(from)
address = attributes.delete(from)
if address.nil?
attributes[to] = nil
return
end
address.transform_keys! do |key|
{
phone: :phone, latitude: :latitude, longitude: :longitude,
first_name: :firstname, last_name: :lastname,
street_address_1: :address1, street_address_2: :address2,
postal_code: :zipcode,
locality: :city,
region: :state,
country: :country,
}.with_indifferent_access[key]
end
address[:state] = find_state(address) if address[:state].present?
address[:country] = find_country(address) if address[:country].present?
attributes["#{to}_attributes"] = address
end
private
def find_state(address)
Spree::State.find_by("LOWER(abbr) = ? OR LOWER(name) = ?",
address.dig(:state, :code)&.downcase,
address.dig(:state, :name)&.downcase)
end
def find_country(address)
Spree::Country.find_by("LOWER(iso) = ? OR LOWER(name) = ?",
address.dig(:country, :code)&.downcase,
address.dig(:country, :name)&.downcase)
end
end

View File

@@ -26,7 +26,10 @@ module OrderStockCheck
current_order.set_order_cycle! nil
flash[:info] = I18n.t('order_cycle_closed')
redirect_to main_app.shop_path
respond_to do |format|
format.json { render json: { path: main_app.shop_path }, status: :see_other }
format.html { redirect_to main_app.shop_path, status: :see_other }
end
end
private

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
class ErrorsController < ApplicationController
layout "errors"
def not_found
render status: :not_found
end
def internal_server_error
render status: :internal_server_error
end
def unprocessable_entity
render status: :unprocessable_entity
end
end

View File

@@ -21,6 +21,10 @@ class SplitCheckoutController < ::BaseController
def edit
redirect_to_step_based_on_order unless params[:step]
check_step if params[:step]
recalculate_tax if params[:step] == "summary"
flash_error_when_no_shipping_method_available if available_shipping_methods.none?
end
def update
@@ -45,6 +49,10 @@ class SplitCheckoutController < ::BaseController
private
def flash_error_when_no_shipping_method_available
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
end
def clear_invalid_payments
@order.payments.with_state(:invalid).delete_all
end
@@ -145,4 +153,18 @@ class SplitCheckoutController < ::BaseController
end
redirect_to_step_based_on_order
end
def check_step
case @order.state
when "cart", "address", "delivery"
redirect_to checkout_step_path(:details) unless params[:step] == "details"
when "payment"
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
end
end
def recalculate_tax
@order.create_tax_charge!
@order.update_order!
end
end

View File

@@ -42,6 +42,10 @@ module Spree
@order.update_order!
end
if params[:set_distribution_step] && @order.update(order_params)
return redirect_to spree.admin_order_customer_path(@order)
end
unless order_params.present? && @order.update(order_params) && @order.line_items.present?
if @order.line_items.empty? && !params[:suppress_error_msg]
@order.errors.add(:line_items, Spree.t('errors.messages.blank'))
@@ -55,7 +59,7 @@ module Spree
redirect_to spree.edit_admin_order_path(@order)
else
# Jump to next step if order is not complete
redirect_to spree.admin_order_customer_path(@order)
redirect_to spree.admin_order_payments_path(@order)
end
end
@@ -63,6 +67,18 @@ module Spree
load_spree_api_key
end
def bulk_cancel
order_ids = params[:order_ids].split(',')
Spree::Order.where(id: order_ids).find_each do |order|
order.send_cancellation_email = params[:send_cancellation_email] != "false"
order.restock_items = params.fetch(:restock_items, "true") == "true"
order.cancel
end
flash[:success] = Spree.t(:order_updated)
end
def fire
event = params[:e]
@order.send_cancellation_email = params[:send_cancellation_email] != "false"
@@ -126,7 +142,7 @@ module Spree
end
def require_distributor_abn
return if @order.distributor.abn.present?
return if @order.distributor.can_invoice?
flash[:error] = t(:must_have_valid_business_number,
enterprise_name: @order.distributor.name)

View File

@@ -18,19 +18,28 @@ module Spree
end
def customers
@customers = []
if spree_current_user.enterprises.pluck(:id).include? search_params[:distributor_id].to_i
@customers = Customer.
ransack(m: 'or', email_start: search_params[:q], first_name_start: search_params[:q],
last_name_start: search_params[:q]).
result.
where(enterprise_id: search_params[:distributor_id].to_i)
end
render json: @customers, each_serializer: ::Api::Admin::CustomerSerializer
render json: load_customers, each_serializer: ::Api::Admin::CustomerSerializer
end
private
def load_customers
return [] unless valid_enterprise_given?
Customer.ransack(
m: 'or', email_start: search_params[:q],
first_name_start: search_params[:q], last_name_start: search_params[:q]
).result.where(enterprise_id: search_params[:distributor_id].to_i)
end
def valid_enterprise_given?
return true if spree_current_user.admin?
spree_current_user.enterprises.where(
id: search_params[:distributor_id].to_i
).present?
end
def ransack_hash
{
m: 'or',

View File

@@ -48,30 +48,11 @@ module Spree
@user.spree_roles = roles.reject(&:blank?).collect{ |r| Spree::Role.find(r) }
end
message = if new_email_unconfirmed?
Spree.t(:email_updated)
else
Spree.t(:account_updated)
end
flash.now[:success] = message
flash.now[:success] = update_message
end
render :edit
end
def generate_api_key
if @user.generate_spree_api_key!
flash[:success] = t('spree.api.key_generated')
end
redirect_to spree.edit_admin_user_path(@user)
end
def clear_api_key
if @user.clear_spree_api_key!
flash[:success] = t('spree.api.key_cleared')
end
redirect_to spree.edit_admin_user_path(@user)
end
protected
def collection
@@ -100,6 +81,16 @@ module Spree
private
def update_message
return Spree.t(:show_api_key_view_toggled) if @user.show_api_key_view_previously_changed?
if new_email_unconfirmed?
Spree.t(:email_updated)
else
Spree.t(:account_updated)
end
end
# handling raise from Admin::ResourceController#destroy
def user_destroy_with_orders_error
render status: :forbidden, text: Spree.t(:error_user_destroy_with_orders)
@@ -137,7 +128,9 @@ module Spree
end
def user_params
::PermittedAttributes::User.new(params).call([:enterprise_limit])
::PermittedAttributes::User.new(params).call(
%i[enterprise_limit show_api_key_view]
)
end
end
end

View File

@@ -0,0 +1,57 @@
# frozen_string_literal: true
module Spree
class ApiKeysController < ::BaseController
include Spree::Core::ControllerHelpers
include I18nHelper
prepend_before_action :load_object
def create
@user.generate_api_key
if @user.save
flash[:success] = t('spree.api.key_generated')
end
redirect_to redirect_path
end
def destroy
@user.spree_api_key = nil
if @user.save
flash[:success] = t('spree.api.key_cleared')
end
redirect_to redirect_path
end
private
def load_object
@user ||= find_user
if @user
authorize! params[:action].to_sym, @user
else
redirect_to main_app.login_path
end
end
def find_user
Spree::User.find_by(id: params[:id]) || spree_current_user
end
def redirect_path
if request.referer.blank? || request.referer.include?(spree.account_path)
developer_settings_path
else
request.referer
end
end
def developer_settings_path
"#{spree.account_path}#/developer_settings"
end
end
end

View File

@@ -49,7 +49,10 @@ module Spree
# Using try because we may not have a card here
if @credit_card.try(:destroy)
remove_shop_authorizations if @credit_card.is_default
if @credit_card.is_default
remove_shop_authorizations
mark_as_default_next_credit_card if credit_cards_with_payment_profile.count > 0
end
flash[:success] = I18n.t(:card_has_been_removed, number: "x-#{@credit_card.last_digits}")
else
flash[:error] = I18n.t(:card_could_not_be_removed)
@@ -67,6 +70,14 @@ module Spree
@credit_card.user.customers.update_all(allow_charges: false)
end
def mark_as_default_next_credit_card
credit_cards_with_payment_profile.first.update(is_default: true)
end
def credit_cards_with_payment_profile
spree_current_user.credit_cards.with_payment_profile
end
def create_customer(token)
Stripe::Customer.create(email: spree_current_user.email, source: token)
end

View File

@@ -4,6 +4,7 @@ module Spree
class OrdersController < ::BaseController
include OrderCyclesHelper
include Rails.application.routes.url_helpers
include CablecarResponses
layout 'darkswarm'
@@ -99,7 +100,8 @@ module Spree
else
flash[:error] = I18n.t(:orders_could_not_cancel)
end
redirect_to request.referer || main_app.order_path(@order)
render status: :found,
operations: cable_car.redirect_to(url: request.referer || main_app.order_path(@order))
end
private

View File

@@ -16,6 +16,7 @@ module Spree
prepend_before_action :handle_unconfirmed_email
before_action :set_checkout_redirect, only: :create
after_action :ensure_valid_locale_persisted, only: :create
skip_before_action :check_disabled_user
def create
authenticate_spree_user!

View File

@@ -78,7 +78,7 @@ module Spree
def load_object
@user ||= spree_current_user
if @user
if @user && !@user.disabled
authorize! params[:action].to_sym, @user
else
redirect_to main_app.login_path

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module Admin
module EnterpriseGroupsHelper
def enterprise_group_side_menu_items
[
{ name: 'primary_details', icon_class: "icon-user", selected: "selected" },
{ name: 'users', icon_class: "icon-user" },
{ name: 'about', icon_class: "icon-pencil" },
{ name: 'images', icon_class: "icon-picture" },
{ name: 'contact', icon_class: "icon-phone" },
{ name: 'web', icon_class: "icon-globe" },
]
end
end
end

View File

@@ -13,5 +13,34 @@ module Admin
def select_only_item(producers)
producers.size == 1 ? producers.first.id : nil
end
def enterprise_side_menu_items(enterprise)
is_shop = enterprise.sells != "none"
show_properties = !!enterprise.is_primary_producer
show_shipping_methods = can?(:manage_shipping_methods, enterprise) && is_shop
show_payment_methods = can?(:manage_payment_methods, enterprise) && is_shop
show_enterprise_fees = can?(:manage_enterprise_fees,
enterprise) && (is_shop || enterprise.is_primary_producer)
[
{ name: 'primary_details', icon_class: "icon-home", show: true, selected: 'selected' },
{ name: 'address', icon_class: "icon-map-marker", show: true },
{ name: 'contact', icon_class: "icon-phone", show: true },
{ name: 'social', icon_class: "icon-twitter", show: true },
{ name: 'about', icon_class: "icon-pencil", show: true, form_name: "about_us" },
{ name: 'business_details', icon_class: "icon-briefcase", show: true },
{ name: 'images', icon_class: "icon-picture", show: true },
{ name: 'properties', icon_class: "icon-tags", show: show_properties },
{ name: 'shipping_methods', icon_class: "icon-truck", show: show_shipping_methods },
{ name: 'payment_methods', icon_class: "icon-money", show: show_payment_methods },
{ name: 'enterprise_fees', icon_class: "icon-tasks", show: show_enterprise_fees },
{ name: 'enterprise_permissions', icon_class: "icon-plug", show: true,
href: admin_enterprise_relationships_path },
{ name: 'inventory_settings', icon_class: "icon-list-ol", show: is_shop },
{ name: 'tag_rules', icon_class: "icon-random", show: is_shop },
{ name: 'shop_preferences', icon_class: "icon-shopping-cart", show: is_shop },
{ name: 'users', icon_class: "icon-user", show: true }
]
end
end
end

View File

@@ -70,10 +70,13 @@ module CheckoutHelper
def display_checkout_taxes_hash(order)
totals = OrderTaxAdjustmentsFetcher.new(order).totals
totals.each_with_object({}) do |(tax_rate, tax_amount), hash|
hash[number_to_percentage(tax_rate.amount * 100, precision: 1)] =
Spree::Money.new tax_amount, currency: order.currency
end
totals.map do |tax_rate, tax_amount|
{
amount: Spree::Money.new(tax_amount, currency: order.currency),
percentage: number_to_percentage(tax_rate.amount * 100, precision: 1),
rate_amount: tax_rate.amount,
}
end.sort_by { |tax| tax[:rate_amount] }
end
def display_line_item_tax_rates(line_item)

View File

@@ -14,15 +14,7 @@ module EnterprisesHelper
end
def available_shipping_methods
return [] if current_distributor.blank?
shipping_methods = current_distributor.shipping_methods.display_on_checkout.to_a
applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor,
"FilterShippingMethods", current_customer&.tag_list)
applicator.filter!(shipping_methods)
shipping_methods.uniq
OrderAvailableShippingMethods.new(current_order, current_customer).to_a
end
def available_payment_methods

View File

@@ -56,10 +56,6 @@ module OrderCyclesHelper
@simple_index ||= !OpenFoodNetwork::Permissions.new(spree_current_user).can_manage_complex_order_cycles?
end
def order_cycles_simple_form
@order_cycles_simple_form ||= @order_cycle.coordinator.sells == 'own'
end
def pickup_time(order_cycle = current_order_cycle)
order_cycle.exchanges.to_enterprises(current_distributor).outgoing.first.pickup_time
end

View File

@@ -44,6 +44,14 @@ module Spree
end
end
def print_invoice_link
if @order.distributor.can_invoice?
print_invoice_link_with_url
else
notify_about_required_enterprise_number
end
end
def ticket_links
return [] unless Spree::Config[:enable_receipt_printing?]
@@ -78,13 +86,20 @@ module Spree
confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) }
end
def print_invoice_link
def print_invoice_link_with_url
{ name: t(:print_invoice),
url: spree.print_admin_order_path(@order),
icon: 'icon-print',
target: "_blank" }
end
def notify_about_required_enterprise_number
{ name: t(:print_invoice),
url: "#",
icon: 'icon-print',
confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) }
end
def print_ticket_link
{ name: t(:print_ticket),
url: print_ticket_admin_order_path(@order),

View File

@@ -41,8 +41,8 @@ class CustomerSchema < JsonApiSchema
street_address_2: "",
postal_code: "1234",
locality: "Melbourne",
region: "Victoria",
country: "Australia",
region: { code: "Vic", name: "Victoria" },
country: { code: "AU", name: "Australia" },
}
end

View File

@@ -1,5 +1,12 @@
# frozen_string_literal: true
# A customer record is created the first time a person orders from a shop.
#
# It's a relationship between a user and an enterprise but for guest orders it
# can also be between an email address and an enterprise.
#
# The main purpose is tagging of customers to access private shops, receive
# discounts et cetera. A customer record is also needed for subscriptions.
class Customer < ApplicationRecord
include SetUnusedAddressFields
@@ -7,10 +14,10 @@ class Customer < ApplicationRecord
searchable_attributes :first_name, :last_name, :email, :code
belongs_to :enterprise
belongs_to :enterprise, optional: false
belongs_to :user, class_name: "Spree::User"
has_many :orders, class_name: "Spree::Order"
before_destroy :check_for_orders
before_destroy :update_orders_and_delete_canceled_subscriptions
belongs_to :bill_address, class_name: "Spree::Address"
alias_attribute :billing_address, :bill_address
@@ -26,7 +33,6 @@ class Customer < ApplicationRecord
validates :code, uniqueness: { scope: :enterprise_id, allow_nil: true }
validates :email, presence: true, 'valid_email_2/email': true,
uniqueness: { scope: :enterprise_id, message: I18n.t('validation_msg_is_associated_with_an_exising_customer') }
validates :enterprise, presence: true
scope :of, ->(enterprise) { where(enterprise_id: enterprise) }
@@ -52,10 +58,12 @@ class Customer < ApplicationRecord
self.user = user || Spree::User.find_by(email: email)
end
def check_for_orders
return true unless orders.any?
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_orders'))
throw :abort
def update_orders_and_delete_canceled_subscriptions
if Subscription.where(customer_id: id).not_canceled.any?
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_subscriptions'))
throw :abort
end
Subscription.where(customer_id: id).destroy_all
orders.update_all(customer_id: nil)
end
end

View File

@@ -84,8 +84,8 @@ class Enterprise < ApplicationRecord
has_one_attached :promo_image
has_one_attached :terms_and_conditions
validates :logo, content_type: %r{\Aimage/.*\Z}
validates :promo_image, content_type: %r{\Aimage/.*\Z}
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :terms_and_conditions, content_type: {
in: "application/pdf",
message: I18n.t(:enterprise_terms_and_conditions_type_error),
@@ -120,6 +120,7 @@ class Enterprise < ApplicationRecord
joins(:shipping_methods).
joins(:payment_methods).
merge(Spree::PaymentMethod.available).
merge(Spree::ShippingMethod.frontend).
select('DISTINCT enterprises.*')
}
scope :not_ready_for_checkout, lambda {
@@ -312,6 +313,10 @@ class Enterprise < ApplicationRecord
correct_instagram_url self[:instagram]
end
def whatsapp_url
correct_whatsapp_url self[:whatsapp_phone]
end
def inventory_variants
if prefers_product_selection_from_inventory_only?
Spree::Variant.visible_for(self)
@@ -383,7 +388,7 @@ class Enterprise < ApplicationRecord
end
def ready_for_checkout?
shipping_methods.any? && payment_methods.available.any?
shipping_methods.frontend.any? && payment_methods.available.any?
end
def self.find_available_permalink(test_permalink)
@@ -408,6 +413,8 @@ class Enterprise < ApplicationRecord
end
def can_invoice?
return true unless Spree::Config.enterprise_number_required_on_invoices?
abn.present?
end
@@ -446,6 +453,10 @@ class Enterprise < ApplicationRecord
url&.sub(%r{(https?://)?}, '')
end
def correct_whatsapp_url(phone_number)
phone_number && "https://wa.me/" + phone_number.tr('+ ', '')
end
def correct_instagram_url(url)
url && strip_url(url).sub(%r{www.instagram.com/}, '').delete("@")
end

View File

@@ -28,8 +28,8 @@ class EnterpriseGroup < ApplicationRecord
has_one_attached :logo
has_one_attached :promo_image
validates :logo, content_type: %r{\Aimage/.*\Z}
validates :promo_image, content_type: %r{\Aimage/.*\Z}
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
scope :by_position, -> { order('position ASC') }
scope :on_front_page, -> { where(on_front_page: true) }

View File

@@ -22,9 +22,11 @@ class OrderCycle < ApplicationRecord
has_many :suppliers, -> { distinct }, source: :sender, through: :cached_incoming_exchanges
has_many :distributors, -> { distinct }, source: :receiver, through: :cached_outgoing_exchanges
has_many :order_cycle_schedules
has_many :schedules, through: :order_cycle_schedules
has_and_belongs_to_many :selected_distributor_shipping_methods,
class_name: 'DistributorShippingMethod',
join_table: 'order_cycles_distributor_shipping_methods'
has_paper_trail meta: { custom_data: proc { |order_cycle| order_cycle.schedule_ids.to_s } }
attr_accessor :incoming_exchanges, :outgoing_exchanges
@@ -150,6 +152,20 @@ class OrderCycle < ApplicationRecord
]
end
def attachable_payment_methods
Spree::PaymentMethod.available(:both).
joins("INNER JOIN distributors_payment_methods
ON payment_method_id = spree_payment_methods.id").
where("distributor_id IN (?)", distributor_ids).
distinct
end
def attachable_distributor_shipping_methods
DistributorShippingMethod.joins(:shipping_method).
merge(Spree::ShippingMethod.frontend).
where("distributor_id IN (?)", distributor_ids)
end
def clone!
oc = dup
oc.name = I18n.t("models.order_cycle.cloned_order_cycle_name", order_cycle: oc.name)
@@ -161,6 +177,9 @@ class OrderCycle < ApplicationRecord
oc.schedule_ids = schedule_ids
oc.save!
exchanges.each { |e| e.clone!(oc) }
oc.selected_distributor_shipping_method_ids = (
attachable_distributor_shipping_methods.map(&:id) & selected_distributor_shipping_method_ids
)
sync_subscriptions
oc.reload
end
@@ -274,6 +293,22 @@ class OrderCycle < ApplicationRecord
items.each { |li| scoper.scope(li.variant) }
end
def distributor_shipping_methods
if simple? || selected_distributor_shipping_methods.none?
attachable_distributor_shipping_methods
else
attachable_distributor_shipping_methods.where(
"distributors_shipping_methods.id IN (?) OR distributor_id NOT IN (?)",
selected_distributor_shipping_methods.map(&:id),
selected_distributor_shipping_methods.map(&:distributor_id)
)
end
end
def simple?
coordinator.sells == 'own'
end
private
def opening?

View File

@@ -5,7 +5,7 @@
# This reduces the need to keep Orders in sync with their parent Subscriptions
class ProxyOrder < ApplicationRecord
belongs_to :order, class_name: 'Spree::Order', dependent: :destroy
belongs_to :order, class_name: 'Spree::Order'
belongs_to :subscription
belongs_to :order_cycle

View File

@@ -99,7 +99,7 @@ module Spree
item.order.changes_allowed?
end
can [:cancel], Spree::Order do |order|
can [:cancel, :bulk_cancel], Spree::Order do |order|
order.user == user
end
@@ -243,7 +243,9 @@ module Spree
end
def add_order_cycle_management_abilities(user)
can [:admin, :index, :read, :edit, :update, :incoming, :outgoing], OrderCycle do |order_cycle|
can [
:admin, :index, :read, :edit, :update, :incoming, :outgoing, :checkout_options
], OrderCycle do |order_cycle|
OrderCycle.visible_by(user).include? order_cycle
end
can [:admin, :index, :create], Schedule

View File

@@ -129,6 +129,7 @@ module Spree
preference :enable_invoices?, :boolean, default: true
preference :invoice_style2?, :boolean, default: false
preference :enable_receipt_printing?, :boolean, default: false
preference :enterprise_number_required_on_invoices?, :boolean, default: true
# Stripe payments
preference :stripe_connect_enabled, :boolean, default: false

View File

@@ -11,15 +11,19 @@ module Spree
has_one_attached :attachment
validates :attachment, attached: true, content_type: %r{\Aimage/.*\Z}
validates :attachment, attached: true, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validate :no_attachment_errors
def variant(name)
attachment.variant(SIZES[name])
if attachment.variable?
attachment.variant(SIZES[name])
else
attachment
end
end
def url(size)
return unless attachment.variable?
return unless attachment.attached?
Rails.application.routes.url_helpers.url_for(variant(size))
end

View File

@@ -433,7 +433,7 @@ module Spree
all_adjustments.destroy_all
payments.clear
shipments.destroy_all
restart_checkout_flow if state == "payment"
restart_checkout_flow if state.in?(["payment", "confirmation"])
end
def state_changed(name)
@@ -704,43 +704,12 @@ module Spree
end
def require_customer?
return false if new_record? || state == 'cart'
true
end
def customer_is_valid?
return true unless require_customer?
customer.present? && customer.enterprise_id == distributor_id && customer.email == email_for_customer
end
def email_for_customer
(user&.email || email)&.downcase
end
def associate_customer
return customer if customer.present?
Customer.of(distributor).find_by(email: email_for_customer)
end
def create_customer
return if customer_is_valid?
Customer.create(
enterprise: distributor,
email: email_for_customer,
user: user,
first_name: bill_address&.first_name.to_s,
last_name: bill_address&.last_name.to_s,
bill_address: bill_address&.clone,
ship_address: ship_address&.clone
)
persisted? && state != "cart"
end
def ensure_customer
self.customer = associate_customer || create_customer
self.customer ||= CustomerSyncer.find_and_update_customer(self)
self.customer ||= CustomerSyncer.create_customer(self) if require_customer?
end
def update_adjustment!(adjustment)

View File

@@ -3,7 +3,10 @@
module Spree
class ShippingMethod < ApplicationRecord
include CalculatedAdjustments
DISPLAY = [:both, :front_end, :back_end].freeze
DISPLAY_ON_OPTIONS = {
both: "",
back_end: "back_end"
}.freeze
acts_as_paranoid
acts_as_taggable
@@ -27,6 +30,7 @@ module Spree
validates :name, presence: true
validate :distributor_validation
validate :at_least_one_shipping_category
validates :display_on, inclusion: { in: DISPLAY_ON_OPTIONS.values }, allow_nil: true
after_save :touch_distributors
@@ -51,9 +55,6 @@ module Spree
}
scope :by_name, -> { order('spree_shipping_methods.name ASC') }
scope :display_on_checkout, -> {
where("spree_shipping_methods.display_on is null OR spree_shipping_methods.display_on = ''")
}
# Here we allow checkout with shipping methods without zones (see issue #3928 for details)
# and also checkout with addresses outside of the zones of the selected shipping method
@@ -101,16 +102,26 @@ module Spree
]
end
def self.on_backend_query
"#{table_name}.display_on != 'front_end' OR #{table_name}.display_on IS NULL"
def self.backend
where(display_on: DISPLAY_ON_OPTIONS[:back_end])
end
def self.on_frontend_query
"#{table_name}.display_on != 'back_end' OR #{table_name}.display_on IS NULL"
def self.frontend
where(display_on: [nil, ""])
end
private
def no_active_or_upcoming_order_cycle_distributors_with_only_one_shipping_method?
return true if new_record?
distributors.
with_order_cycles_as_distributor_outer.
merge(OrderCycle.active.or(OrderCycle.upcoming)).none? do |distributor|
distributor.shipping_method_ids.one?
end
end
def at_least_one_shipping_category
return unless shipping_categories.empty?

View File

@@ -8,14 +8,7 @@ module Spree
scope :frontend,
-> {
includes(:shipping_method).
where(ShippingMethod.on_frontend_query).
references(:shipping_method).
order("cost ASC")
}
scope :backend,
-> {
includes(:shipping_method).
where(ShippingMethod.on_backend_query).
merge(ShippingMethod.frontend).
references(:shipping_method).
order("cost ASC")
}

View File

@@ -71,6 +71,10 @@ module Spree
set_reset_password_token
end
def generate_api_key
self.spree_api_key = SecureRandom.hex(24)
end
def known_users
if admin?
Spree::User.where(nil)
@@ -132,16 +136,6 @@ module Spree
end
end
def generate_spree_api_key!
self.spree_api_key = SecureRandom.hex(24)
save!
end
def clear_spree_api_key!
self.spree_api_key = nil
save!
end
def last_incomplete_spree_order
spree_orders.incomplete.where(created_by_id: id).order('created_at DESC').first
end

View File

@@ -172,6 +172,11 @@ module Spree
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle).fees_by_type_for self
end
def fees_name_by_type_for(distributor, order_cycle)
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor,
order_cycle).fees_name_by_type_for self
end
def option_value(opt_name)
option_values.detect { |o| o.option_type.name == opt_name }.try(:presentation)
end

View File

@@ -17,9 +17,9 @@ class Subscription < ApplicationRecord
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
belongs_to :bill_address, class_name: "Spree::Address"
belongs_to :ship_address, class_name: "Spree::Address"
has_many :subscription_line_items, inverse_of: :subscription
has_many :subscription_line_items, inverse_of: :subscription, dependent: :destroy
has_many :order_cycles, through: :schedule
has_many :proxy_orders
has_many :proxy_orders, dependent: :destroy
has_many :orders, through: :proxy_orders
alias_attribute :billing_address, :bill_address

View File

@@ -0,0 +1,19 @@
# frozen_string_literal: true
class ApplicationReflex < StimulusReflex::Reflex
# Put application-wide Reflex behavior and callbacks in this file.
#
# Learn more at: https://docs.stimulusreflex.com/rtfm/reflex-classes
#
# If your ActionCable connection is: `identified_by :current_user`
# delegate :current_user, to: :connection
#
# If you need to localize your Reflexes, you can set the I18n locale here:
#
# before_reflex do
# I18n.locale = :fr
# end
#
# For code examples, considerations and caveats, see:
# https://docs.stimulusreflex.com/rtfm/patterns#internationalization
end

View File

@@ -14,9 +14,9 @@ module Api
attributes :name, :id, :description, :latitude, :longitude,
:long_description, :website, :instagram, :linkedin, :twitter,
:facebook, :is_primary_producer, :is_distributor, :phone, :visible,
:email_address, :hash, :logo, :promo_image, :path, :pickup, :delivery,
:icon, :icon_font, :producer_icon_font, :category
:facebook, :is_primary_producer, :is_distributor, :phone, :whatsapp_phone,
:whatsapp_url, :visible, :email_address, :hash, :logo, :promo_image, :path, :pickup,
:delivery, :icon, :icon_font, :producer_icon_font, :category
attributes :taxons, :supplied_taxons

View File

@@ -7,9 +7,9 @@ module Api
attributes :name, :id, :description, :latitude, :longitude, :long_description, :website,
:instagram, :linkedin, :twitter, :facebook, :is_primary_producer, :is_distributor,
:phone, :visible, :email_address, :hash, :logo, :promo_image, :path, :category,
:active, :producers, :orders_close_at, :hubs, :taxons, :supplied_taxons, :pickup,
:delivery, :preferred_product_low_stock_display
:phone, :whatsapp_phone, :whatsapp_url, :visible, :email_address, :hash, :logo,
:promo_image, :path, :category, :active, :producers, :orders_close_at, :hubs,
:taxons, :supplied_taxons, :pickup, :delivery, :preferred_product_low_stock_display
has_one :address, serializer: Api::AddressSerializer
has_many :supplied_properties, serializer: Api::PropertySerializer

View File

@@ -11,8 +11,18 @@ module Api
attribute :street_address_2, &:address2
attribute :postal_code, &:zipcode
attribute :locality, &:city
attribute :region, &:state_name
attribute :country, ->(object, _) { object.country.name }
attribute :region do |object|
{
name: object.state.name,
code: object.state.abbr,
}
end
attribute :country do |object|
{
name: object.country.name,
code: object.country.iso,
}
end
end
end
end

View File

@@ -4,7 +4,8 @@ class Api::VariantSerializer < ActiveModel::Serializer
attributes :id, :is_master, :product_name, :sku,
:options_text, :unit_value, :unit_description, :unit_to_display,
:display_as, :display_name, :name_to_display,
:price, :on_demand, :on_hand, :fees, :price_with_fees,
:price, :on_demand, :on_hand,
:fees, :fees_name, :price_with_fees,
:tag_list, :thumb_url,
:unit_price_price, :unit_price_unit
@@ -15,6 +16,10 @@ class Api::VariantSerializer < ActiveModel::Serializer
object.fees_by_type_for(options[:current_distributor], options[:current_order_cycle])
end
def fees_name
object.fees_name_by_type_for(options[:current_distributor], options[:current_order_cycle])
end
def price_with_fees
if options[:enterprise_fee_calculator]
object.price + options[:enterprise_fee_calculator].indexed_fees_for(object)

View File

@@ -0,0 +1,48 @@
# frozen_string_literal: true
# Create, find and update customer records.
#
# P.S.: I almost couldn't resist to call this CustomerService.
class CustomerSyncer
def self.find_and_update_customer(order)
find_customer(order).tap { |customer| synchronise_email(order, customer) }
end
def self.find_customer(order)
order.user&.customers&.of(order.distributor)&.first ||
Customer.of(order.distributor).find_by(email: customer_email(order))
end
def self.synchronise_email(order, customer)
email = order.user&.email
return unless email && customer && email != customer.email
duplicate = Customer.find_by(email: email, enterprise: order.distributor)
if duplicate.present?
Spree::Order.where(customer_id: duplicate.id).update_all(customer_id: customer.id)
Subscription.where(customer_id: duplicate.id).update_all(customer_id: customer.id)
duplicate.destroy
end
customer.update(email: email)
end
def self.create_customer(order)
Customer.create(
enterprise: order.distributor,
email: customer_email(order),
user: order.user,
first_name: order.bill_address&.first_name.to_s,
last_name: order.bill_address&.last_name.to_s,
bill_address: order.bill_address&.clone,
ship_address: order.ship_address&.clone
)
end
def self.customer_email(order)
(order.user&.email || order.email)&.downcase
end
end

View File

@@ -68,12 +68,12 @@ class EmbeddedPageService
end
def current_referer
return if @request.referer.blank?
uri = URI(@request.referer)
return if uri.host.blank?
uri = URI.parse(@request.referer)
return unless uri.is_a?(URI::HTTP) && uri.host.present?
uri.host.downcase
rescue URI::InvalidURIError
false
end
def current_referer_without_www

View File

@@ -0,0 +1,37 @@
# frozen_string_literal: true
class OrderAvailableShippingMethods
attr_reader :order, :customer
delegate :distributor,
:order_cycle,
to: :order
def initialize(order, customer = nil)
@order, @customer = order, customer
end
def to_a
return [] if distributor.blank?
shipping_methods = shipping_methods_before_tag_rules_applied
applicator = OpenFoodNetwork::TagRuleApplicator.new(distributor,
"FilterShippingMethods", customer&.tag_list)
applicator.filter!(shipping_methods)
shipping_methods.uniq
end
private
def shipping_methods_before_tag_rules_applied
if order_cycle.nil? || order_cycle.simple?
distributor.shipping_methods
else
distributor.shipping_methods.where(
id: order_cycle.distributor_shipping_methods.select(:shipping_method_id)
)
end.frontend.to_a
end
end

View File

@@ -30,11 +30,10 @@ class OrderCartReset
return unless current_user
order.associate_user!(current_user) if order.user.blank? || order.email.blank?
order.__send__(:associate_customer) if order.customer.nil? # Only associates existing customers
end
def reset_order_cycle(current_customer)
listed_order_cycles = Shop::OrderCyclesList.new(distributor, current_customer).call
listed_order_cycles = Shop::OrderCyclesList.active_for(distributor, current_customer)
if order_cycle_not_listed?(order.order_cycle, listed_order_cycles)
order.order_cycle = nil

View File

@@ -8,9 +8,13 @@ class OrderCycleForm
def initialize(order_cycle, order_cycle_params, user)
@order_cycle = order_cycle
@order_cycle_params = order_cycle_params
@specified_params = order_cycle_params.keys
@user = user
@permissions = OpenFoodNetwork::Permissions.new(user)
@schedule_ids = order_cycle_params.delete(:schedule_ids)
@selected_distributor_shipping_method_ids = order_cycle_params.delete(
:selected_distributor_shipping_method_ids
)
end
def save
@@ -20,13 +24,15 @@ class OrderCycleForm
order_cycle.transaction do
order_cycle.save!
order_cycle.schedule_ids = schedule_ids
order_cycle.schedule_ids = schedule_ids if parameter_specified?(:schedule_ids)
order_cycle.save!
apply_exchange_changes
attach_selected_distributor_shipping_methods
sync_subscriptions
true
end
rescue ActiveRecord::RecordInvalid
rescue ActiveRecord::RecordInvalid => e
add_exception_to_order_cycle_errors(e)
false
end
@@ -34,24 +40,50 @@ class OrderCycleForm
attr_accessor :order_cycle, :order_cycle_params, :user, :permissions
def add_exception_to_order_cycle_errors(exception)
error = exception.message.split(":").last.strip
order_cycle.errors.add(:base, error) if order_cycle.errors.to_a.exclude?(error)
end
def apply_exchange_changes
return if exchanges_unchanged?
OpenFoodNetwork::OrderCycleFormApplicator.new(order_cycle, user).go!
end
def attach_selected_distributor_shipping_methods
return if @selected_distributor_shipping_method_ids.nil?
order_cycle.reload # so outgoing exchanges are up-to-date for shipping method validations
order_cycle.selected_distributor_shipping_method_ids = selected_distributor_shipping_method_ids
order_cycle.save!
end
def attachable_distributor_shipping_method_ids
@attachable_distributor_shipping_method_ids ||= order_cycle.attachable_distributor_shipping_methods.map(&:id)
end
def exchanges_unchanged?
[:incoming_exchanges, :outgoing_exchanges].all? do |direction|
order_cycle_params[direction].nil?
end
end
def schedule_ids?
@schedule_ids.present?
def selected_distributor_shipping_method_ids
@selected_distributor_shipping_method_ids = (
attachable_distributor_shipping_method_ids &
@selected_distributor_shipping_method_ids.reject(&:blank?).map(&:to_i)
)
if attachable_distributor_shipping_method_ids.sort == @selected_distributor_shipping_method_ids.sort
@selected_distributor_shipping_method_ids = []
end
@selected_distributor_shipping_method_ids
end
def build_schedule_ids
return unless schedule_ids?
return unless parameter_specified?(:schedule_ids)
result = existing_schedule_ids
result |= (requested_schedule_ids & permitted_schedule_ids) # Add permitted and requested
@@ -60,7 +92,7 @@ class OrderCycleForm
end
def sync_subscriptions
return unless schedule_ids?
return unless parameter_specified?(:schedule_ids)
return unless schedule_sync_required?
OrderManagement::Subscriptions::ProxyOrderSyncer.new(subscriptions_to_sync).sync!
@@ -78,6 +110,10 @@ class OrderCycleForm
@schedule_ids.map(&:to_i)
end
def parameter_specified?(key)
@specified_params.map(&:to_s).include?(key.to_s)
end
def permitted_schedule_ids
Schedule.where(id: requested_schedule_ids | existing_schedule_ids)
.merge(permissions.editable_schedules).pluck(:id)

View File

@@ -12,9 +12,9 @@ module PermittedAttributes
:email, :special_instructions,
:existing_card_id, :shipping_method_id,
{ payments_attributes: [
:payment_method_id,
{ source_attributes: PermittedAttributes::PaymentSource.attributes }
],
:payment_method_id,
{ source_attributes: PermittedAttributes::PaymentSource.attributes }
],
ship_address_attributes: PermittedAttributes::Address.attributes,
bill_address_attributes: PermittedAttributes::Address.attributes }
],

View File

@@ -25,10 +25,10 @@ module PermittedAttributes
def self.basic_permitted_attributes
[
:id, :name, :visible, :permalink, :owner_id, :contact_name, :email_address, :phone,
:is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin, :twitter,
:description, :long_description, :logo, :promo_image, :terms_and_conditions,
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions,
:abn, :acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
:whatsapp_phone, :is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin,
:twitter, :description, :long_description, :logo, :promo_image, :terms_and_conditions,
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions, :abn,
:acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
:preferred_product_selection_from_inventory_only, :preferred_shopfront_message,
:preferred_shopfront_closed_message, :preferred_shopfront_taxon_order,
:preferred_shopfront_producer_order, :preferred_shopfront_order_cycle_order,

View File

@@ -17,7 +17,7 @@ module PermittedAttributes
:name, :orders_open_at, :orders_close_at, :coordinator_id,
:preferred_product_selection_from_coordinator_inventory_only,
:automatic_notifications,
{ schedule_ids: [], coordinator_fee_ids: [] }
{ schedule_ids: [], selected_distributor_shipping_method_ids: [], coordinator_fee_ids: [] }
]
end

View File

@@ -97,6 +97,7 @@ module Sets
variants_attributes.each do |attributes|
create_or_update_variant(product, attributes)
end
product.errors.empty?
end
def create_or_update_variant(product, variant_attributes)
@@ -114,6 +115,11 @@ module Sets
variant = product.variants.create(variant_attributes)
if variant.errors.present?
product.errors.merge!(variant.errors)
return false
end
begin
variant.on_demand = on_demand if on_demand.present?
variant.on_hand = on_hand.to_i if on_hand.present?

View File

@@ -3,6 +3,16 @@
# Lists available order cycles for a given customer in a given distributor
module Shop
class OrderCyclesList
def self.active_for(distributor, customer)
new(distributor, customer).call
end
def self.ready_for_checkout_for(distributor, customer)
return OrderCycle.none unless distributor.ready_for_checkout?
new(distributor, customer).call
end
def initialize(distributor, customer)
@distributor = distributor
@customer = customer

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