Compare commits

...

1315 Commits

Author SHA1 Message Date
jibees
532d566308 Merge pull request #9014 from openfoodfoundation/transifex
Transifex
2022-03-21 09:32:27 +01:00
Transifex-Openfoodnetwork
eae8129435 Updating translations for config/locales/en_FR.yml 2022-03-19 02:50:56 +11:00
Transifex-Openfoodnetwork
ed0ed3240e Updating translations for config/locales/fr.yml 2022-03-19 02:47:16 +11:00
Transifex-Openfoodnetwork
5d8cdc3246 Updating translations for config/locales/de_DE.yml 2022-03-19 01:36:44 +11:00
Transifex-Openfoodnetwork
27e31ae09d Updating translations for config/locales/de_DE.yml 2022-03-19 01:36:01 +11:00
Transifex-Openfoodnetwork
f4ce08d39c Updating translations for config/locales/de_DE.yml 2022-03-19 01:31:31 +11: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
f079fcb49a Merge pull request #8992 from openfoodfoundation/dependabot/npm_and_yarn/flatpickr-4.6.11
Bump flatpickr from 4.6.9 to 4.6.11
2022-03-17 16:52:49 +00:00
Filipe
c535ed5789 Merge pull request #8936 from cillian/language-metatags
Include language metatags in html template when more than one language available
2022-03-17 16:16:07 +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
Filipe
0dd398abba Merge pull request #8926 from mkllnk/8925-invalid-param
Gracefully handle admin UI failure on updating enterprise notifications
2022-03-17 14:19:34 +00:00
jibees
56912bb807 Merge pull request #9010 from openfoodfoundation/transifex
Transifex
2022-03-17 14:21:41 +01:00
Transifex-Openfoodnetwork
37801f1345 Updating translations for config/locales/en_IE.yml 2022-03-17 22:14:51 +11:00
jibees
43b284a175 Merge pull request #9005 from openfoodfoundation/transifex
Transifex
2022-03-17 11:04:47 +01:00
Maikel
ab5a323044 Merge pull request #8980 from openfoodfoundation/dependabot/npm_and_yarn/karma-chrome-launcher-3.1.1
Bump karma-chrome-launcher from 3.1.0 to 3.1.1
2022-03-17 09:47:11 +11:00
Transifex-Openfoodnetwork
08755acfd1 Updating translations for config/locales/hu.yml 2022-03-17 04:39:12 +11:00
jibees
3a0f50395f Merge pull request #8989 from openfoodfoundation/transifex
Transifex
2022-03-16 10:41:55 +01:00
Transifex-Openfoodnetwork
fb83ae2ad4 Updating translations for config/locales/en_GB.yml 2022-03-14 22:48:06 +11:00
dependabot[bot]
b9e0a5ecf7 Bump flatpickr from 4.6.9 to 4.6.11
Bumps [flatpickr](https://github.com/chmln/flatpickr) from 4.6.9 to 4.6.11.
- [Release notes](https://github.com/chmln/flatpickr/releases)
- [Commits](https://github.com/chmln/flatpickr/compare/v4.6.9...v4.6.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 09:05:55 +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
jibees
483ec42328 Merge pull request #8990 from jibees/8984-sc-test-failed
SplitCheckout: improve test that failed
2022-03-14 09:03:26 +01:00
Jean-Baptiste Bellet
65596f8467 Do not replace shipping_methods array but push into 2022-03-11 14:34:58 +01:00
Transifex-Openfoodnetwork
d273e97b88 Updating translations for config/locales/de_DE.yml 2022-03-12 00:29:23 +11:00
Transifex-Openfoodnetwork
b410585449 Updating translations for config/locales/en_FR.yml 2022-03-11 23:43:53 +11:00
Transifex-Openfoodnetwork
ac08602d94 Updating translations for config/locales/fr.yml 2022-03-11 23:43:14 +11:00
Jean-Baptiste Bellet
147d15332c Update all locales with the latest Transifex translations 2022-03-11 09:17:43 +01:00
jibees
31b60ca069 Merge pull request #8949 from openfoodfoundation/transifex
Transifex
2022-03-11 09:15:24 +01:00
jibees
1c5ada4d7c Merge pull request #8970 from seballot/docker-nodejs
Docker: upgrade nodeJs from 10 to 14
2022-03-11 09:03:25 +01:00
jibees
04ed7e4a94 Merge pull request #8972 from jibees/8965-retrieve-scale-of-a-product-in-the-BOM-interface
Improve the way we get the unit value (g, oz, lb, ...) in the Bulk Order Management interface
2022-03-11 09:01:02 +01:00
jibees
d4a4a36b14 Merge pull request #8766 from jibees/8477-cancel-order-and-send-confirmation-email-on-last-item-deletion
Edit order: on last item deletion, cancel the order and conditionally send cancellation email to consumer
2022-03-11 08:56:41 +01:00
Filipe
6474055380 Merge pull request #8964 from jibees/8963-display-shipping-options-checkboxes
SplitCheckout: Display shipping options checkboxes on invalid form submit
2022-03-10 16:41:10 +00:00
Filipe
3cf2db68b1 Merge pull request #8945 from jibees/8914-do-not-display-shipping-method-backoffice-only-for-split-checkout
SplitCheckout: display only shipping method that are set as front end available
2022-03-10 16:13:42 +00:00
Filipe
1522263cfc Merge pull request #8893 from jibees/8889-handle-redirect-to-next-step-for-the-split-checkout
SplitCheckout: handle navigation between steps
2022-03-10 16:07:58 +00:00
Filipe
3e4b39c26b Merge pull request #8966 from jibees/8958-improve-use-of-checkboxes-values-in-split-checkout
Splitcheckout: Don't save bill|ship address when associated checkbox is not checked during checkout process
2022-03-10 15:48:27 +00:00
Jean-Baptiste Bellet
e3a529be5d Display only shipping method that are set as front end available
and update the tests as well
2022-03-10 16:15:50 +01:00
Jean-Baptiste Bellet
60ad92c4ff Display ship address options checkboxes
+ Create the associated test: the trick is is that the selected delivery method is the one that required address **and** is before others that do not required ship address
2022-03-10 15:55:10 +01:00
Jean-Baptiste Bellet
20d5c45b7a Remove :debug tag 2022-03-10 15:53:19 +01:00
Filipe
6ce29f81d8 Merge pull request #8920 from apricot12/Remove_checkout_only_option_from_payment_methods_display
Remove checkout only option from payment methods edit form.
2022-03-10 14:38:45 +00:00
dependabot[bot]
0b1697c62b Bump karma-chrome-launcher from 3.1.0 to 3.1.1
Bumps [karma-chrome-launcher](https://github.com/karma-runner/karma-chrome-launcher) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/karma-runner/karma-chrome-launcher/releases)
- [Changelog](https://github.com/karma-runner/karma-chrome-launcher/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-10 09:05:18 +00:00
Maikel
e2f68dac54 Merge pull request #8977 from filipefurtad0/split_checkout_fees
Split-checkout transaction and shipping fees
2022-03-10 10:47:27 +11:00
Sebastian Castro
6f6a78b5a2 Docker: upgrade nodeJs from 10 to 14 2022-03-09 09:28:59 +00:00
filipefurtad0
16fcde7053 Fixes rubocop offenses 2022-03-08 23:13:24 +00:00
filipefurtad0
a6486c2701 Adds assertion on the order confirmation page 2022-03-08 23:12:05 +00:00
filipefurtad0
509a114d51 Adds coverage on transaction fees for split checkout 2022-03-08 23:10:48 +00:00
filipefurtad0
1fdd36e491 Adds coverage on shipping fees, on split checkout 2022-03-08 22:30:14 +00:00
Jean-Baptiste Bellet
0ccba7f144 As the product unit is 'g', we now display information in 'g' 2022-03-08 15:52:50 +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
Jean-Baptiste Bellet
aa71e12020 Serialize variant_unit_scale to be used in the Bulk Order Managment
to retrieve scale of the product
2022-03-08 14:55:25 +01:00
Jean-Baptiste Bellet
1fe7ebcec2 Check uncheck save_bill|ship_address don't save bill|ship_address 2022-03-07 17:42:06 +01:00
Jean-Baptiste Bellet
440e5aaf97 Default checked/unchecked values for checkbox is 0/1 2022-03-07 17:41:05 +01:00
Filipe
53d1994b2a Merge pull request #8956 from Matt-Yorkley/welsh-javascript-fixes
Fix Angular interpolation for translations with apostrophes
2022-03-07 12:23:04 +00:00
Nihal Mohammed
e2bdc69a90 Update available_payment_methods method in enterprises_helper and order model 2022-03-07 17:33:09 +05:30
Nihal Mohammed
e0e800a53f Remove translations for checkout only from edit form and index for payment methods 2022-03-07 17:33:09 +05:30
Nihal Mohammed
3820d4c591 Removed checkout only from DISPLAY options on payment method edit form and updated payment_method_spec 2022-03-07 17:33:09 +05:30
Nihal Mohammed
b0fd333126 Added migration to update display_on column in spree_payment_methods table where string is 'front_end' to NULL 2022-03-07 17:32:23 +05:30
Filipe
5606be7199 Merge pull request #8944 from jibees/8940-display-update-button-on-order-unless-order-is-complete
Split checkout: Display "Update" button on the order table page unless order is complete
2022-03-07 11:58:34 +00:00
Transifex-Openfoodnetwork
8982b34342 Updating translations for config/locales/en_GB.yml 2022-03-07 22:34:59 +11:00
Filipe
be2898f5a2 Merge pull request #8916 from jibees/8894-login-during-guest-checkout
SplitCheckout: as guest user, after login should redirect to the first step of checkout
2022-03-07 09:20:12 +00:00
Filipe
80ad18a684 Merge pull request #8953 from jibees/8951-load-stripejs-in-test-environment
Change css selector from stripe elements in test environment.
2022-03-04 09:57:28 +00:00
Matt-Yorkley
6729119489 Fix Angular interpolation for translations with apostrophes 2022-03-03 20:59:04 +00:00
Transifex-Openfoodnetwork
0b6288d97f Updating translations for config/locales/hu.yml 2022-03-04 01:27:19 +11:00
Jean-Baptiste Bellet
f8f57a31db Use the right selector
In test env. we don't use the stripejs but a mock. Slightly different.
2022-03-03 14:14:39 +01:00
Transifex-Openfoodnetwork
9724b07062 Updating translations for config/locales/de_DE.yml 2022-03-03 03:48:11 +11:00
Filipe
0a9c3b1538 Merge pull request #8932 from filipefurtad0/change_paypal_spec
Clarifies context in checkout_paypal_spec and implements tests as shared examples
2022-03-02 12:21:13 +00:00
Transifex-Openfoodnetwork
87723217ec Updating translations for config/locales/ru.yml 2022-03-02 20:04:35 +11:00
Maikel
9a8082e35c Merge pull request #8947 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.17
Bump karma from 6.3.16 to 6.3.17
2022-03-02 11:27:28 +11:00
Transifex-Openfoodnetwork
bd031f4870 Updating translations for config/locales/en_FR.yml 2022-03-02 06:50:01 +11:00
Transifex-Openfoodnetwork
078309d4e7 Updating translations for config/locales/fr.yml 2022-03-02 06:12:32 +11:00
Jean-Baptiste Bellet
f47de45346 Reference splitcheckout as a checkout redirect
This stored in session value is used to redirect after login

Update tests as well, thanks @filipefurtad0 ! 🙏
2022-03-01 15:12:18 +01:00
Jean-Baptiste Bellet
e14dad1575 Update test on payment step 2022-03-01 14:51:24 +01:00
Jean-Baptiste Bellet
3e85762143 Create a test that test the redirection after the split checkout login
Should be redirected on the first step
2022-03-01 14:25:41 +01:00
Jean-Baptiste Bellet
96d4ee3f4f Extract to a method in the split checkout helper 2022-03-01 14:25:08 +01:00
Jean-Baptiste Bellet
2976b0717c Display "Update" button on the order table page unless order is complete
With the split checkout, we can access this page between the different steps: for this cases, cart actions should be displayed
2022-03-01 10:11:27 +01:00
dependabot[bot]
f573423d3a Bump karma from 6.3.16 to 6.3.17
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.16 to 6.3.17.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.16...v6.3.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 09:05:25 +00:00
Filipe
d052c4f8a4 Merge pull request #8869 from filipefurtad0/remove_signup_string
Removes signup string from private shop login screen
2022-03-01 08:20:06 +00:00
Maikel
c44de8dbb3 Merge pull request #8937 from openfoodfoundation/dependabot/npm_and_yarn/url-parse-1.5.10
Bump url-parse from 1.5.7 to 1.5.10
2022-03-01 11:26:43 +11:00
Maikel Linke
e266475cde Mark style violation as tech debt
There's an issue for it already and we want devs to be able to run
rubocop without seeing any issues they didn't introduce.
2022-03-01 11:21:31 +11:00
Filipe
1338bcbf57 Merge pull request #8939 from filipefurtad0/stock_spec_checkout_split
Checks stock restrictions on checkout split (system spec)
2022-02-28 16:42:58 +00:00
Filipe
d84b6ce2ad Merge pull request #8772 from filipefurtad0/add_specs_split_checkout_payment
[Split Checkout] Adds tests on payments
2022-02-28 16:42:12 +00:00
Jean-Baptiste Bellet
e47198f1e5 Handle both types of redirection
One is based on the order step itself, the other is based on the current step passed through the params
2022-02-28 15:23:37 +01:00
jibees
eeae67e2d0 Merge pull request #8935 from mkllnk/clean-rubocop
Relax our style guide
2022-02-28 15:16:46 +01:00
Filipe
499ad982c3 Merge pull request #8938 from filipefurtad0/controller_spec_checkout_split
Adds controller coverage for stock restrictions on split checkout
2022-02-28 10:32:46 +00:00
filipefurtad0
f6304892c2 Adds controller coverage for stock restrictions 2022-02-27 22:01:48 +00:00
filipefurtad0
7a6f3d67e2 Implements shared example; Checks stock restriction on payment step 2022-02-27 21:51:03 +00:00
filipefurtad0
eb56027505 Moves out-of-stock block within correct context 2022-02-27 19:56:45 +00:00
dependabot[bot]
f0cd9de1c3 Bump url-parse from 1.5.7 to 1.5.10
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-26 14:40:40 +00:00
Matt-Yorkley
50ab0731d7 Bump nokogiri to 1.13.2 2022-02-26 14:39:56 +00:00
filipefurtad0
8ac2035d0c Addresses style issue 2022-02-25 16:47:17 +00:00
filipefurtad0
751e817deb Renames shared_examples 2022-02-25 16:32:31 +00:00
filipefurtad0
82b6d39191 Re-names payment; addresses style issues 2022-02-25 16:06:26 +00:00
filipefurtad0
daffe333c5 Adds coverage on order completition for Cash/Paypal 2022-02-25 16:06:26 +00:00
filipefurtad0
c4bf36d402 Adds Stripe SCA to shared examples block 2022-02-25 16:06:26 +00:00
filipefurtad0
d336ab52a1 Adds Paypal to shared examples block 2022-02-25 16:06:26 +00:00
filipefurtad0
ae3eb90668 Adds shared examples block, with cash 2022-02-25 16:06:26 +00:00
filipefurtad0
09cd9b8462 Adds a test on payment method requirement 2022-02-25 16:06:26 +00:00
filipefurtad0
9449c7c919 Adds a context for existing test case 2022-02-25 16:06:26 +00:00
filipefurtad0
9dceda7e20 Creates a details test block; moves respective tests inside 2022-02-25 16:06:26 +00:00
Cillian O'Ruanaidh
21affa6250 Include language metatags in html template when more than one language available
Fixes #8902

This is to help Google find pages in all languages, see https://developers.google.com/search/docs/advanced/crawling/localized-versions
2022-02-25 12:49:49 +00:00
Maikel Linke
e6b4f462ef Revert "Add rubocop config to allow specs to be 300 lines long"
This reverts commit 0b51d8b297.

I think that this config was complicated in the setup and potentially
confusing to have different rules in different places.

It's better to fix those spec files by either making them smaller or
removing the `module` block in the spec. We can reference the modules
explicitely where needed.
2022-02-25 12:05:04 +11:00
Maikel Linke
cee6a0f17f Declare blocklength rules as agreed upon
The acceptance of this pull request will be the "agree" part. :-)
2022-02-25 11:57:43 +11:00
Maikel Linke
7acae6522b Relax cyclomatic complexity to community default
Why should we be more strict than the rest of the world?
2022-02-25 11:56:33 +11:00
Maikel Linke
2d1e746c64 Remove default values from contested settings
We can just use what the Rubocop community uses as default and we don't
need to spell it out again.
2022-02-25 11:51:35 +11:00
Maikel Linke
3382c1d0bb Relax some contested metrics rules
Rubocop often complains while we think that the code is totally fine. I
would like to achieve the default values one day but there are more
important issues at the moment.
2022-02-25 11:45:15 +11:00
Maikel Linke
0c89479de4 Update rubocop todo list 2022-02-25 11:05:36 +11:00
Maikel Linke
b999673dfc Remove old version of relaxed styled guide
We had an old version under "contested settings" and it looks like some
of them were modified. I hope that our new, separate file will
discourage manual tweaks.

We can include the relaxed rules from a gem as well. Let's see if we
need that complexity one day.
2022-02-25 10:51:54 +11:00
Maikel Linke
1d15f35522 Remove now unnecessary inline rubocop config 2022-02-25 10:46:51 +11:00
Maikel Linke
decab911bd Use relaxed Rubocop styleguide as basis
We then refine it with our own rules.
2022-02-25 10:44:32 +11:00
Matt-Yorkley
0b616aa9ce Update all locales with the latest Transifex translations 2022-02-24 23:34:16 +00:00
filipefurtad0
10217e2ec8 Sets guest and logged-in user as shared examples 2022-02-24 17:20:11 +00:00
filipefurtad0
9bf0667d04 Moves failed response stub into registered user context 2022-02-24 16:27:03 +00:00
Filipe
36e3f1b7a6 Merge pull request #8883 from jibees/8475-send-email-when-payment-needs-authorization
Backoffice order, using stripe payment: when card requires auth, send authorization email to guest user
2022-02-24 13:07:31 +00:00
Maikel Linke
8ffe6f6052 Sanitise user_id param on enterprise update 2022-02-24 14:51:23 +11:00
Maikel Linke
8e070f55ff Spec fail on bad enterprise param
It looks like some JS component can submit an invalid value here and it
causes a server error.
2022-02-24 14:46:42 +11:00
Matt-Yorkley
d945e69404 Merge pull request #8918 from openfoodfoundation/dependabot/npm_and_yarn/url-parse-1.5.7
Bump url-parse from 1.5.3 to 1.5.7
2022-02-22 08:17:02 +00:00
Filipe
385cd49964 Merge pull request #8876 from SarvarKh/product-import-validation
Fix product import on existing, empty unit_type and variant_unit
2022-02-21 23:20:04 +00:00
Filipe
28ac9d980c Merge pull request #8849 from jibees/render-pdf-with-stylesheet
Create a new method pdf_stylesheet_pack_tag that actually include CSS in PDF files
2022-02-21 23:09:21 +00:00
Filipe
dbf5eb76f8 Merge pull request #8689 from apricot12/Transaction_fee_when_crediting
Revoke transaction fee if there is an amount to be credited in order
2022-02-21 20:30:19 +00:00
Filipe
89dc9b938b Merge pull request #8864 from jibees/7934-display-tax-rate-for-shipping-on-invoice
Display tax rate for shipping in alternative invoice model
2022-02-21 20:02:44 +00:00
Filipe
7590b3ecf8 Merge pull request #8756 from jibees/8075-take-into-account-the-inherits_properties-attribute
Product that don't inherits from "producer"/"enterprise" properties should be filtered out by user on shop page
2022-02-21 19:04:08 +00: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
dependabot[bot]
07d20d2ba0 Bump url-parse from 1.5.3 to 1.5.7
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-19 09:25:58 +00:00
filipefurtad0
cefd5db6eb Renames require_login_3_html key 2022-02-18 11:07:37 +00:00
filipefurtad0
1113aefe11 Adds login modal test case from #8861 2022-02-17 13:19:32 +00:00
filipefurtad0
27bc5805ae Removes signup string from private shop login screen 2022-02-17 13:19:31 +00:00
Matt-Yorkley
6c695df917 Merge pull request #8895 from Matt-Yorkley/cloned-subscription-syncing
Sync subscriptions on newly-cloned order cycles
2022-02-17 12:44:39 +00:00
Matt-Yorkley
9a27addd14 Merge pull request #8763 from openfoodfoundation/8577-split-name-column-in-customers-table
Split name column in customers table
2022-02-17 11:57:01 +00:00
Filipe
a6c5d8ca73 Merge pull request #8673 from filipefurtad0/split_checkout_auth_spec
Adds split-checkout toggling lines
2022-02-17 11:10:44 +00:00
Filipe
4dbf047647 Merge pull request #8871 from jibees/8827-preselect-shipping-method
SplitCheckout: preselect the shipping/payment method if the only one available
2022-02-17 10:54:20 +00:00
Jean-Baptiste Bellet
bcd306ebd4 Authorize payment email could be send to guest user
Always send the email to the order.email value
2022-02-17 09:40:28 +01:00
Jean-Baptiste Bellet
012e91879a preselect the only available shipping method 2022-02-17 09:33:23 +01:00
Jean-Baptiste Bellet
716286497e Add test to cover "preselect the shipping method" if only one is available
+ do not preselect if more than one are available
2022-02-17 09:33:23 +01:00
Jean-Baptiste Bellet
7be2f418d0 preselect the only available payment method 2022-02-17 09:33:23 +01:00
Jean-Baptiste Bellet
0e053a2601 Add test to cover "preselect the payment method" if only one is available
+ do not preselect if more than one
2022-02-17 09:33:23 +01:00
Matt-Yorkley
00fa84e3b5 Sync when switching from nil dates to open 2022-02-16 21:45:43 +00:00
Matt-Yorkley
5913720c85 Sync for both open and upcoming OCs when switching from closed 2022-02-16 18:33:09 +00:00
Matt-Yorkley
4592827261 Sync OC subscriptions if transitioning from closed to open 2022-02-16 13:03:27 +00:00
Matt-Yorkley
4260422ea7 Remove a couple of unnecessary memory assignments 2022-02-16 12:55:19 +00:00
Matt-Yorkley
d4488fdb3f Return early if OC is closed 2022-02-16 12:53:22 +00:00
Matt-Yorkley
8c8b9d1b23 Sync subscriptions on newly-cloned order cycles 2022-02-16 10:44:22 +00:00
SarvarKhalimov
22de758e3a Add spec for product import validation 2022-02-16 14:17:35 +05:00
Maikel Linke
33969de371 Allow shared_examples to have more than 25 lines 2022-02-16 11:41:28 +11:00
Maikel Linke
a6dee77071 Style 2022-02-16 10:33:49 +11:00
filipefurtad0
78946f908a Adds shared examples; sets conditional filters on test cases 2022-02-15 23:23:31 +00:00
Matt-Yorkley
4c50ca69ea Improve data migration logic and add test coverage 2022-02-16 10:23:24 +11:00
Matt-Yorkley
fd815a6af6 Don't change Customer factory name generating logic 2022-02-16 10:23:24 +11:00
Matt-Yorkley
feaa92406a Split migration into two parts for easier testing 2022-02-16 10:23:24 +11:00
Maikel Linke
68193efcf6 Keep old customers.name column for compatibilty
Our app code will try to access the old attribute while the migration is
running. That would lead to errors during checkout.
2022-02-16 10:23:24 +11:00
François Turbelin
9a12957e27 Handle the empty-space name on customers 2022-02-16 10:23:23 +11:00
François Turbelin
de4d074cb3 Remove bill_address fetching logic 2022-02-16 10:23:23 +11:00
Maikel Linke
d09ba16411 Associate customers again
And simplify the before_validation actions.
2022-02-16 10:23:23 +11:00
Maikel Linke
07314af3f6 Spec customer record association more realistically
The newly added specs were tested on the master branch and passed. But
the previous commit broke one test case which I marked as pending here.

The removed specs are completely replaced by the new ones. Their main
downside was to test only small bits of internal behaviour without
considering the whole callback chain of the order. The new specs are
more realistic and catch bugs like mentioned above.
2022-02-16 10:23:23 +11:00
François Turbelin
554a8625e5 Refactor ensure_customer method 2022-02-16 10:23:23 +11:00
François Turbelin
5c9dd81595 Deal with nil attirubtes on bill_address 2022-02-16 10:23:23 +11:00
François Turbelin
6d986deb2d Remove translation changes from locale file 2022-02-16 10:23:23 +11:00
François Turbelin
4cb31d04a7 Repair specs with default values on ensure_customer method 2022-02-16 10:23:23 +11:00
François Turbelin
50302163c0 Update migration with better logic and cosmetics 2022-02-16 10:23:23 +11:00
François Turbelin
9682b9256b Arrange classes loading for good migration 2022-02-16 10:23:23 +11:00
François Turbelin
d016c47789 Refactor data migration to use data sets 2022-02-16 10:23:23 +11:00
François Turbelin
b8afb7ec4d Add default values for new fields 2022-02-16 10:23:23 +11:00
François Turbelin
836a60a6c7 Add missing full_name bind to subscriptions serializer 2022-02-16 10:23:23 +11:00
François Turbelin
23776c7a3e Fix more specs 2022-02-16 10:23:23 +11:00
François Turbelin
75345a95af Update customer factory 2022-02-16 10:23:22 +11:00
François Turbelin
eefd9891d6 Add en translations 2022-02-16 10:23:22 +11:00
François Turbelin
7c25127ab6 Improve first_name and last_name setup 2022-02-16 10:23:22 +11:00
Adrien Chauve
ca46359224 More fixes 2022-02-16 10:23:22 +11:00
Adrien Chauve
9b93102a96 More fixes 2022-02-16 10:23:22 +11:00
Adrien Chauve
ba6523bb76 Add Customer.full_name 2022-02-16 10:23:22 +11:00
Adrien Chauve
5ca4d549e7 Update customer creation 2022-02-16 10:23:22 +11:00
Adrien Chauve
d0f347efaa Add migration to split Customers.name into first and last names 2022-02-16 10:23:22 +11:00
Jean-Baptiste Bellet
405b7e6e17 Handle tax rates for ShippingMethod
Co-Authored-By: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-02-15 15:16:58 +01:00
Matt-Yorkley
711a51f2ff Remove .eligible scope
In this case we actually expect there to be no payment fee adjustments at all on the payment, regardless of their eligibility.
2022-02-15 12:24:28 +00:00
Matt-Yorkley
5fba7811c4 Remove #try
#try is useful when the object might be nil or might not respond to the given method. In this case we expect it to exist and respond to #finalized?, so this is a bit more precise.
2022-02-15 12:21:34 +00:00
Matt-Yorkley
5be1b139b9 Replace .stub with expect(x).to receive(:y)
The #stub method is slightly deprecated syntax. Using #expect has the additional benefit here of failing if the object does not receive the expected method call.
2022-02-15 12:19:15 +00:00
Matt-Yorkley
8084ad0068 Extract a comment-method so the code conveys it's purpose 2022-02-15 12:17:08 +00:00
Nihal M. Kelanthodika
b017420319 Add specs to check ensure payment method fee is not applied when crediting/refunding order 2022-02-15 11:52:26 +00:00
Nihal M. Kelanthodika
9215ccc353 Prevents creation of payment adnustment when refunding or crediting an order 2022-02-15 11:52:26 +00:00
Matt-Yorkley
7c7a09a75c Merge pull request #8880 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.19
Bump @storybook/addon-controls from 6.4.18 to 6.4.19
2022-02-15 11:33:04 +00:00
Matt-Yorkley
0d2374f07e Merge pull request #8881 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.19
Bump @storybook/server from 6.4.18 to 6.4.19
2022-02-15 11:32:47 +00:00
dependabot[bot]
1b7d72ffa7 Bump @storybook/server from 6.4.18 to 6.4.19
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/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-02-15 11:32:14 +00:00
dependabot[bot]
2952b0582a Bump @storybook/addon-controls from 6.4.18 to 6.4.19
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/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-02-15 11:31:49 +00:00
Matt-Yorkley
4726e7a8a4 Merge pull request #8879 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.19
Bump @storybook/addon-docs from 6.4.18 to 6.4.19
2022-02-15 11:31:00 +00:00
Matt-Yorkley
46c0baee4f Merge pull request #8885 from jibees/8882-handle-webpacker-error-for-email
Modify assets builder to get CSS inside emails when running in development mode
2022-02-15 11:23:42 +00:00
Maikel Linke
1d5ebe42a9 Update translations 2022-02-15 10:50:01 +11:00
Filipe
e9e5ad2221 Merge pull request #8865 from jibees/8769-use-the-user-in-the-request-to-check-flipper-constraint
Use the user in the request to check flipper constraint for split checkout urls
2022-02-14 19:38:27 +00:00
SarvarKhalimov
d69f42e940 Update app/models/product_import/entry_validator.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-02-15 00:10:32 +05:00
Filipe
2de2703e1f Merge pull request #8868 from jibees/8852-improve-total-cell-design-on-order-summary-table
SplitCheckout : Improve design of the order summary table
2022-02-14 18:48:20 +00:00
Filipe
a9d7fa473e Merge pull request #8870 from jibees/8853-handle-back-button-on-summary-page-for-the-split-checkout
Split checkout: handle the link for "Back to Payment method" button in the summary page
2022-02-14 18:29:11 +00:00
Filipe
ddfda4011d Merge pull request #8873 from Matt-Yorkley/stripe-retries
Update checkout retry logic
2022-02-14 15:28:56 +00:00
Matt-Yorkley
e4030e673d Merge pull request #8875 from openfoodfoundation/dependabot/npm_and_yarn/follow-redirects-1.14.8
Bump follow-redirects from 1.14.7 to 1.14.8
2022-02-14 14:03:59 +00:00
Jean-Baptiste Bellet
74ed878a0c Specify the asset host for the action mailer to get the assets
when running in development with webpacker running as well.
2022-02-14 14:54:09 +01:00
Filipe
6acd8a29f2 Merge pull request #8874 from Matt-Yorkley/puma-update
Update puma to latest version
2022-02-14 09:11:51 +00:00
dependabot[bot]
699e9acfa5 Bump @storybook/addon-docs from 6.4.18 to 6.4.19
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/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-02-14 09:03:42 +00:00
Matt-Yorkley
ad44bd854b Merge pull request #8878 from mkllnk/rubocop-action
Use our defined rubocop version on CI
2022-02-14 08:58:52 +00:00
Matt-Yorkley
3418e5282a Use our defined rubocop version on CI
The default is to use the latest version. That's often fine because we
keep our version up-to-date but it may not always be. It's also great if
builds are re-producible.
2022-02-14 15:56:18 +11:00
Maikel
7601bdfd45 Merge pull request #8867 from openfoodfoundation/transifex
Transifex
2022-02-14 11:20:00 +11:00
SarvarKhalimov
42a0a973ba Fix product import on existing, empty unit_type and variant_unit 2022-02-13 18:28:21 +05:00
dependabot[bot]
0338753421 Bump follow-redirects from 1.14.7 to 1.14.8
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 12:23:25 +00:00
Matt-Yorkley
996bc05b4f Merge pull request #8866 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.16
Bump karma from 6.3.15 to 6.3.16
2022-02-13 12:22:34 +00:00
Matt-Yorkley
15fc50441f Update puma to latest version 2022-02-13 10:54:45 +00:00
Matt-Yorkley
e5818955ff Invalidate all incomplete payments when creating a new one, not just those in "checkout" state.
Looking at prod data; when a checkout submission fails due to something like a card being out of date, the payment's state seems to be "pending" and not "checkout", which means this mechanism fro invalidating old payments is potentially not working where it should.
2022-02-11 17:25:27 +00:00
Jean-Baptiste Bellet
43cd604405 Update to the right link the "Back to Payment method" button
+ create a spec as well
2022-02-11 15:01:53 +01: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
Jean-Baptiste Bellet
f60068c0ce Use the proxy OpenFoodNetwork::FeatureToggle
that actually call Flipper.enabled?
2022-02-11 11:19:00 +01:00
Jean-Baptiste Bellet
e50247db5a Directly used the user in the request
not the memoized one @spree_current_user
2022-02-11 11:19:00 +01:00
Jean-Baptiste Bellet
d858d6f941 Improve design by aligning cell on right but with padding 2022-02-11 11:09:54 +01:00
Transifex-Openfoodnetwork
5519b8b455 Updating translations for config/locales/cy.yml 2022-02-11 21:02:57 +11:00
dependabot[bot]
dd4f45a504 Bump karma from 6.3.15 to 6.3.16
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.15 to 6.3.16.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-11 09:44:14 +00:00
Filipe
6e2c4a385a Merge pull request #8810 from Matt-Yorkley/split-checkout-tax
Reduce expensive tax recalculation calls
2022-02-10 17:42:39 +00:00
Filipe
d8936b412e Merge pull request #8819 from apricot12/8694-Improve_subsvriptions_index_perfomance
8694 improve subscriptions index perfomance by eager loading tags, suppliers and exchanges.
2022-02-10 17:37:00 +00:00
Filipe
820417e6cc Merge pull request #8828 from apricot12/8794-Keep_schedule_when_cloning_OC
Carry over linked schedule to cloned Order Cycle
2022-02-10 17:09:56 +00:00
Filipe
0802b04feb Merge pull request #8857 from jibees/8855-login-signup-on-private-shop
Open modal on login/signup links for a "Visible to Registered Customers Only" shop page
2022-02-10 13:47:02 +00:00
Jean-Baptiste Bellet
af8500e98c Add the test around the cancellation email sending or not 2022-02-10 14:39:00 +01:00
Jean-Baptiste Bellet
a99ecc473d Add tests around item deletion for an order 2022-02-10 14:39:00 +01:00
Jean-Baptiste Bellet
c9b19811ad Add missing i18n key 2022-02-10 14:39:00 +01:00
Jean-Baptiste Bellet
50f547af98 Add an attribute that conditions the sending of the cancellation email
true by default to not change the default behavior.
Can be set to false when sending params send_cancellation_email
2022-02-10 14:39:00 +01:00
Jean-Baptiste Bellet
8624fa2a85 On last item deletion, prevent user on order canceling and cancellation email
... with a modal.
User can cancel the modal or confirm the last item deletion & order cancelation with or without sending a cancellation email to the consumer.
2022-02-10 14:39:00 +01:00
Jean-Baptiste Bellet
17906f378a Create a method that actually adjust Items
Separate it from the adjustItems method that previously test about the item quantity
2022-02-10 14:34:39 +01:00
Jean-Baptiste Bellet
92cd918e5a Add LoginModal as controller + connect action to open login modal 2022-02-10 09:52:13 +01:00
Maikel Linke
9c786ff39e Update translations 2022-02-10 10:08:28 +11:00
Maikel
570f9f2dc0 Merge pull request #8837 from openfoodfoundation/transifex
Transifex
2022-02-10 10:04:20 +11:00
Maikel
fb920c8960 Merge pull request #8845 from mkllnk/swagger-cleanup
Add rspec tools for better integration of the coming API v1
2022-02-10 10:04:03 +11:00
Maikel
026d4dd087 Merge pull request #8848 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.5.1
Bump jest from 27.5.0 to 27.5.1
2022-02-10 09:50:32 +11:00
Maikel
463473f2c3 Merge pull request #8840 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.15
Bump karma from 6.3.13 to 6.3.15
2022-02-10 09:48:56 +11:00
Filipe
30c1d89525 Merge pull request #8822 from Matt-Yorkley/split-checkout-payment-total
[Split Checkout] Move setting of payment total during checkout into OrderUpdater
2022-02-09 16:21:47 +00:00
Transifex-Openfoodnetwork
61a4a72b97 Updating translations for config/locales/ru.yml 2022-02-09 23:30:55 +11:00
Jean-Baptiste Bellet
a951fd2c06 Create a new method pdf_stylesheet_pack_tag that actually include CSS file
If running in developpement (ie. `Webpacker.dev_server.running?`), use webpacker to actually render/serve the CSS files.

Source: https://stackoverflow.com/a/60541688
2022-02-09 11:21:50 +01:00
dependabot[bot]
4db72f7475 Bump jest from 27.5.0 to 27.5.1
Bumps [jest](https://github.com/facebook/jest) from 27.5.0 to 27.5.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.5.0...v27.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 09:04:31 +00:00
dependabot[bot]
0ebe46a17f Bump karma from 6.3.13 to 6.3.15
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.13 to 6.3.15.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.13...v6.3.15)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 08:38:21 +00:00
Matt-Yorkley
f065b4c787 Merge pull request #8847 from jibees/yarn-resolve-lock-file
Update js dependencies lock file
2022-02-08 12:30:36 +00:00
Matt-Yorkley
8dc743f2d4 Extract update_payment_total method 2022-02-08 12:27:42 +00:00
Matt-Yorkley
1c180299a5 Pass indexed payment method tags to PaymentMethod Serializer 2022-02-08 11:42:24 +00:00
Matt-Yorkley
37b5e1b014 Allow Payment Method Serializers to receive options 2022-02-08 11:42:24 +00:00
Nihal M. Kelanthodika
3152fef2ef Eager load distributors and cached_incoming_exchanges 2022-02-08 11:42:24 +00:00
Nihal M. Kelanthodika
f0d6cd1f59 Query payment_method_tags by id 2022-02-08 11:42:24 +00:00
Nihal M. Kelanthodika
ee77210e81 Eager load taggings in SubscriptionsController#Index 2022-02-08 11:42:24 +00:00
Matt-Yorkley
d1339fa253 Merge pull request #8833 from openfoodfoundation/dependabot/npm_and_yarn/webpack-dev-server-3.11.3
Bump webpack-dev-server from 3.11.2 to 3.11.3
2022-02-08 10:34:03 +00:00
Matt-Yorkley
eaeda23e4f Merge pull request #8838 from SarvarKh/updated-getting-started
Update GETTING_STARTED.md to include creation of a new user
2022-02-08 10:32:58 +00:00
Matt-Yorkley
65ed199ba9 Merge pull request #8842 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.5.0
Bump jest from 27.4.7 to 27.5.0
2022-02-08 10:31:16 +00:00
Jean-Baptiste Bellet
e6f7c961e1 Update yarn.lock 2022-02-08 10:26:22 +01:00
Maikel Linke
8f5cb7bd91 Update swagger files, separate v0 and v1, delete old file
The new v1 doesn't contain any API endpoints yet. We will add them later
when they are ready.
2022-02-08 11:44:36 +11:00
Matt-Yorkley
9d67606490 Generate rswag routes and helper 2022-02-08 11:43:49 +11:00
Matt-Yorkley
ae2726fc6b Generate rswag initializers
Done via rswag rake tasks and tidied up a bit.
2022-02-08 11:43:49 +11:00
Matt-Yorkley
3a6fc59f80 Add rswag support gems 2022-02-08 11:43:49 +11:00
Maikel
1ba56851bb Merge pull request #8839 from mkllnk/style
Update Rubocop todo list
2022-02-08 09:13:54 +11:00
SarvarKhalimov
97bdceb78a Update GETTING_STARTED.md to include creation of a new user 2022-02-08 00:11:11 +05:00
dependabot[bot]
c0c7663452 Bump jest from 27.4.7 to 27.5.0
Bumps [jest](https://github.com/facebook/jest) from 27.4.7 to 27.5.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.7...v27.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 09:04:54 +00:00
Jean-Baptiste Bellet
4a3e0ea9b9 Use the right scope to retrieve products based on properties 2022-02-07 08:57:18 +01:00
Jean-Baptiste Bellet
dfe8ed26d9 Update tests and use ransack to search with the new scope: with_properties 2022-02-07 08:57:18 +01:00
Maikel Linke
572a65b324 Create a scope to retrieve product based on its properties
both inherited and own product properties

Update the product spec to test the scope that concern properties
2022-02-07 08:57:18 +01:00
Jean-Baptiste Bellet
f8002ae49a Add some controller specs that handle the supplier_property filtering
with product that don't inherits properties
2022-02-07 08:57:18 +01:00
Jean-Baptiste Bellet
242459fae4 Create the test that actually failed and should not 2022-02-07 08:57:18 +01:00
Maikel Linke
d0bb52f709 Update Rubocop todo list 2022-02-07 16:55:45 +11:00
Maikel
78cbd7b5c7 Merge pull request #8834 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.18
Bump @storybook/addon-docs from 6.4.17 to 6.4.18
2022-02-07 16:29:50 +11:00
Maikel
0d729fa0a8 Merge pull request #8831 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.18
Bump @storybook/addon-controls from 6.4.17 to 6.4.18
2022-02-07 16:29:02 +11:00
dependabot[bot]
f2c3afdbfd Bump @storybook/addon-docs from 6.4.17 to 6.4.18
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.17 to 6.4.18.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.18/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-02-07 05:16:40 +00:00
Maikel
3ae5672d1a Merge pull request #8832 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.18
Bump @storybook/server from 6.4.17 to 6.4.18
2022-02-07 16:15:49 +11:00
Transifex-Openfoodnetwork
4c0b3bf9bf Updating translations for config/locales/en_IE.yml 2022-02-05 03:19:28 +11:00
Transifex-Openfoodnetwork
f7de43e8b7 Updating translations for config/locales/en_IE.yml 2022-02-05 03:16:24 +11:00
Matt-Yorkley
8a1fcf8a62 Update all locales with the latest Transifex translations 2022-02-04 15:50:32 +00:00
Matt-Yorkley
08d7a4de92 Merge pull request #8799 from openfoodfoundation/transifex
Transifex
2022-02-04 15:46:52 +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
Filipe
0777212607 Merge pull request #8774 from Matt-Yorkley/drop-dead-action
Remove unused controller action
2022-02-03 19:47:18 +00:00
Filipe
e403fc171d Merge pull request #8808 from Matt-Yorkley/login-modal
Remove all Angular code from Login/Signup process
2022-02-03 19:36:44 +00:00
Filipe
c4751d7056 Merge pull request #8813 from Matt-Yorkley/split-checkout-address-state
Split checkout: fix loading of saved addresses
2022-02-03 19:06:35 +00:00
Filipe
e2695fdbfb Merge pull request #8829 from mkllnk/8824-patch-aws-sdk
Fix image uploads by patching aws-sdk
2022-02-03 12:44:13 +00:00
dependabot[bot]
cd0542af85 Bump webpack-dev-server from 3.11.2 to 3.11.3
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.11.2 to 3.11.3.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/v3.11.3/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.11.2...v3.11.3)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-03 09:05:42 +00:00
dependabot[bot]
a8e29d7c07 Bump @storybook/server from 6.4.17 to 6.4.18
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.17 to 6.4.18.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.18/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-02-03 09:05:34 +00:00
dependabot[bot]
67be08b40e Bump @storybook/addon-controls from 6.4.17 to 6.4.18
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.17 to 6.4.18.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.18/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-02-03 09:05:19 +00:00
Maikel Linke
2e6d8c1216 Provide aws-sdk with working URI.encode method
The S3 class is calling URI.encode which is removed in Ruby 3. By
providing a URI module within the S3 class makes the S3 code call that
module instead.
2022-02-03 15:20:51 +11:00
Maikel Linke
6468b7d98d Spec image upload
The use of AWS S3 was untested before and it failed after upgrading to
Ruby 3.
2022-02-03 11:25:16 +11:00
Filipe
787b643832 Merge pull request #8818 from jibees/8793-specify-a-min-width-for-radio-input
Split checkout: specify a min width for radio input that improve the rendering on iOS
2022-02-02 18:31:27 +00:00
Nihal M. Kelanthodika
b45f0f3416 Update order_cycle model spec to account for cloning of schedule along with OC 2022-02-02 21:21:38 +05:30
Nihal M. Kelanthodika
6293e927bc Keep linked schedule when cloning OC 2022-02-02 19:13:48 +05:30
Maikel
433227cc09 Merge pull request #8820 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.13
Bump karma from 6.3.12 to 6.3.13
2022-02-02 14:46:46 +11:00
Matt-Yorkley
f77ecc1968 Improve and simplify return authorizations test setup 2022-02-01 11:39:07 +00:00
Matt-Yorkley
7235d1813d Update totals and payment explicitly in current (non-split) checkout 2022-02-01 11:39:07 +00:00
Matt-Yorkley
35392cb117 Remove Order#set_payment_amount! 2022-02-01 11:39:07 +00:00
Matt-Yorkley
31e6405125 Handle setting of payment amount during checkout in OrderUpdater 2022-02-01 11:39:07 +00:00
Filipe
ca0166a420 Merge pull request #8807 from Matt-Yorkley/closed-oc-payment-auth
Fix Stripe payment authorizing for closed order cycles
2022-02-01 11:16:31 +00:00
Filipe
998f7afdc4 Merge pull request #8523 from seballot/progress-for-ajax-request
Improve loading spinner display
2022-02-01 10:03:04 +00:00
Filipe
012527522c Merge pull request #8640 from jibees/8630-make-buttons-sticky
Make split checkout buttons sticky on step 3
2022-02-01 09:41:33 +00:00
dependabot[bot]
bbf10a7198 Bump karma from 6.3.12 to 6.3.13
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.12 to 6.3.13.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.12...v6.3.13)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 09:04:04 +00:00
Maikel
b995c3ed49 Merge pull request #8815 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.17
Bump @storybook/addon-controls from 6.4.14 to 6.4.17
2022-02-01 19:02:34 +11:00
dependabot[bot]
031258e1ee Bump @storybook/addon-controls from 6.4.14 to 6.4.17
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.14 to 6.4.17.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.17/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-02-01 06:06:09 +00:00
Maikel
e060a059d8 Merge pull request #8817 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.17
Bump @storybook/addon-docs from 6.4.14 to 6.4.17
2022-02-01 17:05:42 +11:00
dependabot[bot]
f02c79751c Bump @storybook/addon-docs from 6.4.14 to 6.4.17
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.14 to 6.4.17.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.17/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-02-01 05:40:34 +00:00
Maikel
2938de7eee Merge pull request #8816 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.17
Bump @storybook/server from 6.4.14 to 6.4.17
2022-02-01 16:39:47 +11:00
Filipe
8d18279f53 Merge pull request #8784 from apricot12/7398-Weight_field-on-non-weight-variants
Convert variant.weight into decimal if integer or 0.0 if nil
2022-01-31 18:55:31 +00:00
Matt-Yorkley
5eb88e020c Extract/clarify methods in tabs_controller 2022-01-31 16:35:41 +00:00
Matt-Yorkley
81f5755e3d Add tests for tabs_controller 2022-01-31 16:34:35 +00:00
Filipe
4e4d9bb5a5 Merge pull request #8804 from Matt-Yorkley/split-checkout-fees
[Split Checkout] Ensure fees are applied during checkout update
2022-01-31 16:26:22 +00:00
Matt-Yorkley
5b434ca7c4 Replace conditional with a guard clause 2022-01-31 15:55:35 +00:00
Matt-Yorkley
11ed1574ca Call #check_order_cycle_expiry in PaypalController and StripeController, but avoid it on #authorize action
The authorize action is used for authorizing off-session payments where the order is *already complete* and the order cycle may have closed (backoffice and subscriptions). They are essentially asynchronous and not coupled to the current open/closed state of the order cycle.
2022-01-31 15:55:35 +00:00
Matt-Yorkley
5e6dd1e6e1 Move #check_order_cycle_expiry method to OrderStockCheck and don't call it from BaseController :before_action callback 2022-01-31 15:55:35 +00:00
Jean-Baptiste Bellet
d97381548a Specify a min width for radio 2022-01-31 15:50:37 +01:00
Nihal M. Kelanthodika
ddaac654ef Add specs for conversion of variant weight input into decimal/0.0 2022-01-31 17:43:15 +05:30
Jean-Baptiste Bellet
da6be441f8 Make sticky buttons fullwidth on mobile 2022-01-31 11:47:35 +01:00
Jean-Baptiste Bellet
ae0a71b29d This row adds an extra space on the right of the page
which introduce an horizontal scroll: visual regression
2022-01-31 11:47:21 +01:00
Filipe
6dac65ace5 Merge pull request #8803 from Matt-Yorkley/buttons-regression
Fix visual regression on filter buttons
2022-01-31 10:32:57 +00:00
Jean-Baptiste Bellet
fdeadd0940 Reduce margin on step3 since the container could be a little too high 2022-01-31 11:31:32 +01:00
Jean-Baptiste Bellet
d8391aa1d3 Create a div with a special class (checkout-step3)
... and attach the controller to it

Add the T&Cs inside the sicked container with submit buttons
2022-01-31 11:31:32 +01:00
Jean-Baptiste Bellet
293bc10dde Create a sticky controller that handle the sticky position of an element
.. at the bottom
And then add the sticked class to this element if the element is actually sticked
2022-01-31 11:31:32 +01:00
Jean-Baptiste Bellet
3abef1b703 Specify css for this sticky container
with a nice box-shadow.
Handle special case for mobile view (ie. max width 700px)
2022-01-31 11:31:32 +01:00
Matt-Yorkley
5f02ab79d4 Adjust animation handling for show/hide 2022-01-31 10:02:09 +00:00
Transifex-Openfoodnetwork
8e1272b1e8 Updating translations for config/locales/en_GB.yml 2022-01-31 20:47:33 +11:00
dependabot[bot]
091c04427c Bump @storybook/server from 6.4.14 to 6.4.17
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.14 to 6.4.17.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.17/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-01-31 09:04:40 +00:00
Matt-Yorkley
7c0a631f7f Remove an unnecessary assignment
Co-authored-by: Maikel <maikel@email.org.au>
2022-01-31 08:40:58 +00:00
Matt-Yorkley
0516ec6f15 Enable test for loading address (now passing) 2022-01-30 11:33:31 +00:00
Matt-Yorkley
5e321c9f48 Fix country/state selection for shipping address; missing controller and data 2022-01-30 11:33:31 +00:00
Matt-Yorkley
611beb2e90 Rearrange controller placement, field order, and nesting 2022-01-30 11:33:31 +00:00
Matt-Yorkley
908a22bcb6 Don't repopulate states select on page load; breaks pre-filling selection from saved address 2022-01-30 11:33:31 +00:00
Matt-Yorkley
370ec17818 Improve countries and states loading 2022-01-30 11:33:31 +00:00
Matt-Yorkley
bf4428b688 Tidy up dependent-select controller 2022-01-30 11:33:31 +00:00
Matt-Yorkley
7e62bfcdfb Add failing test for loading address with state correctly in split checkout 2022-01-30 11:33:31 +00:00
Matt-Yorkley
f5bde96701 Merge pull request #8812 from Matt-Yorkley/temp-translation
Disable test which depends on missing Transifex keys
2022-01-29 20:09:22 +00:00
Matt-Yorkley
f4fdc8740e Disable test that depends on missing Transifex keys 2022-01-29 20:06:46 +00:00
Matt-Yorkley
448e4bb67b Reduce expensive tax recalculation calls
This can only really be enabled once we've merged the split checkout
2022-01-29 18:56:52 +00:00
Transifex-Openfoodnetwork
22d5a63a5b Updating translations for config/locales/ar.yml 2022-01-30 03:59:54 +11:00
Matt-Yorkley
f3792acf55 Drop workaround previously required to avoid a bug caused by the stringex gem 2022-01-29 14:49:23 +00:00
Matt-Yorkley
8b59ef20db Improve controller tests 2022-01-29 14:49:23 +00:00
Matt-Yorkley
794e0e0326 Delete old login modal code 2022-01-29 14:49:23 +00:00
Matt-Yorkley
13a7fb79cf Move more login handling out of Angular 2022-01-29 14:49:23 +00:00
Matt-Yorkley
77d8e7da90 Use non-Angular login modal in /registration pages 2022-01-29 14:49:23 +00:00
Matt-Yorkley
a522e597e1 Add Matamo event 2022-01-29 14:49:23 +00:00
Matt-Yorkley
6116fd8881 Improve inaccurate specs 2022-01-29 14:49:23 +00:00
Matt-Yorkley
50389a864a Improve dynamic Angular Bootstrapping 2022-01-29 14:49:23 +00:00
Matt-Yorkley
89e692c6c8 Switch to CableCar for login responses 2022-01-29 14:49:23 +00:00
Matt-Yorkley
0577b46f3f Create simpler non-Angular login modal 2022-01-29 14:49:23 +00:00
Matt-Yorkley
8a18a4de66 Clear up redirecting logic and path building 2022-01-29 10:08:51 +00:00
Matt-Yorkley
04da148af0 Decouple login modal opening from Angular 2022-01-29 10:08:51 +00:00
Matt-Yorkley
6561a7246b Delete unused partial 2022-01-29 10:08:51 +00:00
Matt-Yorkley
798af2dafc Drop unused #create action 2022-01-29 10:08:50 +00:00
Transifex-Openfoodnetwork
a6bf6470f7 Updating translations for config/locales/de_DE.yml 2022-01-29 12:14:24 +11:00
Filipe
e63225d389 Merge pull request #8727 from Matt-Yorkley/js-matomo-login
Move Matomo event tracking for login modal into Authentication service
2022-01-28 20:02:46 +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
Matt-Yorkley
6c6e5ca316 Ensure fees are applied during checkout 2022-01-28 11:38:23 +00:00
Matt-Yorkley
4ace7efd97 Fix visual regression on filter buttons 2022-01-28 10:40:01 +00:00
Transifex-Openfoodnetwork
6856f21e7e Updating translations for config/locales/it.yml 2022-01-28 19:05:08 +11:00
Transifex-Openfoodnetwork
aae40c74a9 Updating translations for config/locales/en_US.yml 2022-01-28 10:15:26 +11:00
Transifex-Openfoodnetwork
0397a68072 Updating translations for config/locales/fr_CA.yml 2022-01-28 09:31:49 +11:00
Transifex-Openfoodnetwork
ccb9df708b Updating translations for config/locales/en_CA.yml 2022-01-28 09:24:03 +11:00
Matt-Yorkley
8c33dc16e8 Update all locales with the latest Transifex translations 2022-01-27 18:24:01 +00:00
Matt-Yorkley
b588ab78b7 Merge pull request #8777 from openfoodfoundation/transifex
Transifex
2022-01-27 18:17:06 +00:00
Matt-Yorkley
73259d4fb7 Merge pull request #8797 from Matt-Yorkley/digest
Add digest gem explicitly
2022-01-27 18:09:14 +00:00
Matt-Yorkley
a535acc256 Add digest gem explicitly
This was previously part of the standard lib in Ruby, but is being transitioned to an external gem. Fixes console warning:

"warning: already initialized constant Digest::REQUIRE_MUTEX"
2022-01-27 15:51:27 +00:00
Filipe
49030049dd Merge pull request #8732 from Matt-Yorkley/template-cull
Remove some Angular templates
2022-01-27 15:18:06 +00:00
Transifex-Openfoodnetwork
2eed23d14b Updating translations for config/locales/fr.yml 2022-01-28 00:24:38 +11:00
Transifex-Openfoodnetwork
2e3bc758e3 Updating translations for config/locales/en_FR.yml 2022-01-28 00:24:36 +11:00
Matt-Yorkley
0bec693655 Merge pull request #8791 from Matt-Yorkley/split-checkout-terms
[Split Checkout] Update terms of service handling
2022-01-27 13:07:04 +00:00
Nihal M. Kelanthodika
23a7ba2479 Added before_save callback to convert variant weight to decimal and 0.0 if nil 2022-01-27 16:33:14 +05:30
Matt-Yorkley
312e6c3326 Merge pull request #8796 from Matt-Yorkley/drop-embedded-shops
Remove embedded shopfronts code
2022-01-27 10:05:51 +00:00
Transifex-Openfoodnetwork
9a46eaffba Updating translations for config/locales/en_FR.yml 2022-01-27 19:18:10 +11:00
Transifex-Openfoodnetwork
135b629134 Updating translations for config/locales/fr.yml 2022-01-27 19:17:46 +11:00
Matt-Yorkley
1ee3d0f7a1 Drop embedded shops code 2022-01-26 19:58:39 +00:00
Filipe
75395f6f29 Merge pull request #8648 from Matt-Yorkley/csp
Configure CSP
2022-01-26 19:55:11 +00:00
Filipe
28a126024f Merge pull request #8722 from cillian/remove-unused-js-from-products-form
Remove unused inline JavaScript from products/_form.html.haml
2022-01-26 19:14:24 +00:00
Filipe
374c05116b Merge pull request #8726 from Matt-Yorkley/stringex-machina
Reduce impact of stringex gem
2022-01-26 19:02:41 +00:00
Filipe
54083ea803 Merge pull request #8738 from jibees/add-locale-to-stripe-elements
Add locale to stripe elements options to display stripe error messages in globale interface chosen language
2022-01-26 19:01:37 +00:00
Filipe
62457f0c69 Merge pull request #8778 from georgethoppil/master
Adding deleted_at check on variant_stock move
2022-01-26 17:33:29 +00:00
Filipe
404fb4cb7f Merge pull request #8771 from tsara27/8458-missing-translation
Missing translation: table headers in product import validation table #8458
2022-01-26 17:22:44 +00:00
Filipe
53b96896a9 Merge pull request #8779 from mkllnk/7872-remove-stripe-connect
Upgrade old Stripe Connect payment methods to Stripe SCA and remove Stripe Connect
2022-01-26 11:57:26 +00:00
Filipe
cea4714296 Merge pull request #8761 from Dmoment/8457-missng-translation-or-between-buttons
removed translation or between buttons
2022-01-26 10:04:41 +00:00
Filipe
30b3b7455d Merge pull request #8717 from jibees/6139-improve-radio-button-on-split-checkout
SplitCheckout: adjust display of long shipping method or payment method label
2022-01-25 16:32:38 +00:00
Filipe
8715e9865b Merge pull request #8643 from jibees/8623-disable-save-card-option
Split Checkout: Show "Save card for future use" checkbox only on "Enter new card details" option selected
2022-01-25 16:11:20 +00:00
Filipe
733d788215 Merge pull request #8758 from Matt-Yorkley/split-checkout-payments
Split checkout: external payment processing
2022-01-25 15:55:56 +00:00
Matt-Yorkley
bfe70691c2 Add test coverage for accepting terms of service 2022-01-25 15:19:32 +00:00
Matt-Yorkley
6e8bb777e6 Show platform and distributor terms and conditions 2022-01-25 15:16:43 +00:00
jibees
b175375510 Merge pull request #8789 from Matt-Yorkley/drop-example-spec
Remove example system spec
2022-01-25 15:07:59 +01:00
Matt-Yorkley
31349ed3ae Remove example system spec 2022-01-25 13:45:15 +00:00
Matt-Yorkley
51990e978b Merge pull request #8786 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.12
Bump karma from 6.3.11 to 6.3.12
2022-01-25 10:12:44 +00:00
dependabot[bot]
79547a07f7 Bump karma from 6.3.11 to 6.3.12
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.11 to 6.3.12.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 09:04:15 +00:00
Matt-Yorkley
caab2421b3 Merge pull request #8785 from mkllnk/8702-flaky-ticket-spec
Wait for JS in ticket printing spec for consistent pass
2022-01-25 09:03:11 +00:00
Maikel Linke
828e3ab08d Wait for JS in spec for consistent pass 2022-01-25 14:12:50 +11:00
Maikel
792fc4bc6d Merge pull request #8782 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.14
Bump @storybook/server from 6.4.13 to 6.4.14
2022-01-25 14:11:24 +11:00
dependabot[bot]
b20cbf010c Bump @storybook/server from 6.4.13 to 6.4.14
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.13 to 6.4.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.14/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-01-25 01:32:10 +00:00
Maikel
3dabb9a99c Merge pull request #8781 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.14
Bump @storybook/addon-docs from 6.4.13 to 6.4.14
2022-01-25 12:31:36 +11:00
dependabot[bot]
5a0ab0380d Bump @storybook/addon-docs from 6.4.13 to 6.4.14
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.13 to 6.4.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.14/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-01-25 00:04:55 +00:00
Maikel
662bc6816d Merge pull request #8780 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.14
Bump @storybook/addon-controls from 6.4.13 to 6.4.14
2022-01-25 11:04:16 +11:00
Matt-Yorkley
b5a1d9ebef Allow using saved cards at checkout 2022-01-24 23:06:43 +00:00
George Thoppil
77e5aab6c8 Merge branch 'openfoodfoundation:master' into master 2022-01-24 16:48:21 -05:00
Matt-Yorkley
8c9ca3b0c3 Extract method and allow Stripe payment completion on orders in confirmation state 2022-01-24 20:49:06 +00:00
Matt-Yorkley
8552da2377 Extract and stub PaymentMethodFetcher 2022-01-24 20:28:59 +00:00
Matt-Yorkley
ebb69d7f93 Add controller test for payment redirect 2022-01-24 20:28:59 +00:00
Matt-Yorkley
167adb3ddc Memoize selected_payment_method 2022-01-24 20:28:59 +00:00
Matt-Yorkley
02590014ab Improve split checkout feature toggle 2022-01-24 20:28:59 +00:00
Matt-Yorkley
50b82d347b Redirect to payment gateway during order confirmation 2022-01-24 20:28:59 +00:00
Matt-Yorkley
41d2fdb368 Bump cable_ready 2022-01-24 20:28:59 +00:00
Matt-Yorkley
b86e2c8c16 Merge pull request #8757 from Matt-Yorkley/ruby-3
Upgrade to Ruby 3
2022-01-24 19:54:13 +00:00
Matt-Yorkley
4082b867af Merge pull request #8783 from openfoodfoundation/dependabot/npm_and_yarn/node-fetch-2.6.7
Bump node-fetch from 2.6.1 to 2.6.7
2022-01-24 16:30:45 +00:00
Matt-Yorkley
41d56ce98b Add rexml
This was previously included in Ruby, and has now been extracted. It's used by activemerchant and selenium and possibly others, but those gems don't currently declare it as a dependency.
2022-01-24 14:34:48 +00:00
GeorgeThoppil
b2e9106654 Linting/Trailing whitespace 2022-01-24 09:30:55 -05:00
Matt-Yorkley
21a3a6e338 Update bootsnap 2022-01-24 14:11:08 +00:00
Matt-Yorkley
48a7cfa09e Fix more deprecated keyword arguments 2022-01-24 14:11:08 +00:00
Matt-Yorkley
f7b65efb00 Bump to Ruby 3.0.3 2022-01-24 14:11:08 +00:00
Matt-Yorkley
8ec7d3b651 Fix use of deprecated keyword args syntax in reports 2022-01-24 14:11:08 +00:00
Matt-Yorkley
783c097653 Update roo gem for Ruby 3 compatibility 2022-01-24 14:11:08 +00:00
Matt-Yorkley
06b2031914 Update Ruby to 3.0.2 2022-01-24 14:11:08 +00:00
George Thoppil
745758b7de Update spec/models/spree/order_spec.rb
Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-01-24 09:06:09 -05:00
Filipe
1ddff2c4bf Merge pull request #8678 from Matt-Yorkley/dead-code-js-uri
Remove outdated jsUri
2022-01-24 13:15:02 +00:00
dependabot[bot]
7eed639164 Bump node-fetch from 2.6.1 to 2.6.7
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 13:01:44 +00:00
Filipe
82b24026a7 Merge pull request #8747 from openfoodfoundation/dependabot/bundler/monetize-1.12.0
Bump monetize from 1.11.0 to 1.12.0
2022-01-24 13:01:08 +00:00
Filipe
1120e4e460 Merge pull request #8759 from jibees/8547-use-the-last-payment-in-the-Payment-Method-Report
Use the last payment method instead of the first for the Payment Method Report
2022-01-24 12:51:08 +00:00
Filipe
f17226ffbe Merge pull request #8438 from cillian/show-out-of-stock-line-items
If an order has out of stock line items display them and let admins remove them
2022-01-24 12:18:19 +00:00
dependabot[bot]
93619cffdf Bump @storybook/addon-controls from 6.4.13 to 6.4.14
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.13 to 6.4.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.14/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-01-24 09:05:56 +00:00
Maikel Linke
19909deaf6 Remove obsolete StripeConnect payment gateway
The newer StripeSCA is a complete replacement.
2022-01-24 12:35:45 +11:00
Maikel Linke
ee85b9654d Remove references to StripeConnect class 2022-01-24 12:35:45 +11:00
Maikel Linke
f22c2b0e73 Remove option to create StripeConnect methods 2022-01-24 12:35:45 +11:00
Maikel Linke
191646b611 Update Stripe config description 2022-01-24 12:35:45 +11:00
Maikel Linke
9abacf9047 Upgrade old StripeConnect payment methods to SCA
StripeConnect has been replaced by StripeSCA. But we still have some
StripeConnect payment methods in our production databases. We need to
convert them to StripeSCA methods before we can remove the related
code and clean up. Otherwise our code would raise errors when
encountering an old StripeConnect method, not knowing what that is.
2022-01-24 12:35:45 +11:00
Maikel
205fb630cb Fix typos in release task template 2022-01-24 10:23:51 +11:00
GeorgeThoppil
f1c4f80be4 Adding deleted_at check on variant_stock move 2022-01-23 13:45:54 -05:00
Matt-Yorkley
04e2b8728b Merge pull request #8775 from openfoodfoundation/dependabot/npm_and_yarn/log4js-6.4.0
Bump log4js from 6.3.0 to 6.4.0
2022-01-22 10:56:18 +00:00
Matt-Yorkley
658011d574 Merge pull request #8776 from openfoodfoundation/dependabot/npm_and_yarn/nanoid-3.2.0
Bump nanoid from 3.1.30 to 3.2.0
2022-01-22 10:47:55 +00:00
Transifex-Openfoodnetwork
61b09a456b Updating translations for config/locales/it.yml 2022-01-22 21:20:24 +11:00
dependabot[bot]
5e21ae23c0 Bump nanoid from 3.1.30 to 3.2.0
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 09:49:33 +00:00
dependabot[bot]
30df9e5139 Bump log4js from 6.3.0 to 6.4.0
Bumps [log4js](https://github.com/log4js-node/log4js-node) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/log4js-node/log4js-node/releases)
- [Changelog](https://github.com/log4js-node/log4js-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/log4js-node/log4js-node/compare/v6.3.0...v6.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 22:50:55 +00:00
Matt-Yorkley
e077607767 Remove unused controller action 2022-01-21 21:31:42 +00:00
Tsara Sudrajat
56ac2e4e61 Convert product headings to load from translation 2022-01-21 18:30:38 +07:00
Filipe
42c6cea78d Merge pull request #8739 from Matt-Yorkley/split-checkout-completion
Split checkout completion
2022-01-20 14:38:01 +00:00
Deepak Chauhan
5a6f322fd7 Merge branch 'master' into 8457-missng-translation-or-between-buttons 2022-01-20 15:41:15 +05:30
Deepak Chauhan
45660b48bb removed or from admin/show_more.html.haml and split_checkout/_guest.html.haml 2022-01-20 15:35:58 +05:30
Deepak Chauhan
018e19c2c8 removed translation or from _edit_resourse_link to prevent rspec failing 2022-01-20 13:05:05 +05:30
Deepak Chauhan
3b3eb1e522 removed translation or from en.yml 2022-01-20 10:15:44 +05:30
Maikel
ae38d94d71 Merge pull request #8743 from openfoodfoundation/transifex
Transifex
2022-01-20 10:54:10 +11:00
Matt-Yorkley
2f7ef33caf Add test for maintaining hub selection after order completion 2022-01-19 22:43:54 +00:00
Matt-Yorkley
0f154de235 Use OrderCompletion in split checkout for #order_completion_reset 2022-01-19 17:51:03 +00:00
Matt-Yorkley
fb8f5ee5ce Increase flexibility in test setup 2022-01-19 17:51:03 +00:00
Matt-Yorkley
49623f6b4a Simplify test setup 2022-01-19 17:51:03 +00:00
Matt-Yorkley
d57e64cf7e Add new order factories for checkout steps 2022-01-19 17:49:05 +00:00
Filipe
2e85783465 Merge pull request #8731 from Matt-Yorkley/split-checkout-default-addresses
Split checkout: default address saving
2022-01-19 17:43:51 +00:00
Filipe
7444e2d2f3 Merge pull request #8741 from Matt-Yorkley/guest-checkout-login
Fix split checkout guest user login
2022-01-19 16:43:24 +00:00
Filipe
baa3f64839 Merge pull request #8751 from openfoodfoundation/dependabot/bundler/rails-i18n-7.0.1
Bump rails-i18n from 6.0.0 to 7.0.1
2022-01-19 15:49:06 +00:00
Transifex-Openfoodnetwork
ec2bb34023 Updating translations for config/locales/ru.yml 2022-01-20 01:30:50 +11:00
Matt-Yorkley
2b960a04c6 Move Order callback entirely into service 2022-01-19 13:40:33 +00:00
Matt-Yorkley
8a944e3e78 Tidy up Order#save_default_addresses 2022-01-19 13:40:33 +00:00
Matt-Yorkley
8f37aa71f2 Save default addresses when requested during checkout 2022-01-19 13:40:33 +00:00
Matt-Yorkley
fb00a51ae8 Merge pull request #8653 from Matt-Yorkley/split-checkout-t-and-c
Split checkout T&Cs
2022-01-19 13:39:15 +00:00
Matt-Yorkley
21ed136e00 Enable opening login modal via broadcasted DOM Event 2022-01-19 13:14:10 +00:00
Matt-Yorkley
8ce27bed86 Move guest checkout handling to the frontend 2022-01-19 13:14:10 +00:00
Matt-Yorkley
27c7b16b03 Merge pull request #8748 from openfoodfoundation/dependabot/bundler/ddtrace-0.54.1
Bump ddtrace from 0.53.0 to 0.54.1
2022-01-19 09:50:10 +00:00
Maikel
a5b0324f76 Merge pull request #8750 from openfoodfoundation/dependabot/bundler/activerecord-import-1.3.0
Bump activerecord-import from 1.2.0 to 1.3.0
2022-01-19 15:13:41 +11:00
Maikel
31341537ff Merge pull request #8749 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.13.2
Bump rubocop-rails from 2.12.4 to 2.13.2
2022-01-19 15:12:07 +11:00
Maikel
88be980456 Merge pull request #8746 from openfoodfoundation/dependabot/bundler/stripe-5.42.0
Bump stripe from 5.39.0 to 5.42.0
2022-01-19 15:08:24 +11:00
Maikel
273d41fcd8 Merge pull request #8745 from openfoodfoundation/dependabot/bundler/listen-3.7.1
Bump listen from 3.7.0 to 3.7.1
2022-01-19 15:07:02 +11:00
Deepak Chauhan
7adc1186c6 removed transaltion or between buttons from multiple views 2022-01-19 03:16:55 +05:30
Matt-Yorkley
a6408007db Merge pull request #8683 from filipefurtad0/add_specs_split_checkout_1
Adds additional test coverage on step 1
2022-01-18 21:12:27 +00:00
Deepak Chauhan
1ed5b3a3f6 removed translation or between buttons 2022-01-19 02:01:29 +05:30
Jean-Baptiste Bellet
8455d79f9b Use the last payment method instead of the first for the Payment Method Report 2022-01-18 20:35:08 +01:00
filipefurtad0
9ef8e86e59 Removes xpath within blocks on spec file 2022-01-18 18:09:14 +00:00
filipefurtad0
f250f6dc53 Updates mandatory field error count after merging #8691 2022-01-18 15:12:15 +00:00
filipefurtad0
63ae159091 Changes assertion from URL to page content on spec file 2022-01-18 15:10:31 +00:00
filipefurtad0
3b6bb1c9a8 Removes within blocks; replaces field names by ids 2022-01-18 14:39:24 +00:00
filipefurtad0
ee601bb357 Uses reload to fetch bill/ship address ids 2022-01-18 14:39:24 +00:00
filipefurtad0
25244725e9 Changes assertion from URL to page content 2022-01-18 14:39:24 +00:00
filipefurtad0
ab2d92ab8f Applies helper change on spec file 2022-01-18 14:39:24 +00:00
filipefurtad0
22d9da9edc Changes helper name 2022-01-18 14:39:24 +00:00
filipefurtad0
ec4ec66051 Corrects rubocop offense 2022-01-18 14:39:24 +00:00
filipefurtad0
f3e0799205 Adds DB validation for same ship and bill addresses 2022-01-18 14:39:24 +00:00
filipefurtad0
3ad8e2df4f Adds coverage on mandatory fields - details/billing/shipping 2022-01-18 14:39:24 +00:00
filipefurtad0
0da2d6e469 Adds coverage for required fields - address shipping 2022-01-18 14:39:24 +00:00
filipefurtad0
01f870b818 Adds coverage on ship_address_same_as_billing option 2022-01-18 14:39:24 +00:00
Matt-Yorkley
9acc67d413 Use https when loading google maps JS 2022-01-18 12:22:06 +00:00
Matt-Yorkley
931e68ef6f Update script sources for google maps and bugnsag 2022-01-18 12:22:06 +00:00
Matt-Yorkley
a6af9b3ad5 Disable CSP on order ticket printing via QZ 2022-01-18 12:22:06 +00:00
Matt-Yorkley
8bb3fddbed Use https when loading fonts in admin 2022-01-18 12:22:06 +00:00
Matt-Yorkley
4c9e64589b Update style sources 2022-01-18 12:22:06 +00:00
Matt-Yorkley
6b0d5e01d5 Move preview pages to fixtures 2022-01-18 12:22:06 +00:00
Matt-Yorkley
accb9228ee Tidy up embedding specs 2022-01-18 12:22:06 +00:00
Matt-Yorkley
d691940623 Simplify header checking in tests 2022-01-18 12:22:06 +00:00
Matt-Yorkley
6af5f46d30 Update CSP; re-enable Angular templates
We really need to remove all those Angular templates as soon as possible, and then revert this commit...
2022-01-18 12:22:06 +00:00
Matt-Yorkley
e8f3fe8510 Update header checks in tests 2022-01-18 12:22:06 +00:00
Matt-Yorkley
dfbd384c95 Refactor embedding to a Concern 2022-01-18 12:22:06 +00:00
Matt-Yorkley
4649698fc4 Remove #set_response_headers 2022-01-18 12:19:54 +00:00
Matt-Yorkley
6a3ca98ac6 Add frame-ancestors to CSP 2022-01-18 12:19:54 +00:00
Matt-Yorkley
05abb63036 Remove X-Frame-Options header
This header is largely deprecated, and is functionally replaced here by use of the frame-ancestors CSP configuration
2022-01-18 12:19:54 +00:00
Matt-Yorkley
ce9b64a848 Set Angular CSP
If you don't set this flag, Angular helpfully attempts to check if this is disabled by *triggering* a CSP violation just to see what happens... 🙈
2022-01-18 12:19:54 +00:00
Matt-Yorkley
114a9d8993 Allow unsafe_inline 2022-01-18 12:19:54 +00:00
Matt-Yorkley
0fc6b4c882 Add some whitelisting 2022-01-18 12:19:54 +00:00
Matt-Yorkley
0dd97a631e Set CSP configuration 2022-01-18 12:19:54 +00:00
Matt-Yorkley
e1849e5fb6 Merge pull request #8752 from openfoodfoundation/dependabot/bundler/bugsnag-6.24.1
Bump bugsnag from 6.24.0 to 6.24.1
2022-01-18 12:09:51 +00:00
jibees
8a3c188f31 Merge pull request #8753 from openfoodfoundation/dependabot/bundler/sidekiq-6.3.1
Bump sidekiq from 6.2.2 to 6.3.1
2022-01-18 12:17:20 +01:00
Matt-Yorkley
1f31aed56d Merge pull request #8754 from Matt-Yorkley/json
Bump json gem back up to 2.6.1
2022-01-18 10:29:26 +00:00
dependabot[bot]
6884da4f50 Bump sidekiq from 6.2.2 to 6.3.1
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.2 to 6.3.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.2.2...v6.3.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-01-18 10:26:09 +00:00
dependabot[bot]
e9dda6cd96 Bump bugsnag from 6.24.0 to 6.24.1
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.24.0 to 6.24.1.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.24.0...v6.24.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 10:25:40 +00:00
Transifex-Openfoodnetwork
98968591fc Updating translations for config/locales/de_DE.yml 2022-01-18 21:25:22 +11:00
dependabot[bot]
cfd8f81b3a Bump rails-i18n from 6.0.0 to 7.0.1
Bumps [rails-i18n](https://github.com/svenfuchs/rails-i18n) from 6.0.0 to 7.0.1.
- [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)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 10:24:56 +00:00
Matt-Yorkley
383d938d7c Bump json back up to 2.6.1 2022-01-18 10:24:43 +00:00
dependabot[bot]
c0e63d8299 Bump activerecord-import from 1.2.0 to 1.3.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.2.0 to 1.3.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.2.0...v1.3.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-01-18 10:24:29 +00:00
dependabot[bot]
661d678910 Bump rubocop-rails from 2.12.4 to 2.13.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.4 to 2.13.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.12.4...v2.13.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-01-18 10:23:59 +00:00
dependabot[bot]
0c2c853e8e Bump ddtrace from 0.53.0 to 0.54.1
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.53.0 to 0.54.1.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.53.0...v0.54.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 10:23:17 +00:00
dependabot[bot]
944a899931 Bump monetize from 1.11.0 to 1.12.0
Bumps [monetize](https://github.com/RubyMoney/monetize) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/RubyMoney/monetize/releases)
- [Changelog](https://github.com/RubyMoney/monetize/blob/main/CHANGELOG.md)
- [Commits](https://github.com/RubyMoney/monetize/compare/v1.11.0...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 10:22:31 +00:00
dependabot[bot]
64ecc5757f Bump stripe from 5.39.0 to 5.42.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.39.0 to 5.42.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.39.0...v5.42.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-01-18 10:21:54 +00:00
dependabot[bot]
9ac5a1d379 Bump listen from 3.7.0 to 3.7.1
Bumps [listen](https://github.com/guard/listen) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/guard/listen/releases)
- [Commits](https://github.com/guard/listen/compare/v3.7.0...v3.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 10:21:14 +00:00
Matt-Yorkley
1fda316d4c Merge pull request #8740 from Matt-Yorkley/rails-bump
Update Rails from 6.1.4.1 to 6.1.4.4
2022-01-18 10:19:24 +00:00
Matt-Yorkley
eb12648538 Merge pull request #8742 from openfoodfoundation/dependabot/npm_and_yarn/browserslist-4.19.1
Bump browserslist from 4.16.3 to 4.19.1
2022-01-18 09:57:12 +00:00
jibees
fdba942c7e Merge pull request #8734 from mkllnk/dependencies
Restrict Dependabot to update only the lockfiles
2022-01-18 10:39:29 +01:00
Transifex-Openfoodnetwork
7d55bf9184 Updating translations for config/locales/en_FR.yml 2022-01-18 20:18:34 +11:00
Transifex-Openfoodnetwork
f8a9d9ecfa Updating translations for config/locales/fr.yml 2022-01-18 20:18:22 +11:00
Matt-Yorkley
7c2b3cdf51 Fix param whitelisting
Co-authored-by: Maikel <maikel@email.org.au>
2022-01-18 09:14:55 +00:00
Matt-Yorkley
3bfea510b2 Update spec/services/url_generator_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-01-18 08:45:46 +00:00
Maikel
7fb227710f Merge pull request #8728 from shen-sat/6056-improve-auto-test-coverage-on-order-customer-details
[6045] Add test for hiding billing address form and adding new customer on o…
2022-01-18 11:46:11 +11:00
dependabot[bot]
98a8036c7b Bump browserslist from 4.16.3 to 4.19.1
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.19.1.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.3...4.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 00:42:43 +00:00
Maikel
1ad43964c1 Merge pull request #8737 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.13
Bump @storybook/addon-docs from 6.4.12 to 6.4.13
2022-01-18 11:31:58 +11:00
dependabot[bot]
de7860fd91 Bump @storybook/addon-docs from 6.4.12 to 6.4.13
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.12 to 6.4.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.13/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-01-18 00:16:49 +00:00
Maikel
ac0c8e8419 Merge pull request #8736 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.13
Bump @storybook/addon-controls from 6.4.12 to 6.4.13
2022-01-18 11:09:18 +11:00
dependabot[bot]
8d14b4d1fe Bump @storybook/addon-controls from 6.4.12 to 6.4.13
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.12 to 6.4.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.13/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-01-18 00:05:06 +00:00
Maikel
d5f5b3065a Merge pull request #8735 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.13
Bump @storybook/server from 6.4.12 to 6.4.13
2022-01-18 11:02:35 +11:00
Matt-Yorkley
8f883d53a3 Update Rails from 6.1.4.1 to 6.1.4.4 2022-01-17 21:37:09 +00:00
Matt-Yorkley
1cbb0d8bbd Update all locales with the latest Transifex translations 2022-01-17 21:00:43 +00:00
Matt-Yorkley
bf6b221aa5 Merge pull request #8720 from openfoodfoundation/transifex
Transifex
2022-01-17 20:58:26 +00:00
Matt-Yorkley
632d94ee37 Merge pull request #8733 from Matt-Yorkley/bump-stimulusjs
Update to StimulusJS 3.0.1
2022-01-17 20:56:54 +00:00
Filipe
067f90b17c Merge pull request #8712 from Matt-Yorkley/oc-mails
OC notifications
2022-01-17 20:30:40 +00:00
Filipe
8114eb1c9f Merge pull request #8666 from openfoodfoundation/stripe-controller
Extract new StripeController
2022-01-17 20:21:40 +00:00
Filipe
62f0de75ee Merge pull request #8679 from Matt-Yorkley/drop-jquery-ujs
Drop jquery_ujs
2022-01-17 16:30:25 +00:00
Jean-Baptiste Bellet
c22f3ec1db Add locale to stripe elements options to display messages in right language
List of supported language by stripe elements:
https://stripe.com/docs/js/appendix/supported_locales
2022-01-17 15:10:51 +01:00
Transifex-Openfoodnetwork
084bbe576c Updating translations for config/locales/en_FR.yml 2022-01-17 21:19:59 +11:00
Transifex-Openfoodnetwork
d870e972ae Updating translations for config/locales/fr.yml 2022-01-17 21:11:58 +11:00
dependabot[bot]
6c622b170f Bump @storybook/server from 6.4.12 to 6.4.13
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.12 to 6.4.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.13/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-01-17 09:08:04 +00:00
Maikel Linke
bbafe9ff94 Restrict Dependabot to update only the lockfiles
This enables us to specify versions in the Gemfile and package.json and
Dependabot won't suggest updates we excluded that way.
2022-01-17 11:42:14 +11:00
Matt-Yorkley
ac9fef883d Fix Jest issue with updated StimulusJS package 2022-01-16 12:25:54 +00:00
Matt-Yorkley
c499f0757f Bump StimulusJS to 3.0.1 2022-01-16 12:25:54 +00:00
Matt-Yorkley
31b4c06ea3 Update rendering and shipping_type_selector directive 2022-01-16 11:30:58 +00:00
Matt-Yorkley
a6ef7ca17f Move shipping_type_selector template to views 2022-01-16 11:05:17 +00:00
Matt-Yorkley
f06ec94b30 Render shop_variant partial normally and remove shop_variant directive 2022-01-16 10:46:26 +00:00
Matt-Yorkley
e5009432c3 Render regular partials 2022-01-16 10:45:26 +00:00
Matt-Yorkley
3afd6c273a Move shop_variant templates to views 2022-01-16 10:41:55 +00:00
Matt-Yorkley
11578a8852 Merge pull request #8730 from filipefurtad0/address_label_fix
Fixes translation/rendering inconsistency on Country label (step 3)
2022-01-15 20:33:02 +00:00
Transifex-Openfoodnetwork
f7e5034f69 Updating translations for config/locales/de_DE.yml 2022-01-16 07:02:27 +11:00
filipefurtad0
e7aa19c95d Fixes translation/rendering inconsistency on Country label(step 3) 2022-01-15 19:43:57 +00:00
Matt-Yorkley
26ac59fbba Move Matomo event tracking for login modal into Autherntication service 2022-01-15 16:21:33 +00:00
Filipe
dfdeb7368e Merge pull request #8681 from SarvarKh/translation-correction
Add flash message translation for log out
2022-01-15 14:55:26 +00:00
Matt-Yorkley
18ac9b5335 Add support for generating valid/unique permalinks for Enterprises with non-roman characters in their name 2022-01-15 13:21:09 +00:00
Matt-Yorkley
2063bffad6 Replace use of Stringex#to_url with (encapsulated) UrlGenerator#to_url 2022-01-15 13:21:09 +00:00
Matt-Yorkley
0ef35b319c Create UrlGenerator service 2022-01-15 13:21:09 +00:00
Shen Sat
c8e8308f22 Add test for hiding billing address form and adding new customer on orders page 2022-01-15 12:37:02 +00:00
Matt-Yorkley
3f5e5d52ad Improve concern syntax and definition 2022-01-15 12:31:43 +00:00
Matt-Yorkley
ea312c78b0 Move PermalinkGenerator out of lib directory 2022-01-15 12:31:43 +00:00
Matt-Yorkley
1953a2ef6a Don't require stringex 2022-01-15 12:31:43 +00:00
Matt-Yorkley
7be31c74a7 Don't load stringex gem by default in gemfile 2022-01-15 12:31:43 +00:00
Matt-Yorkley
7062cab31f Replace unnecessary uses of StringEx#to_url with ActiveSupport#parameterize 2022-01-15 10:22:10 +00:00
Matt-Yorkley
11c6ce16ea Move payment-authorizing tests to stripe controller spec 2022-01-14 19:41:08 +00:00
Matt-Yorkley
2f39f5bac4 Add re-routing for any unprocessed payments still using old return URL 2022-01-14 19:41:08 +00:00
Matt-Yorkley
5a2c14e79a Use new return URL when authorizing Stripe payments in backoffice or subs 2022-01-14 19:41:08 +00:00
Matt-Yorkley
c209be9c17 Clarify params
Spree::Order.to_param outputs the order *number* (not the id) when used to build URLs. This makes it a bit more explicit.
2022-01-14 19:41:08 +00:00
Matt-Yorkley
12f7fc98fa Move payment authorization to StripeController
This Stripe-payment-authorizing logic is used by backoffice and subscriptions orders (but not the checkout), and was previously being handled by the #show action in Spree::OrdersController. It involves the user being redirected back to OFN after visiting a Stripe URL.
2022-01-14 19:41:08 +00:00
Matt-Yorkley
6c2b623f8b Tidy up OrderController 2022-01-14 19:41:08 +00:00
Matt-Yorkley
5a70664a6a Pull stripe-related tests into new controller spec 2022-01-14 19:41:08 +00:00
Matt-Yorkley
c65beae869 Extract some methods and move to simpler callbacks with guard clauses 2022-01-14 19:41:08 +00:00
Matt-Yorkley
c4d55feac8 Extract #last_payment 2022-01-14 19:41:08 +00:00
Matt-Yorkley
ddf6e7eadd Use proper module/namespace 2022-01-14 19:41:08 +00:00
Matt-Yorkley
48c4ecde08 Update checkout specs using deleted OrderCompletionReset 2022-01-14 19:41:08 +00:00
Matt-Yorkley
410485fbf4 Use #order_failed_route in #process_order_completion! 2022-01-14 19:41:08 +00:00
Matt-Yorkley
072f4f4c60 Use new stripe confirm path and remove dead code 2022-01-14 19:41:08 +00:00
Matt-Yorkley
3f3bfadb59 Simplify StripeScaPaymentAuthorize and clarify both return URL types (checkout and off-session) 2022-01-14 19:41:08 +00:00
Matt-Yorkley
7b8e1f5c30 Update/improve paypal controller specs 2022-01-14 19:41:08 +00:00
Matt-Yorkley
9583a3cc3d Use order token param in specs 2022-01-14 19:41:08 +00:00
Matt-Yorkley
9b2801db24 Fix calls to private method #expire_current_order in specs 2022-01-14 19:41:08 +00:00
Matt-Yorkley
7fe770a855 Add route to catch pre-existing payments which may still use Checkout#edit as return URL 2022-01-14 19:41:08 +00:00
Matt-Yorkley
789c29f678 Extract #load_checkout_order 2022-01-14 19:41:08 +00:00
Matt-Yorkley
daee5b49b5 Extract #process_payment_completion! 2022-01-14 19:41:08 +00:00
Matt-Yorkley
76647863e8 Add new Stripe controller 2022-01-14 19:41:08 +00:00
Matt-Yorkley
28d89103eb Extract #gateway_error 2022-01-14 19:41:08 +00:00
Matt-Yorkley
7633255bea Extract #order_failed_route 2022-01-14 19:41:08 +00:00
Matt-Yorkley
414e1eb299 Tidy up OrdersController#load_order 2022-01-14 19:41:08 +00:00
Matt-Yorkley
6385d9a782 Simplify interface of #order_completion_route 2022-01-14 19:41:08 +00:00
Matt-Yorkley
7cbdb7c1a2 Remove paypal-specific workaround from OrdersController
The previous commit means this is no longer needed here.
2022-01-14 19:41:08 +00:00
Matt-Yorkley
1b459b2491 Extract #processing_failed 2022-01-14 19:41:08 +00:00
Matt-Yorkley
c1defdb1ff Extract #order_processing_error 2022-01-14 19:41:08 +00:00
Matt-Yorkley
5c44614a8d Extract and standardise payment/checkout #processing_succeeded 2022-01-14 19:41:08 +00:00
Matt-Yorkley
96f30133a7 Don't reset order for split checkout
The various places where we "reset" an order to cart state if a checkout submission does not succeed are an artifact of the process-all-the-steps-at-once approach of the current checkout.
2022-01-14 19:41:08 +00:00
Matt-Yorkley
1e21a6a32f Extract and standardise use of #handle_insufficient_stock 2022-01-14 19:41:08 +00:00
Matt-Yorkley
b6cf6483f2 Extract and standardise use of order loading around checkout processing 2022-01-14 19:41:08 +00:00
Matt-Yorkley
4d6c4f850f Remove pointless callbacks in CheckoutController
These exact same checks are already made in #load_order (and #order_invalid_for_checkout?), which is called before these other two (later) callbacks.
2022-01-14 19:41:08 +00:00
Matt-Yorkley
77d89ec7d0 Extract and standardise use of #order_completion_route 2022-01-14 19:41:08 +00:00
Matt-Yorkley
4c1fc2b326 Standardise use of #order_completion_reset 2022-01-14 19:41:08 +00:00
Matt-Yorkley
124b63fad0 Remove unused flash assignment 2022-01-14 19:41:08 +00:00
Matt-Yorkley
01bd77e437 Remove duplicate translation key 2022-01-14 19:41:08 +00:00
Matt-Yorkley
e58b1b1094 Tidy up before and after callbacks 2022-01-14 19:41:08 +00:00
Matt-Yorkley
9b6d4da8d5 Pull related lines into OrderCompletion#order_completion_reset 2022-01-14 19:41:08 +00:00
Matt-Yorkley
02995530e2 Pull apart OrderCompletionReset service 2022-01-14 19:41:08 +00:00
Matt-Yorkley
67b8a55273 Separate OrderCompletionReset from Checkout::PostCheckoutActions and don't pass controller objects to Checkout::PostCheckoutActions
We need to separate some of these bits to make them easier to call in different contexts. Also there's some weird stuff happening here with the controller being passed in to the service, and it seems like a code smell to me...
2022-01-14 19:41:08 +00:00
Matt-Yorkley
ad60f2392a Delete unused return statement 2022-01-14 19:41:08 +00:00
Matt-Yorkley
06eb98bdf4 Extract #valid_order_line_items? 2022-01-14 19:41:08 +00:00
Transifex-Openfoodnetwork
3daaa9d50b Updating translations for config/locales/es.yml 2022-01-15 05:45:15 +11:00
Matt-Yorkley
c5c5738382 Merge pull request #8706 from openfoodfoundation/mkllnk-pr-template
Change instructions to move release notes to the title of a new pull request
2022-01-14 13:57:28 +00:00
Matt-Yorkley
2d746a5f30 Merge pull request #8723 from cillian/remove-unused-js-from-general-settings-edit
Remove unused code for currency select menu which no longer exists
2022-01-14 13:54:45 +00:00
Cillian O'Ruanaidh
22a48de033 Remove unused code for currency select menu which no longer exists
This removes inline JavaScript for #8699. This code was for the old currency select menu which was removed in 4839b7bd63
2022-01-14 12:33:30 +00:00
Cillian O'Ruanaidh
bc33df6659 Remove unused inline JavaScript from products/_form.html.haml
For #8699. This code, which was introduced in 1309d80f65, does not appear to be used. The CSS at https://github.com/openfoodfoundation/openfoodnetwork/blob/master/app/webpacker/css/admin/sections/products.scss#L6 is used instead.
2022-01-14 12:07:33 +00:00
Matt-Yorkley
534354a177 Add data migration 2022-01-14 11:23:41 +00:00
Transifex-Openfoodnetwork
93ecc894c6 Updating translations for config/locales/de_DE.yml 2022-01-14 07:09:03 +11:00
Transifex-Openfoodnetwork
f374186b8d Updating translations for config/locales/fr_CA.yml 2022-01-14 05:20:05 +11:00
Transifex-Openfoodnetwork
883e137a43 Updating translations for config/locales/en_CA.yml 2022-01-14 04:27:24 +11:00
Transifex-Openfoodnetwork
d89bfd30c9 Updating translations for config/locales/en_CA.yml 2022-01-14 03:57:37 +11:00
Matt-Yorkley
1d4803c31a Whitelist valid step param values 2022-01-13 13:55:33 +00:00
Matt-Yorkley
b850fd6fda Add controller spec for split checkout 2022-01-13 13:55:33 +00:00
Matt-Yorkley
f378a9a0cb Merge pull request #8715 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.11
Bump karma from 6.3.10 to 6.3.11
2022-01-13 13:25:04 +00:00
Transifex-Openfoodnetwork
646bd05973 Updating translations for config/locales/en_FR.yml 2022-01-13 23:00:00 +11:00
Transifex-Openfoodnetwork
2cc1b6a2f8 Updating translations for config/locales/fr.yml 2022-01-13 22:43:21 +11:00
dependabot[bot]
a869388759 Bump karma from 6.3.10 to 6.3.11
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.10 to 6.3.11.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.10...v6.3.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-13 10:51:41 +00:00
Matt-Yorkley
7366aeb333 Merge pull request #8718 from openfoodfoundation/revert-8709-dependabot/npm_and_yarn/webpack-dev-server-4.7.3
Revert "Bump webpack-dev-server from 3.11.2 to 4.7.3"
2022-01-13 10:48:19 +00:00
Matt-Yorkley
6e7fdd75ff Revert "Bump webpack-dev-server from 3.11.2 to 4.7.3" 2022-01-13 10:47:58 +00:00
Jean-Baptiste Bellet
f78ff3fc3b Improve display when label is long
(ie. longer than the available screen width)
2022-01-13 11:05:44 +01:00
Maikel
72edd9fa36 Merge pull request #8690 from apricot12/8489-Mising-stripe-translations
Add translations for all stripe decline codes
2022-01-13 16:30:24 +11:00
Maikel
de1d7f31a6 Merge pull request #8709 from openfoodfoundation/dependabot/npm_and_yarn/webpack-dev-server-4.7.3
Bump webpack-dev-server from 3.11.2 to 4.7.3
2022-01-13 16:26:03 +11:00
Maikel
50a94931d4 Merge pull request #8645 from Matt-Yorkley/initialization-deprecations
Initialization deprecations
2022-01-13 16:06:56 +11:00
dependabot[bot]
8eadb0af8a Bump webpack-dev-server from 3.11.2 to 4.7.3
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.11.2 to 4.7.3.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.11.2...v4.7.3)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-13 05:03:49 +00:00
Maikel
696bbdc2e2 Merge pull request #8649 from Matt-Yorkley/deprecation-fixes
Deprecation fixes
2022-01-13 15:59:47 +11:00
Maikel
7bac200b88 Merge pull request #8687 from openfoodfoundation/dependabot/npm_and_yarn/shortcut-buttons-flatpickr-0.4.0
Bump shortcut-buttons-flatpickr from 0.3.1 to 0.4.0
2022-01-13 15:57:26 +11:00
Maikel
9d9441a85f Merge pull request #8714 from openfoodfoundation/dependabot/npm_and_yarn/follow-redirects-1.14.7
Bump follow-redirects from 1.13.0 to 1.14.7
2022-01-13 15:56:23 +11:00
Maikel
84b83da167 Merge pull request #8710 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.12
Bump @storybook/addon-docs from 6.4.9 to 6.4.12
2022-01-13 15:55:04 +11:00
Maikel
5257361df8 Merge pull request #8651 from Matt-Yorkley/custom-errors
Remove custom errors gem
2022-01-13 15:54:50 +11:00
dependabot[bot]
a6887bea0b Bump @storybook/addon-docs from 6.4.9 to 6.4.12
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.9 to 6.4.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.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-01-13 04:34:20 +00:00
dependabot[bot]
c34570f398 Bump follow-redirects from 1.13.0 to 1.14.7
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.0 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.0...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-13 04:24:47 +00:00
Maikel
b9b78443a0 Merge pull request #8711 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.12
Bump @storybook/addon-controls from 6.4.9 to 6.4.12
2022-01-13 15:24:21 +11:00
Maikel
f973f62e49 Merge pull request #8708 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.12
Bump @storybook/server from 6.4.9 to 6.4.12
2022-01-13 15:23:34 +11:00
Matt-Yorkley
f8efff9a4e Don't show terms of service unless required 2022-01-12 22:17:22 +00:00
Matt-Yorkley
18cdf98aa1 Set terms and conditions accepted when completing checkout 2022-01-12 22:17:22 +00:00
Matt-Yorkley
f2c506a292 Update and extract summary_step? check 2022-01-12 22:17:22 +00:00
Filipe
7709e86d41 Merge pull request #8676 from jibees/8668-split-checkout-as-guest
Handle checkout as guest feature on split checkout
2022-01-12 20:22:01 +00:00
Filipe
cc0de4618c Merge pull request #8692 from jibees/8691-make-first-name-and-last-name-fields-mandatory
Validate the presence of first/last name if there is no company
2022-01-12 19:48:35 +00:00
Matt-Yorkley
58d3ad412a Rename method for clarity 2022-01-12 17:52:10 +00:00
Matt-Yorkley
cb5dd6eed9 Move T&C checks to service 2022-01-12 17:52:10 +00:00
Matt-Yorkley
0143adb8e0 Merge pull request #8518 from pacodelaluna/fix-webpacker-container-configuration
Fix Webpacker container configuration
2022-01-12 14:35:00 +00:00
Matt-Yorkley
9be37b0aaa Reset flags when cloning an OC 2022-01-12 11:44:21 +00:00
Matt-Yorkley
54e1a8807a Use mails_sent flag for tracking mails 2022-01-12 11:44:21 +00:00
Matt-Yorkley
8f825a709c Add mails_sent column to order cycles 2022-01-12 10:34:47 +00:00
dependabot[bot]
a474e19448 Bump @storybook/addon-controls from 6.4.9 to 6.4.12
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.9 to 6.4.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.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-01-12 09:07:12 +00:00
dependabot[bot]
6352929dc1 Bump @storybook/server from 6.4.9 to 6.4.12
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.9 to 6.4.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.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-01-12 09:05:53 +00:00
Maikel
165d121aab Merge pull request #8650 from Matt-Yorkley/rubocop-skips-validations
Allow methods which skip callbacks in Rubocop
2022-01-12 13:06:46 +11:00
Maikel
71fe167092 Move release notes to the title of the PR
Github can generate release notes from titles automatically. That's much easier than us copying the text from each pull request.

Also changed:

- Converted instructions for the issue number to a comment to make pasting the issue number easier.
- More detail for testing instructions. Many people don't fill them out correctly.
- Formatting of comments for better readability.
2022-01-12 12:55:12 +11:00
Matt-Yorkley
fa06f30ebe Merge branch 'master' into transifex 2022-01-11 21:10:28 +00:00
Sebastian Castro
115dfe445b loading-message: make them all look the same in admin
use font awesome spinner instead of an image
2022-01-11 21:55:07 +01:00
Sebastian Castro
4a436978a9 loading-popup: debounce display 2022-01-11 21:55:07 +01:00
Sebastian Castro
0eb97f1cdc loading-popup: improve style 2022-01-11 21:55:07 +01:00
Matt-Yorkley
80342e258b Update all locales with the latest Transifex translations 2022-01-11 20:34:55 +00:00
Filipe
d66dac4ccb Merge pull request #8621 from apricot12/Unit-value-shop-front
Update units when variant unit name is edited
2022-01-11 17:41:20 +00:00
Transifex-Openfoodnetwork
42c321850a Updating translations for config/locales/en_CA.yml 2022-01-12 00:27:40 +11:00
Transifex-Openfoodnetwork
00d8b2be1f Updating translations for config/locales/en_GB.yml 2022-01-12 00:27:38 +11:00
Transifex-Openfoodnetwork
c253a2f360 Updating translations for config/locales/en_FR.yml 2022-01-12 00:27:36 +11:00
Transifex-Openfoodnetwork
b944b53e99 Updating translations for config/locales/ru.yml 2022-01-12 00:24:38 +11:00
Transifex-Openfoodnetwork
3e9e159df2 Updating translations for config/locales/de_DE.yml 2022-01-12 00:24:32 +11:00
Transifex-Openfoodnetwork
db27639f0b Updating translations for config/locales/en_US.yml 2022-01-12 00:24:30 +11:00
Filipe
4978c95e75 Merge pull request #8467 from SarvarKh/validate-social-links
Fix the issue with 'at' in enterprise twitter and instagram
2022-01-11 12:53:11 +00:00
Filipe
f2b14beea9 Merge pull request #8541 from jibees/8506-improve-shiped-email
Improve shipped email design
2022-01-11 11:36:32 +00:00
Filipe
da703b2d95 Merge pull request #8615 from jibees/8559-enable-sort-orders-by-order-full-name
Enable sorting orders by order full name
2022-01-11 11:27:36 +00:00
Jean-Baptiste Bellet
6e62985e19 update tests as there are now 2 more mandatory fields
First name and last name
2022-01-11 10:30:45 +01:00
Jean-Baptiste Bellet
1a270af82b Test the presence of the firstname and the lastname if company is not present
Co-Authored-By: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-01-11 10:30:45 +01:00
Transifex-Openfoodnetwork
f61ad4470d Updating translations for config/locales/en_GB.yml 2022-01-11 20:11:03 +11:00
Maikel
3480c5d931 Merge pull request #8654 from Matt-Yorkley/rails-defaults
Apply recommended framework defaults
2022-01-11 16:12:27 +11:00
Transifex-Openfoodnetwork
82ecadc17c Updating translations for config/locales/de_DE.yml 2022-01-11 09:30:24 +11:00
SarvarKhalimov
f09f6208c2 Remove trailing whitespace from user_sessions_controller_spec.rb 2022-01-11 00:01:08 +05:00
SarvarKhalimov
6c559995ab Add test for user log_out user#destroy 2022-01-10 22:50:44 +05:00
SarvarKhalimov
5523b91364 Add translation for already_signed_out key in en.yml file
Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-01-10 22:20:21 +05:00
SarvarKhalimov
b8161fb028 Remove duplicated flash notice from app/controllers/spree/user_sessions_controller.rb
Remove flash duplicattion in favor of already existing devise default flash notice

Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2022-01-10 21:59:48 +05:00
Nihal M. Kelanthodika
000c59ffa7 Add translations for all stripe decline codes 2022-01-10 20:47:47 +05:30
jibees
cc1e3912ad Merge pull request #8685 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.10
Bump karma from 6.3.9 to 6.3.10
2022-01-10 15:23:29 +01:00
dependabot[bot]
346ec9ef1d Bump karma from 6.3.9 to 6.3.10
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.9 to 6.3.10.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.9...v6.3.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 12:14:59 +00:00
Matt-Yorkley
fd4a18a838 Merge pull request #8680 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.4.7
Bump jest from 27.4.6 to 27.4.7
2022-01-10 12:11:12 +00:00
Jean-Baptiste Bellet
a1b21d7706 Take into account the lb unit name 2022-01-10 11:50:40 +01:00
Jean-Baptiste Bellet
f6e64f3a3c Update the tests as well 2022-01-10 11:27:32 +01:00
Jean-Baptiste Bellet
c5beff249e Should be divided by scale if the smallest unit 2022-01-10 11:27:18 +01:00
Jean-Baptiste Bellet
4c508a5bf9 Group by unit size is specific: it needs to be divided by scale if not the smallest unit 2022-01-10 11:24:22 +01:00
Jean-Baptiste Bellet
da9c0f4b8c Refactor: create two internal methods: getScale and getFormattedValueWithUnitName
Then, the old formattedValueWithUnitName calls those two private methods
2022-01-10 11:23:30 +01:00
Jean-Baptiste Bellet
467183af48 Rename getScale to getLineItemScale to be more specific 2022-01-10 11:22:11 +01:00
dependabot[bot]
8d46a185d6 Bump shortcut-buttons-flatpickr from 0.3.1 to 0.4.0
Bumps [shortcut-buttons-flatpickr](https://github.com/jcsmorais/shortcut-buttons-flatpickr) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/jcsmorais/shortcut-buttons-flatpickr/releases)
- [Commits](https://github.com/jcsmorais/shortcut-buttons-flatpickr/compare/0.3.1...0.4.0)

---
updated-dependencies:
- dependency-name: shortcut-buttons-flatpickr
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 09:10:22 +00:00
Jean-Baptiste Bellet
36db396fe5 Do not redirect if user is logged in 2022-01-10 10:02:08 +01:00
Jean-Baptiste Bellet
573798e4a4 Handle visit /checkout/details in both case: authorized or not 2022-01-10 09:40:16 +01:00
Jean-Baptiste Bellet
9a74934f79 Do not redirect to /guest if step is specified 2022-01-10 09:40:16 +01:00
Jean-Baptiste Bellet
b6e8862401 Update test for guest checkout when distributor doesn't allow 2022-01-10 09:40:16 +01:00
Jean-Baptiste Bellet
6be2fbb0b9 Specify allow_guest_orders attribute 2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
b1524aa0bd Guard clause: redirect to /guest when POST
When there is no connected user, and when the distributor doesn't allow guest orders, redirect on POST method
2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
a36d03a7ab Update test as well ; guest checkout when distributor allow 2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
2568d775ae Create the guest view and its associated css 2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
efda693f8e Do not show tabs if the current step if the /guest step 2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
f2c3a380ac Redirect to /guest if distributor doesn't allow guest order 2022-01-10 09:39:46 +01:00
Jean-Baptiste Bellet
2929b6278d Redirect to /guest if no step required and no current connected user 2022-01-10 09:39:45 +01:00
Jean-Baptiste Bellet
3e14501337 Create a new step: the guest view 2022-01-10 09:39:45 +01:00
Transifex-Openfoodnetwork
228f6db139 Updating translations for config/locales/ru.yml 2022-01-10 18:53:37 +11:00
Filipe
54c61f459e Merge pull request #8677 from filipefurtad0/add_specs_split_checkout_1
Migrates some test scenarios from checkout_spec.rb
2022-01-09 16:20:41 +00:00
filipefurtad0
0af025d948 Re-writes test structure, descrive vs. context 2022-01-08 17:59:04 +00:00
Matt-Yorkley
99b75c9a6a Adjust usage of remote-method links on credit card deletion 2022-01-08 16:54:23 +00:00
Matt-Yorkley
40ed23688d Remove jquery_ujs 2022-01-08 16:54:23 +00:00
Transifex-Openfoodnetwork
fbeb295019 Updating translations for config/locales/fr_CA.yml 2022-01-08 09:09:50 +11:00
Transifex-Openfoodnetwork
d4d4b70eb2 Updating translations for config/locales/en_CA.yml 2022-01-08 08:50:21 +11:00
Matt-Yorkley
f23a12020c Merge pull request #8675 from Matt-Yorkley/dead-code-spree-js
Remove unused JS
2022-01-07 14:29:24 +00:00
Cillian O'Ruanaidh
e2b8108972 If an order has out of stock line items display them and let admins remove them 2022-01-07 13:15:44 +00:00
filipefurtad0
4276be1132 Simplifies/re-writes 'before do' block 2022-01-07 13:11:27 +00:00
filipefurtad0
e2c5c08c1e Updates the spec to reflect the changes in the helper 2022-01-07 13:06:28 +00:00
filipefurtad0
2df841f637 Renames module - removes 'request' naming 2022-01-07 13:03:44 +00:00
filipefurtad0
ebbc028dda Removes split_ prefix from helper 2022-01-07 12:56:15 +00:00
filipefurtad0
9149306fc1 Moves(up)/renames SplitCheckoutHelper 2022-01-07 12:55:09 +00:00
filipefurtad0
12d1e45e06 Fixes rubocop issues 2022-01-07 12:13:15 +00:00
filipefurtad0
9685bb6ae9 Adds tests for logged-in user scenarios 2022-01-07 12:13:15 +00:00
filipefurtad0
93478d4079 Adds split-checkout helper 2022-01-07 12:13:15 +00:00
filipefurtad0
447d146365 Adds test out of stock product redirect 2022-01-07 12:13:15 +00:00
Jean-Baptiste Bellet
515e2cfc51 Multiply by unit_value as sumOfUnitValues is now scaled 2022-01-07 10:32:47 +01:00
Jean-Baptiste Bellet
b746eacd11 Both sumUnitValues and sumMaxUnitValues should handle imperial units 2022-01-07 10:32:46 +01:00
Jean-Baptiste Bellet
5db50481dd Rounding to 3 decimals as scope method 2022-01-07 10:32:46 +01:00
Jean-Baptiste Bellet
d4435b5f10 Update variant_unit_manager_spec.js.coffee 2022-01-07 10:32:46 +01:00
Jean-Baptiste Bellet
9cf5645478 Add a spec to handle imperial units 2022-01-07 10:32:46 +01:00
Jean-Baptiste Bellet
7b2a9df326 Handle unitsVariant when calling formattedValueWithUnitName
- unitsVariant was unread but is necessary to compute the unit_name thanks to `VariantUnitManager.getUnitName()`
2022-01-07 10:32:46 +01:00
Jean-Baptiste Bellet
3922ffa6a9 Handle imperial units for VariantUnitManager 2022-01-07 10:32:45 +01:00
Transifex-Openfoodnetwork
9c37cd68f8 Updating translations for config/locales/en_US.yml 2022-01-07 03:29:40 +11:00
Matt-Yorkley
14a62f5d49 Change paths helpers to urls 2022-01-06 13:10:48 +00:00
Matt-Yorkley
95464cf956 Update uses of (removed) jsuri interface 2022-01-06 13:10:48 +00:00
Matt-Yorkley
0721800f56 Remove jsuri.js 2022-01-06 13:10:48 +00:00
dependabot[bot]
60e793b899 Bump jest from 27.4.6 to 27.4.7
Bumps [jest](https://github.com/facebook/jest) from 27.4.6 to 27.4.7.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.6...v27.4.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-06 12:31:36 +00:00
Filipe
6f47619c5a Merge pull request #8659 from openfoodfoundation/dependabot/npm_and_yarn/jquery-ui-1.13.0
Bump jquery-ui from 1.10.4 to 1.13.0
2022-01-06 12:28:34 +00:00
Filipe
f3ceffc4b6 Merge pull request #8662 from openfoodfoundation/dependabot/npm_and_yarn/select2-4.0.13
Bump select2 from 3.4.5 to 4.0.13
2022-01-06 12:22:44 +00:00
SarvarKhalimov
945969ba0c Add flash message translation for log out 2022-01-06 16:25:15 +05:00
Matt-Yorkley
f42abe8268 Remove configs which are already enabled in framework defaults 2022-01-05 15:36:16 +00:00
Matt-Yorkley
8a0646704a Bump framework defaults to 6.1 2022-01-05 15:35:22 +00:00
Matt-Yorkley
b51891f1ab ActionMailer::MailDeliveryJob is the new default class for mailer handling
ActionMailer::DeliveryJob is deprecated in favour of ActionMailer::MailDeliveryJob, and will be removed in Rails 7
2022-01-05 15:35:22 +00:00
Matt-Yorkley
037c647336 Bump framework defaults to 6.0 2022-01-05 15:35:22 +00:00
Matt-Yorkley
973c60babd Disable some incompatible defaults
Using `config.load_defaults` applies a large number of recommended config options, but some of them introduce breaking changes. By selectively disabling the ones that don't work nicely with OFN we can still get the benefits of all the other enabled options.

These options currently don't play nicely with OFN, and break the CI build in various places.
2022-01-05 15:35:22 +00:00
Matt-Yorkley
a19335d247 Enable framework defaults for Rails 5.2 2022-01-05 15:35:22 +00:00
Matt-Yorkley
49ab74e472 Remove unused JS 2022-01-05 15:25:55 +00:00
Matt-Yorkley
9aa6e79f2f Merge pull request #8661 from SuprajaRamesh/fixing-missing-translation
Fixing missing translation for "Are you sure?" when deleting a product
2022-01-05 15:08:45 +00:00
Matt-Yorkley
8dbaa491f1 Merge pull request #8674 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.4.6
Bump jest from 27.4.5 to 27.4.6
2022-01-05 15:07:20 +00:00
Matt-Yorkley
0ac831658b Merge pull request #8660 from Matt-Yorkley/foreman-fix
Fix Foreman/Procfile environment loading issue
2022-01-05 15:06:53 +00:00
dependabot[bot]
8cb7755d08 Bump jest from 27.4.5 to 27.4.6
Bumps [jest](https://github.com/facebook/jest) from 27.4.5 to 27.4.6.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.5...v27.4.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-05 09:07:12 +00:00
Matt-Yorkley
9956d627fa Use fixed theme 2022-01-04 19:41:42 +00:00
Matt-Yorkley
ae00d997b1 Remove broken image references 2022-01-04 19:41:42 +00:00
Matt-Yorkley
6ce25a0e57 Vendor jquery-ui-theme 2022-01-04 19:41:42 +00:00
Matt-Yorkley
d00992c26c Import additional jquery-ui files 2022-01-04 19:41:42 +00:00
Matt-Yorkley
3ad17aedd4 Merge pull request #8634 from Matt-Yorkley/order-tokens
Clarify use of order tokens
2022-01-04 13:05:41 +00:00
Matt-Yorkley
312cc3fc25 Update import of changed stylesheet filename 2022-01-04 12:47:17 +00:00
Filipe
13d04c367d Merge pull request #8636 from Matt-Yorkley/stripe-auth-emails
Stripe auth email sending; quick tidy up
2022-01-04 11:01:47 +00:00
dependabot[bot]
dbb2107584 Bump select2 from 3.4.5 to 4.0.13
Bumps [select2](https://github.com/select2/select2) from 3.4.5 to 4.0.13.
- [Release notes](https://github.com/select2/select2/releases)
- [Changelog](https://github.com/select2/select2/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/select2/select2/compare/3.4.5...4.0.13)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-04 10:50:59 +00:00
dependabot[bot]
02aaab4bcc Bump jquery-ui from 1.10.4 to 1.13.0
Bumps [jquery-ui](https://github.com/jquery/jquery-ui) from 1.10.4 to 1.13.0.
- [Release notes](https://github.com/jquery/jquery-ui/releases)
- [Commits](https://github.com/jquery/jquery-ui/compare/1.10.4...1.13.0)

---
updated-dependencies:
- dependency-name: jquery-ui
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-04 10:48:37 +00:00
jibees
3f0ac6ba08 Merge pull request #8646 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.7.4
Bump mrujs from 0.7.2 to 0.7.4
2022-01-04 11:47:52 +01:00
Matt-Yorkley
c655c3b04e Merge pull request #8664 from Matt-Yorkley/webpacker-admin-css
Rename admin css pack
2022-01-04 10:42:01 +00:00
Matt-Yorkley
39f0f56af7 Rename admin css pack
It looks like Webpacker can get confused sometimes when packs with different formats have the same name (eg: admin.js and admin.scss)...
2022-01-04 10:27:10 +00:00
SuprajaR
f9a1b17709 asserted the confirmation msg in test 2022-01-04 00:10:38 +05:30
Matt-Yorkley
82363b2c2a Fix Foreman/Procfile environment loading issue 2022-01-03 17:42:58 +00:00
SuprajaR
f3f7fba855 Replacing text with translation 2022-01-03 22:28:56 +05:30
dependabot[bot]
7717674e2a Bump mrujs from 0.7.2 to 0.7.4
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.7.2 to 0.7.4.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.7.2...v0.7.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 15:17:26 +00:00
Filipe
59661f3a27 Merge pull request #7784 from Matt-Yorkley/webpacker-assets
Webpacker assets
2022-01-03 15:12:15 +00:00
Matt-Yorkley
f4262421a8 Fix capture styles 2022-01-03 14:07:33 +00:00
Jean-Baptiste Bellet
35c58ca5c9 Update all locales with the latest Transifex translations 2022-01-03 14:30:05 +01:00
jibees
bb7c423de4 Merge pull request #8644 from openfoodfoundation/transifex
Transifex
2022-01-03 14:28:38 +01:00
Transifex-Openfoodnetwork
1a0843fad4 Updating translations for config/locales/fr_CM.yml 2022-01-03 21:30:28 +11:00
jibees
329aeeed50 Merge pull request #8655 from filipefurtad0/remove_js_true_specs
Removes js: true setting from system specs
2022-01-03 09:49:18 +01:00
filipefurtad0
3a4ce808e8 Removes js: true setting from system specs 2021-12-29 19:42:05 +00:00
Matt-Yorkley
f5ebd47751 Replace customisations with explicit patch in an initializer
See previous commit.

This isn't nice, but it does the same job as the gem did. We can also update this code now as Rails changes (the gem was incompatible with Rails 7).
2021-12-28 10:19:35 +00:00
Matt-Yorkley
f07bc042b5 Remove custom_error_message gem 2021-12-27 22:00:55 +00:00
Matt-Yorkley
01f25cbd13 Move more assets after rebase 2021-12-27 17:45:06 +00:00
Matt-Yorkley
7cff1e01a8 Tell Zeitwerk to ignore app/webpacker directory.
The files here are not Ruby classes
2021-12-27 17:45:06 +00:00
Matt-Yorkley
2586ddc5ac Fix a CSS compiling issue after rebase 2021-12-27 17:45:06 +00:00
Matt-Yorkley
eb224ec033 Move new CSS file after rebase 2021-12-27 17:45:06 +00:00
Matt-Yorkley
09b9c3d4d0 Fix postcss-loader config
The configuration keys have some issues across different versions of postcss
2021-12-27 17:45:06 +00:00
Matt-Yorkley
afd381cbad Require fonts explicitly 2021-12-27 17:45:06 +00:00
Matt-Yorkley
297e2f1b38 Update webpacker css config 2021-12-27 17:45:06 +00:00
Matt-Yorkley
469c4e69e0 Update broken variable reference
The previous font variable is only present in admin css
2021-12-27 17:45:06 +00:00
Matt-Yorkley
959c89a3ec Move new image 2021-12-27 17:45:06 +00:00
Matt-Yorkley
8a34e8e762 Move new scss files 2021-12-27 17:45:06 +00:00
Matt-Yorkley
9afc002286 Refactor use of image files in specs 2021-12-27 17:45:06 +00:00
Matt-Yorkley
c198dc0fca Stub CSS request in invoice specs 2021-12-27 17:45:06 +00:00
Matt-Yorkley
1ff75ee642 Update preloaded font path 2021-12-27 17:45:06 +00:00
Matt-Yorkley
19fc4993d5 Delete unused Spree logo 2021-12-27 17:45:06 +00:00
Matt-Yorkley
aa6a4925ac Update default images paths for logos 2021-12-27 17:45:06 +00:00
Matt-Yorkley
16c6155b14 Use old image tag in Angular template files
Angular templates apparently don't work with Webpacker... :/
2021-12-27 17:45:06 +00:00
Matt-Yorkley
9e6082f0cf Use old image tag for non-compiled images 2021-12-27 17:45:06 +00:00
Matt-Yorkley
63f6567637 Use new image path when uploading files in specs 2021-12-27 17:45:06 +00:00
Matt-Yorkley
f2fc100b5f Replace #image_path helper calls with #image_pack_path 2021-12-27 17:45:06 +00:00
Matt-Yorkley
3c9d461f5f Provide #image_pack_path helper method 2021-12-27 17:45:06 +00:00
Matt-Yorkley
2888d75cd3 Replace #image_tag helper calls with #image_pack_tag 2021-12-27 17:45:06 +00:00
Matt-Yorkley
12f51febd3 Enable Webpack compiling for all images 2021-12-27 17:45:06 +00:00
Matt-Yorkley
31276ff3f5 Remove images and fonts from app/assets 2021-12-27 17:45:06 +00:00
Matt-Yorkley
a11aebb2ca Update stylesheets loaded with wicked-pdf to use Webpack
Luckily wicked-pdf already has a corresponding helper method.
2021-12-27 17:45:06 +00:00
Matt-Yorkley
90956c9d10 Switch mail CSS to Webpacker 2021-12-27 17:45:06 +00:00
Matt-Yorkley
250f0c0a65 Bring in missing select2 image
This missing image was previously ignored, but now causes a compile error when not found.
2021-12-27 17:45:06 +00:00
Matt-Yorkley
a55c38c842 Fix image paths in vendored select2 stylesheet 2021-12-27 17:45:06 +00:00
Matt-Yorkley
0e4d77a1bc Move current select2-rails gem stylesheet to /vendor
This version isn't available via npm and we can't load it from the gem any more as we move to Webpack assets.

As a side note: I think we'll need to replace Select2 soon anyway, so we can delete this once we've done that.
2021-12-27 17:45:06 +00:00
Matt-Yorkley
80be57a777 Install select2 via yarn and import CSS from node_modules 2021-12-27 17:45:06 +00:00
Matt-Yorkley
74bed15f7f Fix crazy issue with @extend on icons
This one line of code was crashing asset compilation... :/
2021-12-27 17:45:06 +00:00
Matt-Yorkley
a38d495bef Update admin css image paths 2021-12-27 17:45:06 +00:00
Matt-Yorkley
2ac3cda2f4 Deal with deprecated @extend syntax
Errors:
```
SassError: SassError: compound selectors may no longer be extended.
Consider `@extend a, :hover` instead.
See http://bit.ly/ExtendCompound for details.
```
2021-12-27 17:45:06 +00:00
Matt-Yorkley
2992439706 Include shared variables 2021-12-27 17:45:06 +00:00
Matt-Yorkley
df9f9c1c3b Replace glob imports
Apparently glob imports aren't a thing in modern sass... *shrugs*
2021-12-27 17:45:06 +00:00
Matt-Yorkley
5bc02d1e74 Fix admin font paths and loading 2021-12-27 17:45:06 +00:00
Matt-Yorkley
6ee6fc733d Remove duplicated imports 2021-12-27 17:45:06 +00:00
Matt-Yorkley
28f9f4245d Fix deprecated syntax using @extend with :before
This is no longer valid scss
2021-12-27 17:45:06 +00:00
Matt-Yorkley
6f06205eed Switch admin CSS to webpack 2021-12-27 17:45:06 +00:00
Matt-Yorkley
ba583dcf39 Install jquery-ui via yarn
We can delete the gem once the Javascript part has been handled
2021-12-27 17:45:06 +00:00
Matt-Yorkley
9d18f318ac Remove Sprockets includes in admin scss 2021-12-27 17:45:06 +00:00
Matt-Yorkley
b33ac49442 Update vendor import paths 2021-12-27 17:45:06 +00:00
Matt-Yorkley
05ac7e6798 Comment out leaflet image paths
These images don't exist anywhere. They were silently ignored before.
2021-12-27 17:45:06 +00:00
Matt-Yorkley
0057dbcb89 Remove Sprockets require statements 2021-12-27 17:45:06 +00:00
Matt-Yorkley
bab60f4944 Drop foundation-rails gem 2021-12-27 17:45:06 +00:00
Matt-Yorkley
2e194ac312 Switch to npm-based Foundation javascript 2021-12-27 17:45:06 +00:00
Matt-Yorkley
54929ab6ed Drop foundation-icons gem
It looks like we don't actually use these icons anywhere...
2021-12-27 17:45:06 +00:00
Matt-Yorkley
ec2213d2f0 Reduce duplicate import statements
It looks ike these CSS rules are actually being re-imported multiple times, which is bloating the output.
2021-12-27 17:45:06 +00:00
Matt-Yorkley
825aeeae04 Migrate images and update assets 2021-12-27 17:45:06 +00:00
Matt-Yorkley
cb27081425 Install Foundation 5.5.2 via yarn 2021-12-27 17:45:05 +00:00
Matt-Yorkley
8dfc30438b Move CSS to Webpacker 2021-12-27 17:45:05 +00:00
Transifex-Openfoodnetwork
6a312b8cca Updating translations for config/locales/it.yml 2021-12-28 03:49:53 +11:00
Matt-Yorkley
f0f5a1a2da Allow methods which skip validations in Rubocop
There are plenty of places where we use methods which skip validations for perfectly good reasons...
2021-12-27 16:36:45 +00:00
Matt-Yorkley
aaf5d1ba38 Patch CanCan deprecated keyword arguments
Solves an issue with use of deprecated positional args. The version of CanCan which fixes this is not currently compatible with OFN...
2021-12-27 16:27:04 +00:00
Matt-Yorkley
4dc2172dd2 Update deprecated #search method name
DEPRECATION WARNING: #search is deprecated and will be removed in 2.3, please use #ransack instead (called from search at /home/user/Github/openfoodnetwork/lib/open_food_network/sales_tax_report.rb:40)
2021-12-27 16:24:33 +00:00
Matt-Yorkley
482879245f Merge pull request #8632 from Matt-Yorkley/default-url-options
Set default_url_options in all environments
2021-12-27 12:23:49 +00:00
Matt-Yorkley
15c59d1a93 Merge pull request #8647 from Matt-Yorkley/test-suite-issues
Fix infinite loop in datepicker selection logic
2021-12-27 12:19:56 +00:00
Matt-Yorkley
c046f72ca8 Fix infinite loop in datepicker selection logic 2021-12-27 11:17:33 +00:00
Matt-Yorkley
70dc9a170e Remove unnecessary config.autoload_paths 2021-12-25 20:51:55 +00:00
Matt-Yorkley
6aada422fd Fix deprecation warnings around class loading during initialization
This:
```
DEPRECATION WARNING: Initialization autoloaded the constant User.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload User, for example,
the expected changes won't be reflected in that stale Class object.

This autoloaded constant has been unloaded.

In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:

    Rails.application.reloader.to_prepare do
      # Autoload classes and modules needed at boot time here.
    end

That block runs when the application boots, and every time there is a reload.
For historical reasons, it may run twice, so it has to be idempotent.

Check the "Autoloading and Reloading Constants" guide to learn more about how
Rails autoloads and reloads.
```
2021-12-25 20:51:18 +00:00
Matt-Yorkley
5b5a9ad750 Set default_url_options explicitly in all environments 2021-12-25 13:27:16 +00:00
Matt-Yorkley
b813acdab3 Tidy up (consolidate) setting of the "domain" in dev and test environments 2021-12-25 13:27:16 +00:00
Transifex-Openfoodnetwork
fd3bc76d8b Updating translations for config/locales/en_FR.yml 2021-12-24 20:26:20 +11:00
Transifex-Openfoodnetwork
5d91e05dd0 Updating translations for config/locales/fr.yml 2021-12-24 20:25:42 +11:00
Filipe
750411fd15 Merge pull request #8592 from openfoodfoundation/gateway-redirects
Refactor payment gateway redirects handling
2021-12-23 21:35:45 +00:00
Filipe
e1664c173a Merge pull request #8622 from openfoodfoundation/transifex
Transifex
2021-12-23 21:34:55 +00:00
Filipe
20c0195584 Merge pull request #8017 from cillian/hide-variants-with-no-stock
When creating backoffice orders hide variants with no stock by default
2021-12-23 21:34:06 +00:00
Filipe
b256696544 Merge pull request #8549 from mkllnk/deprecate-stripe-connect
Hide old "Stripe" (StripeConnect) payment method type, keep new Stripe SCA
2021-12-23 21:33:42 +00:00
Filipe
7560b4e056 Merge pull request #8482 from jibees/6689-search-city-and-state-name
Search enterprises through name + city and state_name
2021-12-23 21:33:06 +00:00
Filipe
a3f3d8f96f Merge pull request #8598 from seballot/oc-notify-producers
Configuration to automatically notify producers on order cycle close
2021-12-23 21:31:45 +00:00
Matt-Yorkley
860c2ba03c Update spec/models/order_cycle_spec.rb 2021-12-23 20:41:49 +01:00
Sebastian Castro
708d40ac67 reset_processed_at adds guard clause 2021-12-23 20:41:49 +01:00
Sebastian Castro
ed64b6176f OC will renotify automatically if closing date change 2021-12-23 20:41:49 +01:00
Sebastian Castro
b76defc602 Improve notify producer button
Add icon
Better confirmation message
Adds tooltip
Adds small icon and change text if already notified
2021-12-23 20:41:49 +01:00
Sebastian Castro
d18b482b4c Move button rules into dedicate file 2021-12-23 20:41:49 +01:00
Sebastian Castro
eb6797220f Lift order cycle advanced settings UI 2021-12-23 20:41:49 +01:00
Sebastian Castro
95ff3d7a11 Add automatic_notification field in advanced settings 2021-12-23 20:41:49 +01:00
Matt-Yorkley
887879f410 Create job for handling of closing order cycles 2021-12-23 20:41:49 +01:00
Matt-Yorkley
492325b74a Add automatic_notifications column to order_cycles table 2021-12-23 20:41:49 +01:00
Matt-Yorkley
e78cea457c Add :unprocessed scope to OrderCycle 2021-12-23 20:41:42 +01:00
Matt-Yorkley
17a112907c Add processed_at column to order_cycles table 2021-12-23 20:41:42 +01:00
Filipe
b786d89fe9 Merge pull request #8555 from jibees/8507-fix-product-search-order-
Searching variants should order results by variant display name
2021-12-23 17:41:01 +00:00
Jean-Baptiste Bellet
f121704dd5 "Save card for future use" checkbox is part of the stripelements
... and should be hidden is the end-user select an existing card
2021-12-23 14:25:24 +01:00
Filipe
24301000bf Merge pull request #8631 from jibees/8625-step2-submit-errors
SplitCheckout - Handle submit on step2
2021-12-22 18:30:10 +00:00
Matt-Yorkley
570eb21469 Merge pull request #8638 from cillian/store-payment-captured-at
Add a :captured_at column on payments to store when they are captured
2021-12-22 15:21:55 +00:00
Nihal M. Kelanthodika
b848b082be Add test case for update_units callback in product model 2021-12-22 20:08:52 +05:30
Filipe
4001fa985b Merge pull request #8612 from Matt-Yorkley/packing-reports-filtering
Packing reports filtering
2021-12-22 13:03:17 +00:00
Matt-Yorkley
f0d54dd083 Tidy up #redirect_to_payment_gateway 2021-12-22 09:58:08 +00:00
jibees
2a0b7df7f4 clearer intention
- it uses simple index_by and map which is easier to understand than each_with_index.to_h
- it avoids sorting and therefore should be the most efficient solution.

Co-authored-by: Maikel <maikel@email.org.au>
2021-12-22 10:03:34 +01:00
Maikel
aae873df9d Merge pull request #8639 from filipefurtad0/sitemap_spec_into_syste
Updates/moves sitemap_spec
2021-12-22 16:16:09 +11:00
Filipe
1cee7b6f17 Merge pull request #8614 from mkllnk/8606-subs-dups
Synchronise processing of subscriptions and avoid duplicate order creation
2021-12-21 16:57:46 +00:00
filipefurtad0
b79ae1af7a Fixes rubocop offense 2021-12-21 10:51:20 +00:00
Matt-Yorkley
8016e90e07 Ensure payment method is actually selected 2021-12-20 18:47:22 +00:00
Matt-Yorkley
dd23e3d38a Simplify payment method controller 2021-12-20 18:47:22 +00:00
Matt-Yorkley
b4dab46cf8 Remove unused code for changing required attributes 2021-12-20 18:36:28 +00:00
Matt-Yorkley
723d6489cd Extract initSelectedCard() 2021-12-20 18:36:26 +00:00
Matt-Yorkley
9525e353a3 Don't try to select a card if there is no select element
This error was being thrown when the user had no cards saved:
```
TypeError: stripeCardsController is null
```
2021-12-20 18:36:09 +00:00
Matt-Yorkley
a64f654697 Don't try to select a card if there is no selectTarget
This error was being thrown when the user had no cards saved:
```
Error: Missing target element "stripe-cards.select"
```
2021-12-20 15:41:22 +00:00
Matt-Yorkley
f18fc3c2f3 Implement disconnect() to tidy up (remove) event listeners from the DOM when finished 2021-12-20 15:29:52 +00:00
Matt-Yorkley
d58f5aa25d Move initialization to initialize() 2021-12-20 15:29:52 +00:00
Matt-Yorkley
33c156bb55 Extract (arrow) functions for callbacks used by event listeners and reduce variable assignments 2021-12-20 15:29:52 +00:00
Matt-Yorkley
24c051bad3 Simplify stripe selected check 2021-12-20 15:21:13 +00:00
filipefurtad0
b25e0ed87b Deletes spec/features/consumer folder 2021-12-20 15:13:57 +00:00
filipefurtad0
c5b14827d0 Adds URL port to the assertion 2021-12-20 14:54:03 +00:00
filipefurtad0
eef89e73c8 Updates/moves sitemap_spec 2021-12-20 14:49:05 +00:00
Jean-Baptiste Bellet
ad24351bb3 Reorganize CSS to display error correctly
`.card-errors` is no more child of `.stripe-card`
2021-12-20 15:34:58 +01:00
Jean-Baptiste Bellet
2c5667ef56 Initialize stripe-cards controller when selecting a payment method 2021-12-20 15:34:58 +01:00
Jean-Baptiste Bellet
d4ec075dfc Disabled stripe-cards input if a already registred card is select
And then re-enabled it, if use decide to register a new card
2021-12-20 15:34:58 +01:00
Jean-Baptiste Bellet
7b6aa99de2 Handle when input is already checked
ie. user hasn't click on anything
2021-12-20 15:34:58 +01:00
Jean-Baptiste Bellet
6ef7256295 Only submit handle form submit if stripeElementsForm is visible 2021-12-20 15:34:58 +01:00
Transifex-Openfoodnetwork
78ce44fffd Updating translations for config/locales/en_GB.yml 2021-12-20 19:40:45 +11:00
Maikel Linke
6d1e984af7 Enable testers to activate StripeConnect
This will make it easier to test the removal of StripeConnect.
2021-12-20 17:16:39 +11:00
Maikel Linke
470fc92825 Fix old, confusing typo 2021-12-20 17:13:40 +11:00
Maikel Linke
22de357724 Hide deprecated StripeConnect payment gateway
StripeConnect has been replaced by StripeSCA but some people still use
the old StripeConnect. Let's prevent people from creating deprecated
payment methods before migrating existing data.
2021-12-20 17:12:19 +11:00
Maikel Linke
6966dea0f5 Extract changing Stripe method selection logic
It will change and it's clearer in a separate method.
2021-12-20 17:09:57 +11:00
Maikel Linke
28e6fa235c Style Layout/HashAlignment 2021-12-20 15:23:58 +11:00
Maikel Linke
178d296c9f Adapt specs to use stripe_sca_payment_method
There are still some specs directly related to StripeConnect and I left
them for now.
2021-12-20 15:00:14 +11:00
Maikel Linke
60adaf3646 Disallow StripeConnect in subscriptions 2021-12-20 15:00:14 +11:00
Luis Ramos
6c281e288c Switch filter to StripeSCA, this must have been an error, must be tested (manually or automatically) 2021-12-20 15:00:13 +11:00
Matt-Yorkley
68af9b6e80 Only email the hub about authorization required when necessary
This is needed in subscriptions, but in the backoffice the hub manager gets a notification in the UI, so the email is not needed.
2021-12-17 19:03:23 +00:00
Cillian O'Ruanaidh
401cc19532 Fix Rubocop LineTooLong violation in spree/admin/variants_controller 2021-12-17 15:40:51 +00:00
Cillian O'Ruanaidh
9bc7922734 Only left join variant overrides belonging to the distributor when searching for in stock variants.
Before the :scope_to_distributor call was filtering out variants from other distributors anyway via the :exchange_variants table but it is clearer if we filter by distributor on the :variant_overrides left join too.
2021-12-17 15:25:55 +00:00
Cillian O'Ruanaidh
84eaafb822 Add a :captured_at column on payments to store when they are captured
Fixes #8611.
2021-12-17 14:45:47 +00:00
Filipe
e036e9b979 Merge pull request #8591 from filipefurtad0/consumer_specs_into_system
Consumer specs into system
2021-12-17 13:52:28 +00:00
Matt-Yorkley
438c205d87 Add basic test to SubscriptionConfirmJob spec 2021-12-17 12:38:09 +00:00
Filipe
0cc7bdeafa Merge pull request #8521 from seballot/confirm-hub-change
Confirmation popup on shop change in admin section.
2021-12-17 10:56:37 +00:00
Filipe
cd70ce95a6 Merge pull request #8594 from seballot/products-index
Hide loading html components on product index
2021-12-17 09:36:54 +00:00
Filipe
e1bd2fc695 Merge pull request #8600 from seballot/shop-filters
Make the shop filter section always visible when scrolling
2021-12-17 09:31:51 +00:00
Filipe
e85101e5ff Merge pull request #8599 from seballot/select
Style all standard select as the text input in the backoffice
2021-12-17 09:25:43 +00:00
Matt-Yorkley
542e3ad1aa Reuse StripeScaPaymentAuthorize in Admin::PaymentsController 2021-12-16 20:42:19 +00:00
Matt-Yorkley
dbe4d61e57 Add explanatory note for "off-session" payment processing 2021-12-16 17:57:53 +00:00
Matt-Yorkley
6b683d600f Break up #call! with some readable comment-methods 2021-12-16 17:22:56 +00:00
Matt-Yorkley
bbdbf387b7 Combine SendAuthorizationEmails and StripeScaPaymentAuthorize 2021-12-16 17:13:16 +00:00
Matt-Yorkley
fb2c0a253b Remove reference to params[:token] in Admin::Orders::CustomerDetailsController
params[:token] and session[:access_token] are only really used in the context of guest users in the customer-facing parts of the app. Here the user should be fully authenticated already to view the page. There aren't any URL that point at this controller which append a token to the params.
2021-12-16 14:02:50 +00:00
Matt-Yorkley
ec3dadfe68 Remove reference to params[:token] in PaymentsController
There seemingly shouldn't be any case where this controller actually receives a token param. There's only one place that creates urls that direct to this controller (Stripe authorization emails), and they do not attach any kind of token to the URL.

If the user is not logged in here (or doesn't have an access_token in their session), they get asked to log in.

Note to future devs: see previous commit for additional context.
2021-12-16 13:41:04 +00:00
Matt-Yorkley
9f49a84e7f Clarify use of access tokens used for viewing order details as a guest user
There are 4 or 5 different places in the app where we reference a :token and params[:token] for completely different purposes (they're not even vaguely the *same* token).

This is an attempt to clarify the places in the app where we use params[:token] in relation to *orders*, for allowing guest users (who are not logged in) to view details of an order they have placed (like after checkout completion), and differentiate it from the various other places where params[:token] can actually be used for something entirely different!
2021-12-16 13:35:55 +00:00
Matt-Yorkley
35e20fc179 Can sort orders via bill_address.lastname
We only need to check the orders sort

Fix ordering in api/v0/orders_controller_spec
2021-12-16 09:33:38 +01:00
Matt-Yorkley
45beefc533 Keep the order of passed argument
Do not retrieve the orders list sorted by completed_at but by the order_ids array itself

Add BulkInvoiceJob spec and cover sorting behaviour
2021-12-16 09:33:38 +01:00
Jean-Baptiste Bellet
7a48ffdd38 Add order.full_name as new column
+ add the linked sortable header via `bill_address_lastname`
2021-12-16 09:26:49 +01:00
Jean-Baptiste Bellet
9c280ee612 add new line 2021-12-16 09:26:49 +01:00
Transifex-Openfoodnetwork
d2b0616a67 Updating translations for config/locales/de_DE.yml 2021-12-16 12:04:37 +11:00
Matt-Yorkley
ef7a02004e Update specs 2021-12-15 21:20:58 +00:00
Matt-Yorkley
b77ff346a3 Replace #raise with #return in Checkout::StripeRedirect
The (potential) unhappy code path here was raising an error which would not be explicitly handled, and would in theory not return a useful message / response.
2021-12-15 21:20:58 +00:00
Matt-Yorkley
0fc4b851f2 Refactor payment gateway redirects handling
The checkout was holding a lot of responsibility for knowing which kinds of payment gateways are available and how to initiate the process of redirecting to the external payment page (if needed). This was being hidden somewhat by the way the logic was tucked away in services.

PaymentMethod objects now know whether or not they require an external payment process, and know how that process should be started and how to build the required URL.

So we can now *ask* any payment method if it requires external payment processing or not, and *tell* it to start the process and return the relevant URL (if needed).
2021-12-15 21:20:58 +00:00
Filipe
fd94f26765 Merge pull request #8557 from Matt-Yorkley/card-brand-formatting
Credit card brand formatting
2021-12-15 20:18:21 +00:00
Filipe
f6385215d3 Merge pull request #8568 from Matt-Yorkley/paypal-controller
Move paypal controller
2021-12-15 18:12:27 +00:00
Transifex-Openfoodnetwork
933492a596 Updating translations for config/locales/en_FR.yml 2021-12-16 03:45:53 +11:00
Transifex-Openfoodnetwork
125e93e38f Updating translations for config/locales/fr.yml 2021-12-16 03:45:18 +11:00
Filipe
c4f4d67fc0 Merge pull request #8503 from jibees/split-checkout-payment-forms
Split checkout payment forms
2021-12-15 12:57:03 +00:00
Jean-Baptiste Bellet
a33ebbdc85 Include and joins after the order seems in order to select fields...
...that are in the order by
2021-12-15 10:11:51 +01:00
Nihal M. Kelanthodika
44c3820a8f Update units when variant unit name is edited 2021-12-15 12:30:10 +05:30
Maikel Linke
0cc4e5728e Reference product attributes for sorting correctly
The previous version failed in some cases as it relied on a table name
generated by Rails.
2021-12-15 15:23:52 +11:00
Matt-Yorkley
6bbcec1186 Merge pull request #8617 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.4.5
Bump jest from 27.4.4 to 27.4.5
2021-12-14 11:55:46 +00:00
dependabot[bot]
d945c64248 Bump jest from 27.4.4 to 27.4.5
Bumps [jest](https://github.com/facebook/jest) from 27.4.4 to 27.4.5.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.4...v27.4.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 09:06:31 +00:00
Maikel Linke
bc50a01953 Ensure deterministic query to avoid deadlocks 2021-12-14 11:33:16 +11:00
Maikel Linke
9b6c9bd773 Synchronise processing of proxy orders 2021-12-14 11:33:16 +11:00
Maikel Linke
ce0913758b Bring initial proxy order processing closer
We want to make it one transaction soon.
2021-12-14 11:33:16 +11:00
Maikel Linke
7fdc2fdea2 Spec duplicate subscription order issue #8606 2021-12-14 11:33:16 +11:00
Matt-Yorkley
3800eb0eef Merge pull request #8610 from Matt-Yorkley/user-class
Remove Spree.user_class
2021-12-13 15:52:00 +00:00
Maikel Linke
b7e0d46dad Style Layout/LineLength 2021-12-13 13:56:52 +11:00
Maikel Linke
6aa6506df0 Style/StringConcatenation 2021-12-13 13:52:57 +11:00
Matt-Yorkley
48048e11e7 Improve test coverage around packing report filtering 2021-12-12 13:23:56 +00:00
Matt-Yorkley
aecdfee364 Reorganise :though associations on line_item and allow searching/filtering on product, supplier, order_cycle 2021-12-12 13:23:56 +00:00
Matt-Yorkley
1efaa7e726 Switch search filters from orders to line_items 2021-12-12 13:23:56 +00:00
Matt-Yorkley
e3f9825696 Rename #scoped_orders_relation 2021-12-11 19:04:22 +00:00
filipefurtad0
af548815ae Fixes rubocop warnings 2021-12-11 17:48:09 +00:00
filipefurtad0
67d24373e6 Updates assertion to be Ferrum syntax compliant 2021-12-11 17:40:56 +00:00
filipefurtad0
eb315b42e4 Updates cookie_helper to support Ferrum syntax 2021-12-11 17:39:39 +00:00
filipefurtad0
472cc114c0 Fixes line break assertion in account_spec 2021-12-11 17:03:00 +00:00
Filipe
f7087842b4 Merge pull request #8556 from sinansonmez/8546-include-navigation-only-for-super-admins
Navigation is included only for super admin users
2021-12-11 16:34:10 +00:00
Matt-Yorkley
1143960ce1 Merge pull request #8607 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.4.4
Bump jest from 27.4.3 to 27.4.4
2021-12-11 13:04:22 +00:00
Sebastian Castro
e20a8122b1 Make the shop filter section always visible when scrolling 2021-12-10 20:53:47 +01:00
Sebastian Castro
8fe125bd1b Adds thin-scroll-bar class 2021-12-10 20:53:47 +01:00
Matt-Yorkley
6d2521bf5f Remove Spree.user_class
This construct was previously used in Spree to switch out the user class with a dummy class during certain tests. We don't use this any more, so it's just mess.

🔥
2021-12-10 18:18:20 +00:00
filipefurtad0
345b9a181c Updates/moves shops_spec into system 2021-12-10 17:48:01 +00:00
filipefurtad0
0e8cc0f916 Updates/moves producers_spec into system 2021-12-10 17:48:01 +00:00
filipefurtad0
2e313dd5e5 Updates/moves multilingual_spec into system 2021-12-10 17:48:01 +00:00
filipefurtad0
2b02fd8826 Updates/moves groups_spec into system 2021-12-10 17:48:01 +00:00
filipefurtad0
83468710d3 Updates/moves footer_links_spec into system 2021-12-10 17:48:01 +00:00
filipefurtad0
f304c6ad9c Updates/moves account_spec into system 2021-12-10 17:48:01 +00:00
Filipe
215d8fc86e Merge pull request #8605 from mkllnk/8449-flaky-spec
Make flaky system spec reliable
2021-12-10 16:49:39 +00:00
dependabot[bot]
9797116bba Bump jest from 27.4.3 to 27.4.4
Bumps [jest](https://github.com/facebook/jest) from 27.4.3 to 27.4.4.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.3...v27.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 16:28:29 +00:00
Matt-Yorkley
d424476854 Merge pull request #8609 from Matt-Yorkley/babel-loader
Add babel-loader to JS dependencies
2021-12-10 16:22:07 +00:00
Matt-Yorkley
c1d9516640 Add babel-loader to JS dependencies
This package should have been included by other dependencies, but it seems there's some weird issues with the package not being found and this is one of the main suggested solutions.

Deployments are currently failing with: "ERROR in Entry module not found: Error: Cannot resolve module 'babel-loader'"
2021-12-10 14:39:40 +00:00
Matt-Yorkley
99aaae1111 Merge pull request #8602 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.9
Bump @storybook/addon-docs from 6.4.8 to 6.4.9
2021-12-10 13:23:29 +00:00
dependabot[bot]
cf0738b1d0 Bump @storybook/addon-docs from 6.4.8 to 6.4.9
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.8 to 6.4.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.9/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 13:19:22 +00:00
Matt-Yorkley
bb78391759 Merge pull request #8603 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.9
Bump @storybook/server from 6.4.8 to 6.4.9
2021-12-10 13:15:18 +00:00
Matt-Yorkley
a4794b22d5 Delete route to non-existent paypal controller action 2021-12-10 11:46:53 +00:00
Matt-Yorkley
9fa19cb772 Update namespacing in specs 2021-12-10 11:46:53 +00:00
Matt-Yorkley
f101b06226 Update all references to paypal routes 2021-12-10 11:46:53 +00:00
Matt-Yorkley
0b48fa540a Move paypal routes out of spree namespace 2021-12-10 11:46:52 +00:00
Matt-Yorkley
575f409ebf Delete routes to non-existant content controller 2021-12-10 11:46:52 +00:00
Matt-Yorkley
5a1aa300d5 Delete route to non-existant checkout controller action 2021-12-10 11:46:52 +00:00
Matt-Yorkley
0d620aac94 Move paypal_controller out of spree namespace 2021-12-10 11:46:52 +00:00
dependabot[bot]
5415b30fdf Bump @storybook/server from 6.4.8 to 6.4.9
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.4.8 to 6.4.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.9/app/server)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 03:36:16 +00:00
Maikel
ba1e810a3c Merge pull request #8601 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.9
Bump @storybook/addon-controls from 6.4.1 to 6.4.9
2021-12-10 14:32:17 +11:00
Maikel Linke
0a8ad8bd37 Make flaky system spec reliable
It was failing 50% of the time since it was converted into a system
spec.
2021-12-10 14:03:22 +11:00
Maikel
4be0536b18 Merge pull request #8597 from openfoodfoundation/transifex
Transifex
2021-12-10 12:06:27 +11:00
Maikel
d215294c40 Merge pull request #8567 from LiamMcM/fix-broken-links
Fix out-of-date links in CONTRIBUTING.md
2021-12-10 12:05:40 +11:00
Maikel
74de65b183 Merge pull request #8570 from mkllnk/rubocop
Update Rubocop config
2021-12-10 09:45:45 +11:00
Maikel Linke
67aa3447da Automatically regenerate style todo list
We used to keep a manual file for metrics violations because the
automatic file didn't exclude on a file-by-file basis. But Rubocop has
an additional option these days so that we can generate that
automatically in the normal todo list.

The todo list was also out of date.
2021-12-10 09:29:20 +11:00
Maikel Linke
faf0a3ab84 Remove unnecessary disabling of cop 2021-12-10 09:26:57 +11:00
Maikel Linke
207cc8908a Remove useless assignments
Rubocop highlighted this. The todo list actually contains these files
but somehow the cop still runs and reports these as violations.
2021-12-10 09:26:57 +11:00
Maikel Linke
64d25b2999 Remove dead code highlighted by Rubocop
The assignments here didn't actually do anything and `number` was
restricted to numbers only already. No whitespace to remove.
2021-12-10 09:26:57 +11:00
Jean-Baptiste Bellet
a80818d2b6 Fix rubocop warning
Extra empty line detected at module body end.
2021-12-09 11:30:57 +01:00
jibees
53e12fb5e5 Get rid of conditional branches with & operator
Co-authored-by: Maikel <maikel@email.org.au>
2021-12-09 11:12:23 +01:00
jibees
3c491299fd Update config/locales/en.yml
Co-authored-by: Maikel <maikel@email.org.au>
2021-12-09 11:05:41 +01:00
Sebastian Castro
bce9fc5b4e Style all standard select as the text input 2021-12-09 10:09:39 +01:00
dependabot[bot]
baaf24948a Bump @storybook/addon-controls from 6.4.1 to 6.4.9
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.4.1 to 6.4.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.9/addons/controls)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-09 09:06:11 +00:00
Transifex-Openfoodnetwork
a2b734f636 Updating translations for config/locales/en_US.yml 2021-12-09 01:41:49 +11:00
Sebastian Castro
18d966f0de Closes #8441 Confirmation popup on shop change 2021-12-08 13:34:15 +01:00
Sebastian Castro
8624d11585 products-index: Hide html component with ng-cloak 2021-12-08 12:44:58 +01:00
Maikel
8107aa3a05 Merge pull request #8589 from filipefurtad0/shop_products_spec_into_system
Remaining shopping specs into system
2021-12-08 18:17:51 +11:00
Maikel
d38d8283b1 Merge pull request #8588 from filipefurtad0/shop_embedded_into_system
Updates/moves embedded_groups into system
2021-12-08 18:13:30 +11:00
Maikel
77085cf9bb Merge pull request #8587 from filipefurtad0/checkout_stripe_into_system
Updates/moves checkout_stripe into system
2021-12-08 18:12:49 +11:00
Maikel
9307b97f5b Merge pull request #8586 from filipefurtad0/checkout_paypal_into_system
Updates/moves checkout_paypal into system
2021-12-08 18:11:45 +11:00
Maikel
81fff677ac Merge pull request #8584 from filipefurtad0/shop_cart_spec_into_system
Updates/moves cart_spec into system
2021-12-08 18:10:34 +11:00
Maikel
2dd80a8c6b Merge pull request #8583 from filipefurtad0/shopping_caching_into_system
Updates/moves shops_caching into system
2021-12-08 18:09:23 +11:00
Maikel
1957ae185b Merge pull request #8582 from filipefurtad0/darkswarm_into_system
Updates/moves darkswarm_caching into system
2021-12-08 18:07:49 +11:00
Maikel
086b469a1a Merge pull request #8575 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.4.8
Bump @storybook/server from 6.3.12 to 6.4.8
2021-12-08 18:06:57 +11:00
Maikel
65e5291679 Merge pull request #8569 from Matt-Yorkley/dead-code-backordered
Remove dead code: Order#backordered?
2021-12-08 18:05:38 +11:00
Maikel
d34478f271 Merge pull request #8448 from filipefurtad0/reports_spec_into_system
Moves/updates reports_spec.rb into system
2021-12-08 18:03:48 +11:00
dependabot[bot]
4bbdaf07ea Bump @storybook/server from 6.3.12 to 6.4.8
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.12 to 6.4.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.8/app/server)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-08 05:10:04 +00:00
Maikel
d2c0c3ff7b Merge pull request #8573 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.8
Bump @storybook/addon-docs from 6.4.3 to 6.4.8
2021-12-08 16:07:43 +11:00
filipefurtad0
9565400ee0 Removes typo, deletes byebug 2021-12-07 17:30:58 +00:00
filipefurtad0
7f39a1e1d6 Removes line break in assertion 2021-12-07 17:26:06 +00:00
Matt-Yorkley
83fafe9969 Fix stripe elements styling
The selectors are different now that we're not using Angular to build the stripe card element.
2021-12-07 16:46:42 +00:00
filipefurtad0
5a77ee75e1 Moves/Updates variant_override_spec into system 2021-12-07 16:35:19 +00:00
Matt-Yorkley
d22cb0e1e1 Add billing address name to card 2021-12-07 16:29:25 +00:00
Matt-Yorkley
6b8c91845e Update strong params 2021-12-07 16:29:25 +00:00
Matt-Yorkley
2fe96c5f63 Update Stripe controller hidden fields 2021-12-07 16:29:25 +00:00
Matt-Yorkley
9979ecf8b4 Update view to use new Stimulus controller for Stripe card form 2021-12-07 16:29:25 +00:00
Matt-Yorkley
cbd7b37eb3 Change card field name
The order[card] field is already in use / needed for other data 👍
2021-12-07 16:29:25 +00:00
Matt-Yorkley
720d147421 Bring in stimulus controller for stripe elements 2021-12-07 16:29:25 +00:00
Matt-Yorkley
7f4b2cc00a Tidy up checks on Enumerable objects 2021-12-07 16:29:25 +00:00
Matt-Yorkley
ce7fb1b4dc Move select-options-formatting logic to helper 2021-12-07 16:29:25 +00:00
Matt-Yorkley
d85597fe4c Rename stripe cards controller 2021-12-07 16:29:25 +00:00
Matt-Yorkley
8105f0ebf3 Simplify partial selecting and rename stripe_sca partial 2021-12-07 16:29:25 +00:00
Jean-Baptiste Bellet
33887e8b6e Remove wrong min attribute on input 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
fd5ad7566a Disabled all form elements that should not be sent to the controller 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
f7662947dc Extract to a method that handle all the form elements 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
fbe69b8027 Manage savedCards or enter new card behavior for stripe payment form 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
7437c6a6d7 Add a stripe controller that show/hide stripe form if saved cards or not 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
34ce08d901 Format card label in card selector 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
68e4d55f80 Avoid ternary operator 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
f9b0798c88 Add stripe_sca, paypal, check payment method
Stripe_sca use the same template than stripe
2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
e89caf7a0d Add stripe as payment method 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
fc6fba4fe9 Move into specific folder 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
216e06cd6b Update stripe card errors styles 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
792763d275 use specific gateway form template for split checkout 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
2564de4ca4 Display the right container by default regarding the selected_payment_method 2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
5f3ea6accb Do not init by hidden all the container
that allow to init the content without clicking on anything
2021-12-07 16:27:22 +00:00
Jean-Baptiste Bellet
7159cc3ff1 Handle required attribute on input for PaymentMethod controller
This is done for one reason : do not submit form with required attribute on input that are actually hidden ; this is not handle correctly by browsers.

This idea here is to add/remove the required attribute on each input if the form is visible or not.
2021-12-07 16:27:22 +00:00
filipefurtad0
28698ab3bd Moves/Updates unit_price_spec into system 2021-12-07 16:25:21 +00:00
filipefurtad0
85a41205e9 Moves/Updates products_spec into system 2021-12-07 16:23:52 +00:00
Jean-Baptiste Bellet
3063b041d1 Change the paymentmethod controller to handle both desc and form
Add tests as well

Update _payment.html.haml

Update _payment.html.haml
2021-12-07 16:23:39 +00:00
filipefurtad0
9488ba097e Updates/moves embedded_groups into system 2021-12-07 16:10:25 +00:00
filipefurtad0
7dd002cb4d Updates/moves checkout_stripe into system 2021-12-07 16:01:56 +00:00
filipefurtad0
4fbc7eeb44 Updates/moves checkout_paypal into system 2021-12-07 13:46:40 +00:00
Matt-Yorkley
53d01b1275 Update all locales with the latest Transifex translations 2021-12-07 13:30:07 +00:00
Matt-Yorkley
775475f88a Merge pull request #8566 from openfoodfoundation/transifex
Transifex
2021-12-07 13:26:25 +00:00
Matt-Yorkley
0197831246 Merge pull request #8585 from openfoodfoundation/revert-8500-8495-Variant-unit-name-shopfront
Revert "Fixed inconsistency with display of unit name for products sold by item"
2021-12-07 13:24:38 +00:00
Matt-Yorkley
290e292dea Revert "Fixed inconsistency with display of unit name for products sold by item" 2021-12-07 13:24:12 +00:00
filipefurtad0
bceecc533e Updates/moves cart_spec into system 2021-12-07 11:21:27 +00:00
filipefurtad0
fb87ef29a6 Updates/moves shops_caching into system 2021-12-07 11:09:17 +00:00
filipefurtad0
37d4a21521 Updates/moves darkswarm_caching into system 2021-12-07 10:45:38 +00:00
Jean-Baptiste Bellet
cad8d8316d Improve variant order when searching 2021-12-07 11:37:39 +01:00
Filipe
2233c7ae0f Merge pull request #8571 from mkllnk/fix-flaky-product-import
Avoid flaky race conditions in product import spec
2021-12-07 10:32:00 +00:00
Jean-Baptiste Bellet
1b6cfb60a1 Searching variants should order results by variants display name 2021-12-07 11:18:20 +01:00
Jean-Baptiste Bellet
12f7935a26 Add needed Helper to handle create 2021-12-07 11:18:20 +01:00
Jean-Baptiste Bellet
31cc2549ed Order variant search by display_name 2021-12-07 11:18:20 +01:00
Maikel Linke
5793ddfe1b Give product import spec more time
It seems to be really slow.
2021-12-07 17:06:45 +11:00
Matt-Yorkley
2408b7f74e Simplify card formatting 2021-12-06 15:20:39 +00:00
Transifex-Openfoodnetwork
fa2b14e31b Updating translations for config/locales/en_GB.yml 2021-12-06 21:03:46 +11:00
filipefurtad0
1bd04f283f Fixes rubocop update validation errors 2021-12-06 09:14:21 +00:00
dependabot[bot]
201d663d10 Bump @storybook/addon-docs from 6.4.3 to 6.4.8
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.3 to 6.4.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.8/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-06 09:07:29 +00:00
Maikel Linke
d99feeaaa5 Remove unreliable spec expectation
We were not failing if these percentages were not displayed. But the
spec did fail when the import was finished already and the progress bar
wasn't there any more.

Let's avoid these race conditions and wait for the final completion
page.
2021-12-06 18:06:16 +11:00
Maikel Linke
dc7dfcacba Wait for product import to finish in spec
The expectation returned to early.
2021-12-06 18:01:17 +11:00
Matt-Yorkley
87fe341b5b Remove dead code: Order#backordered? 2021-12-05 15:17:27 +00:00
Matt-Yorkley
dcad00d047 Merge pull request #8484 from Matt-Yorkley/stripe-session-checks
Stripe checkout alerting
2021-12-05 12:04:00 +00:00
filipefurtad0
1393b52d98 Corrects several Rubocop offenses 2021-12-05 11:04:01 +00:00
Transifex-Openfoodnetwork
59380ef547 Updating translations for config/locales/it.yml 2021-12-04 04:00:36 +11:00
Liam McMenemie
b18e38a7ef Fix out-of-date links in CONTRIBUTING.md 2021-12-03 16:54:54 +00:00
filipefurtad0
b246cbad06 Deletes trailing space 2021-12-03 11:07:01 +00:00
filipefurtad0
8d20174a0f Deletes doubled unused pick_date method 2021-12-03 11:06:04 +00:00
filipefurtad0
e0006a6dc4 Removes build line related to feature specs 2021-12-03 10:54:28 +00:00
filipefurtad0
7487e7256a Implements pick_date and pick_datetime helpers 2021-12-03 10:54:28 +00:00
filipefurtad0
05de253ad7 Adds pick_date and pick_datetime helpers 2021-12-03 10:54:28 +00:00
filipefurtad0
61aa357a39 Makes timedate selection independent of current date 2021-12-03 10:54:28 +00:00
filipefurtad0
2096b3474e Fixes date selection on xero-flapickr 2021-12-03 10:54:28 +00:00
filipefurtad0
87365a939a Fixes case on xero_invoice_header class 2021-12-03 10:54:28 +00:00
filipefurtad0
d2dddb674e Fixes date selection on flapickr 2021-12-03 10:54:28 +00:00
filipefurtad0
5245d5574f Fixes string case in assertions 2021-12-03 10:54:28 +00:00
filipefurtad0
a7a1673e2e Moves/updates reports_spec.rb into system 2021-12-03 10:54:28 +00:00
jibees
9590b15f50 Merge pull request #8550 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.4.3
Bump jest from 27.3.1 to 27.4.3
2021-12-03 09:32:13 +01:00
Matt-Yorkley
6e905bd2fc Merge pull request #8561 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.7.2
Bump mrujs from 0.7.1 to 0.7.2
2021-12-03 01:11:59 +00:00
Filipe
89864395ca Merge pull request #8520 from seballot/multiple-flash-messages
Fix rendering problem with multiple flash messages in the admin section
2021-12-03 01:05:36 +00:00
Filipe
b2e5a89395 Merge pull request #8487 from jibees/7278-multipe-stripe-form-in-admin-section
Allow mutiple stripe form in the admin section
2021-12-03 00:21:03 +00:00
dependabot[bot]
6aa0a9864d Bump mrujs from 0.7.1 to 0.7.2
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.7.1...v0.7.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-02 21:22:09 +00:00
Matt-Yorkley
d2f542032e Update all locales with the latest Transifex translations 2021-12-02 21:20:26 +00:00
Matt-Yorkley
639ff6730f Merge pull request #8558 from openfoodfoundation/transifex
Transifex
2021-12-02 21:15:16 +00:00
Matt-Yorkley
e533973ecd Merge pull request #8513 from jibees/run-rubocop-with-reviewdog
Run rubocop with reviewdog
2021-12-02 21:14:04 +00:00
Matt-Yorkley
5f4c24f44d Merge pull request #8522 from seballot/vscode
gitignore vscode editor folder
2021-12-02 21:13:45 +00:00
Matt-Yorkley
684143cd46 Merge pull request #8515 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.1.0
Bump @hotwired/turbo from 7.0.1 to 7.1.0
2021-12-02 21:13:31 +00:00
Transifex-Openfoodnetwork
2a9a92dd6c Updating translations for config/locales/en_IE.yml 2021-12-03 04:30:38 +11:00
Matt-Yorkley
4cdb892c75 Refactor formatting of credit card brand names and reformat automatically when saving
This little bit of "translation" between what we might receive as input and what ActiveMerchant requires is important, but currently the responsibility for this job is spread all over the code base. It can now just live in the CreditCard model (in one place) and doesn't need to be duplicated anywhere else (like several different places in frontend Javascript!)
2021-12-02 16:22:52 +00:00
Filipe
f56dc2e284 Merge pull request #8517 from openfoodfoundation/chore-remove-deprecated-application.yml
Remove references to deprecated application.yml config file.
2021-12-02 10:54:08 +00:00
Sinan Chaush
68908fdff5 Navigation is included only for super admin users 2021-12-02 11:53:46 +01:00
Filipe
ff485314a4 Merge pull request #8526 from jibees/3584-fix-adjustment-on-voiding-payment
Revoke transaction fee if payment is cancelled
2021-12-02 10:44:08 +00:00
dependabot[bot]
b28942b2eb Bump jest from 27.3.1 to 27.4.3
Bumps [jest](https://github.com/facebook/jest) from 27.3.1 to 27.4.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.3.1...v27.4.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-02 04:52:17 +00:00
Maikel
d0625e99c7 Merge pull request #8545 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.3
Bump @storybook/addon-docs from 6.4.1 to 6.4.3
2021-12-02 15:47:40 +11:00
Adrien Chauve
8585c68691 Remove occurences of application.yml.example 2021-12-01 18:39:26 +01:00
Adrien Chauve
2095024f48 Don't git-ignore application.yml any more 2021-12-01 18:37:26 +01:00
Adrien Chauve
abf1b54364 Fix environment variables loading when running whenever 2021-12-01 18:34:39 +01:00
dependabot[bot]
26c711f095 Bump @storybook/addon-docs from 6.4.1 to 6.4.3
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.4.1 to 6.4.3.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.3/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-01 09:09:59 +00:00
Maikel
97751763a7 Merge pull request #8536 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.4.1
Bump @storybook/addon-docs from 6.3.12 to 6.4.1
2021-12-01 15:06:27 +11:00
dependabot[bot]
a58fd7a388 Bump @storybook/addon-docs from 6.3.12 to 6.4.1
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.12 to 6.4.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.1/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.1/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-01 03:36:53 +00:00
Maikel
74b81febe0 Merge pull request #8535 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.4.1
Bump @storybook/addon-controls from 6.3.12 to 6.4.1
2021-12-01 14:33:03 +11:00
Jean-Baptiste Bellet
57dc10888c Improve shipped email design
- Use default class for header, content
 - Use monospace font for the list of the items
 - Add line breaks for the list of the items
2021-11-30 17:02:42 +01:00
Jean-Baptiste Bellet
9bc7343420 Create a mailer preview for the shipped email
Available on http://localhost:3000/rails/mailers/spree/shipment/shipped
2021-11-30 16:55:07 +01:00
dependabot[bot]
108aed21bc Bump @storybook/addon-controls from 6.3.12 to 6.4.1
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.12 to 6.4.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.1/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.1/addons/controls)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-30 09:06:18 +00:00
Jean-Baptiste Bellet
58ea420626 Voiding a payment should revoke any payment fees
... and create a new one if a new payment is then linked to the order.
2021-11-30 09:42:10 +01:00
Matt-Yorkley
64fd8da742 Merge pull request #8531 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.7.1
Bump mrujs from 0.6.0 to 0.7.1
2021-11-29 15:53:56 +00:00
Jean-Baptiste Bellet
59eb91c7c8 Remove id "card-element" as well 2021-11-29 10:18:06 +01:00
dependabot[bot]
87da55abb7 Bump mrujs from 0.6.0 to 0.7.1
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.6.0 to 0.7.1.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.6.0...v0.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 09:08:30 +00:00
Jean-Baptiste Bellet
57a94d64f2 Revoke adjustment if payment is cancelled 2021-11-26 16:31:25 +01:00
Sebastian Castro
c9952eb372 gitignore vscode editor folder 2021-11-26 11:40:50 +01:00
Sebastian Castro
588420ff93 Fixs #8442 display multiple flash messages correctly 2021-11-26 11:38:43 +01:00
François Turbelin
58d54aa4ec Fix Webpacker container configuration 2021-11-26 09:22:18 +01:00
Jean-Baptiste Bellet
7ef976a52a Update all locales with the latest Transifex translations 2021-11-25 13:47:09 +01:00
jibees
fed893eba8 Merge pull request #8504 from openfoodfoundation/transifex
Transifex
2021-11-25 13:43:21 +01:00
jibees
b39d3bb7de Merge pull request #8492 from shveikus/8479-tab-behaviour-for-login-modal
Update TAB behavior for the login modal
2021-11-25 13:42:25 +01:00
jibees
76176b2482 Merge pull request #8498 from drummer83/drummer83-country_first
Switch the order of 'state' and 'country' input fields
2021-11-25 13:41:46 +01:00
jibees
439f4ad24c Merge pull request #8497 from drummer83/drummer83-localize_button
Place the localize button above the map/below the address
2021-11-25 13:41:19 +01:00
Nihal M. Kelanthodika
74b87adee3 Merge pull request #8500 from apricot12/8495-Variant-unit-name-shopfront 2021-11-25 16:06:06 +05:30
dependabot[bot]
8a05351a97 Bump @hotwired/turbo from 7.0.1 to 7.1.0
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.0.1...v7.1.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>
2021-11-25 09:07:39 +00:00
jibees
2f3d2952d0 Merge pull request #8510 from openfoodfoundation/release-task
Add more detail to the release task template
2021-11-25 09:19:20 +01:00
Maikel
6ff7acd496 Merge pull request #8508 from openfoodfoundation/mkllnk-rails-tutorials-link
Direct beginners to Rails tutorials
2021-11-25 16:51:49 +11:00
Transifex-Openfoodnetwork
d3131d6e23 Updating translations for config/locales/de_DE.yml 2021-11-25 10:04:12 +11:00
Transifex-Openfoodnetwork
ce69dbd016 Updating translations for config/locales/ru.yml 2021-11-25 07:39:36 +11:00
SarvarKhalimov
5d36c66aff Update follow partial to reflect social urls correctly 2021-11-25 01:05:45 +05:00
Adrien Chauve
051950e04c Remove references to deprecated application.yml config file.
Point to .env and other .env.* config files.
2021-11-24 15:11:00 +01:00
Jean-Baptiste Bellet
1f74ded192 run rubocop view reviewdog 2021-11-24 09:25:42 +01:00
Nihal M. Kelanthodika
aefb580023 Update unit_to_display spec 2021-11-23 12:59:42 +05:30
Maikel Linke
1da9dbc53e Add more detail to the release task
New developers need a bit more guidance. And it's actually quite handy
for me, too.

We may want to remove duplication between this document and the wiki.
2021-11-23 17:21:37 +11:00
Maikel
5f87c30d3e Merge pull request #8465 from jibees/7963-permission-to-delete-relationship-both-ways
Manager can delete enterprises relationship in both direction
2021-11-23 09:20:32 +11:00
shveikus
9e75e0e65c Add spec for logging using keyboard 2021-11-22 23:40:22 +03:00
Dmitry Shveikus
9bd604cbe9 Update TAB behaviour for login modal 2021-11-22 23:40:22 +03:00
Jean-Baptiste Bellet
b6afdb13fc Use timeout to put in other callback and then update the StatusMessage 2021-11-22 21:39:20 +01:00
Jean-Baptiste Bellet
5575697c9f Add a directive attribute 'selected' that update AdminStripeElements when true
Filled with `PaymentCtrl.isSelected(payment_method_id)`

Therefore, each time a stripe payment is selected, the one that is actually selected is linked to `AdminStripeElements.card` and `AdminStripeElements.stripe`
2021-11-22 21:39:20 +01:00
Jean-Baptiste Bellet
5348d26054 Add new "error" attribute in the StatusMessage
It is used by `admin/payments/services/stripe_elements.js.coffee`
2021-11-22 21:39:20 +01:00
Jean-Baptiste Bellet
36c12a92f2 Display errors on the right specific DOM element 2021-11-22 21:39:20 +01:00
Jean-Baptiste Bellet
fc779e0237 Mount Stripe element to the specific DOM element 2021-11-22 21:39:20 +01:00
Jean-Baptiste Bellet
f7bf6e1083 Include Stripe js only once in the admin section 2021-11-22 21:39:20 +01:00
SarvarKhalimov
c202c52d8b Refactor correct_social_url method in enterprise model and its tests 2021-11-22 23:31:56 +05:00
Maikel
a3dd14906f Direct beginners to Rails tutorials 2021-11-22 17:56:20 +11:00
Transifex-Openfoodnetwork
ba5555a522 Updating translations for config/locales/nb.yml 2021-11-20 00:51:04 +11:00
Nihal M. Kelanthodika
8a42043701 Fixed inconsistency with display of unit name for products sold by item 2021-11-19 13:39:42 +05:30
Maikel
3b082beaab Merge pull request #8493 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.9
Bump karma from 6.3.8 to 6.3.9
2021-11-19 16:14:23 +11:00
Maikel Linke
f89263f060 Update translations 2021-11-19 15:43:52 +11:00
Maikel
e2013a9eb9 Merge pull request #8491 from openfoodfoundation/transifex
Transifex
2021-11-19 14:31:00 +11:00
Matt-Yorkley
40e67c3907 Merge pull request #8105 from andrewpbrett/void-extra-outstanding-payments
Void payments requiring auth upon marking order paid
2021-11-18 16:52:40 +00:00
Matt-Yorkley
bc5c9ff8e2 Merge pull request #8472 from Matt-Yorkley/notify-resumed
Include items from resumed orders when mailing producers
2021-11-18 15:20:08 +00:00
Matt-Yorkley
527a53bd0f Merge pull request #8485 from Matt-Yorkley/stripe-addresses
Checkout address handling
2021-11-18 15:19:27 +00:00
Maikel
c208700c77 Merge pull request #8070 from jibees/8065-add-tests-to-split-checkout
Add tests to split checkout
2021-11-18 11:17:17 +11:00
Konrad
60d1305b0a Add files via upload 2021-11-18 00:28:49 +01:00
Konrad
87b3b6fa36 Add files via upload 2021-11-18 00:23:05 +01:00
Matt-Yorkley
378d3d5ab6 Merge pull request #8476 from Matt-Yorkley/reports-producers-visibility
Ensure line items are correctly scoped for producers
2021-11-17 15:07:37 +00:00
dependabot[bot]
be92b8aff8 Bump karma from 6.3.8 to 6.3.9
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.8 to 6.3.9.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.8...v6.3.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-17 09:05:15 +00:00
Matt-Yorkley
8d5dbb1f47 Remove/simplify setup objects and improve old shipping method names 2021-11-17 09:47:13 +01:00
Matt-Yorkley
f3dc1c80cf Update error field counts 2021-11-17 09:47:13 +01:00
Matt-Yorkley
ac317bc3ce Fix Flipper stubs 2021-11-17 09:47:13 +01:00
Matt-Yorkley
1089ded2a2 Move spec under /consumer 2021-11-17 09:47:13 +01:00
Jean-Baptiste Bellet
04ba570875 Add split checkout system test 2021-11-17 09:47:13 +01:00
Jean-Baptiste Bellet
3185033dea Generate id and for on label and input when using rails helper 2021-11-17 09:47:13 +01:00
Maikel
c3076f0316 Merge pull request #8447 from Matt-Yorkley/keyword-args-deprecation
Fix keyword args deprecations
2021-11-17 17:09:15 +11:00
Maikel
c5c09dbcf8 Merge pull request #8483 from Matt-Yorkley/guest-token
Remove dead code: session[:guest_token]
2021-11-17 17:07:00 +11:00
Maikel
917ca7b0cf Merge pull request #8481 from mkllnk/8474-concurrency-spec
Test for concurrent checkouts reliably
2021-11-17 12:26:07 +11:00
Matt-Yorkley
b1c0da9675 Bang! 2021-11-16 17:32:10 +00:00
Transifex-Openfoodnetwork
14eff4adb6 Updating translations for config/locales/en_FR.yml 2021-11-17 03:25:35 +11:00
Transifex-Openfoodnetwork
fa6ce98b71 Updating translations for config/locales/fr.yml 2021-11-17 03:24:15 +11:00
Matt-Yorkley
0efa370211 Merge pull request #8405 from jibees/7961-translate-stripe-error-message
Translate stripe error messages during payment processing
2021-11-16 11:49:12 +00:00
Matt-Yorkley
3e02023bf8 Move handling of unused payments to Order::Updater
An order can be set to paid in various cases that are unrelated to the order being finalized, so this bit of logic needs to be called at the point the order actually gets paid.
2021-11-15 15:42:04 +00:00
Andy Brett
0b3d78b2a5 void transactions in memory instead of fetching from db
Co-authored-by: Maikel <maikel@email.org.au>
2021-11-15 15:42:04 +00:00
Andy Brett
48a867ac99 expect specific payment to receive message
Co-authored-by: Maikel <maikel@email.org.au>
2021-11-15 15:42:04 +00:00
Andy Brett
0ef07023ad remove any_instance_of in order_spec
Co-authored-by: Maikel <maikel@email.org.au>
2021-11-15 15:42:04 +00:00
Andy Brett
60677bce4f void payments requiring auth upon marking order paid 2021-11-15 15:42:04 +00:00
Matt-Yorkley
b388196ce3 Merge pull request #8471 from jibees/7885-duplicate-product-in-order-cycle
Use distinct to return unique product list for scope `visible_for`
2021-11-15 10:05:11 +00:00
SarvarKhalimov
f8c45b3e31 Update app/models/enterprise.rb - optimise delete @ method
Co-authored-by: Maikel <maikel@email.org.au>
2021-11-15 13:21:19 +11:00
SarvarKhalimov
6f9fc9f06c Add a new rspec test and optimize existing for correct_social_url 2021-11-15 13:21:04 +11:00
SarvarKhalimov
5d2a5e63ec Fix the issue with 'at' in interprise twitter and insgram 2021-11-15 13:21:04 +11:00
Matt-Yorkley
ac5766b00b Report current order info on all checkout failures 2021-11-14 20:01:32 +00:00
Matt-Yorkley
f8349434bf Skip address setup logic if we're coming from Stripe
The code here runs from a callback which was originally designed to make sure the checkout page was set up correctly in the "normal" checkout workflow. It wasn't really designed to be run when the page is being loaded a second time due to the user being redirected back from Stripe (with SCA). The things it's doing here are necessary in the former case, but a really bad idea in the latter (potentially messing up the order's ship and bill addresses in certain cases like guest checkout).
2021-11-14 16:54:44 +00:00
Matt-Yorkley
f83d0a766f Memoize Checkout#valid_payment_intent_provided? 2021-11-14 14:24:23 +00:00
Matt-Yorkley
bbb47964db Notify Bugsnag if the order loaded at checkout is invalid after being redirected back from Stripe during payment processing. 2021-11-14 13:58:15 +00:00
Matt-Yorkley
1bf4e6fa56 Reorder conditions for performance
A little micro-optimisation: `@order.checkout_allowed?` requires a database query, whereas `@order.completed?` does not. So in cases where the order is completed we can return early here before hitting the database.
2021-11-14 13:58:15 +00:00
Matt-Yorkley
8d0cbe886a Rename method for clarity 2021-11-14 13:58:15 +00:00
Matt-Yorkley
48acc0ecd0 Add Bugsnag notice when an OC closes during checkout completion
This info could be useful to know whilst debugging order completion issues.
2021-11-14 13:58:15 +00:00
Matt-Yorkley
d0f572b051 Remove dead code: session[:guest_token]
This `session[:guest_token]` doesn't seem to ever be assigned anywhere in the codebase, and it doesn't seem to be read at any point either..? There are some various places where `current_order.token` is used and `session[:access_token]` is used, but not this.

As far as I can tell: it was part of an old version of Spree and related to the spree_auth_devise gem (which we no longer use).
2021-11-14 12:02:07 +00:00
Matt-Yorkley
00862844d5 Memoize Checkout#valid_payment_intent_provided? 2021-11-14 11:39:36 +00:00
Jean-Baptiste Bellet
3df304c9d6 Search and match through name + city and state_name
- Rename enterpriseMatchesNameQueryFilter as well to enterpriseMatchesQueryFilter
 - Update tests as well
2021-11-12 15:57:28 +01:00
Matt-Yorkley
0a22a3baa6 Merge pull request #8478 from Matt-Yorkley/split-admin-system-tests
Split admin system tests into two groups
2021-11-12 10:20:46 +00:00
Jean-Baptiste Bellet
fff2c3ae74 Update spec to take into account the non-duplication of product in inventory 2021-11-12 10:55:47 +01:00
Maikel Linke
4c4691adbb Update translations 2021-11-12 14:48:30 +11:00
Maikel
28b8b9cc55 Merge pull request #8460 from openfoodfoundation/transifex
Transifex
2021-11-12 14:38:45 +11:00
Maikel Linke
6212ad18a8 Test for concurrent checkouts reliably
Apparently, controller specs are not thread safe and we got random test
failures. I converted it into a request spec and fine-tuned it to make
it more reliable.
2021-11-12 14:09:17 +11:00
Matt-Yorkley
f3d22ba777 Merge pull request #8439 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.6.0
Bump mrujs from 0.5.11 to 0.6.0
2021-11-11 16:29:33 +00:00
Matt-Yorkley
6635b59250 Split admin system tests into two groups 2021-11-11 14:49:03 +00:00
Matt-Yorkley
0d8d4db41f Fix keyword args deprecations
/home/runner/work/openfoodnetwork/openfoodnetwork/lib/spree/core/delegate_belongs_to.rb:75: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

/home/runner/work/openfoodnetwork/openfoodnetwork/lib/spree/i18n.rb:20: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
2021-11-11 14:16:37 +00:00
Matt-Yorkley
b1c1284c18 Merge pull request #8450 from filipefurtad0/admin_into_system_3
Moves/Updates admin into system (cont. III)
2021-11-11 14:05:19 +00:00
Matt-Yorkley
0683941f88 Ensure line items are correctly scoped for producers 2021-11-11 13:11:19 +00:00
Jean-Baptiste Bellet
7041ec71a4 Translate some error messages during payment processing if exists
- Stripe error messages aren't translated. But, Stripe send the error code. Use it (if found it, and translation key does exist) to translated the error message
 - Populate the en.yml file with some of the most known errors

Co-Authored-By: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2021-11-11 12:04:38 +01:00
Matt-Yorkley
fa4751b998 Include items from resumed orders when mailing producers 2021-11-10 15:09:24 +00:00
Jean-Baptiste Bellet
d2dbe6c738 Use distinct to return unique product
- Product were displayed twice (or more) in certain condition under order cycle incoming products admin interface
2021-11-10 14:49:19 +01:00
Maikel
d799f446be Merge pull request #8466 from filipefurtad0/admin_into_system_v
Moves/updates missing admin feature specs into system (cont.)
2021-11-10 11:30:11 +11:00
Maikel
6cc194a10b Merge pull request #8464 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.8
Bump karma from 6.3.7 to 6.3.8
2021-11-10 11:24:56 +11:00
jibees
7bbb68e0c2 Merge pull request #8462 from filipefurtad0/admin_into_features_iv
Moves/updates subscriptions_spec into system
2021-11-09 14:56:36 +01:00
filipefurtad0
901d1cbc44 Moves/updates variants_spec into system 2021-11-08 19:15:37 +00:00
filipefurtad0
42992e63a5 Moves/updates users_spec into system 2021-11-08 16:46:41 +00:00
filipefurtad0
05393351f6 Moves/updates unit_price_spec into system 2021-11-08 16:45:32 +00:00
filipefurtad0
7e0d24c784 Moves/updates tax_settings into system 2021-11-08 16:33:25 +00:00
Jean-Baptiste Bellet
6266c3c5ae User can delete relationship between enterprises in both direction
A permits B
B permits A

Manager for A and B enterprises can delete the two relations.

Update specs as well
2021-11-08 14:21:42 +01:00
Transifex-Openfoodnetwork
bb23be0909 Updating translations for config/locales/en_GB.yml 2021-11-08 22:02:14 +11:00
dependabot[bot]
de6ebc361a Bump karma from 6.3.7 to 6.3.8
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.7...v6.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 09:07:47 +00:00
filipefurtad0
d646b29573 Comments out drag_to block - not implemented in Cuprite 2021-11-06 19:23:36 +00:00
filipefurtad0
fa4a2dbab4 Moves/updates tag_rules into system 2021-11-06 19:18:42 +00:00
filipefurtad0
151ff59d1b Moves/updates subscriptions_spec into system 2021-11-06 17:11:14 +00:00
Guido Oliveira
db45d7f4eb Cancel empty orders on BOM page 2021-11-06 10:25:34 -03:00
filipefurtad0
6a33ad44f0 Fixes failing example on enterprises spec 2021-11-06 12:33:04 +00:00
filipefurtad0
a946b93fb9 Deletes obsolete example 2021-11-06 12:13:07 +00:00
filipefurtad0
182ef9eb3e Changes deletion action 2021-11-06 11:54:39 +00:00
filipefurtad0
9b3db4e667 Updates/moves shipping_methods into system 2021-11-06 11:53:02 +00:00
filipefurtad0
5fae9e2b30 Updates/moves schedules_spec into system 2021-11-06 11:50:20 +00:00
Matt-Yorkley
8cb2a2cc96 Merge pull request #8451 from Matt-Yorkley/variant-search-debounce
Fix debounce on variant search dropdown
2021-11-05 18:59:44 +00:00
jibees
a737ee4d1b Merge pull request #8446 from filipefurtad0/admin_into_system_2
Moves/Updates admin into system (cont.)
2021-11-05 17:02:56 +01:00
Transifex-Openfoodnetwork
42b00abf3e Updating translations for config/locales/fr.yml 2021-11-06 02:29:34 +11:00
Transifex-Openfoodnetwork
70634dc0c1 Updating translations for config/locales/en_FR.yml 2021-11-06 00:12:34 +11:00
Matt-Yorkley
4dfbdc3bfa Merge pull request #8456 from openfoodfoundation/dependabot/npm_and_yarn/dns-packet-1.3.4
Bump dns-packet from 1.3.1 to 1.3.4
2021-11-05 11:26:14 +00:00
Matt-Yorkley
40e4e6427e Merge pull request #8454 from openfoodfoundation/dependabot/npm_and_yarn/url-parse-1.5.3
Bump url-parse from 1.5.1 to 1.5.3
2021-11-05 11:26:04 +00:00
dependabot[bot]
f0d0f8620f Bump dns-packet from 1.3.1 to 1.3.4
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 10:51:13 +00:00
Matt-Yorkley
22ec427951 Merge pull request #8452 from openfoodfoundation/dependabot/npm_and_yarn/postcss-7.0.39
Bump postcss from 7.0.35 to 7.0.39
2021-11-05 10:50:33 +00:00
Matt-Yorkley
e626e86015 Update all locales with the latest Transifex translations# 2021-11-05 10:46:03 +00:00
Matt-Yorkley
c1b2af006e Merge pull request #8435 from openfoodfoundation/transifex
Transifex
2021-11-05 10:39:14 +00:00
Matt-Yorkley
e31470d640 Merge pull request #8453 from openfoodfoundation/dependabot/npm_and_yarn/ws-6.2.2
Bump ws from 6.2.1 to 6.2.2
2021-11-05 10:23:17 +00:00
dependabot[bot]
fd3a20cfc6 Bump url-parse from 1.5.1 to 1.5.3
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 10:07:49 +00:00
dependabot[bot]
bf14ddb187 Bump postcss from 7.0.35 to 7.0.39
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.39.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/7.0.39/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.39)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 10:07:45 +00:00
dependabot[bot]
46aa4b6733 Bump ws from 6.2.1 to 6.2.2
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/6.2.1...6.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 10:07:45 +00:00
Matt-Yorkley
47dbfa7d17 Merge pull request #8145 from Matt-Yorkley/reports-query-interface
Reports Query Interface
2021-11-05 10:06:52 +00:00
Transifex-Openfoodnetwork
a000d9f984 Updating translations for config/locales/de_DE.yml 2021-11-05 12:29:48 +11:00
Transifex-Openfoodnetwork
13c9100ab7 Updating translations for config/locales/it.yml 2021-11-05 12:26:44 +11:00
Transifex-Openfoodnetwork
11477becdf Updating translations for config/locales/ru.yml 2021-11-05 12:26:42 +11:00
Maikel
a29330884c Merge pull request #8289 from jibees/7409-add-signup-matomo-event
Track event via matomo when submitting signup form
2021-11-05 11:05:45 +11:00
Maikel
3f571d178f Merge pull request #8418 from KombiCode/7706-add-close-button-to-flatpickr
7706 add close button to flatpickr
2021-11-05 11:04:50 +11:00
Matt-Yorkley
0d7bb2ff90 Update sorting by name in supplier report 2021-11-04 22:08:27 +00:00
Matt-Yorkley
c6ef14e9ee Update masking in supplier report 2021-11-04 22:08:10 +00:00
Matt-Yorkley
ce61b5088e Fix debounce on variant search dropdown
This wasn't applied correctly so there was zero debounce, leading to a big excess of pointless requests whilst typing in the variant search dropdown
2021-11-04 20:44:09 +00:00
Matt-Yorkley
373fc2e22e Update show_customer_names_to_suppliers check 2021-11-04 14:55:23 +00:00
Matt-Yorkley
ce047c4255 Ensure Suppliers multiselect options persist between page loads 2021-11-04 14:55:23 +00:00
Matt-Yorkley
b1611f514e Enable reloading in development 2021-11-04 14:55:23 +00:00
Matt-Yorkley
439a2318fb Move API response under top-level :data node 2021-11-04 14:55:23 +00:00
Matt-Yorkley
b6c593d5a4 Feature toggle API reports 2021-11-04 14:55:23 +00:00
Matt-Yorkley
97b22ec65d Update related specs 2021-11-04 14:55:23 +00:00
Matt-Yorkley
924f6568d6 Replace data loading with new Reports::QueryInterface 2021-11-04 14:55:23 +00:00
Matt-Yorkley
72212fd718 Add arel-helpers gem 2021-11-04 14:55:23 +00:00
Matt-Yorkley
817f0942dd Pull in reports POC work replacing Packing reports 2021-11-04 14:55:23 +00:00
Matt-Yorkley
c15321ee5a Merge pull request #8420 from Matt-Yorkley/customer-names-migration
Customer names preference migration
2021-11-04 14:52:57 +00:00
Matt-Yorkley
21bf5797ac Improve data migration 2021-11-04 11:48:30 +00:00
Matt-Yorkley
d46ed59699 Remove preference from Enterprise class 2021-11-04 11:48:30 +00:00
Matt-Yorkley
cf5d964133 Update usages of old preference getters and setters 2021-11-04 11:48:30 +00:00
Matt-Yorkley
4f5c266356 Add migration unit test 2021-11-04 11:48:30 +00:00
Matt-Yorkley
6f5cd98b1b Migrate preference to enterprises table 2021-11-04 11:48:30 +00:00
Matt-Yorkley
cfc2f2717c Merge pull request #8436 from Matt-Yorkley/drop-source-columns
Drop source_id and source_type columns from spree_adjustments
2021-11-04 11:39:48 +00:00
Rachel Arnould
761c2708c4 Update README.md 2021-11-03 15:14:08 +01:00
Matt-Yorkley
68542ce2b6 Merge pull request #8437 from Matt-Yorkley/statemachines-warnings
Ignore StateMachines warnings in console output
2021-11-03 09:29:00 +00:00
Matt-Yorkley
cf64128d54 Update db/migrate/20211029174211_drop_source_columns.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-11-03 09:26:47 +00:00
Matt-Yorkley
1b471aca4b Merge pull request #8430 from Matt-Yorkley/remove-codecov
Remove Codecov
2021-11-03 09:25:40 +00:00
Thierry Jet
fd5e34bf5c Few changes in test files for date(time)picker in order to make tests more readable 2021-11-03 09:57:23 +01:00
Maikel
1cef0dd2ac Merge pull request #8428 from Matt-Yorkley/enterprise-dead-code
Remove Enterprise #inheritance_column
2021-11-03 17:29:42 +11:00
Matt-Yorkley
39c4d787b1 Merge pull request #8440 from filipefurtad0/admin_into_system
Admin into system
2021-11-02 19:22:13 +00:00
filipefurtad0
1dd1147e88 Moves/Updates properties_spec into system 2021-11-02 15:22:43 +00:00
filipefurtad0
8f1afde0d9 Moves/Updates products_spec into system 2021-11-02 15:18:37 +00:00
Matt-Yorkley
f90b7d5226 Merge pull request #8444 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.7
Bump karma from 6.3.6 to 6.3.7
2021-11-02 10:41:00 +00:00
dependabot[bot]
267e0b856b Bump karma from 6.3.6 to 6.3.7
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.6 to 6.3.7.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.6...v6.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 09:05:29 +00:00
filipefurtad0
97859aa58a Changes assertion to consider slow progress bar 2021-11-01 19:21:48 +00:00
filipefurtad0
94ad5d3c74 Changes fixture path to absolute path 2021-11-01 19:20:45 +00:00
filipefurtad0
efec88a4fe Moves/updates product_import into system 2021-11-01 19:19:20 +00:00
Transifex-Openfoodnetwork
df796800c2 Updating translations for config/locales/de_DE.yml 2021-11-02 05:35:08 +11:00
filipefurtad0
bcb964648f Moves/updates payments_stripe into system 2021-11-01 18:32:16 +00:00
filipefurtad0
aa87d21e6a Moves/updates payments_spec into system 2021-11-01 18:29:42 +00:00
filipefurtad0
d0eec31503 Moves/updates payment_method_spec spec into system 2021-11-01 17:53:47 +00:00
filipefurtad0
d6a1c6aa1f Moves/updates overview_spec spec into system 2021-11-01 17:48:24 +00:00
filipefurtad0
0a14da59d5 Adds js wait line to reduce flakiness 2021-11-01 17:42:41 +00:00
filipefurtad0
a179acff2a Moves/updates order_spec spec into system 2021-11-01 17:41:05 +00:00
filipefurtad0
7e6dea4970 Moves/updates order_print spec into system 2021-11-01 15:34:20 +00:00
filipefurtad0
f68f13155d Adds missing helper to base_spec_helper.rb 2021-11-01 15:31:07 +00:00
filipefurtad0
a8889cb96c Moves/updates OC complex_nav into system 2021-11-01 15:01:01 +00:00
filipefurtad0
71b4a7d38e Moves/updates multilingual_spec into system 2021-11-01 14:57:58 +00:00
dependabot[bot]
9273e86b6b Bump mrujs from 0.5.11 to 0.6.0
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.11 to 0.6.0.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.5.11...v0.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 09:07:00 +00:00
Matt-Yorkley
636ca9987a Ignore StateMachines warnings in console output
We *already* ignore them anyway, so this just removes the console noise.
2021-10-29 18:59:08 +01:00
Matt-Yorkley
1007d7afdf Drop source_id and source_type columns from spree_adjustments
These are no longer used
2021-10-29 18:46:53 +01:00
Transifex-Openfoodnetwork
7afae8fc7a Updating translations for config/locales/ru.yml 2021-10-30 03:29:36 +11:00
Transifex-Openfoodnetwork
822d10983c Updating translations for config/locales/en_FR.yml 2021-10-30 03:29:33 +11:00
Transifex-Openfoodnetwork
5598967f1d Updating translations for config/locales/it.yml 2021-10-30 03:26:29 +11:00
Transifex-Openfoodnetwork
7f38f646ce Updating translations for config/locales/en_IE.yml 2021-10-30 03:26:27 +11:00
Matt-Yorkley
b0545c7fd3 Merge pull request #8431 from filipefurtad0/admin_specs_into_system
Admin enterprise specs into system
2021-10-29 16:10:31 +01:00
Matt-Yorkley
d75ebb8dab Merge pull request #8419 from drummer83/master
Added blank space in "Address (contd.)"
2021-10-29 16:09:01 +01:00
Matt-Yorkley
fafbc1c3cb Merge pull request #8410 from openfoodfoundation/dependabot/bundler/capybara-3.36.0
Bump capybara from 3.35.3 to 3.36.0
2021-10-29 14:45:38 +01:00
Matt-Yorkley
64d368a960 Merge pull request #8424 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.11
Bump mrujs from 0.5.10 to 0.5.11
2021-10-29 14:40:20 +01:00
filipefurtad0
a1b094b015 Uses trigger.click to click elements outside visible area 2021-10-29 14:28:16 +01:00
filipefurtad0
ace761464e Moves/updates enteprises_spec into system 2021-10-29 14:28:16 +01:00
filipefurtad0
a11cd901af Moves/updates enteprise_user into system 2021-10-29 14:28:16 +01:00
filipefurtad0
222817d317 Moves/updates enteprise_roles into system 2021-10-29 14:28:16 +01:00
filipefurtad0
56888dd6b0 Moves/updates enteprise_relationships into system 2021-10-29 14:28:16 +01:00
filipefurtad0
6c24708aec Moves/updates enteprise_groups_spec into system 2021-10-29 14:28:16 +01:00
Matt-Yorkley
1942af4bb6 Update all locales with the latest Transifex translations 2021-10-29 14:23:11 +01:00
Matt-Yorkley
649380a99d Merge pull request #8393 from openfoodfoundation/transifex
Transifex
2021-10-29 14:15:12 +01:00
jibees
4447cc19bf Merge pull request #8432 from Matt-Yorkley/split-system-tests
Break up system tests into two jobs
2021-10-29 14:30:51 +02:00
Matt-Yorkley
1ad1e51bb6 Break up system tests into two jobs 2021-10-29 12:00:45 +01:00
Matt-Yorkley
b898598070 Merge pull request #8411 from openfoodfoundation/dependabot/bundler/pagy-5.1.2
Bump pagy from 5.1.1 to 5.1.2
2021-10-29 10:27:17 +01:00
Thierry Jet
c8340d5c3b Add flatpickr_spec.rb to spec/system and add tests for datepicker in it. Use nth-last-child in tests. Modify test for datetimepicker to also select a datetime before closing and then check the value is correct after close occurred 2021-10-29 11:06:24 +02:00
Thierry Jet
8eff2716ed Modify choose_today_from_datepicker to avoid possible ambiguous match with the find 2021-10-29 11:06:24 +02:00
Matt-Yorkley
5316f7cd68 Remove Codecov
We're still getting build errors related to CodeCov reports not being uploaded
2021-10-29 10:02:13 +01:00
Maikel
43514f61ea Merge pull request #8312 from mariodz95/8249_fix_snail_on_shipping_method_fees
Fix snail on shipping method fees
2021-10-29 12:04:25 +11:00
Maikel
e5c755e6ad Merge pull request #8395 from sinansonmez/7937-include-missing-navigation-for-super-admin-only
Missing navigation for super admin users only included
2021-10-29 12:03:48 +11:00
Maikel
03963c8feb Merge pull request #8415 from jibees/add-tax_category_id-to-adjustements
API: add the tax_category_id for each ajustements of an order
2021-10-29 12:02:59 +11:00
Maikel
1b79fdd333 Merge pull request #8409 from luisAzcuaga/task/rubocop
[6055] Task: Run rubocop over existing todo
2021-10-29 12:01:12 +11:00
Jean-Baptiste Bellet
fc8cd30cce Add the tax_category_id for each adjustement
- This tax_category_id could be null
 - Special case if the originator is a Spree::TaxRate: then use the tax_category_id of the originator

Co-Authored-By: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2021-10-28 15:04:43 +02:00
Matt-Yorkley
d1a91a53ea Merge pull request #8365 from lamphanqg/fix_menu_indicator
Fix menu indicator on bulk order page
2021-10-28 13:59:32 +01:00
Matt-Yorkley
f0ec739350 Merge pull request #8366 from lamphanqg/fix_bulk_buy_layout
Fix broken layout of bulk buy
2021-10-28 12:35:36 +01:00
Matt-Yorkley
462ff15f76 Remove Enterprise #inheritance_column
Apparently this was part of an old feature from 2014...
2021-10-28 10:44:23 +01:00
dependabot[bot]
846629b7f2 Bump mrujs from 0.5.10 to 0.5.11
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.5.10...v0.5.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-28 09:04:55 +00:00
Maikel
2e8f4c1538 Merge pull request #8367 from bellvat/bug-show-error
Add test and change order_cycle#show to redirect to edit page.
2021-10-28 16:36:47 +11:00
Maikel
514e2dde27 Merge pull request #8394 from georgethoppilshopify/master
Fix about us paragraph breaks
2021-10-28 16:36:12 +11:00
Luis Azcuaga
39b2cfca39 Update spec/system/consumer/shopping/shopping_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-10-27 16:02:07 -05:00
Konrad
1f422522a9 Update en.yml 2021-10-27 18:04:45 +02:00
Matt-Yorkley
074ae7ce40 Merge pull request #8417 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.10
Bump mrujs from 0.5.9 to 0.5.10
2021-10-27 11:12:43 +01:00
dependabot[bot]
4e6f2bee84 Bump mrujs from 0.5.9 to 0.5.10
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.9 to 0.5.10.
- [Release notes](https://github.com/ParamagicDev/mrujs/releases)
- [Changelog](https://github.com/ParamagicDev/mrujs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ParamagicDev/mrujs/compare/v0.5.9...v0.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-27 09:07:09 +00:00
Maikel
866c3d6276 Merge pull request #8413 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.6
Bump karma from 6.3.5 to 6.3.6
2021-10-27 14:35:54 +11:00
Maikel
509bdd845b Merge pull request #8408 from Matt-Yorkley/remove-dalli-gem
Remove dalli gem
2021-10-27 14:13:02 +11:00
Maikel
40aac6a21b Merge pull request #8386 from jibees/download-artifact
Archive failed tests screenshots
2021-10-27 14:03:49 +11:00
Thierry Jet
41a7369b23 Add a test for datetimepicker close button usage 2021-10-26 19:51:28 +02:00
Thierry Jet
5ebee9cd5f Translation stuff ready for Close button. Add close: key scoped spree.admin.date_picker in en.yml 2021-10-26 19:38:49 +02:00
Thierry Jet
66f754267b Customize spacing for shortcut-buttons into flatpickr 2021-10-26 14:40:42 +02:00
Thierry Jet
47e9692226 Add a close button to datepicker. Close the popover when clicked. Not yet using translation 2021-10-26 14:36:16 +02:00
Thierry Jet
c45e120ff8 Add a close button to datetimepicker. Close the popover when clicked. Not yet using translation 2021-10-26 14:33:02 +02:00
dependabot[bot]
becbdd6e67 Bump karma from 6.3.5 to 6.3.6
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.5...v6.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 09:05:16 +00:00
dependabot[bot]
c0f8175519 Bump pagy from 5.1.1 to 5.1.2
Bumps [pagy](https://github.com/ddnexus/pagy) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/5.1.1...5.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 09:03:21 +00:00
dependabot[bot]
595a97eee3 Bump capybara from 3.35.3 to 3.36.0
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.35.3 to 3.36.0.
- [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.35.3...3.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 09:02:39 +00:00
Luis Azcuaga
e8fd89a6d2 Run rubocop over existing todo 2021-10-25 21:28:28 -05:00
PHAN QUANG LAM
77524c633d Fix menu indicator on bulk order page 2021-10-26 06:41:30 +09:00
Matt-Yorkley
af53838e83 Remove dalli gem
Dalli is a wrapper around memcached, which we previously removed.
2021-10-25 18:40:16 +01:00
Transifex-Openfoodnetwork
fa84de0e52 Updating translations for config/locales/it.yml 2021-10-25 19:52:17 +11:00
Sinan Chaush
aedacb1311 Missing navigation for super admin users only included 2021-10-24 22:34:38 +02:00
GeorgeThoppil
2c596fb2dd Adding regex op on long_description 2021-10-23 14:45:49 -04:00
Transifex-Openfoodnetwork
8f3facb1f0 Updating translations for config/locales/en_IE.yml 2021-10-24 01:07:26 +11:00
Transifex-Openfoodnetwork
4a951ebf37 Updating translations for config/locales/en_FR.yml 2021-10-23 01:12:59 +11:00
Transifex-Openfoodnetwork
332fb61249 Updating translations for config/locales/fr.yml 2021-10-23 01:12:38 +11:00
Transifex-Openfoodnetwork
ab4d093113 Updating translations for config/locales/ru.yml 2021-10-22 20:40:29 +11:00
Jean-Baptiste Bellet
665566c28c Archive failed tests screenshots 2021-10-21 09:50:04 +02:00
Monica Sirathanarun
ebaf96ddae Add test and change order_cycle#show to redirect to edit page. 2021-10-19 23:20:54 +07:00
mariodz95
d1160ec66a Fix snail on shipping method fees 2021-10-19 09:56:35 +02:00
PHAN QUANG LAM
8a2a746c5e Fix broken layout of bulk buy 2021-10-17 07:30:07 +09:00
Jean-Baptiste Bellet
e7c04a2dd6 Track event on Signin/Signup Modal View
Event Category: SignIn/Signup
Event Action: Modal View
Event Name: the current url
2021-10-12 15:26:11 +02:00
Jean-Baptiste Bellet
9fcd6cd215 Track event on Login Submit Success
Event Category: SignIn/Signup
Event Action: Login Submit Success
Event Name: the current url
2021-10-12 15:26:11 +02:00
Jean-Baptiste Bellet
969a7ef2d0 Track event on Signup Submit Success
Event Category: SignIn/Signup
Event Action: Signup Submit Success
Event Name: the current url
2021-10-12 15:25:59 +02:00
Cillian O'Ruanaidh
2462d71ab5 When creating backoffice orders hide variants with no stock by default
But let people include out of stock variants by checking a checkbox if they want.

Note, we only apply the variants in stock scope if a distributor is
present. I think this is because this search method is also used when
setting up subscriptions so I don't think we want to change the
behaviour there.

Co-authored-by: Maikel Linke <maikel@email.org.au>
2021-10-08 13:13:32 +01:00
937 changed files with 27721 additions and 11830 deletions

4
.env
View File

@@ -53,8 +53,8 @@ SMTP_PASSWORD="f00d"
# see="https://developers.google.com/maps/documentation/javascript/get-api-key
# GOOGLE_MAPS_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Stripe Connect details for instance account
# Find these under 'API keys' and 'Connect' in your Stripe account dashboard -> Account Settings
# Stripe details for instance account
# Find these under 'Developers' -> 'API keys' in your Stripe account dashboard.
# Under 'Connect', the Redirect URI should be set to https://YOUR_SERVER_URL/stripe/callbacks (e.g. https://openfoodnetwork.org.uk/stripe/callbacks)
# Under 'Webhooks', you should set up a Connect endpoint pointing to https://YOUR_SERVER_URL/stripe/webhooks e.g. (https://openfoodnetwork.org.uk/stripe/webhooks)
# STRIPE_INSTANCE_SECRET_KEY="sk_test_xxxxxx" # This can be a test key or a live key

View File

@@ -5,3 +5,5 @@ SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
SITE_URL="0.0.0.0:3000"

View File

@@ -2,3 +2,5 @@
# Override locally with `.env.test.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SITE_URL="test.host"

1
.foreman Normal file
View File

@@ -0,0 +1 @@
env: ""

View File

@@ -7,17 +7,55 @@ assignees: ''
---
Steps:
## Preparation on Thursday
- [ ] Merge pull requests in the [Ready To Go] column
- [ ] Merge [Transifex pull request]
- [ ] Include translations: `tx pull --force`
- [ ] [Draft new release]
- [ ] Notify #instance-managers of user-facing changes.
- [ ] Test: https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master <!-- replace the URL -->
- [ ] Update translations if necessary
- [ ] Publish and notify #global-community
- [ ] Deploy and notify #instance-managers
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
- [ ] Notify [#instance-managers] of user-facing changes.
## 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
## 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.
<details><summary>Command line instructions</summary>
<pre>
cd ofn-install
git pull
ansible-playbook --limit all-prod --extra-vars "git_version=vx.y.z" playbooks/deploy.yml
</pre>
</details>
- [ ] Notify [#instance-managers]:
> @instance_managers The new release has been deployed.
- [ ] Nudge next release manager
The full process is described at https://github.com/openfoodfoundation/openfoodnetwork/wiki/Releasing.
[Ready To Go]: #zenhub
[Transifex pull request]: https://github.com/openfoodfoundation/openfoodnetwork/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+head%3Atransifex
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A%23%23+User+facing+changes+:eyes:%0A%0A%0A%0A%23%23+Technical+changes+:wrench:%0A%0A
[releases]: https://github.com/openfoodfoundation/openfoodnetwork/releases
[#instance-managers]: https://app.slack.com/client/T02G54U79/CG7NJ966B
[Find build]: https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master
[#global-community]: https://app.slack.com/client/T02G54U79/C59ADD8F2

View File

@@ -1,32 +1,39 @@
#### What? Why?
Closes #[the issue number this PR is related to]
Closes # <!-- Insert issue number here. -->
<!-- Explain why this change is needed and the solution you propose.
Provide context for others to understand it. -->
Provide context for others to understand it. -->
#### What should we test?
<!-- List which features should be tested and how. -->
<!-- List which features should be tested and how.
This can be similar to the Steps to Reproduce in the issue.
Also think of other parts of the app which could be affected
by your change. -->
- Visit ... page.
-
#### Release notes
<!-- Write a one liner description of the change to be included in the release notes.
Every PR is worth mentioning, because you did it for a reason. -->
<!-- Please select one for your PR and delete the other. -->
Changelog Category: User facing changes | Technical changes
<!-- Choose a pull request title above which explains your change to a
a user of the Open Food Network app. -->
The title of the pull request will be included in the release notes.
#### Dependencies
<!-- Does this PR depend on another one?
Add the link or remove this section. -->
Add the link or remove this section. -->
#### Documentation updates
<!-- Are there any wiki pages that need updating after merging this PR?
List them here or remove this section. -->
List them here or remove this section. -->

View File

@@ -6,8 +6,10 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 10
versioning-strategy: lockfile-only
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: lockfile-only

View File

@@ -34,12 +34,12 @@ jobs:
- "spec/controllers"
- "spec/models"
- "spec/features/admin/[a-o0-9]*_spec.rb"
- "spec/features/admin/[p-z]*_spec.rb"
- "spec/features/consumer"
- "spec/lib"
- "spec/migrations"
- "spec/serializers"
- "spec/system"
- "spec/system/admin/[a-o0-9]*_spec.rb"
- "spec/system/admin/[p-z]*_spec.rb"
- "spec/system/consumer"
- "engines/*/spec"
fail-fast: false
steps:
@@ -57,17 +57,23 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up application.yml
run: cp config/application.yml.example config/application.yml
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run controller tests
- name: Run tests
run: bundle exec rspec --profile -- ${{ matrix.specs }}
- name: Archive failed tests screenshots
if: failure()
uses: actions/upload-artifact@v2
with:
name: failed-tests-screenshots
path: tmp/capybara/screenshots/*.png
retention-days: 7
if-no-files-found: ignore
test-the-rest:
runs-on: ubuntu-18.04
services:
@@ -98,9 +104,6 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up application.yml
run: cp config/application.yml.example config/application.yml
- name: Set up database
run: |
bundle exec rake db:create

18
.github/workflows/linters.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Linters
on: [push, pull_request]
jobs:
rubocop:
name: runner / rubocop
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
- name: rubocop
uses: reviewdog/action-rubocop@v2
with:
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile
reporter: github-pr-check
level: error
fail_on_error: true

2
.gitignore vendored
View File

@@ -6,6 +6,7 @@
.env.development.local
.env.test.local
.swp
.vscode
*.swo
*.swp
.sass-cache
@@ -42,7 +43,6 @@ config/initializers/feature_toggle.rb
NERD_tree*
coverage
libpeerconnection.log
/config/application.yml
/config/newrelic.yml
node_modules
vendor/bundle/

View File

@@ -10,12 +10,12 @@ inherit_from:
# The automatically generated todo list to ignore all current violations.
- .rubocop_todo.yml
# The relaxed style rules as a common starting point which we can refine.
- .rubocop_relaxed_styleguide.yml
# Our Open Food Network style guide. If you want to see all violations,
# then use only that configuration:
#
# bundle exec rubocop -c .rubocop_styleguide.yml
#
- .rubocop_styleguide.yml
# A manually compiled todo list to ignore metrics violations on a file-by-file basis.
- .rubocop_manual_todo.yml

View File

@@ -1,776 +0,0 @@
# A manually compiled todo list to ignore metrics violations on a file-by-file basis.
#
# The file .rubocop_todo.yml is generated automatically and contains a
# configuration to make all files pass. For a lot of cops it just lists
# the offending files. But for metrics cops it sets a different metric.
#
# Since we don't want these lax metrics, we override them in our config
# file .rubocop.yml which results in a lot of offences again. This file
# lists all offending files for each cop to make rubocop pass. We can
# improve the code over time and remove items from the list.
#
# This file was manually created by using the following tools:
#
# rubocop > rubo.log
# # inspect log file to see which cops are failing
# # copy cop configurations and add Exclude parameter
# grep ExampleCop rubo.log | cut -d ":" -f 1 | sort -u | while read f; do echo " - $f"; done >> .rubocop.yml
#
# This process probably doesn't need repeating. Otherwise there is plenty
# of room for improvements and automation.
Layout/LineLength:
Max: 100
Exclude:
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprise_relationships_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/v0/order_cycles_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/helpers/angular_form_builder.rb
- app/helpers/angular_form_helper.rb
- app/helpers/enterprises_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/orders_helper.rb
- app/jobs/subscription_confirm_job.rb
- app/mailers/subscription_mailer.rb
- app/models/column_preference.rb
- app/models/concerns/order_shipment.rb
- app/models/concerns/product_stock.rb
- app/models/concerns/variant_stock.rb
- app/models/customer.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
- app/models/proxy_order.rb
- app/models/schedule.rb
- app/models/spree/app_configuration.rb
- app/models/spree/image.rb
- app/models/spree/line_item.rb
- app/models/spree/order.rb
- app/models/spree/payment_method.rb
- app/models/spree/preferences/store.rb
- app/models/subscription.rb
- app/models/variant_override.rb
- app/serializers/api/admin/subscription_line_item_serializer.rb
- app/serializers/api/admin/subscription_serializer.rb
- app/services/cart_service.rb
- app/services/checkout/post_checkout_actions.rb
- app/services/embedded_page_service.rb
- app/services/order_cycle_form.rb
- app/services/order_syncer.rb
- app/services/variant_units/variant_and_line_item_naming.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/subscriptions/validator.rb
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
- engines/order_management/spec/services/order_management/order/updater_spec.rb
- engines/web/app/helpers/web/cookies_policy_helper.rb
- engines/web/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/lettuce_share_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/open_food_network/reports/line_items.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/scope_variants_for_search.rb
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/localized_number.rb
- lib/tasks/data.rake
- lib/tasks/enterprises.rake
- spec/controllers/admin/bulk_line_items_controller_spec.rb
- spec/controllers/admin/column_preferences_controller_spec.rb
- spec/controllers/admin/enterprises_controller_spec.rb
- spec/controllers/admin/manager_invitations_controller_spec.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/admin/schedules_controller_spec.rb
- spec/controllers/admin/stripe_accounts_controller_spec.rb
- spec/controllers/admin/stripe_connect_settings_controller_spec.rb
- spec/controllers/admin/subscription_line_items_controller_spec.rb
- spec/controllers/admin/subscriptions_controller_spec.rb
- spec/controllers/admin/variant_overrides_controller_spec.rb
- spec/controllers/api/v0/base_controller_spec.rb
- spec/controllers/api/v0/enterprises_controller_spec.rb
- spec/controllers/api/v0/exchange_products_controller_spec.rb
- spec/controllers/api/v0/logos_controller_spec.rb
- spec/controllers/api/v0/order_cycles_controller_spec.rb
- spec/controllers/api/v0/orders_controller_spec.rb
- spec/controllers/api/v0/product_images_controller_spec.rb
- spec/controllers/api/v0/products_controller_spec.rb
- spec/controllers/api/v0/promo_images_controller_spec.rb
- spec/controllers/api/v0/terms_and_conditions_controller_spec.rb
- spec/controllers/cart_controller_spec.rb
- spec/controllers/checkout_controller_spec.rb
- spec/controllers/enterprises_controller_spec.rb
- spec/controllers/line_items_controller_spec.rb
- spec/controllers/shops_controller_spec.rb
- spec/controllers/spree/admin/adjustments_controller_spec.rb
- spec/controllers/spree/admin/orders_controller_spec.rb
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
- spec/controllers/spree/admin/orders/invoices_spec.rb
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
- spec/controllers/spree/admin/reports_controller_spec.rb
- spec/controllers/spree/admin/variants_controller_spec.rb
- spec/controllers/spree/credit_cards_controller_spec.rb
- spec/controllers/spree/orders_controller_spec.rb
- spec/controllers/stripe/callbacks_controller_spec.rb
- spec/controllers/stripe/webhooks_controller_spec.rb
- spec/controllers/user_confirmations_controller_spec.rb
- spec/factories/stock_location_factory.rb
- spec/features/admin/adjustments_spec.rb
- spec/features/admin/bulk_order_management_spec.rb
- spec/features/admin/bulk_product_update_spec.rb
- spec/features/admin/configuration/content_spec.rb
- spec/features/admin/customers_spec.rb
- spec/features/admin/enterprise_fees_spec.rb
- spec/features/admin/enterprise_relationships_spec.rb
- spec/features/admin/enterprises/images_spec.rb
- spec/features/admin/enterprises/index_spec.rb
- spec/features/admin/enterprises_spec.rb
- spec/features/admin/multilingual_spec.rb
- spec/features/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb
- spec/features/admin/order_cycles/complex_editing_spec.rb
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/admin/order_cycles/list_spec.rb
- spec/features/admin/order_cycles/simple_spec.rb
- spec/features/admin/order_spec.rb
- spec/features/admin/overview_spec.rb
- spec/features/admin/payment_method_spec.rb
- spec/features/admin/payments_stripe_spec.rb
- spec/features/admin/product_import_spec.rb
- spec/features/admin/products_spec.rb
- spec/features/admin/reports_spec.rb
- spec/features/admin/schedules_spec.rb
- spec/features/admin/shipping_methods_spec.rb
- spec/features/admin/subscriptions_spec.rb
- spec/features/admin/tag_rules_spec.rb
- spec/features/admin/users_spec.rb
- spec/features/admin/variant_overrides_spec.rb
- spec/features/consumer/authentication_spec.rb
- spec/features/consumer/caching/shops_caching_spec.rb
- spec/features/consumer/multilingual_spec.rb
- spec/features/consumer/shopping/cart_spec.rb
- spec/features/consumer/shopping/checkout_auth_spec.rb
- spec/features/consumer/shopping/checkout_spec.rb
- spec/features/consumer/shopping/checkout_stripe_spec.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/features/consumer/shopping/products_spec.rb
- spec/features/consumer/shopping/shopping_spec.rb
- spec/features/consumer/shopping/unit_price_spec.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/features/consumer/shops_spec.rb
- spec/helpers/enterprises_helper_spec.rb
- spec/helpers/injection_helper_spec.rb
- spec/helpers/order_cycles_helper_spec.rb
- spec/helpers/spree/admin/base_helper_spec.rb
- spec/jobs/subscription_confirm_job_spec.rb
- spec/jobs/subscription_placement_job_spec.rb
- spec/lib/open_food_network/customers_report_spec.rb
- spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
- spec/lib/open_food_network/group_buy_report_spec.rb
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
- spec/lib/open_food_network/order_grouper_spec.rb
- spec/lib/open_food_network/permissions_spec.rb
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
- spec/lib/spree/core/calculated_adjustments_spec.rb
- spec/lib/stripe/authorize_response_patcher_spec.rb
- spec/mailers/order_mailer_spec.rb
- spec/mailers/subscription_mailer_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
- spec/models/order_cycle_spec.rb
- spec/models/product_importer_spec.rb
- spec/models/spree/ability_spec.rb
- spec/models/spree/address_spec.rb
- spec/models/spree/adjustment_spec.rb
- spec/models/spree/classification_spec.rb
- spec/models/spree/gateway/stripe_connect_spec.rb
- spec/models/spree/inventory_unit_spec.rb
- spec/models/spree/line_item_spec.rb
- spec/models/spree/order/checkout_spec.rb
- spec/models/spree/order_inventory_spec.rb
- spec/models/spree/order_spec.rb
- spec/models/spree/payment_method_spec.rb
- spec/models/spree/payment_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/shipping_method_spec.rb
- spec/models/spree/tax_rate_spec.rb
- spec/models/spree/user_spec.rb
- spec/models/spree/variant_spec.rb
- spec/models/tag_rule/filter_order_cycles_spec.rb
- spec/models/tag_rule/filter_payment_methods_spec.rb
- spec/models/tag_rule/filter_products_spec.rb
- spec/models/tag_rule/filter_shipping_methods_spec.rb
- spec/models/terms_of_service_file_spec.rb
- spec/models/variant_override_spec.rb
- spec/requests/api/orders_spec.rb
- spec/requests/checkout/failed_checkout_spec.rb
- spec/requests/embedded_shopfronts_headers_spec.rb
- spec/serializers/api/admin/exchange_serializer_spec.rb
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
- spec/services/address_geocoder_spec.rb
- spec/services/cart_service_spec.rb
- spec/services/checkout/form_data_adapter_spec.rb
- spec/services/checkout/post_checkout_actions_spec.rb
- spec/services/content_sanitizer_spec.rb
- spec/services/embedded_page_service_spec.rb
- spec/services/exchange_products_renderer_spec.rb
- spec/services/order_cycle_distributed_variants_spec.rb
- spec/services/order_syncer_spec.rb
- spec/services/paypal_items_builder_spec.rb
- spec/services/permissions/order_spec.rb
- spec/services/permitted_attributes/order_cycle_spec.rb
- spec/services/products_renderer_spec.rb
- spec/services/product_tag_rules_filterer_spec.rb
- spec/support/cancan_helper.rb
- spec/support/features/datepicker_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/support/request/stripe_stubs.rb
- spec/support/request/web_helper.rb
- spec/swagger_helper.rb
- spec/views/spree/admin/payment_methods/index.html.haml_spec.rb
Metrics/AbcSize:
Max: 15
Exclude:
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscription_line_items_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/v0/enterprises_controller.rb
- app/controllers/api/v0/product_images_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/api/v0/shipments_controller.rb
- app/controllers/api/v0/taxons_controller.rb
- app/controllers/api/v0/variants_controller.rb
- app/controllers/checkout_controller.rb
- app/controllers/discourse_sso_controller.rb
- app/controllers/enterprises_controller.rb
- app/controllers/spree/admin/adjustments_controller.rb
- app/controllers/spree/admin/general_settings_controller.rb
- app/controllers/spree/admin/images_controller.rb
- app/controllers/spree/admin/mail_methods_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- app/controllers/spree/admin/overview_controller.rb
- 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/search_controller.rb
- app/controllers/spree/admin/shipping_methods_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/controllers/spree/user_passwords_controller.rb
- app/controllers/spree/users_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/user_confirmations_controller.rb
- app/controllers/user_passwords_controller.rb
- app/controllers/user_registrations_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/zones_helper.rb
- app/helpers/spree/base_helper.rb
- app/helpers/spree/orders_helper.rb
- app/mailers/spree/order_mailer.rb
- app/models/calculator/flat_percent_per_item.rb
- app/models/column_preference.rb
- app/models/enterprise_group.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/order_cycle.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/product_import/unit_converter.rb
- app/models/proxy_order.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/models/spree/item_adjustments.rb
- app/models/spree/line_item.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/payment/processing.rb
- app/models/spree/payment.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/admin/enterprise_serializer.rb
- app/serializers/api/variant_serializer.rb
- app/services/cap_quantity.rb
- app/services/cart_service.rb
- app/services/create_order_cycle.rb
- app/services/order_cycle_form.rb
- app/services/order_factory.rb
- app/services/order_syncer.rb
- app/services/place_proxy_order.rb
- app/services/process_payment_intent.rb
- app/services/sets/model_set.rb
- app/services/variants_stock_levels.rb
- app/services/variant_units/option_value_namer.rb
- app/services/variant_units/variant_and_line_item_naming.rb
- engines/order_management/app/services/order_management/order/updater.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- engines/order_management/app/services/order_management/stock/package.rb
- engines/order_management/app/services/order_management/stock/packer.rb
- engines/order_management/app/services/order_management/subscriptions/form.rb
- engines/order_management/app/services/order_management/subscriptions/validator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/customers_report.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/lettuce_share_report.rb
- lib/open_food_network/order_and_distributor_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/order_grouper.rb
- lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb
- lib/open_food_network/packing_report.rb
- lib/open_food_network/payments_report.rb
- lib/open_food_network/permissions.rb
- lib/open_food_network/products_and_inventory_report.rb
- lib/open_food_network/reports/line_items.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/users_and_enterprises_report.rb
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/api/controller_setup.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/auth.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/delegate_belongs_to.rb
- lib/spree/core/permalinks.rb
- lib/spree/core/product_duplicator.rb
- lib/spree/core/s3_support.rb
- lib/spree/localized_number.rb
- lib/stripe/account_connector.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/profile_storer.rb
- lib/tasks/enterprises.rake
- lib/tasks/sample_data/order_factory.rb
- lib/tasks/sample_data/product_factory.rb
- spec/features/admin/product_import_spec.rb
- spec/features/admin/reports_spec.rb
- spec/features/admin/subscriptions_spec.rb
- spec/features/consumer/shopping/shopping_spec.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/models/enterprise_spec.rb
- spec/models/product_importer_spec.rb
- spec/services/order_checkout_restart_spec.rb
- spec/support/i18n_translations_checker.rb
- spec/support/performance_helper.rb
- spec/support/request/web_helper.rb
Metrics/BlockLength:
Max: 25
IgnoredMethods: [
"class_eval",
"collection",
"context",
"describe",
"feature",
"it",
"member",
"namespace",
"resource",
"resources",
"scenario"
]
Exclude:
- app/models/spree/order/checkout.rb
- app/models/spree/payment/processing.rb
- app/models/spree/payment.rb
- app/models/spree/shipment.rb
- lib/spree/core/controller_helpers/common.rb
- lib/tasks/data.rake
- spec/factories/address_factory.rb
- spec/factories/enterprise_factory.rb
- spec/factories/line_item_factory.rb
- spec/factories/order_cycle_factory.rb
- spec/factories/order_factory.rb
- spec/factories/payment_method_factory.rb
- spec/factories/product_factory.rb
- spec/factories.rb
- spec/factories/shipment_factory.rb
- spec/factories/shipping_method_factory.rb
- spec/factories/subscription_factory.rb
- spec/factories/user_factory.rb
- spec/factories/variant_factory.rb
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/consumer/shopping/checkout_spec.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/lib/open_food_network/group_buy_report_spec.rb
- spec/requests/api/orders_spec.rb
- spec/spec_helper.rb
- spec/support/cancan_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/swagger_helper.rb
Metrics/CyclomaticComplexity:
Max: 6
Exclude:
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_inventory.rb
- app/models/spree/payment.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/services/cart_service.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/localized_number.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/credit_card_clone_destroyer.rb
- spec/models/product_importer_spec.rb
- spec/support/i18n_translations_checker.rb
Metrics/PerceivedComplexity:
Max: 7
Exclude:
- app/controllers/admin/enterprises_controller.rb
- app/controllers/api/v0/variants_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/models/enterprise_relationship.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_inventory.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/payments_report.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/localized_number.rb
- spec/models/product_importer_spec.rb
Metrics/MethodLength:
Max: 10
Exclude:
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/contents_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/manager_invitations_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/v0/product_images_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/api/v0/shipments_controller.rb
- app/controllers/api/v0/taxons_controller.rb
- app/controllers/api/v0/variants_controller.rb
- app/controllers/shop_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/orders/customer_details_controller.rb
- 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/tax_categories_controller.rb
- app/controllers/spree/admin/taxons_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/admin/variants_controller.rb
- app/controllers/spree/credit_cards_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
- app/controllers/user_confirmations_controller.rb
- app/controllers/user_passwords_controller.rb
- app/controllers/user_registrations_controller.rb
- app/helpers/checkout_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/mailers/producer_mailer.rb
- app/models/calculator/default_tax.rb
- app/models/column_preference.rb
- app/models/enterprise.rb
- app/models/enterprise_relationship.rb
- app/models/preference_sections/footer_and_external_links_section.rb
- app/models/preference_sections/main_links_section.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/credit_card.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/models/spree/order/checkout.rb
- app/models/spree/order_contents.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/payment/processing.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable_class_methods.rb
- app/models/spree/preferences/preferable.rb
- app/models/spree/preferences/store.rb
- app/models/spree/product.rb
- app/models/spree/return_authorization.rb
- app/models/spree/shipment.rb
- app/models/spree/taxon.rb
- app/models/spree/tax_rate.rb
- app/models/spree/zone.rb
- app/serializers/api/admin/order_cycle_serializer.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/services/cart_service.rb
- app/services/mail_configuration.rb
- app/services/order_cycle_form.rb
- app/services/permitted_attributes/checkout.rb
- app/services/place_proxy_order.rb
- app/services/process_payment_intent.rb
- app/services/variant_units/option_value_namer.rb
- engines/order_management/app/services/order_management/order/updater.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_allocation_report.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_supplier_report.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
- engines/order_management/app/services/order_management/stock/estimator.rb
- engines/order_management/app/services/order_management/stock/package.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/discourse/single_sign_on.rb
- lib/open_food_network/column_preference_defaults.rb
- lib/open_food_network/customers_report.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/enterprise_issue_validator.rb
- lib/open_food_network/group_buy_report.rb
- lib/open_food_network/lettuce_share_report.rb
- lib/open_food_network/order_and_distributor_report.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/order_grouper.rb
- lib/open_food_network/packing_report.rb
- lib/open_food_network/payments_report.rb
- lib/open_food_network/permissions.rb
- lib/open_food_network/products_and_inventory_report.rb
- lib/open_food_network/reports/line_items.rb
- lib/open_food_network/sales_tax_report.rb
- lib/open_food_network/users_and_enterprises_report.rb
- lib/open_food_network/xero_invoices_report.rb
- lib/spree/api/controller_setup.rb
- lib/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/delegate_belongs_to.rb
- lib/spree/core/permalinks.rb
- lib/spree/core/s3_support.rb
- lib/spree/localized_number.rb
- lib/spree/responder.rb
- lib/stripe/credit_card_clone_finder.rb
- lib/stripe/profile_storer.rb
- lib/tasks/sample_data/group_factory.rb
- lib/tasks/sample_data/order_factory.rb
- lib/tasks/sample_data/product_factory.rb
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/models/product_importer_spec.rb
- spec/support/i18n_translations_checker.rb
Metrics/ClassLength:
Max: 100
Exclude:
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/order_cycles_controller.rb
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/v0/products_controller.rb
- app/controllers/application_controller.rb
- app/controllers/checkout_controller.rb
- app/controllers/spree/admin/orders_controller.rb
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/controllers/spree/orders_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/models/enterprise.rb
- app/models/order_cycle.rb
- app/models/product_import/entry_processor.rb
- app/models/product_import/entry_validator.rb
- app/models/product_import/product_importer.rb
- app/models/spree/ability.rb
- app/models/spree/address.rb
- app/models/spree/credit_card.rb
- app/models/spree/gateway/stripe_sca.rb
- app/models/spree/line_item.rb
- app/models/spree/order.rb
- app/models/spree/payment.rb
- app/models/spree/product.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/user.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/cached_enterprise_serializer.rb
- app/serializers/api/enterprise_shopfront_serializer.rb
- app/services/cart_service.rb
- app/services/order_syncer.rb
- engines/order_management/app/services/order_management/order/updater.rb
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/order_cycle_form_applicator.rb
- lib/open_food_network/order_cycle_management_report.rb
- lib/open_food_network/order_cycle_permissions.rb
- lib/open_food_network/packing_report.rb
- lib/open_food_network/payments_report.rb
- lib/open_food_network/permissions.rb
- lib/open_food_network/users_and_enterprises_report.rb
- lib/open_food_network/xero_invoices_report.rb
Metrics/ModuleLength:
Max: 100
Exclude:
- app/helpers/admin/injection_helper.rb
- app/helpers/injection_helper.rb
- app/helpers/spree/admin/base_helper.rb
- app/helpers/spree/admin/navigation_helper.rb
- app/helpers/spree/admin/orders_helper.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment/processing.rb
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
- lib/open_food_network/column_preference_defaults.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
- spec/models/spree/adjustment_spec.rb
- spec/models/spree/line_item_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/tax_rate_spec.rb
- spec/models/spree/variant_spec.rb
Metrics/ParameterLists:
Max: 5
Exclude:
- app/helpers/angular_form_builder.rb
- app/models/product_import/entry_processor.rb
- lib/open_food_network/xero_invoices_report.rb
- spec/features/admin/reports_spec.rb
- spec/support/controller_requests_helper.rb
Lint/UselessAssignment:
Exclude:
- 'spec/**/*'
- app/models/spree/credit_card.rb
- app/models/spree/taxon.rb
- lib/spree/core/controller_helpers/common.rb
Metrics/BlockNesting:
Max: 3
Exclude:
- app/models/spree/payment/processing.rb

View File

@@ -0,0 +1,153 @@
# Relaxed.Ruby.Style
## Version 2.5
Style/Alias:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylealias
Style/AsciiComments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
Style/BeginBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
Style/BlockDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
Style/CommentAnnotation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
Style/Documentation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledocumentation
Layout/DotPosition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
Style/DoubleNegation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
Style/EndBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleendblock
Style/FormatString:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleformatstring
Style/IfUnlessModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
Style/Lambda:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylelambda
Style/ModuleFunction:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
Style/MultilineBlockChain:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
Style/NegatedIf:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
Style/NegatedWhile:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
Style/NumericPredicate:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
Style/ParallelAssignment:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
Style/PerlBackrefs:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
Style/Semicolon:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
Style/SignalException:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
Style/SingleLineBlockParams:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
Style/SingleLineMethods:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
Layout/SpaceInsideParens:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
Style/SpecialGlobalVars:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
Style/StringLiterals:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
Style/TrailingCommaInArguments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
Style/TrailingCommaInArrayLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
Style/TrailingCommaInHashLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
Style/SymbolArray:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
Style/WhileUntilModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
Style/WordArray:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewordarray
Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
Lint/AssignmentInCondition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
Layout/LineLength:
Enabled: false
Metrics:
Enabled: false

View File

@@ -1,7 +0,0 @@
inherit_from:
- .rubocop.yml
# This rubocop config file is only used for specs
# Here we allow specs to be 300 lines long
Metrics/ModuleLength:
Max: 300

View File

@@ -19,6 +19,34 @@ AllCops:
#
# Cop settings that have been agreed upon by the OFN community
Metrics:
Enabled: true
Metrics/BlockLength:
IgnoredMethods: [
"class_eval",
"collection",
"context",
"describe",
"feature",
"it",
"member",
"namespace",
"resource",
"resources",
"scenario",
"shared_examples",
]
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"
- "touch_all"
- "update_all"
- "update_attribute"
- "update_column"
- "update_columns"
Style/Documentation:
Enabled: false
@@ -37,6 +65,7 @@ Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/LineLength:
Enabled: true
Max: 100
Lint/RaiseException:
@@ -66,156 +95,16 @@ Lint/UselessAssignment:
Exclude:
- spec/**/*
## Relaxed.Ruby.Style SETTINGS
#
# These styles are a starting point for the conversation around conventions
# They should be removed or tweaked and moved above as decisions are made
# NOTE: Cops which did not fail at the time of writing were removed
Layout/DotPosition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledotposition
Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespacebeforeblockbraces
Layout/SpaceInsideParens:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespaceinsideparens
Style/Alias:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylealias
Style/BlockDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleblockdelimiters
Style/CommentAnnotation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylecommentannotation
Style/DoubleNegation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledoublenegation
Style/FormatString:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleformatstring
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleifunlessmodifier
Style/Lambda:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylelambda
Style/MultilineBlockChain:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylemultilineblockchain
Style/NegatedIf:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedif
Style/NegatedWhile:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile
Style/ParallelAssignment:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleparallelassignment
Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylepercentliteraldelimiters
Style/Semicolon:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesemicolon
Style/SingleLineMethods:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesinglelinemethods
Style/TrailingCommaInArguments:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainarguments
Style/TrailingCommaInArrayLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainliteral
Style/TrailingCommaInHashLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainliteral
Style/WordArray:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylewordarray
Style/SymbolArray:
Enabled: false
StyleGuide: https://rubocop.readthedocs.io/en/latest/cops_style/#stylesymbolarray
Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintambiguousregexpliteral
Lint/AssignmentInCondition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition
Metrics/AbcSize:
Max: 15
Metrics/BlockLength:
Max: 25
IgnoredMethods: [
"class_eval",
"collection",
"context",
"describe",
"feature",
"it",
"member",
"namespace",
"resource",
"resources",
"scenario"
]
Metrics/BlockNesting:
Max: 3
Metrics/ClassLength:
Max: 100
Metrics/ModuleLength:
Max: 100
Metrics/CyclomaticComplexity:
Max: 6
Max: 30 # default 17
Metrics/MethodLength:
Max: 10
Metrics/ParameterLists:
Max: 5
Enabled: true
Max: 25 # default 10
Metrics/PerceivedComplexity:
Max: 7
Enabled: true
Max: 14 # default 8
Naming/PredicateName:
Enabled: false

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
2.7.3
3.0.3

View File

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

View File

@@ -69,5 +69,5 @@ From here, your pull request will progress through the [Review, Test, Merge & De
[semaphore]: https://semaphoreci.com/
[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU
[ofn-transifex]: https://www.transifex.com/open-food-foundation/open-food-network/
[i18n]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/i18n
[welcome-dev]: https://github.com/openfoodfoundation/openfoodnetwork/projects/27
[i18n]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Internationalisation-%28i18n%29
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/2

View File

@@ -49,11 +49,10 @@ RUN sh -c "echo 'deb https://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main'
apt-get update && \
apt-get install -yqq --no-install-recommends postgresql-client-9.5 libpq-dev
# Install node & yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y nodejs yarn
# Install NodeJs and yarn
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install --no-install-recommends -y nodejs \
&& npm install -g yarn
# Install Chrome
RUN wget --quiet -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \

View File

@@ -2,6 +2,10 @@
This is a general guide to setting up an Open Food Network **development environment on your local machine**. If you want to setup OFN on a server, please have a look at the [ofn-install deployment guide](https://github.com/openfoodfoundation/ofn-install/wiki).
#### Still learning Ruby on Rails?
Head to our wiki on [Learning Rails](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Learning-Rails) to find some good starting points.
### Requirements
The fastest way to make it work locally is to use Docker, you only need to setup git, see the [Docker setup guide](docker/README.md).
@@ -56,7 +60,7 @@ If the script succeeds you're ready to start developing. If not, take a look at
Now, your dreams of spinning up a development server can be realised:
bundle exec rails server
foreman start
Go to [http://localhost:3000](http://localhost:3000) to play around!
@@ -81,7 +85,7 @@ The tests of all custom engines can be run with:
Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop.
Note: The time zone on your machine should match the one defined in `config/application.yml`.
Note: The time zone on your machine should match the one defined in the `.env[.*]` file.
Once [npm dependencies are installed][karma], AngularJS tests can be run with:

38
Gemfile
View File

@@ -1,19 +1,19 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby "2.7.3"
ruby "3.0.3"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'dotenv-rails', require: 'dotenv/rails-now' # Load ENV vars before other gems
gem 'rails', '~> 6.1.4'
gem 'rails', '>= 6.1.4'
gem 'activemerchant', '>= 1.78.0'
gem 'rexml'
gem 'angular-rails-templates', '>= 0.3.0'
gem 'awesome_nested_set'
gem 'ransack', '2.4.2'
gem 'responders'
gem 'sass-rails', '< 5.1.0' # this restriction originates from the compass-rails's version
gem 'webpacker', '~> 5'
gem 'i18n'
@@ -32,31 +32,36 @@ gem 'dfc_provider', path: './engines/dfc_provider'
gem "order_management", path: "./engines/order_management"
gem 'web', path: './engines/web'
gem 'activerecord-postgresql-adapter'
gem 'pg', '~> 1.2.3'
gem "activerecord-postgresql-adapter"
gem "arel-helpers", "~> 2.12"
gem "pg", "~> 1.2.3"
gem 'acts_as_list', '1.0.4'
gem 'cancancan', '~> 1.15.0'
gem 'digest'
gem 'ffaker'
gem 'highline', '2.0.3' # Necessary for the install generator
gem 'json'
gem 'monetize', '~> 1.11'
gem 'paranoia', '~> 2.4'
gem 'state_machines-activerecord'
gem 'stringex', '~> 2.8.5'
gem 'stringex', '~> 2.8.5', require: false
gem 'paypal-sdk-merchant', '1.117.2'
gem 'stripe'
gem 'devise'
gem 'devise-i18n'
gem 'devise-encryptable'
gem 'devise-i18n'
gem 'devise-token_authenticatable'
gem 'jwt', '~> 2.3'
gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
gem 'pagy', '~> 5.1'
gem 'rswag-api'
gem 'rswag-ui'
gem 'angularjs-rails', '1.8.0'
gem 'aws-sdk', '1.67.0'
gem 'bugsnag'
@@ -72,8 +77,6 @@ gem 'acts-as-taggable-on', '~> 8.1'
gem 'angularjs-file-upload-rails', '~> 2.4.1'
gem 'bigdecimal', '3.0.2'
gem 'bootsnap', require: false
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
gem 'dalli'
gem 'geocoder'
gem 'gmaps4rails'
gem 'mimemagic', '> 0.3.5'
@@ -83,36 +86,33 @@ gem 'rack-rewrite'
gem 'rack-ssl', require: 'rack/ssl'
gem 'roadie-rails'
gem 'puma'
gem 'hiredis'
gem 'puma'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem "cable_ready", "5.0.0.pre2"
gem "cable_ready", "5.0.0.pre3"
gem 'combine_pdf'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'immigrant'
gem 'roo', '~> 2.8.3'
gem 'roo', github: "roo-rb/roo" # master is currently needed for Ruby 3.x (awaiting new release)
gem 'spreadsheet_architect'
gem 'whenever', require: false
gem 'test-unit', '~> 3.5'
gem 'coffee-rails', '~> 5.0.0'
gem 'compass-rails'
gem 'mini_racer', '0.4.0'
gem 'uglifier', '>= 1.0.3'
gem 'angular_rails_csrf'
gem 'foundation-icons-sass-rails'
gem 'foundation-rails', '= 5.5.2.1'
gem 'jquery-rails', '4.4.0'
gem 'jquery-ui-rails', '~> 4.2'
@@ -139,6 +139,7 @@ group :test, :development do
gem 'awesome_print'
gem 'bullet'
gem 'capybara'
gem 'cuprite'
gem 'database_cleaner', require: false
gem "factory_bot_rails", '6.2.0', require: false
gem 'fuubar', '~> 2.5.1'
@@ -147,17 +148,15 @@ group :test, :development do
gem 'letter_opener', '>= 1.4.1'
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry'
gem 'rswag'
gem 'rswag-specs'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'webdrivers'
gem 'cuprite'
end
group :test do
gem 'byebug'
gem 'codecov', require: false
gem 'pdf-reader'
gem 'rails-controller-testing'
gem 'simplecov', require: false
@@ -170,6 +169,7 @@ end
group :development do
gem 'debugger-linecache'
gem 'foreman'
gem 'listen'
gem 'pry', '~> 0.13.0'
gem 'pry-byebug', '~> 3.9.0'
gem 'rubocop'

View File

@@ -1,9 +1,3 @@
GIT
remote: https://github.com/jeremydurham/custom-err-msg.git
revision: 3a8ec9dddc7a5b0aab7c69a6060596de300c68f4
specs:
custom_error_message (1.1.1)
GIT
remote: https://github.com/openfoodfoundation/db2fog.git
revision: 5b63343847452f52aa42f7fc169d6ab3af57cda3
@@ -30,6 +24,14 @@ 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:
@@ -57,63 +59,63 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
actioncable (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
mail (>= 2.7.1)
actionmailer (6.1.4.1)
actionpack (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.1)
actionview (= 6.1.4.1)
activesupport (= 6.1.4.1)
actionpack (6.1.4.4)
actionview (= 6.1.4.4)
activesupport (= 6.1.4.4)
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.1)
actionpack (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
nokogiri (>= 1.8.5)
actionview (6.1.4.1)
activesupport (= 6.1.4.1)
actionview (6.1.4.4)
activesupport (= 6.1.4.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
activejob (6.1.4.4)
activesupport (= 6.1.4.4)
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.1)
activesupport (= 6.1.4.1)
activerecord (6.1.4.1)
activemodel (= 6.1.4.1)
activesupport (= 6.1.4.1)
activerecord-import (1.2.0)
activerecord (>= 3.2)
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)
activerecord (>= 4.2)
activerecord-postgresql-adapter (0.0.1)
pg
activerecord-session_store (2.0.0)
@@ -122,14 +124,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
mini_mime (>= 1.1.0)
activesupport (6.1.4.1)
activesupport (6.1.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -150,6 +152,8 @@ GEM
railties (>= 3, < 7)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.8.0)
arel-helpers (2.12.1)
activerecord (>= 3.1.0, < 7)
ast (2.4.2)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
@@ -159,39 +163,45 @@ GEM
aws-sdk-v1 (1.67.0)
json (~> 1.4)
nokogiri (~> 1)
axlsx_styler (1.1.0)
activesupport (>= 3.1)
caxlsx (>= 2.0.2)
bcrypt (3.1.16)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.9.1)
msgpack (~> 1.0)
bugsnag (6.24.0)
bootsnap (1.10.1)
msgpack (~> 1.2)
bugsnag (6.24.1)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (6.1.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cable_ready (5.0.0.pre2)
cable_ready (5.0.0.pre3)
rails (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.35.3)
capybara (3.36.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
caxlsx (3.1.1)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
childprocess (4.1.0)
chronic (0.10.2)
chunky_png (1.4.0)
climate_control (0.2.0)
cliver (0.3.2)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
@@ -202,22 +212,6 @@ GEM
coffee-script-source (1.12.2)
combine_pdf (1.0.21)
ruby-rc4 (>= 0.1.5)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
compass-rails (4.0.0)
compass (~> 1.0.0)
sass-rails (< 5.1)
sprockets (< 4.0)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
crack (0.4.5)
@@ -228,16 +222,16 @@ GEM
cuprite (0.13)
capybara (>= 2.1, < 4)
ferrum (~> 0.11.0)
dalli (3.0.2)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
ddtrace (0.53.0)
ffi (~> 1.0)
ddtrace (0.54.1)
debase-ruby_core_source (= 0.10.12)
msgpack
debase-ruby_core_source (0.10.12)
debugger-linecache (1.2.0)
devise (4.8.0)
bcrypt (~> 3.0)
@@ -252,11 +246,13 @@ GEM
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
digest (3.1.0)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
dry-inflector (0.2.1)
e2mmap (0.1.0)
erubi (1.10.0)
et-orbi (1.2.4)
@@ -283,7 +279,7 @@ GEM
concurrent-ruby (~> 1.1)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.20.0)
ffi (1.15.4)
ffi (1.15.5)
flipper (0.20.4)
flipper-active_record (0.20.4)
activerecord (>= 5.0, < 7)
@@ -310,12 +306,6 @@ GEM
nokogiri (>= 1.5.11, < 2.0.0)
foreman (0.87.2)
formatador (0.2.5)
foundation-icons-sass-rails (3.0.0)
railties (>= 3.1.1)
sass-rails (>= 3.1.1)
foundation-rails (5.5.2.1)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
fugit (1.4.5)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
@@ -323,7 +313,7 @@ GEM
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.7.0)
globalid (0.5.2)
globalid (1.0.0)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
good_migrations (0.1.0)
@@ -336,6 +326,7 @@ GEM
hashery (2.1.2)
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
i18n-js (3.9.0)
@@ -363,12 +354,16 @@ GEM
letter_opener (1.7.0)
launchy (~> 2.2)
libv8-node (15.14.0.1)
loofah (2.12.0)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.13.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
@@ -376,22 +371,22 @@ GEM
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_mime (1.1.0)
mini_portile2 (2.6.1)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.14.4)
monetize (1.11.0)
minitest (5.15.0)
monetize (1.12.0)
money (~> 6.12)
money (6.14.1)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.4.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
@@ -400,7 +395,7 @@ GEM
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
pagy (5.1.1)
pagy (5.1.2)
paper_trail (12.1.0)
activerecord (>= 5.2)
request_store (~> 1.1)
@@ -413,7 +408,7 @@ GEM
parallel (1.21.0)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.0.2.0)
parser (3.1.0.0)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
@@ -435,7 +430,7 @@ GEM
byebug (~> 11.0)
pry (~> 0.13.0)
public_suffix (4.0.6)
puma (5.5.2)
puma (5.6.2)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.0)
@@ -452,20 +447,20 @@ GEM
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.6.0)
rails (6.1.4.1)
actioncable (= 6.1.4.1)
actionmailbox (= 6.1.4.1)
actionmailer (= 6.1.4.1)
actionpack (= 6.1.4.1)
actiontext (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activemodel (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
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)
bundler (>= 1.15.0)
railties (= 6.1.4.1)
railties (= 6.1.4.4)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -476,17 +471,17 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
rails-i18n (6.0.0)
rails-i18n (7.0.1)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (>= 6.0.0, < 8)
rails_safe_tasks (1.0.0)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
railties (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
method_source
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
rainbow (3.1.1)
rake (13.0.6)
ransack (2.4.2)
activerecord (>= 5.2.4)
@@ -497,7 +492,7 @@ GEM
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.5.1)
regexp_parser (2.1.1)
regexp_parser (2.2.0)
request_store (1.5.0)
rack (>= 1.4)
responders (3.0.1)
@@ -510,9 +505,10 @@ GEM
roadie-rails (2.2.0)
railties (>= 5.1, < 6.2)
roadie (>= 3.1, < 5.0)
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rodf (1.1.1)
builder (>= 3.0)
dry-inflector (~> 0.1)
rubyzip (>= 1.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
@@ -536,10 +532,6 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.2)
rswag (2.4.0)
rswag-api (= 2.4.0)
rswag-specs (= 2.4.0)
rswag-ui (= 2.4.0)
rswag-api (2.4.0)
railties (>= 3.1, < 7.0)
rswag-specs (2.4.0)
@@ -558,9 +550,9 @@ GEM
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.12.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-rails (2.12.4)
rubocop-rails (2.13.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
@@ -585,7 +577,7 @@ GEM
semantic_range (3.0.0)
shoulda-matchers (5.0.0)
activesupport (>= 5.2.0)
sidekiq (6.2.2)
sidekiq (6.3.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
@@ -602,15 +594,19 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spreadsheet_architect (4.2.0)
axlsx_styler (>= 1.0.0, < 2)
caxlsx (>= 2.0.2, < 4)
rodf (>= 1.0.0, < 2)
spring (3.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
state_machines (0.5.0)
state_machines-activemodel (0.8.0)
@@ -620,12 +616,12 @@ GEM
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stringex (2.8.5)
stripe (5.39.0)
stripe (5.42.0)
temple (0.8.2)
test-prof (1.0.7)
test-unit (3.5.0)
power_assert
thor (1.1.0)
thor (1.2.1)
thread-local (1.1.0)
thwait (0.2.0)
e2mmap
@@ -677,7 +673,7 @@ GEM
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.1)
zeitwerk (2.5.3)
PLATFORMS
ruby
@@ -695,6 +691,7 @@ DEPENDENCIES
angular_rails_csrf
angularjs-file-upload-rails (~> 2.4.1)
angularjs-rails (= 1.8.0)
arel-helpers (~> 2.12)
awesome_nested_set
awesome_print
aws-sdk (= 1.67.0)
@@ -703,17 +700,13 @@ DEPENDENCIES
bugsnag
bullet
byebug
cable_ready (= 5.0.0.pre2)
cable_ready (= 5.0.0.pre3)
cancancan (~> 1.15.0)
capybara
catalog!
codecov
coffee-rails (~> 5.0.0)
combine_pdf
compass-rails
cuprite
custom_error_message!
dalli
database_cleaner
db2fog!
ddtrace
@@ -723,6 +716,7 @@ DEPENDENCIES
devise-i18n
devise-token_authenticatable
dfc_provider!
digest
dotenv-rails
factory_bot_rails (= 6.2.0)
ffaker
@@ -731,8 +725,6 @@ DEPENDENCIES
flipper-ui
fog-aws (~> 2.0)
foreman
foundation-icons-sass-rails
foundation-rails (= 5.5.2.1)
fuubar (~> 2.5.1)
geocoder
gmaps4rails
@@ -750,6 +742,7 @@ DEPENDENCIES
jwt (~> 2.3)
knapsack
letter_opener (>= 1.4.1)
listen
mimemagic (> 0.3.5)
mini_racer (= 0.4.0)
monetize (~> 1.11)
@@ -770,7 +763,7 @@ DEPENDENCIES
rack-rewrite
rack-ssl
rack-timeout
rails (~> 6.1.4)
rails (>= 6.1.4)
rails-controller-testing
rails-i18n
rails_safe_tasks (~> 1.0)
@@ -778,14 +771,16 @@ DEPENDENCIES
redcarpet
redis (>= 4.0)
responders
rexml
roadie-rails
roo (~> 2.8.3)
roo!
rspec-rails (>= 3.5.2)
rspec-retry
rswag
rswag-api
rswag-specs
rswag-ui
rubocop
rubocop-rails
sass-rails (< 5.1.0)
sd_notify
select2-rails!
selenium-webdriver
@@ -793,6 +788,7 @@ DEPENDENCIES
sidekiq
sidekiq-scheduler
simplecov
spreadsheet_architect
spring
spring-commands-rspec
state_machines-activerecord
@@ -815,7 +811,7 @@ DEPENDENCIES
wkhtmltopdf-binary
RUBY VERSION
ruby 2.7.3p183
ruby 3.0.3p157
BUNDLED WITH
2.1.4

View File

@@ -1,5 +1,4 @@
[![Build](https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/build.yml/badge.svg)](https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/openfoodfoundation/openfoodnetwork/branch/master/graph/badge.svg?token=FBSOod4qiu)](https://codecov.io/gh/openfoodfoundation/openfoodnetwork)
[![Code Climate](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork.png)](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
# Open Food Network
@@ -40,7 +39,7 @@ We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. B
## Licence
Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
Copyright (c) 2012 - 2021 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -47,7 +47,6 @@
//= require equalize
//= require css_browser_selector_dev
//= require responsive-tables
//= require admin/spree_paypal_express
//= require admin/spree/handlebar_extensions
// OFN specific

View File

@@ -144,7 +144,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.variantIdCounter
$scope.deleteProduct = (product) ->
if confirm("Are you sure?")
if confirm(t('are_you_sure'))
$http(
method: "DELETE"
url: "/api/v0/products/" + product.id

View File

@@ -104,15 +104,38 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
else
StatusMessage.display 'failure', t "unsaved_changes_error"
$scope.cancelOrder = (order) ->
return $http(
method: 'GET'
url: "/admin/orders/#{order.number}/fire?e=cancel")
$scope.deleteLineItem = (lineItem) ->
if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete
LineItems.delete lineItem
if lineItem.order.item_count == 1
if confirm(t('js.admin.deleting_item_will_cancel_order'))
$scope.cancelOrder(lineItem.order).then(-> $scope.refreshData())
else if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete
LineItems.delete(lineItem, () -> $scope.refreshData())
$scope.deleteLineItems = (lineItemsToDelete) ->
existingState = $scope.confirmDelete
$scope.confirmDelete = false
$scope.deleteLineItem lineItem for lineItem in lineItemsToDelete when lineItem.checked
$scope.confirmDelete = existingState
$scope.deleteLineItems = (lineItems) ->
lineItemsToDelete = lineItems.filter (item) -> item.checked
willCancelOrders = false
itemsPerOrder = new Map()
for item in lineItemsToDelete
{ order } = item
if itemsPerOrder.has(order)
itemsPerOrder.get(order).push(item)
else
itemsPerOrder.set(order, [item])
willCancelOrders = true if (order.item_count == itemsPerOrder.get(order).length)
if willCancelOrders
return unless confirm(t("js.admin.deleting_item_will_cancel_order"))
itemsPerOrder.forEach (items, order) =>
if order.item_count == items.length
$scope.cancelOrder(order).then(-> $scope.refreshData())
else
Promise.all(LineItems.delete(item) for item in items).then(-> $scope.refreshData())
$scope.allBoxesChecked = ->
checkedCount = $scope.filteredLineItems.reduce (count,lineItem) ->
@@ -128,29 +151,53 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.selectedUnitsProduct = unitsProduct
$scope.selectedUnitsVariant = unitsVariant
$scope.getLineItemScale = (lineItem) ->
if lineItem.units_product && lineItem.units_variant && (lineItem.units_product.variant_unit == "weight" || lineItem.units_product.variant_unit == "volume")
lineItem.units_product.variant_unit_scale
else
1
$scope.sumUnitValues = ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.final_weight_volume
sum = $scope.filteredLineItems?.reduce (sum, lineItem) ->
sum + $scope.roundToThreeDecimals(lineItem.final_weight_volume / $scope.getLineItemScale(lineItem))
, 0
$scope.sumMaxUnitValues = ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.max_quantity * lineItem.units_variant.unit_value
sum + lineItem.max_quantity * $scope.roundToThreeDecimals(lineItem.units_variant.unit_value / $scope.getLineItemScale(lineItem))
, 0
$scope.roundToThreeDecimals = (value) ->
Math.round(value * 1000) / 1000
$scope.allFinalWeightVolumesPresent = ->
for i,lineItem of $scope.filteredLineItems
return false if !lineItem.hasOwnProperty('final_weight_volume') || !(lineItem.final_weight_volume > 0)
true
# How is this different to OptionValueNamer#name?
# Should it be extracted to that class or VariantUnitManager?
$scope.formattedValueWithUnitName = (value, unitsProduct, unitsVariant) ->
# A Units Variant is an API object which holds unit properies of a variant
if unitsProduct.hasOwnProperty("variant_unit") && (unitsProduct.variant_unit == "weight" || unitsProduct.variant_unit == "volume") && value > 0
scale = VariantUnitManager.getScale(value, unitsProduct.variant_unit)
Math.round(value/scale * 1000)/1000 + " " + VariantUnitManager.getUnitName(scale, unitsProduct.variant_unit)
$scope.getScale = (unitsProduct, unitsVariant) ->
if unitsProduct.hasOwnProperty("variant_unit") && (unitsProduct.variant_unit == "weight" || unitsProduct.variant_unit == "volume")
unitsProduct.variant_unit_scale
else
null
$scope.getFormattedValueWithUnitName = (value, unitsProduct, unitsVariant, scale) ->
unit_name = VariantUnitManager.getUnitName(scale, unitsProduct.variant_unit)
$scope.roundToThreeDecimals(value) + " " + unit_name
$scope.getGroupBySizeFormattedValueWithUnitName = (value, unitsProduct, unitsVariant) ->
scale = $scope.getScale(unitsProduct, unitsVariant)
if scale
value = value / scale if scale != 28.35 && scale != 1 && scale != 453.6 # divide by scale if not smallest unit
$scope.getFormattedValueWithUnitName(value, unitsProduct, unitsVariant, scale)
else
''
$scope.formattedValueWithUnitName = (value, unitsProduct, unitsVariant) ->
scale = $scope.getScale(unitsProduct, unitsVariant)
if scale
$scope.getFormattedValueWithUnitName(value, unitsProduct, unitsVariant, scale)
else
''
$scope.fulfilled = (sumOfUnitValues) ->
@@ -158,7 +205,9 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
if $scope.selectedUnitsProduct.hasOwnProperty("group_buy_unit_size") && $scope.selectedUnitsProduct.group_buy_unit_size > 0 &&
$scope.selectedUnitsProduct.hasOwnProperty("variant_unit") &&
( $scope.selectedUnitsProduct.variant_unit == "weight" || $scope.selectedUnitsProduct.variant_unit == "volume" )
Math.round( sumOfUnitValues / $scope.selectedUnitsProduct.group_buy_unit_size * 1000)/1000
scale = $scope.selectedUnitsProduct.variant_unit_scale
sumOfUnitValues = sumOfUnitValues * scale unless scale == 28.35 || scale == 453.6
$scope.roundToThreeDecimals(sumOfUnitValues / $scope.selectedUnitsProduct.group_buy_unit_size)
else
''

View File

@@ -8,3 +8,6 @@ angular.module("admin.payments").controller "PaymentCtrl", ($scope, Payment, Sta
$scope.submitted = true
StatusMessage.display 'progress', t("spree.admin.payments.source_forms.stripe.submitting_payment")
Payment.purchase()
$scope.isSelected = (payment_method_id) ->
return parseInt($scope.form_data.payment_method) == payment_method_id

View File

@@ -1,10 +1,12 @@
angular.module('admin.payments').directive "stripeElements", ($injector, AdminStripeElements) ->
restrict: 'E'
template: "<label for='card-element'>\
<div id='card-element'></div>\
<div id='card-errors' class='error'></div>\
</label>"
template: "<div >\
<div class='card-element'></div>\
<div class='error card-errors'></div>\
</div>"
scope:
selected: "="
link: (scope, elem, attr)->
if $injector.has('stripeObject')
stripe = $injector.get('stripeObject')
@@ -18,13 +20,13 @@ angular.module('admin.payments').directive "stripeElements", ($injector, AdminSt
color: '#5c5c5c'
'::placeholder':
color: '#6c6c6c'
card.mount('#card-element')
card.mount(elem.find('.card-element').get(0))
# Elements validates user input as it is typed. To help your customers
# catch mistakes, you should listen to change events on the card Element
# and display any errors:
card.addEventListener 'change', (event) ->
displayError = document.getElementById('card-errors')
displayError = elem.find('.card-errors').get(0)
if event.error
displayError.textContent = event.error.message
else
@@ -32,5 +34,7 @@ angular.module('admin.payments').directive "stripeElements", ($injector, AdminSt
return
AdminStripeElements.stripe = stripe
AdminStripeElements.card = card
scope.$watch "selected", (value) ->
if (value)
AdminStripeElements.stripe = stripe
AdminStripeElements.card = card

View File

@@ -1,4 +1,4 @@
angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, StatusMessage) ->
angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, StatusMessage, $timeout) ->
new class AdminStripeElements
# These are both set from the AdminStripeElements directive
@@ -13,11 +13,11 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta
@stripe.createToken(@card, cardData).then (response) =>
if(response.error)
StatusMessage.display 'error', response.error.message
$timeout -> StatusMessage.display 'error', response.error.message
console.error(JSON.stringify(response.error))
else
secrets.token = response.token.id
secrets.cc_type = @mapTokenApiCardBrand(response.token.card.brand)
secrets.cc_type = response.token.card.brand
secrets.card = response.token.card
submit()
@@ -29,32 +29,14 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta
@stripe.createPaymentMethod({ type: 'card', card: @card }, @card, cardData).then (response) =>
if(response.error)
StatusMessage.display 'error', response.error.message
$timeout -> StatusMessage.display 'error', response.error.message
console.error(JSON.stringify(response.error))
else
secrets.token = response.paymentMethod.id
secrets.cc_type = @mapPaymentMethodsApiCardBrand(response.paymentMethod.card.brand)
secrets.cc_type = response.paymentMethod.card.brand
secrets.card = response.paymentMethod.card
submit()
# Maps the brand returned by Stripe's tokenAPI to that required by activemerchant
mapTokenApiCardBrand: (cardBrand) ->
switch cardBrand
when 'MasterCard' then return 'master'
when 'Visa' then return 'visa'
when 'American Express' then return 'american_express'
when 'Discover' then return 'discover'
when 'JCB' then return 'jcb'
when 'Diners Club' then return 'diners_club'
# Maps the brand returned by Stripe's paymentMethodsAPI to that required by activemerchant
mapPaymentMethodsApiCardBrand: (cardBrand) ->
switch cardBrand
when 'mastercard' then return 'master'
when 'amex' then return 'american_express'
when 'diners' then return 'diners_club'
else return cardBrand # a few brands are equal, for example, visa
# It doesn't matter if any of these are nil, all are optional.
makeCardData: (secrets) ->
{'name': secrets.name,

View File

@@ -37,17 +37,6 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
options.push [[I18n.t('items'), 'items']]
options = [].concat options...
@getScale: (value, unitType) ->
scaledValue = null
validScales = []
unitScales = VariantUnitManager.unitScales(unitType)
validScales.unshift scale for scale in unitScales when value/scale >= 1
if validScales.length > 0
validScales[0]
else
unitScales[0]
@getUnitName: (scale, unitType) ->
if @units[unitType][scale]
@units[unitType][scale]['name']

View File

@@ -82,10 +82,23 @@ adjustItems = function(shipment_number, variant_id, quantity){
var inventory_units = _.where(shipment.inventory_units, {variant_id: variant_id});
if (quantity == 0 && inventory_units.length == shipment.inventory_units.length) {
ofnAlert(t("js.admin.orders.cannot_remove_last_item"));
ofnCancelOrderAlert((confirm, sendEmailCancellation) => {
if (confirm) {
doAdjustItems(shipment_number, variant_id, quantity, inventory_units, () => {
var redirectTo = new URL(Spree.routes.cancel_order.toString());
redirectTo.searchParams.append("send_cancellation_email", sendEmailCancellation);
window.location.href = redirectTo.toString();
});
}
});
return;
}
doAdjustItems(shipment_number, variant_id, quantity, inventory_units, () => {
window.location.reload();
});
}
doAdjustItems = function(shipment_number, variant_id, quantity, inventory_units, callback) {
var url = Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number;
var new_quantity = 0;
@@ -106,7 +119,7 @@ adjustItems = function(shipment_number, variant_id, quantity){
url: Spree.url(url),
data: { variant_id: variant_id, quantity: new_quantity }
}).done(function( msg ) {
window.location.reload();
callback();
});
}
}
@@ -181,6 +194,24 @@ ofnAlert = function(message) {
$('#custom-alert').show();
}
ofnCancelOrderAlert = function(callback) {
$('#custom-confirm .message').html(
` ${t("js.admin.orders.cancel_the_order_html")}
<div class="form">
<input type="checkbox" name="send_cancellation_email" value="1" id="send_cancellation_email" />
<label for="send_cancellation_email">${t("js.admin.orders.cancel_the_order_send_cancelation_email")}</label>
</div>`);
$('#custom-confirm button.confirm').unbind( "click" ).click(() => {
$('#custom-confirm').hide();
callback(true, $('#send_cancellation_email').is(':checked'));
});
$('#custom-confirm button.cancel').click(() => {
$('#custom-confirm').hide();
callback(false)
});
$('#custom-confirm').show();
}
ofnConfirm = function(callback) {
$('#custom-confirm').data($(event.target).data());
$('#custom-confirm button.confirm').click(callback);

View File

@@ -1,7 +1,11 @@
$(document).ready ->
progressTimer = null
$(document).ajaxStart ->
$("#progress").fadeIn()
progressTimer = setTimeout ->
$("#progress").fadeIn()
, 500
$(document).ajaxStop ->
$("#progress").fadeOut()
clearTimeout(progressTimer) if progressTimer?
$("#progress").stop().hide()

View File

@@ -1,13 +1,10 @@
#= require jsuri
class window.Spree
# Helper function to take a URL and add query parameters to it
@url: (uri, query) ->
if uri.path == undefined
uri = new Uri(uri)
if query
$.each query, (key, value) ->
uri.addQueryParam(key, value)
@url: (uri) ->
if uri.pathname == undefined
uri = new URL(uri.toString())
if Spree.api_key
uri.addQueryParam('token', Spree.api_key)
params = new URLSearchParams(uri.search)
params.append('token', Spree.api_key)
return uri

View File

@@ -2,10 +2,9 @@ root = exports ? this
root.taxon_tree_menu = (obj, context) ->
base_url = Spree.url(Spree.routes.taxonomy_taxons_path)
admin_base_url = Spree.url(Spree.routes.admin_taxonomy_taxons_path)
edit_url = admin_base_url.clone()
edit_url.setPath(edit_url.path() + '/' + obj.attr("id") + "/edit");
base_url = Spree.url(Spree.routes.taxonomy_taxons)
admin_base_url = Spree.url(Spree.routes.admin_taxonomy_taxons)
edit_url = Spree.url(Spree.routes.admin_taxonomy_taxons + '/' + obj.attr("id") + "/edit");
create:
label: "<i class='icon-plus'></i> " + Spree.translations.add,

View File

@@ -9,7 +9,7 @@ handle_move = (e, data) ->
new_parent = data.rslt.np
url = Spree.url(base_url).clone()
url.setPath url.path() + '/' + node.attr("id")
url.pathname = url.pathname + '/' + node.attr("id")
$.ajax
type: "POST",
dataType: "json",
@@ -41,7 +41,7 @@ handle_rename = (e, data) ->
name = data.rslt.new_name
url = Spree.url(base_url).clone()
url.setPath(url.path() + '/' + node.attr("id"))
url.pathname = url.pathname + '/' + node.attr("id")
$.ajax
type: "POST",
@@ -70,10 +70,10 @@ root = exports ? this
root.setup_taxonomy_tree = (taxonomy_id) ->
if taxonomy_id != undefined
# this is defined within admin/taxonomies/edit
root.base_url = Spree.url(Spree.routes.taxonomy_taxons_path)
root.base_url = Spree.url(Spree.routes.taxonomy_taxons)
$.ajax
url: base_url.path().replace("/taxons", "/jstree"),
url: base_url.pathname.replace("/taxons", "/jstree"),
success: (taxonomy) ->
last_rollback = null
@@ -82,7 +82,7 @@ root.setup_taxonomy_tree = (taxonomy_id) ->
data: taxonomy,
ajax:
url: (e) ->
base_url.path() + '/' + e.attr('id') + '/jstree'
base_url.pathname + '/' + e.attr('id') + '/jstree'
themes:
theme: "apple",
url: "/assets/jquery.jstree/themes/apple/style.css"

View File

@@ -1,17 +0,0 @@
//= require admin/spree_backend
SpreePaypalExpress = {
hideSettings: function(paymentMethod) {
if (SpreePaypalExpress.paymentMethodID && paymentMethod.val() == SpreePaypalExpress.paymentMethodID) {
$('.payment-method-settings').children().hide();
$('#payment_amount').prop('disabled', 'disabled');
$('button[type="submit"]').prop('disabled', 'disabled');
$('#paypal-warning').show();
} else if (SpreePaypalExpress.paymentMethodID) {
$('.payment-method-settings').children().show();
$('button[type=submit]').prop('disabled', '');
$('#payment_amount').prop('disabled', '');
$('#paypal-warning').hide();
}
}
}

View File

@@ -16,7 +16,7 @@ angular.module("admin.subscriptions").controller "DetailsController", ($scope, $
return if !newValue?
paymentMethod = ($scope.paymentMethods.filter (pm) -> pm.id == newValue)[0]
return unless paymentMethod?
$scope.cardRequired = (paymentMethod.type == "Spree::Gateway::StripeConnect" || paymentMethod.type == "Spree::Gateway::StripeSCA")
$scope.cardRequired = paymentMethod.type == "Spree::Gateway::StripeSCA"
$scope.loadCustomer() if $scope.cardRequired && !$scope.customer
$scope.loadCustomer = ->

View File

@@ -1,12 +1,21 @@
$(document).ready(function() {
var onClickButtons = function(index, fp) {
var date;
// Memorize index used for the 'Close' button
// (currently it has index of 1)
var closeButtonIndex = 1;
switch (index) {
case 0:
date = new Date();
break;
case closeButtonIndex:
fp.close();
break;
}
// Set the date unless clicked button was the 'Close' one
if (index != closeButtonIndex) {
fp.setDate(date, true);
}
fp.setDate(date, true);
}
window.FLATPICKR_DATE_DEFAULT = {
altInput: true,
@@ -15,9 +24,14 @@ $(document).ready(function() {
locale: I18n.base_locale,
plugins: [
ShortcutButtonsPlugin({
button: [{
label: Spree.translations.today
}],
button: [
{
label: Spree.translations.today
},
{
label: Spree.translations.close
}
],
label: "or",
onClick: onClickButtons
}),
@@ -35,9 +49,14 @@ $(document).ready(function() {
time_24hr: true,
plugins: [
ShortcutButtonsPlugin({
button: [{
label: Spree.translations.now
}],
button: [
{
label: Spree.translations.now
},
{
label: Spree.translations.close
}
],
label: "or",
onClick: onClickButtons
}),

View File

@@ -10,15 +10,16 @@ angular.module("admin.utils").directive "variantAutocomplete", ($timeout) ->
element.select2
placeholder: t('admin.orders.select_variant')
minimumInputLength: 3
quietMillis: 300
ajax:
url: Spree.routes.variants_search
datatype: "json"
quietMillis: 500 # debounce
data: (term, page) ->
q: term
distributor_id: scope.distributor_id
order_cycle_id: scope.order_cycle_id
eligible_for_subscriptions: scope.eligible_for_subscriptions
include_out_of_stock: scope.include_out_of_stock
results: (data, page) ->
window.variants = data # this is how spree auto complete JS code picks up variants
results: data
@@ -27,3 +28,5 @@ angular.module("admin.utils").directive "variantAutocomplete", ($timeout) ->
formatSelection: (variant) ->
element.parent().children(".options_placeholder").html variant.options_text
variant.name
element.on "select2-opening", ->
scope.include_out_of_stock = if $('#include_out_of_stock').is(':checked') then "1" else ""

View File

@@ -6,6 +6,7 @@ angular.module("admin.utils").factory "StatusMessage", ->
notice: {style: {color: 'grey'}}
success: {style: {color: '#9fc820'}}
failure: {style: {color: '#da5354'}}
error: {style: {color: '#da5354'}}
statusMessage:
text: ""

View File

@@ -1,5 +1,4 @@
#= require jquery2
#= require jquery_ujs
#= require jquery.ui.all
#
#= require angular
@@ -50,13 +49,15 @@
#
#= require modernizr
#
#= require foundation-sites/js/foundation.js
#= require ./darkswarm
#= require_tree ./mixins
#= require_tree ./directives
#= require_tree .
document.addEventListener "turbo:load", ->
window.injector = angular.bootstrap document.body, ["Darkswarm"]
try
window.injector = angular.bootstrap document.body, ["Darkswarm"]
true
document.addEventListener "turbo:before-render", ->

View File

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

View File

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

View File

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

View File

@@ -1,12 +0,0 @@
angular.module('Darkswarm').controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
$scope.open = AuthenticationService.open
$scope.toggle = AuthenticationService.toggle
$scope.spree_user = SpreeUser.spree_user
$scope.isActive = AuthenticationService.isActive
$scope.select = AuthenticationService.select
$scope.tabs =
login: { active: $scope.isActive('/login') }
signup: { active: $scope.isActive('/signup') }
forgot: { active: $scope.isActive('/forgot') }

View File

@@ -1,4 +1,4 @@
angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, $http) ->
$scope.Checkout = Checkout
$scope.submitted = false
@@ -35,14 +35,9 @@ angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageServ
$scope.$broadcast 'purchaseFormInvalid', $scope.formdata
$scope.ensureUserIsGuest = (callback = null) ->
$http.post("/user/registered_email", {email: $scope.order.email}).then (response)->
if response.data.registered == true
$scope.promptLogin()
else
$http.post("/user/registered_email", {email: $scope.order.email})
.then (response)->
window.CableReady.perform(response.data)
.catch ->
$scope.validateForm() if $scope.submitted
callback() if callback
$scope.promptLogin = ->
SpreeUser.spree_user.email = $scope.order.email
AuthenticationService.pushMessage t('devise.failure.already_registered')
AuthenticationService.open '/login'

View File

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

View File

@@ -1,4 +1,4 @@
angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards, $controller) ->
angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, $http, CreditCard, CreditCards, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.savedCreditCards = CreditCards.saved
@@ -12,3 +12,11 @@ angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, CreditCard, C
$scope.allow_name_change = true
$scope.disable_fields = false
$scope.deleteCard = (id) ->
$http(
method: "DELETE"
url: "/credit_cards/#{id}"
).finally ->
window.location.reload()

View File

@@ -1,4 +1,4 @@
angular.module('Darkswarm').controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
angular.module('Darkswarm').controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location, Enterprises, Search, $document, HashNavigation, FilterSelectorsService, EnterpriseModal, enterpriseMatchesQueryFilter, distanceWithinKmFilter) ->
$scope.Enterprises = Enterprises
$scope.producers_to_filter = Enterprises.producers
$scope.filterSelectors = FilterSelectorsService.createSelectors()
@@ -55,8 +55,8 @@ angular.module('Darkswarm').controller "EnterprisesCtrl", ($scope, $rootScope, $
$scope.filterEnterprises = ->
es = Enterprises.hubs
$scope.nameMatches = enterpriseMatchesNameQueryFilter(es, true)
noNameMatches = enterpriseMatchesNameQueryFilter(es, false)
$scope.nameMatches = enterpriseMatchesQueryFilter(es, true)
noNameMatches = enterpriseMatchesQueryFilter(es, false)
$scope.distanceMatches = distanceWithinKmFilter(noNameMatches, 50)

View File

@@ -67,7 +67,7 @@ angular.module('Darkswarm').controller "ProductsCtrl", ($scope, $sce, $filter, $
page: page || $scope.page,
per_page: $scope.per_page,
'q[name_or_meta_keywords_or_variants_display_as_or_variants_display_name_or_supplier_name_cont]': $scope.query,
'q[properties_id_or_supplier_properties_id_in_any][]': $scope.activeProperties,
'q[with_properties][]': $scope.activeProperties,
'q[primary_taxon_id_in_any][]': $scope.activeTaxons
}

View File

@@ -1,5 +0,0 @@
angular.module('Darkswarm').directive 'auth', (AuthenticationService) ->
restrict: 'A'
link: (scope, elem, attrs) ->
elem.bind "click", ->
AuthenticationService.open '/' + attrs.auth

View File

@@ -1,8 +1,6 @@
angular.module('Darkswarm').directive "shippingTypeSelector", ->
# Builds selector for shipping types
restrict: 'E'
replace: true
templateUrl: 'shipping_type_selector.html'
restrict: 'C'
link: (scope, elem, attr)->
scope.shippingTypes =
pickup: false

View File

@@ -1,7 +0,0 @@
angular.module('Darkswarm').directive "shopVariant", ->
restrict: 'E'
replace: true
templateUrl: 'shop_variant.html'
scope:
variant: '='
controller: 'ShopVariantCtrl'

View File

@@ -9,7 +9,7 @@ angular.module('Darkswarm').directive "stripeElements", ($injector, StripeElemen
if $injector.has('stripeObject')
stripe = $injector.get('stripeObject')
card = stripe.elements().create 'card',
card = stripe.elements({ locale: I18n.base_locale }).create 'card',
hidePostalCode: true
style:
base:

View File

@@ -1,4 +0,0 @@
angular.module('Darkswarm').filter 'enterpriseMatchesNameQuery', ->
(enterprises, matches_name_query) ->
enterprises.filter (enterprise) ->
enterprise.matches_name_query == matches_name_query

View File

@@ -0,0 +1,4 @@
angular.module('Darkswarm').filter 'enterpriseMatchesQuery', ->
(enterprises, matches_query) ->
enterprises.filter (enterprise) ->
enterprise.matches_query == matches_query

View File

@@ -1,54 +0,0 @@
# This class deals with displaying things in the login modal. It chooses
# the modal tab templates and deals with switching tabs and passing data
# between the tabs. It has direct access to the instance of the login modal,
# and provides that access to other controllers as a service.
angular.module('Darkswarm').factory "AuthenticationService", (Navigation, $modal, $location, Redirections, Loading)->
new class AuthenticationService
selectedPath: "/login"
modalMessage: null
constructor: ->
if $location.path() in ["/login", "/signup", "/forgot"] || location.pathname is '/register/auth'
@open @initialTab(), @initialTemplate()
open: (path = false, template = 'authentication.html') =>
@modalInstance = $modal.open
templateUrl: template
windowClass: "login-modal medium"
@modalInstance.result.then @close, @close
@selectedPath = path || @selectedPath
Navigation.navigate @selectedPath
# Opens the /login tab if returning from email confirmation,
# the /signup tab if opened from the enterprise registration page,
# otherwise opens whichever tab is selected in the URL params ('/login', '/signup', or '/forgot')
initialTab: ->
if angular.isDefined($location.search()['validation'])
'/login'
else if location.pathname is '/register/auth'
'/signup'
else
$location.path()
# Loads the registration page modal when needed, otherwise the default modal
initialTemplate: ->
if location.pathname is '/register/auth'
'registration_authentication.html'
else
'authentication.html'
pushMessage: (message) ->
@modalMessage = String(message)
select: (path)=>
@selectedPath = path
Navigation.navigate @selectedPath
isActive: Navigation.isActive
close: ->
if location.pathname in ["/register", "/register/auth"]
Loading.message = t 'going_back_to_home_page'
location.hash = ""
location.pathname = "/"

View File

@@ -61,7 +61,9 @@ angular.module('Darkswarm').factory "EnterpriseRegistrationService", ($http, Reg
enterprise = {}
excluded = [ 'address', 'country', 'id' ]
for key, value of @enterprise when key not in excluded
enterprise[key] = value
if (key == 'long_description')
enterprise[key] = value.replace(/(?:\r\n|\r|\n)/g, '<br>')
else enterprise[key] = value
enterprise.address_attributes = @enterprise.address if @enterprise.address?
enterprise.address_attributes.country_id = @enterprise.country.id if @enterprise.country?
enterprise

View File

@@ -53,8 +53,8 @@ angular.module('Darkswarm').factory 'Enterprises', (enterprises, ShopsResource,
flagMatching: (query) ->
for enterprise in @enterprises
enterprise.matches_name_query = if query? && query.length > 0
Matcher.match([enterprise.name], query)
enterprise.matches_query = if query? && query.length > 0
Matcher.match([enterprise.name, enterprise.address?.state_name, enterprise.address?.city], query)
else
false

View File

@@ -1,3 +0,0 @@
angular.module('Darkswarm').factory "Redirections", ($location)->
new class Redirections
after_login: $location.search().after_login

View File

@@ -16,7 +16,7 @@ angular.module('Darkswarm').factory 'StripeElements', ($rootScope, Messages) ->
@reportError(response.error, t("error") + ": #{response.error.message}")
else
secrets.token = response.token.id
secrets.cc_type = @mapTokenApiCardBrand(response.token.card.brand)
secrets.cc_type = response.token.card.brand
secrets.card = response.token.card
submit()
.catch (response) =>
@@ -37,7 +37,7 @@ angular.module('Darkswarm').factory 'StripeElements', ($rootScope, Messages) ->
@reportError(response.error, t("error") + ": #{response.error.message}")
else
secrets.token = response.paymentMethod.id
secrets.cc_type = @mapPaymentMethodsApiCardBrand(response.paymentMethod.card.brand)
secrets.cc_type = response.paymentMethod.card.brand
secrets.card = response.paymentMethod.card
submit()
.catch (response) =>
@@ -56,24 +56,6 @@ angular.module('Darkswarm').factory 'StripeElements', ($rootScope, Messages) ->
# $evalAsync is improved way of triggering a digest without calling $apply
$rootScope.$evalAsync()
# Maps the brand returned by Stripe's tokenAPI to that required by activemerchant
mapTokenApiCardBrand: (cardBrand) ->
switch cardBrand
when 'MasterCard' then return 'master'
when 'Visa' then return 'visa'
when 'American Express' then return 'american_express'
when 'Discover' then return 'discover'
when 'JCB' then return 'jcb'
when 'Diners Club' then return 'diners_club'
# Maps the brand returned by Stripe's paymentMethodsAPI to that required by activemerchant
mapPaymentMethodsApiCardBrand: (cardBrand) ->
switch cardBrand
when 'mastercard' then return 'master'
when 'amex' then return 'american_express'
when 'diners' then return 'diners_club'
else return cardBrand # a few brands are equal, for example, visa
# It doesn't matter if any of these are nil, all are optional.
makeCardData: (secrets) ->
{'name': secrets.name,

View File

@@ -6,7 +6,7 @@
%p.error{ ng: { show: 'error' } }
{{error}}
%img.spinner{ src: image_path("spinning-circles.svg"), ng: { show: "loading" } }
%img.spinner{ src: image_path("/spinning-circles.svg"), ng: { show: "loading" } }
%p{ ng: { show: "loading" } }
= t('js.admin.orders.index.please_wait')

View File

@@ -3,7 +3,7 @@
%form#image_upload{ name: 'form', novalidate: true, enctype: 'multipart/form-data', multipart: true, ng: { controller: "ProductImageCtrl" } }
%div.image-preview
%img.spinner{ src: image_path("spinning-circles.svg"), ng: { hide: "!imageUploader.isUploading" }}
%img.spinner{ src: image_path("/spinning-circles.svg"), ng: { hide: "!imageUploader.isUploading" }}
%img.preview{ng: {src: "{{imagePreview}}", class: "{'faded': imageUploader.isUploading}"}}
%label{for: 'image-upload', class: 'button'} {{ 'admin.products.index.upload_an_image' | t }}

View File

@@ -6,6 +6,6 @@
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
%br
%img.spinner{ src: image_path("spinning-circles.svg")}
%i.spinner.fa.fa-spin.fa-circle-o-notch
%h1
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}

View File

@@ -21,5 +21,4 @@
%input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.update_schedule' | t }}", ng: { show: 'schedule.id' } }
%span{ ng: { show: 'schedule.id' } } or
%input.button.red{ type: 'button', value: "{{ 'js.admin.order_cycles.schedules.delete_schedule' | t }}", ng: { show: 'schedule.id', click: 'delete()'} }
or
%input.button{ type: 'button', value: "{{ 'actions.cancel' | t }}", ng: { click: 'close()' } }

View File

@@ -1,4 +1,3 @@
%div{ ng: { show: "data.length > limit" } }
%input{ type: 'button', value: t(:show_more), ng: { click: 'limit = limit + increment' } }
or
%input{ type: 'button', value: t(:show_all_with_more, num: '{{ data.length - limit }}'), ng: { click: 'limit = data.length' } }

View File

@@ -1,7 +0,0 @@
%div{"ng-controller" => "AuthenticationCtrl"}
%tabset
%ng-include{src: "'login.html'"}
%ng-include{src: "'signup.html'"}
%ng-include{src: "'forgot.html'"}
%a.close-reveal-modal{"ng-click" => "$close()"}
%i.ofn-i_009-close

View File

@@ -1,31 +0,0 @@
%tab#forgot{ heading: "{{'forgot_password' | t}}", active: "tabs.forgot.active", select: "select(path)"}
%form{ ng: { controller: "ForgotCtrl", submit: "submit()" } }
.row
.large-12.columns
.alert-box.success{"ng-show" => "sent"}
{{ 'password_reset_sent' | t }}
.alert-box.success{"ng-show" => "messages != null"}
{{ messages }}
.alert-box.alert{"ng-show" => "errors != null"}
{{ errors }}
%a{ng: {show: 'user_unconfirmed', click: 'resend_confirmation()'}}
= t('devise.confirmations.resend_confirmation_email')
.row
.large-12.columns
%label{for: "email"} {{'signup_email' | t}}
%input.title.input-text{name: "email",
type: "email",
id: "email",
tabindex: 1,
inputmode: "email",
"ng-model" => "spree_user.email"}
.row
.large-12.columns
%input.button.primary{name: "commit",
tabindex: "3",
type: "submit",
value: "{{'reset_password' | t}}"}

View File

@@ -1,44 +0,0 @@
%tab#login-content{ heading: "{{'label_login' | t}}", active: "tabs.login.active", select: "select(path)"}
%form{ ng: { controller: "LoginCtrl", submit: "submit()" } }
.row
.large-12.columns
.alert-box.alert{"ng-show" => "errors != null"}
{{ errors }}
%a{ng: {show: 'user_unconfirmed', click: 'resend_confirmation()'}}
= t('devise.confirmations.resend_confirmation_email')
.alert-box.success{ng: {show: 'messages != null'}}
{{ messages }}
.row
.large-12.columns
%label{for: "email"} {{'email' | t}}
%input.title.input-text{name: "email",
type: "email",
id: "email",
tabindex: 1,
inputmode: "email",
"ng-model" => "spree_user.email"}
.row
.large-12.columns
%label{for: "password"} {{'password' | t}}
%input.title.input-text{name: "password",
type: "password",
id: "password",
autocomplete: "off",
tabindex: 2,
inputmode: "password",
"ng-model" => "spree_user.password"}
.row
.large-12.columns
%input{name: "remember_me",
type: "checkbox",
id: "remember_me",
value: "1",
"ng-model" => "spree_user.remember_me"}
%label{for: "remember_me"} {{'remember_me' | t}}
.row
.large-12.columns
%input.button.primary{name: "commit",
tabindex: "3",
type: "submit",
value: "{{'label_login' | t}}"}

View File

@@ -2,7 +2,7 @@
%p.modal-header {{'follow' | t}}
.follow-icons
%span{"ng-if" => "::enterprise.twitter"}
%a{"ng-href" => "http://twitter.com/{{::enterprise.twitter}}", target: "_blank"}
%a{"ng-href" => "http://www.twitter.com/{{::enterprise.twitter}}", target: "_blank"}
%i.ofn-i_041-twitter
%span{"ng-if" => "::enterprise.facebook"}
@@ -14,5 +14,5 @@
%i.ofn-i_042-linkedin
%span{"ng-if" => "::enterprise.instagram"}
%a{"ng-href" => "http://instagram.com/{{::enterprise.instagram}}", target: "_blank"}
%a{"ng-href" => "http://www.instagram.com/{{::enterprise.instagram}}", target: "_blank"}
%i.ofn-i_043-instagram

View File

@@ -14,7 +14,8 @@
%a.cta-hub{"ng-repeat" => "hub in enterprise.hubs | filter:{id: '!'+enterprise.id} | orderBy:'-active'",
"ng-href" => "{{::hub.path}}#/shop", "ofn-empties-cart" => "hub",
"ng-class" => "::{primary: hub.active, secondary: !hub.active}",
"ng-click" => "$close()"}
"ng-click" => "$close()",
"ofn-change-hub" => "hub"}
.hub-name{"ng-bind" => "::hub.name"}
%span{"ng-if" => "::hub.active"} ({{'maps_open' | t}})
%span{"ng-if" => "::!hub.active"} ({{'maps_closed' | t}})

View File

@@ -1,17 +0,0 @@
.container
.row.modal-centered
%h2 {{'js.registration.welcome_to_ofn' | t}}
%h5 {{'js.registration.signup_or_login' | t}}:
%div{"ng-controller" => "AuthenticationCtrl"}
%tabset
%ng-include{src: "'signup.html'"}
%ng-include{src: "'login.html'"}
%ng-include{src: "'forgot.html'"}
%div{ ng: { show: "active('/signup')"} }
%hr
{{'js.registration.have_an_account' | t}}
%a{ href: "", ng: { click: "select('/login')"}}
{{'js.registration.action_login' | t}}
%a.close-reveal-modal{"ng-click" => "$close()"}
%i.ofn-i_009-close

View File

@@ -1,4 +0,0 @@
%ul.small-block-grid-2.medium-block-grid-4.large-block-grid-2
%active-selector{"ng-repeat" => "(name, selector) in selectors"}
%i{"ng-class" => "selector.icon"}
{{ selector.translation_key | t | capitalize }}

View File

@@ -1,23 +0,0 @@
.variants.row
.small-4.medium-4.large-5.columns.variant-name
.inline{"ng-if" => "::variant.display_name"} {{ ::variant.display_name }}
.variant-unit {{ ::variant.unit_to_display }}
.small-3.medium-3.large-2.columns.variant-price
%price-breakdown{"price-breakdown" => "_", variant: "variant",
"price-breakdown-append-to-body" => "true",
"price-breakdown-placement" => "bottom",
"price-breakdown-animation" => true}
{{ variant.price_with_fees | localizeCurrency }}
.unit-price.variant-unit-price
%question-mark-with-tooltip{"question-mark-with-tooltip" => "_",
"question-mark-with-tooltip-append-to-body" => "true",
"question-mark-with-tooltip-placement" => "top",
"question-mark-with-tooltip-animation" => true,
key: "'js.shopfront.unit_price_tooltip'"}
{{ variant.unit_price_price | localizeCurrency }}&nbsp;/&nbsp;{{ variant.unit_price_unit }}
.medium-2.large-2.columns.total-price
%span{"ng-class" => "{filled: variant.line_item.total_price}"}
{{ variant.line_item.total_price | localizeCurrency }}
%ng-include{src: "'partials/shop_variant_no_group_buy.html'"}
%ng-include{src: "'partials/shop_variant_with_group_buy.html'"}

View File

@@ -1,51 +0,0 @@
%tab#sign-up-content{ heading: "{{'label_signup' | t}}", active: 'tabs.signup.active', select: "select(path)"}
%form{ ng: { controller: "SignupCtrl", submit: "submit()" } }
.row
.large-12.columns
.alert-box.success{ng: {show: 'messages != null'}}
{{ messages }}
.large-12.columns
.alert-box.alert{ng: {show: 'errors.message != null'}}
{{ errors.message }}
.row
.large-12.columns
%label{for: "email"} {{'signup_email' | t}}
%input.title.input-text{name: "email",
type: "email",
id: "email",
tabindex: 1,
inputmode: "email",
"ng-model" => "spree_user.email"}
%span.error{"ng-show" => "errors.email != null"}
{{ errors.email.join(' ') }}
.row
.large-12.columns
%label{for: "password"} {{'choose_password' | t}}
%input.title.input-text{name: "password",
type: "password",
id: "password",
autocomplete: "off",
tabindex: 2,
inputmode: "password",
"ng-model" => "spree_user.password"}
%span.error{"ng-show" => "errors.password != null"}
{{ errors.password.join(' ') }}
.row
.large-12.columns
%label{for: "password_confirmation"} {{'confirm_password' | t}}
%input.title.input-text{name: "password_confirmation",
type: "password",
id: "password_confirmation",
autocomplete: "off",
tabindex: 2,
inputmode: "password",
"ng-model" => "spree_user.password_confirmation"}
%span.error{"ng-show" => "errors.password_confirmation != null"}
{{ errors.password_confirmation.join(' ') }}
.row
.large-12.columns
%input.button.primary{name: "commit",
tabindex: "3",
type: "submit",
value: "{{'action_signup' | t}}"}

View File

@@ -1,21 +0,0 @@
@import "variables";
#advanced_settings {
background-color: $spree-light-blue;
border: 1px solid $pale-blue;
margin-bottom: 20px;
.row{
margin: 0px -4px;
padding: 20px 0px;
.column.alpha, .columns.alpha {
padding-left: 20px;
}
.column.omega, .columns.omega {
padding-right: 20px;
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*
*= require normalize
*= require responsive-tables
*= require jquery.powertip
*= require jquery.ui.dialog
*= require shared/textAngular
*= require shared/ng-tags-input.min
*= require select2
*= require flatpickr/dist/flatpickr
*= require flatpickr/dist/themes/material_blue
*= require shortcut-buttons-flatpickr/dist/themes/light
*= require_self
*/
//************************************************************************//
//************************************************************************//
@import 'globals/functions';
@import 'globals/variables';
@import 'variables';
@import 'globals/mixins';
@import 'shared/typography';
@import 'shared/tables';
@import 'shared/icons';
@import 'shared/forms';
@import 'shared/layout';
@import 'plugins/flatpickr-customization';
@import 'plugins/powertip';
@import 'plugins/jstree';
@import 'plugins/font-awesome';
@import 'plugins/select2';
@import 'sections/orders';
@import 'sections/products';
@import 'hacks/mozilla';
@import 'hacks/opera';
@import 'hacks/ie';
@import 'components/*';
@import 'pages/*';
@import '*';
@import "../shared/question-mark-icon";
@import "question-mark-tooltip";

View File

@@ -1,31 +0,0 @@
@import 'admin/globals/variables';
@import 'admin/globals/mixins';
#progress {
@include border-radius(10px);
position: fixed;
top: -10px;
left: 50%;
z-index: 1000;
opacity: 0.8;
width: 200px;
background-color: $spree-blue;
color: $color-1;
display: none;
font-size: 120%;
font-weight: bold;
line-height: 40px;
margin-left: -100px;
padding-top: 15px;
text-align: center;
text-transform: uppercase;
.spinner {
position: absolute;
left: 50%;
width: 30px;
height: 30px;
top: -5px;
margin-left: -15px;
}
}

View File

@@ -1,26 +0,0 @@
@import 'admin/plugins/font-awesome';
// Some fixes for fontwesome stylesheets
[class^="icon-"], [class*=" icon-"] {
&:before {
padding-right: 5px;
}
&.button, &.icon_link {
width: auto;
&:before {
padding-top: 3px;
}
}
}
.icon-email:before { @extend .icon-envelope:before }
.icon-resend_authorization_email:before { @extend .icon-envelope:before }
.icon-resume:before { @extend .icon-refresh:before }
.icon-cancel:before,
.icon-void:before { @extend .icon-remove:before }
.icon-capture:before { @extend .icon-ok:before }
.icon-credit:before { @extend .icon-ok:before }

View File

@@ -1,25 +0,0 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require autocomplete
*= require leaflet
*= require_self
*/
@import 'variables';
@import 'foundation';
@import 'foundation-icons';
@import 'base/*';
@import 'layout/*';
@import '*';
@import 'pages/*';
@import 'web/all';
ofn-modal {
display: block;
}
@import "../shared/question-mark-icon";

View File

@@ -1,13 +0,0 @@
@import 'darkswarm/branding';
$modal-background-color: #efefef;
$modal-content-background-color: #fff;
$modal-alert-link-color: #fff;
$modal-alert-link-hover-color: rgba(255, 255, 255, .7);
$cookies-banner-background-color: $dark-grey;
$cookies-banner-button-background-color: $clr-turquoise;
$cookies-banner-text-color: $white;
$cookies-policy-modal-background-color: $disabled-light;
$cookies-policy-modal-border-bottom-color: $disabled-light;
$cookies-policy-modal-table-tr-even-background-color: $disabled-very-light;

View File

@@ -1,11 +0,0 @@
/* This file MUST be plain css, as roadie does not seem to be able to handle other file types */
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/

View File

@@ -1,9 +1,11 @@
# frozen_string_literal: true
class SplitCheckoutConstraint
def matches?(request)
Flipper.enabled? :split_checkout, current_user(request)
OpenFoodNetwork::FeatureToggle.enabled? :split_checkout, current_user(request)
end
def current_user(request)
@spree_current_user ||= request.env['warden'].user
request.env['warden'].user
end
end

View File

@@ -99,7 +99,7 @@ module Admin
def customer_params
params.require(:customer).permit(
:enterprise_id, :name, :email, :code, :tag_list,
:enterprise_id, :first_name, :last_name, :email, :code, :tag_list,
ship_address_attributes: PermittedAttributes::Address.attributes,
bill_address_attributes: PermittedAttributes::Address.attributes,
)

View File

@@ -36,12 +36,12 @@ module Admin
def bulk_update
@flat_percent_value = enterprise_fee_bulk_params.dig('collection_attributes', '0', 'calculator_attributes', 'preferred_flat_percent')
unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
end
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
if @enterprise_fee_set.save

View File

@@ -234,8 +234,10 @@ module Admin
end
def update_enterprise_notifications
if params.key? :receives_notifications
@enterprise.update_contact params[:receives_notifications]
user_id = params[:receives_notifications].to_i
if user_id.positive? && @enterprise.user_ids.include?(user_id)
@enterprise.update_contact(user_id)
end
end

View File

@@ -26,7 +26,9 @@ module Admin
def show
respond_to do |format|
format.html
format.html do
redirect_to edit_admin_order_cycle_path(@order_cycle)
end
format.json do
render_as_json @order_cycle, current_user: spree_current_user
end

View File

@@ -0,0 +1,54 @@
# frozen_string_literal: true
module Admin
class ReportsController < Spree::Admin::BaseController
include ReportsActions
helper ReportsHelper
before_action :authorize_report
def show
render_report && return if ransack_params.blank?
@report = report_class.new(spree_current_user, ransack_params, report_options)
if export_spreadsheet?
export_report
else
render_report
end
end
private
def export_report
render report_format.to_sym => @report.public_send("to_#{report_format}"),
:filename => report_filename
end
def render_report
assign_view_data
load_form_options
render report_type
end
def assign_view_data
@report_type = report_type
@report_subtype = report_subtype || report_loader.default_report_subtype
@report_subtypes = report_class.report_subtypes.map do |subtype|
[t("packing.#{subtype}_report", scope: i18n_scope), subtype]
end
end
def load_form_options
return unless form_options_required?
form_options = Reporting::FrontendData.new(spree_current_user)
@distributors = form_options.distributors.to_a
@suppliers = form_options.suppliers.to_a
@order_cycles = form_options.order_cycles.to_a
end
end
end

View File

@@ -16,15 +16,16 @@ module Admin
respond_to do |format|
format.html do
if view_context.subscriptions_setup_complete?(@shops)
@order_cycles = OrderCycle.joins(:schedules).managed_by(spree_current_user)
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user)
@order_cycles = OrderCycle.joins(:schedules).managed_by(spree_current_user).includes([:distributors, :cached_incoming_exchanges])
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).includes(:taggings)
@payment_method_tags = payment_method_tags_by_id
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user)
else
@shop = @shops.first
render :setup_explanation
end
end
format.json { render_as_json @collection, ams_prefix: params[:ams_prefix] }
format.json { render_as_json @collection, ams_prefix: params[:ams_prefix], payment_method_tags: payment_method_tags_by_id }
end
end
@@ -165,5 +166,21 @@ module Admin
@subscription_params ||= PermittedAttributes::Subscription.new(params).call.
to_h.with_indifferent_access
end
def payment_method_tags_by_id
payment_method_tags = ::ActsAsTaggableOn::Tag.
joins(:taggings).
includes(:taggings).
where(taggings: { taggable_type: "Spree::PaymentMethod",
taggable_id: Spree::PaymentMethod.from(Enterprise.managed_by(spree_current_user).
select('enterprises.id').find_by(id: params[:enterprise_id])),
context: 'tags' })
payment_method_tags.each_with_object({}) do |tag, hash|
payment_method_id = tag.taggings.first.taggable_id
hash[payment_method_id] ||= []
hash[payment_method_id] << tag.name
end
end
end
end

View File

@@ -52,11 +52,11 @@ module Api
if api_key.blank?
# An anonymous user
@current_api_user = Spree.user_class.new
@current_api_user = Spree::User.new
return
end
return if @current_api_user = Spree.user_class.find_by(spree_api_key: api_key.to_s)
return if @current_api_user = Spree::User.find_by(spree_api_key: api_key.to_s)
invalid_api_key
end

View File

@@ -75,7 +75,10 @@ module Api
def render_paginated_products
results = products
@pagy, results = pagy(results, items: params[:per_page] || DEFAULT_PER_PAGE) if pagination_required?
if pagination_required?
@pagy, results = pagy(results,
items: params[:per_page] || DEFAULT_PER_PAGE)
end
serialized_products = ActiveModel::ArraySerializer.new(
results,

View File

@@ -81,8 +81,7 @@ module Api
def permitted_ransack_params
[:name_or_meta_keywords_or_variants_display_as_or_variants_display_name_or_supplier_name_cont,
:properties_id_or_supplier_properties_id_in_any,
:primary_taxon_id_in_any]
:with_properties, :primary_taxon_id_in_any]
end
def distributor

View File

@@ -15,7 +15,10 @@ module Api
orders = SearchOrders.new(params, current_api_user).orders
@pagy, orders = pagy(orders, items: params[:per_page] || default_per_page) if pagination_required?
if pagination_required?
@pagy, orders = pagy(orders,
items: params[:per_page] || default_per_page)
end
render json: {
orders: serialized_orders(orders),

View File

@@ -0,0 +1,38 @@
# frozen_string_literal: true
module Api
module V0
class ReportsController < Api::V0::BaseController
include ReportsActions
rescue_from ::Reporting::Errors::Base, with: :render_error
before_action :validate_report, :authorize_report, :validate_query
def show
@report = report_class.new(current_api_user, ransack_params, report_options)
render_report
end
private
def render_report
render json: { data: @report.as_json }
end
def render_error(error)
render json: { error: error.message }, status: :unprocessable_entity
end
def validate_report
raise ::Reporting::Errors::NoReportType if report_type.blank?
raise ::Reporting::Errors::ReportNotFound if report_class.blank?
end
def validate_query
raise ::Reporting::Errors::MissingQueryParams if ransack_params.blank?
end
end
end
end

View File

@@ -37,8 +37,8 @@ class ApplicationController < ActionController::Base
include Spree::Core::ControllerHelpers::RespondWith
include Spree::Core::ControllerHelpers::Common
prepend_before_action :restrict_iframes
before_action :set_cache_headers # prevent cart emptying via cache when using back button #1213
before_action :set_after_login_url
include RawParams
include EnterprisesHelper
@@ -62,15 +62,11 @@ class ApplicationController < ActionController::Base
end
def set_checkout_redirect
referer_path = OpenFoodNetwork::RefererParser.path(request.referer)
if referer_path
is_checkout_path_the_referer = [main_app.checkout_path].include?(referer_path)
session["spree_user_return_to"] = if is_checkout_path_the_referer
referer_path
else
main_app.root_path
end
end
referer_path = URI(request.referer.to_s).path
return unless referer_path == main_app.checkout_path ||
referer_path == main_app.checkout_step_path(:details)
session["spree_user_return_to"] = main_app.checkout_path
end
def shopfront_session
@@ -103,27 +99,20 @@ class ApplicationController < ActionController::Base
private
def set_after_login_url
store_location_for(:spree_user, params[:after_login]) if params[:after_login]
end
def shopfront_redirect
session[:shopfront_redirect]
end
def restrict_iframes
response.headers['X-Frame-Options'] = 'DENY'
response.headers['Content-Security-Policy'] = "frame-ancestors 'none'"
end
def enable_embedded_shopfront
embed_service = EmbeddedPageService.new(params, session, request, response)
embed_service.embed!
@shopfront_layout = 'embedded' if embed_service.use_embedded_layout?
end
def action
params[:action].to_sym
end
def require_distributor_chosen
unless @distributor = current_distributor
unless (@distributor = current_distributor)
redirect_to main_app.root_path
false
end
@@ -151,15 +140,6 @@ class ApplicationController < ActionController::Base
!current_distributor.ready_for_checkout?
end
def check_order_cycle_expiry
if current_order_cycle&.closed?
current_order.empty!
current_order.set_order_cycle! nil
flash[:info] = I18n.t('order_cycle_closed')
redirect_to main_app.shop_path
end
end
# All render calls within the block will be performed with the specified format
# Useful for rendering html within a JSON response, particularly if the specified
# template or partial then goes on to render further partials without specifying

View File

@@ -12,7 +12,6 @@ class BaseController < ApplicationController
include OrderCyclesHelper
before_action :set_locale
before_action :check_order_cycle_expiry
private

View File

@@ -28,7 +28,7 @@ class CartController < BaseController
end
def check_authorization
session[:access_token] ||= params[:token]
session[:access_token] ||= params[:order_token]
order = Spree::Order.find_by(number: params[:id]) || current_order
if order

View File

@@ -3,9 +3,10 @@
require 'open_food_network/address_finder'
class CheckoutController < ::BaseController
layout 'darkswarm'
include OrderStockCheck
include OrderCompletion
layout 'darkswarm'
helper 'terms_and_conditions'
helper 'checkout'
@@ -21,26 +22,14 @@ class CheckoutController < ::BaseController
before_action :load_order
before_action :ensure_order_not_completed
before_action :ensure_checkout_allowed
before_action :handle_insufficient_stock
before_action :associate_user
before_action :check_authorization
before_action :enable_embedded_shopfront
helper 'spree/orders'
def edit
return handle_redirect_from_stripe if valid_payment_intent_provided?
# This is only required because of spree_paypal_express. If we implement
# a version of paypal that uses this controller, and more specifically
# the #action_failed method, then we can remove this call
reset_order_to_cart
rescue Spree::Core::GatewayError => e
rescue_from_spree_gateway_error(e)
end
def edit; end
def update
params_adapter = Checkout::FormDataAdapter.new(permitted_params, @order, spree_current_user)
@@ -48,7 +37,8 @@ class CheckoutController < ::BaseController
checkout_workflow(params_adapter.shipping_method_id)
rescue Spree::Core::GatewayError => e
rescue_from_spree_gateway_error(e)
gateway_error(e)
action_failed(e)
rescue StandardError => e
flash[:error] = I18n.t("checkout.failed")
action_failed(e)
@@ -56,52 +46,22 @@ class CheckoutController < ::BaseController
@order.update_order!
end
# Clears the cached order. Required for #current_order to return a new order
# to serve as cart. See https://github.com/spree/spree/blob/1-3-stable/core/lib/spree/core/controller_helpers/order.rb#L14
# for details.
def expire_current_order
session[:order_id] = nil
@current_order = nil
end
private
def check_authorization
authorize!(:edit, current_order, session[:access_token])
end
def ensure_checkout_allowed
redirect_to main_app.cart_path unless @order.checkout_allowed?
end
def ensure_order_not_completed
redirect_to main_app.cart_path if @order.completed?
end
def load_order
@order = current_order
load_checkout_order
redirect_to(main_app.shop_path) && return if redirect_to_shop?
handle_invalid_stock && return unless valid_order_line_items?
return handle_invalid_stock unless valid_order_line_items?
before_address
setup_for_current_state
end
def redirect_to_shop?
!@order ||
!@order.checkout_allowed? ||
@order.completed?
end
def valid_order_line_items?
@order.insufficient_stock_lines.empty? &&
OrderCycleDistributedVariants.new(@order.order_cycle, @order.distributor).
distributes_order_variants?(@order)
end
def handle_invalid_stock
cancel_incomplete_payments if valid_payment_intent_provided?
reset_order_to_cart
respond_to do |format|
@@ -115,20 +75,6 @@ class CheckoutController < ::BaseController
end
end
def cancel_incomplete_payments
# The checkout could not complete due to stock running out. We void any pending (incomplete)
# Stripe payments here as the order will need to be changed and resubmitted (or abandoned).
@order.payments.incomplete.each do |payment|
payment.void_transaction!
payment.adjustment&.update_columns(eligible: false, state: "finalized")
end
flash[:notice] = I18n.t("checkout.payment_cancelled_due_to_stock")
end
def reset_order_to_cart
OrderCheckoutRestart.new(@order).call
end
def setup_for_current_state
method_name = :"before_#{@order.state}"
__send__(method_name) if respond_to?(method_name, true)
@@ -147,31 +93,13 @@ class CheckoutController < ::BaseController
current_order.payments.destroy_all if request.put?
end
def valid_payment_intent_provided?
return false unless params["payment_intent"]&.starts_with?("pi_")
last_payment = OrderPaymentFinder.new(@order).last_payment
@order.state == "payment" &&
last_payment&.state == "requires_authorization" &&
last_payment&.response_code == params["payment_intent"]
end
def handle_redirect_from_stripe
return checkout_failed unless @order.process_payments!
if OrderWorkflow.new(@order).next && order_complete?
checkout_succeeded
redirect_to(order_path(@order)) && return
else
checkout_failed
end
end
def checkout_workflow(shipping_method_id)
while @order.state != "complete"
if @order.state == "payment"
update_payment_total
return if redirect_to_payment_gateway
return action_failed if @order.errors.any?
return action_failed unless @order.process_payments!
end
@@ -183,26 +111,28 @@ class CheckoutController < ::BaseController
update_response
end
def redirect_to_payment_gateway
redirect_path = Checkout::PaypalRedirect.new(params).path
redirect_path = Checkout::StripeRedirect.new(params, @order).path if redirect_path.blank?
return if redirect_path.blank?
def update_payment_total
@order.updater.update_totals
@order.updater.update_pending_payment
end
render json: { path: redirect_path }, status: :ok
def redirect_to_payment_gateway
return unless selected_payment_method.external_gateway?
return unless (redirect_url = selected_payment_method.external_payment_url(order: @order))
render json: { path: redirect_url }, status: :ok
true
end
def order_error
if @order.errors.present?
@order.errors.full_messages.to_sentence
else
t(:payment_processing_failed)
end
def selected_payment_method
@selected_payment_method ||= Spree::PaymentMethod.find(
params.dig(:order, :payments_attributes, 0, :payment_method_id)
)
end
def update_response
if order_complete?
checkout_succeeded
processing_succeeded
update_succeeded_response
else
action_failed(RuntimeError.new("Order not complete after the checkout workflow"))
@@ -213,35 +143,22 @@ class CheckoutController < ::BaseController
@order.state == "complete" || @order.completed?
end
def checkout_succeeded
Checkout::PostCheckoutActions.new(@order).success(self, params, spree_current_user)
session[:access_token] = current_order.token
flash[:notice] = t(:order_processed_successfully)
end
def update_succeeded_response
respond_to do |format|
format.html do
respond_with(@order, location: order_path(@order))
respond_with(@order, location: order_completion_route)
end
format.json do
render json: { path: order_path(@order) }, status: :ok
render json: { path: order_completion_route }, status: :ok
end
end
end
def action_failed(error = RuntimeError.new(order_error))
checkout_failed(error)
def action_failed(error = RuntimeError.new(order_processing_error))
processing_failed(error)
action_failed_response
end
def checkout_failed(error = RuntimeError.new(order_error))
Bugsnag.notify(error)
flash[:error] = order_error if flash.blank?
Checkout::PostCheckoutActions.new(@order).failure
end
def action_failed_response
respond_to do |format|
format.html do
@@ -254,11 +171,6 @@ class CheckoutController < ::BaseController
end
end
def rescue_from_spree_gateway_error(error)
flash[:error] = t(:spree_gateway_error_flash_for_checkout, error: error.message)
action_failed(error)
end
def permitted_params
PermittedAttributes::Checkout.new(params).call
end

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