Commit Graph

777 Commits

Author SHA1 Message Date
Filipe
f917027cb1 Merge pull request #10249 from jibees/10228-split-checkout-error-422-on-step-2-payment-update-highlighted-fields
SplitCheckout: Fix an issue that was sending unintentionally bad params for payment
2023-01-24 10:31:49 +00:00
Jean-Baptiste Bellet
251ab2ac9a Payment method id attribute don't need to start with paymentmethod 2023-01-23 17:46:26 +01:00
Jean-Baptiste Bellet
1a874d6fcf Introduce pagination for BOM page 2023-01-18 17:39:42 +01:00
Jean-Baptiste Bellet
121a4a08af On filters reseting , set dates to undefined: range is not mandatory
+ send flatpickr event to reset the component

+ update specs as well
2023-01-18 17:39:09 +01:00
Jean-Baptiste Bellet
2d86e8857a Put payment method description just above the
+ update spec by adding `data-paymentmethod-id` attribute
2022-12-28 15:21:29 +01:00
Jean-Baptiste Bellet
69faf590b0 Create a spy obj for order_cycle_form as required now by removeCoordinatorFee()
Based on `spec/javascripts/unit/admin/order_cycles/controllers/order_cycle_exchanges_controller_spec.js.coffee`
2022-12-07 09:37:31 +01:00
Jean-Baptiste Bellet
66a684920a allSaved() method from LineItems needs to be spy 2022-11-03 15:55:48 +01:00
saunmanoj888
490c5afc59 Mock bigDecimal methods in specs 2022-10-25 00:05:31 +05:30
saunmanoj888
ee8454bd2c Use js-big-decimal package for calculation 2022-10-21 21:30:00 +05:30
saunmanoj888
b40cd579bc Fix spec failure 2022-10-19 23:18:22 +05:30
saunmanoj888
8e45b758ba Fix unit value UI issue 2022-10-19 22:59:28 +05:30
Rachel Arnould
617a417dc2 Merge pull request #9506 from binarygit/remove-angular-from-payment-methods
Remove angular from payment methods
2022-10-11 13:13:26 +02:00
Manish Sharma
cd71233163 Fixed duplicates enterprises in order cycles 2022-10-10 14:30:58 +05:30
binarygit
01c477f2cb Remove angular from Payment Methods 2022-10-08 14:20:54 +02: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
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
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
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
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
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
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
binarygit
8861b6d077 Replace permalinks angular ctrl with stimulus 2022-08-31 10:06:51 +05:45
binarygit
79ba223e12 Delete angular code for side_menu 2022-08-10 15:14:15 +05:45
binarygit
e18a242b90 Render admin/enterprises/<name>/edit page using stimulus 2022-08-10 15:08:59 +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
Jean-Baptiste Bellet
b2a0310e6f Handle the case when errors is a string 2022-07-05 15:48:31 +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
a68f9a71fb When items quantities, update sumUnitValues() and sumMaxUnitValues()
by summing only `quantity` and `max_quantity`

+ update the specs as well

Co-Authored-By: Maikel <maikel@email.org.au>
2022-04-27 11:21:47 +02:00
Jean-Baptiste Bellet
a4afeeaa3d When BOM is 'item', do not update sumOfUnitValues with scale
since scale is always `1`, but return a value

+ update tests as well
2022-04-25 15:53:38 +02:00
Jean-Baptiste Bellet
3553cc0d9f When it's items scale is '1'
update tests as well
2022-04-25 15:51:38 +02:00
Cillian O'Ruanaidh
4162830bee Switch help modals from angular templates to use ViewComponent and StimulusJs 2022-04-20 09:36:30 +10:00
Filipe
01e915800e Merge pull request #9037 from jibees/9028-last-item-of-order-cancellation
BOM: show custom modal on last item deletion of an order
2022-04-15 18:47:51 +01:00
Jean-Baptiste Bellet
af69064d3a Add mocked shopfront 2022-04-15 10:53:28 +10:00
GeorgeThoppil
706f6025e9 Add all variants for only one distributor 2022-04-04 19:59:42 -04:00
Jean-Baptiste Bellet
17989b2f90 Update tests as well around order cancellation on item deletion
js specs are not that easy to code (needs to spy callback...). Use system spec instead.
2022-03-25 11:52:08 +01:00
Filipe
87c79a5941 Merge pull request #8294 from guidoDutra/8131-cancel-empty-orders-on-BOM-page
Cancel empty orders on BOM page
2022-03-18 11:24:26 +00:00
Filipe
19270f1777 Merge pull request #8987 from jibees/8981-BOM-correct-value-for-current-and-max-fullfilled
BOM: correct max and current fulfilled units values
2022-03-17 18:15:59 +00:00
Filipe
53544ee66a Merge pull request #8805 from cillian/remove-inline-advanced-settings-toggle-js
Replace inline JS for toggling order cycle advanced settings with StimulusJs controller
2022-03-17 16:05:46 +00:00
Jean-Baptiste Bellet
ea3e15f0c8 Max|Current fulfilled value is the max|current divided by group_buy_unit_size
+ improve testing with representative values
 + Update bulk_order_management_spec.rb and revert previously changed values
2022-03-14 09:06:05 +01:00
Jean-Baptiste Bellet
915714246f Directly use the variant_unit_scale instead of VariantUnitManager.getScale
and update the tests as well
2022-03-08 14:59:08 +01:00
Jean-Baptiste Bellet
adcdca812d Delete that getScale method which is now useless
since we now rely on the serialized variant_unit_scale
2022-03-08 14:58:34 +01:00
Filipe
9966b5b33c Merge pull request #8565 from jibees/8171-group-by-imperial-unit
Handle imperial units in the Bulk Order Management interface
2022-02-21 14:47:38 +00:00
Cillian O'Ruanaidh
1b8c1bd27a Only initialise Stimulus app once in Jest tests in :beforeAll rather than :beforeEach
Before there was an issue with the remote_toggle_controller tests, which contains two tests. If you commented out one test and ran the other it would pass and vice versa but if both tests were uncommented only the first test would ever pass, the second one would fail. See https://github.com/openfoodfoundation/openfoodnetwork/pull/8805#discussion_r801464322

Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-02-11 10:21:26 +00:00
Cillian O'Ruanaidh
b43a68d717 Merge branch 'master' into remove-inline-advanced-settings-toggle-js 2022-02-04 12:24:17 +00:00
Cillian O'Ruanaidh
05756616dd Add a remote-toggle controller that can toggle elements outside of its scope
This is instead of adding the :data-controller attribute to the div#wrapper because that will wrap pretty much all content on the admin pages.

Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-02-04 12:23:24 +00:00
Cillian O'Ruanaidh
d03b52a163 Revert "Replace inline JS for toggling order cycle advanced settings with StimulusJs controller"
This reverts commit 67ae2e72f3.
2022-02-04 11:47:38 +00:00
Matt-Yorkley
81f5755e3d Add tests for tabs_controller 2022-01-31 16:34:35 +00:00
Cillian O'Ruanaidh
67ae2e72f3 Replace inline JS for toggling order cycle advanced settings with StimulusJs controller
Partially addresses #8699.

This adjusts the Stimulus toggle controller so you can toggle content in both directions via a single element. This is in addition to the previous behaviour for toggling via multiple elements like radio buttons when each element always toggles in one direction only.

If a toggle element contains a chevron icon this will automatically toggle the direction of that icon too.

Note, in order to not have to re-implement the animation provided by the slideToggle() function in standard JavaScript, this just switches the style :display between 'none' and 'block' so it is not as smooth. Perhaps it could be made more smooth later with a CSS transition.
2022-01-28 16:19:36 +00:00
Jean-Baptiste Bellet
f6e64f3a3c Update the tests as well 2022-01-10 11:27:32 +01:00