Compare commits

...

1590 Commits

Author SHA1 Message Date
Maikel Linke
e31d17f4fb Update translations 2021-10-26 15:59:56 +11:00
jibees
eae134f3b6 Merge pull request #8330 from openfoodfoundation/dependabot/bundler/stripe-5.39.0
Bump stripe from 5.38.0 to 5.39.0
2021-10-22 09:19:26 +02:00
jibees
fa7c64841f Merge pull request #8286 from mkllnk/permalink-check
Avoid superfluous permalink check on site load
2021-10-22 09:14:41 +02:00
jibees
a5a45539c3 Merge pull request #8308 from mariodz95/8250_fix_snail_when_editing_non_numeric_characters_on_enterprise_fees
Fix snail when editing non numeric characters on enterprise fees
2021-10-22 09:14:28 +02:00
jibees
e123353252 Merge pull request #8325 from achauve/3976-improve-error-handling-of-unsupported-image-formats
Improve error handling of unsupported image formats
2021-10-22 09:13:19 +02:00
jibees
2e846ce1e0 Merge pull request #8347 from achauve/8227-fix-opening-product-description-links-in-new-tabs
Fix: product edition doesn't break description links
2021-10-22 09:13:02 +02:00
Maikel Linke
19aae9bca0 Update translations 2021-10-22 17:55:46 +11:00
Maikel
9053d3e832 Merge pull request #8309 from openfoodfoundation/transifex
Transifex
2021-10-22 17:51:49 +11:00
jibees
741966b569 Merge pull request #8375 from jibees/8358-add-tax-category-to-line-item
Add `tax_category_id` for a line_item
2021-10-21 15:00:29 +02:00
jibees
16a07d2bb2 Merge pull request #8384 from filipefurtad0/fix_flaky_checkout_spec
Adds context to helper to assure actions are successful
2021-10-21 09:13:56 +02:00
jibees
d4452cea39 Merge pull request #8383 from openfoodfoundation/dependabot/bundler/selenium-webdriver-4.0.2
Bump selenium-webdriver from 3.142.7 to 4.0.2
2021-10-21 09:11:56 +02:00
filipefurtad0
c94b5d1598 Toggles shipping info section 2021-10-20 18:58:06 +01:00
filipefurtad0
21449ea711 Adds respective sections to assure elements are found 2021-10-20 15:37:45 +01:00
dependabot[bot]
ccec7fd00b Bump selenium-webdriver from 3.142.7 to 4.0.2
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 3.142.7 to 4.0.2.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-20 09:02:45 +00:00
Filipe
29c2f2e5e9 Merge pull request #8381 from jibees/8328-fix-flaky-on-checkout_spec
(try to) fix flaky for spec/system/consumer/shopping/checkout_spec.rb
2021-10-20 09:23:49 +01:00
jibees
c7658b4a78 Merge pull request #8380 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.3.1
Bump jest from 27.3.0 to 27.3.1
2021-10-20 09:56:13 +02:00
jibees
d3889ee948 Merge pull request #8370 from openfoodfoundation/dependabot/bundler/dalli-3.0.2
Bump dalli from 2.7.11 to 3.0.2
2021-10-20 09:55:19 +02:00
Jean-Baptiste Bellet
d13d1209be Prefer find and click and wait for title to appears 2021-10-20 09:32:30 +02:00
jibees
8852fe1a49 Merge pull request #8340 from filipefurtad0/enterprises_into_system
Enterprises into system
2021-10-20 09:17:14 +02:00
Transifex-Openfoodnetwork
04a286d3c7 Updating translations for config/locales/en_FR.yml 2021-10-20 15:32:13 +11:00
Transifex-Openfoodnetwork
3b4bd8e5ec Updating translations for config/locales/fr.yml 2021-10-20 15:31:56 +11:00
Maikel
c642b98067 Merge pull request #8193 from jibees/8155-split-checkout-mobile-views
Some responsive modifications for split checkout
2021-10-20 11:48:57 +11:00
dependabot[bot]
23c7ac6508 Bump stripe from 5.38.0 to 5.39.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.38.0 to 5.39.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.38.0...v5.39.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-20 00:46:20 +00:00
Maikel
3bfd53b92c Merge pull request #8377 from openfoodfoundation/dependabot/bundler/pagy-5.0.1
Bump pagy from 4.11.0 to 5.0.1
2021-10-20 11:45:08 +11:00
filipefurtad0
c7eed5ae57 Adds the system helper to business_address 2021-10-19 15:44:26 +01:00
filipefurtad0
33f374d177 Defines strings for warning accepting with let 2021-10-19 15:38:07 +01:00
filipefurtad0
6639ce416a Squashes terms_and_conditions_spec edits
Moves terms_and_conditions_spec into system

Updates terms_and_conditions_spec into system
2021-10-19 15:34:26 +01:00
filipefurtad0
9ab335302e Moves/updates index_spec into system 2021-10-19 15:34:26 +01:00
filipefurtad0
f62749e3bf Wraps alert text in images_spec 2021-10-19 15:34:26 +01:00
filipefurtad0
9579783543 Moves/updates images_spec into system 2021-10-19 15:34:26 +01:00
filipefurtad0
1ed5f2c248 Moves/updates business_address_form_spec into system 2021-10-19 15:34:26 +01:00
jibees
6deb5ea4d4 Merge pull request #8331 from openfoodfoundation/dependabot/bundler/geocoder-1.7.0
Bump geocoder from 1.6.7 to 1.7.0
2021-10-19 16:22:40 +02:00
dependabot[bot]
da816a4569 Bump jest from 27.3.0 to 27.3.1
Bumps [jest](https://github.com/facebook/jest) from 27.3.0 to 27.3.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.3.0...v27.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-19 14:16:46 +00:00
dependabot[bot]
a84298d4bd Bump dalli from 2.7.11 to 3.0.2
Bumps [dalli](https://github.com/petergoldstein/dalli) from 2.7.11 to 3.0.2.
- [Release notes](https://github.com/petergoldstein/dalli/releases)
- [Changelog](https://github.com/petergoldstein/dalli/blob/master/History.md)
- [Commits](https://github.com/petergoldstein/dalli/compare/v2.7.11...v3.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-19 14:15:33 +00:00
jibees
2ceb23fdcf Merge pull request #8369 from openfoodfoundation/dependabot/bundler/redis-4.5.1
Bump redis from 4.4.0 to 4.5.1
2021-10-19 16:15:09 +02:00
jibees
76bf359f26 Merge pull request #8376 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.4
Bump rubocop-rails from 2.12.3 to 2.12.4
2021-10-19 14:34:10 +02:00
jibees
2b3078040d Merge pull request #8359 from filipefurtad0/fix_flaky_checkout_auth_spec
Switches to css to select accordion element
2021-10-19 14:20:14 +02:00
dependabot[bot]
a52b3a516b Bump rubocop-rails from 2.12.3 to 2.12.4
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.3 to 2.12.4.
- [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.3...v2.12.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-19 12:12:35 +00:00
filipefurtad0
2db64a5b9f Deletes unused helper methods 2021-10-19 11:26:00 +01:00
filipefurtad0
5888d868b7 Switches to css to select accordion element 2021-10-19 11:26:00 +01:00
Filipe
c525c59c1d Merge pull request #8373 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.9
Bump mrujs from 0.5.5 to 0.5.9
2021-10-19 11:22:59 +01:00
jibees
0bd9018d92 Merge pull request #8348 from openfoodfoundation/dependabot/bundler/json-2.6.0
Bump json from 2.5.1 to 2.6.0
2021-10-19 10:46:14 +02:00
mariodz95
578efa945e Fix snail when editing enterprise fees 2021-10-19 10:26:44 +02:00
Maikel
c55e1c03f8 Merge pull request #8354 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.12
Bump @storybook/addon-controls from 6.3.10 to 6.3.12
2021-10-19 15:22:48 +11:00
Maikel Linke
7c73495b07 Update Pagy config for version 5
Some variables were renamed.
2021-10-19 15:12:35 +11:00
Maikel
a271a66998 Merge pull request #8271 from sinansonmez/8176-preselect-supplier-when-only-one
When creating a product, preselect the supplier if there is only one
2021-10-19 14:12:00 +11:00
Maikel
0ffe73cf56 Merge pull request #8253 from mkllnk/spec-matrix
Simplify GH Actions config with matrix syntax
2021-10-19 09:53:11 +11:00
Maikel Linke
61333a958e Continue all jobs when one failed
It's nice to see the whole result to then work on all failures,
especially when there are flaky specs.
2021-10-19 09:15:51 +11:00
Maikel Linke
9ccb744ef3 Remove superfluous env parameter
It's already defined globally.
2021-10-19 09:15:51 +11:00
Maikel Linke
a4db3b675d DRY actions config with matrix syntax
This uses the matrix syntax for all rspec calls. It is easier to
maintain than the previous list of GH Actions workflows.

The execution of the rspec rake task is still in its own job because it
doesn't fit in the same pattern. The JS tests are also executed in that
job.
2021-10-19 09:15:51 +11:00
Maikel Linke
d6c216840e Use matrix to split jobs
This demonstrates how you can split the tests across multiple jobs
without repeating the job configuration. This has a lot of potential to
DRY our config.
2021-10-19 09:15:51 +11:00
dependabot[bot]
a9570be75c Bump mrujs from 0.5.5 to 0.5.9
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.5 to 0.5.9.
- [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.5...v0.5.9)

---
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-18 14:18:52 +00:00
dependabot[bot]
57f0ca1dfc Bump @storybook/addon-controls from 6.3.10 to 6.3.12
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.10 to 6.3.12.
- [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.3.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>
2021-10-18 13:26:33 +00:00
dependabot[bot]
e35f13d4a8 Bump json from 2.5.1 to 2.6.0
Bumps [json](https://github.com/flori/json) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 13:23:03 +00:00
Filipe
6669a2c108 Merge pull request #8360 from filipefurtad0/testing_capybara_no_animations
Disables animations when running Capybara tests
2021-10-18 14:12:32 +01:00
dependabot[bot]
763fc2c484 Bump pagy from 4.11.0 to 5.0.1
Bumps [pagy](https://github.com/ddnexus/pagy) from 4.11.0 to 5.0.1.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/4.11.0...5.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 13:05:22 +00:00
jibees
206d23d162 Merge pull request #8374 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.3.0
Bump jest from 27.2.5 to 27.3.0
2021-10-18 15:03:54 +02:00
jibees
83f130e597 Merge pull request #8371 from openfoodfoundation/dependabot/bundler/test-unit-3.5.0
Bump test-unit from 3.4.8 to 3.5.0
2021-10-18 15:01:55 +02:00
jibees
e2afd9a0fb Merge pull request #8334 from jibees/8333-fix-flaky-around-registration_spec
Move registration_spec as system spec
2021-10-18 12:00:45 +02:00
Adrien Chauve
bd3bea8025 Fix: product edition doesn't break description links
-> otherwise product edition was breaking description links, which were
not opening in a new tab anymore.
2021-10-18 11:29:33 +02:00
Adrien Chauve
1a185ade03 Add links to external site in product view test 2021-10-18 11:29:33 +02:00
dependabot[bot]
910f2a5ee2 Bump jest from 27.2.5 to 27.3.0
Bumps [jest](https://github.com/facebook/jest) from 27.2.5 to 27.3.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.2.5...v27.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 09:08:06 +00:00
dependabot[bot]
99080857d8 Bump test-unit from 3.4.8 to 3.5.0
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.8 to 3.5.0.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.8...3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 09:04:08 +00:00
dependabot[bot]
f080051d57 Bump redis from 4.4.0 to 4.5.1
Bumps [redis](https://github.com/redis/redis-rb) from 4.4.0 to 4.5.1.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.4.0...v4.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 09:03:35 +00:00
Jean-Baptiste Bellet
115dac3ca9 Add tax_category_id for a line_item 2021-10-18 10:56:27 +02:00
Adrien Chauve
e488f599e6 Add new feature test to check error message on unsupported image format 2021-10-18 08:55:51 +02:00
Maikel
5252c83265 Merge pull request #8363 from openfoodfoundation/dependabot/bundler/webdrivers-4.7.0
Bump webdrivers from 4.6.1 to 4.7.0
2021-10-18 17:18:16 +11:00
Maikel
012943d498 Merge pull request #8353 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.12
Bump @storybook/addon-docs from 6.3.10 to 6.3.12
2021-10-18 17:09:30 +11:00
Maikel
a48d009b1f Merge pull request #8346 from filipefurtad0/order_cycles_into_system
Order cycles into system
2021-10-18 17:06:25 +11:00
Maikel
dfac2b5782 Merge pull request #8339 from filipefurtad0/configuration_into_system
Configuration specs update into system specs
2021-10-18 17:00:26 +11:00
Adrien Chauve
c818ec5508 Fix image creation button title and icon 2021-10-17 22:47:12 +02:00
Adrien Chauve
3d6654a4b5 Cleanup errors on wrong image format
-> Remove all duplicates and use the same error message than in product
creation.
2021-10-17 22:47:12 +02:00
Jean-Baptiste Bellet
ae45a2dd9d Move registration_spec as system spec 2021-10-15 14:40:00 +02:00
filipefurtad0
6c5021379d Disables animations when running feature tests 2021-10-15 10:29:25 +01:00
filipefurtad0
fa2d5cdb3d Disables animations when running tests 2021-10-15 10:29:25 +01:00
filipefurtad0
4509624ccf Moves/updates simple_spec.rb into system 2021-10-15 10:23:29 +01:00
filipefurtad0
1fceeef12a Moves/updates list_spec.rb into system 2021-10-15 10:23:29 +01:00
filipefurtad0
3a3af86e02 Moves/updates _updating_specific_time into system 2021-10-15 10:23:29 +01:00
filipefurtad0
0ad7fd3527 Fixes string on assertion to pass as system spec 2021-10-15 10:23:29 +01:00
filipefurtad0
117fcefae2 Moves/updates complex_editing_spec into system 2021-10-15 10:23:29 +01:00
filipefurtad0
9417413506 Moves/updates _multiple_product_pages into system 2021-10-15 10:23:29 +01:00
filipefurtad0
e643a54829 Moves/updates _exchange_same_enterprise into system 2021-10-15 10:23:29 +01:00
filipefurtad0
e877a7693b Moves/updates _exchange_same_enterprise into system 2021-10-15 10:23:29 +01:00
filipefurtad0
e68186b1ff Moves/updates _specific_time_spec into system 2021-10-15 10:23:29 +01:00
filipefurtad0
9ba4a79e85 Moves/Updates zones_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
fcde3f8ee4 Moves/Updates terms_of_service_files_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
e4be81f76f Moves/Updates taxonomies_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
65e93c7010 Moves/Updates tax_rates_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
b5bcb71c0e Moves/Updates tax_categories_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
23e3ce2399 Moves/Updates states_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
06cc30230b Moves/Updates shipping_categories_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
559bd39760 Moves/Updates mail_methods_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
9a649574a6 Moves/Updates general_settings_spec into system 2021-10-15 10:19:00 +01:00
filipefurtad0
e50eefd1c9 Moves/Updates content_spec into system 2021-10-15 10:19:00 +01:00
dependabot[bot]
fcf4f67c2c Bump webdrivers from 4.6.1 to 4.7.0
Bumps [webdrivers](https://github.com/titusfortner/webdrivers) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/titusfortner/webdrivers/releases)
- [Changelog](https://github.com/titusfortner/webdrivers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/titusfortner/webdrivers/compare/v4.6.1...v4.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-15 09:03:19 +00:00
Adrien Chauve
ad56105d31 Display error messages on product image creation (not only edition) 2021-10-15 10:45:35 +02:00
Filipe
28b2fa2886 Merge pull request #8361 from mkllnk/fix-js-errors
Fix JS errors in system specs
2021-10-15 09:39:26 +01:00
dependabot[bot]
60db386020 Bump @storybook/addon-docs from 6.3.10 to 6.3.12
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.10 to 6.3.12.
- [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.3.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>
2021-10-15 06:20:03 +00:00
Maikel
bbb3a7856a Merge pull request #8352 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.12
Bump @storybook/server from 6.3.10 to 6.3.12
2021-10-15 17:17:35 +11:00
Maikel
26d9063feb Merge pull request #8342 from openfoodfoundation/dependabot/bundler/puma-5.5.2
Bump puma from 5.5.1 to 5.5.2
2021-10-15 16:59:29 +11:00
Maikel Linke
c89cf36831 Raise JavaScript errors within system specs (again)
Re-raising console errors helps us to find subtle bugs.
2021-10-15 16:34:56 +11:00
Maikel Linke
cef1092a2d Avoid state leakage from one spec to others
Activating Stripe meant that other specs were trying to load the Stripe
JS code without setting up Stripe correctly. That lead to JS errors in
the console.
2021-10-15 16:34:56 +11:00
Maikel
feceff8613 Merge pull request #8357 from filipefurtad0/remove_js_errors_on_system
Sets js_errors to false
2021-10-15 14:42:03 +11:00
filipefurtad0
ef68791fd6 Sets js_errors: to false and keeps headless; true
Sets js_errors to false

Sets headless to true
2021-10-14 14:11:36 +01:00
dependabot[bot]
3e32c94328 Bump @storybook/server from 6.3.10 to 6.3.12
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.10 to 6.3.12.
- [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.3.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>
2021-10-14 09:06:13 +00:00
Maikel
1efba73cb3 Merge pull request #8332 from jibees/update-yarn-lock-file
Update yarn.lock file
2021-10-14 16:49:19 +11:00
jibees
a9d4233af9 Merge pull request #8310 from mkllnk/raise-js-errors-in-system-specs
Raise JavaScript errors within system specs
2021-10-13 11:27:45 +02:00
dependabot[bot]
c56c04001d Bump puma from 5.5.1 to 5.5.2
Bumps [puma](https://github.com/puma/puma) from 5.5.1 to 5.5.2.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.5.1...v5.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-13 09:02:36 +00:00
Matt-Yorkley
2dfa3de11e Merge pull request #8341 from openfoodfoundation/dependabot/bundler/puma-5.5.1
Bump puma from 5.5.0 to 5.5.1
2021-10-12 21:13:21 +02:00
Transifex-Openfoodnetwork
e579b6b183 Updating translations for config/locales/en_FR.yml 2021-10-13 05:53:55 +11:00
Transifex-Openfoodnetwork
cb75850270 Updating translations for config/locales/en_FR.yml 2021-10-13 05:50:54 +11:00
Transifex-Openfoodnetwork
3217411a38 Updating translations for config/locales/fr.yml 2021-10-13 05:50:38 +11:00
dependabot[bot]
af65ff8d04 Bump puma from 5.5.0 to 5.5.1
Bumps [puma](https://github.com/puma/puma) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.5.0...v5.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-12 18:26:07 +00:00
Filipe
8aa7ef2e39 Merge pull request #8336 from jibees/8335-fix-flaky-embedded_shopfronts_spec
Move embedded_shopfronts_spec as system spec
2021-10-12 14:32:08 +01:00
Filipe
2d45e6b5b6 Merge pull request #8338 from jibees/8337-flaky-orders_spec
Move orders_spec.rb as system spec
2021-10-12 14:27:33 +01:00
Jean-Baptiste Bellet
059163c49d Move embedded_shopfronts_spec as system spec 2021-10-12 14:28:54 +02:00
Jean-Baptiste Bellet
d53ae3370d Move orders_spec.rb as system spec 2021-10-12 14:27:38 +02:00
Matt-Yorkley
ca5f18827a Merge pull request #8323 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.5
Bump mrujs from 0.5.4 to 0.5.5
2021-10-12 13:55:50 +02:00
Jean-Baptiste Bellet
ea94a228e8 Run yarn to update yarn.lock file
yarn.lock was somehow de-synchronized from package.json probably since https://github.com/openfoodfoundation/openfoodnetwork/pull/8300
2021-10-12 12:08:56 +02:00
Matt-Yorkley
2a09ba11a2 Merge pull request #8322 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.5
Bump jest from 27.2.4 to 27.2.5
2021-10-12 11:22:56 +02:00
Matt-Yorkley
adde85c8dd Merge pull request #8329 from mkllnk/checkout-spec
Expect content after page is loaded
2021-10-12 11:21:29 +02:00
dependabot[bot]
b79925fa58 Bump geocoder from 1.6.7 to 1.7.0
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.6.7 to 1.7.0.
- [Release notes](https://github.com/alexreisner/geocoder/releases)
- [Changelog](https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alexreisner/geocoder/compare/v1.6.7...v1.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-12 09:04:51 +00:00
Maikel
fff54d2aad Merge pull request #8321 from openfoodfoundation/dependabot/bundler/test-unit-3.4.8
Bump test-unit from 3.4.7 to 3.4.8
2021-10-12 16:09:37 +11:00
Maikel Linke
5a85fcd349 Expect content after page is loaded
The login action takes some time and the spec wasn't waiting for that. I
suspected a race condition when AngularJS is initialising form values
and we are expecting certain values.
2021-10-12 15:04:16 +11:00
Maikel
ccc73eb829 Merge pull request #8316 from jibees/5937-resolve-flaky-spec-on-shopping_spec
resolve flaky spec on shopping spec
2021-10-12 14:27:37 +11:00
Matt-Yorkley
3fe237b25d Merge pull request #8319 from filipefurtad0/account_folder_into_system_spec
Updates and moves consumer/account folder into system
2021-10-12 02:33:36 +02:00
Jean-Baptiste Bellet
0faab42c2a Fix Ruby 2.7 warning"Using the last argument as keyword parameters is deprecated;"
https://bloggie.io/@kinopyo/how-to-fix-ruby-2-7-warning-using-the-last-argument-as-keyword-parameters-is-deprecated
2021-10-11 14:56:11 +02:00
dependabot[bot]
ad99f80b12 Bump mrujs from 0.5.4 to 0.5.5
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.4 to 0.5.5.
- [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.4...v0.5.5)

---
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-11 09:07:19 +00:00
dependabot[bot]
91e5bac13a Bump jest from 27.2.4 to 27.2.5
Bumps [jest](https://github.com/facebook/jest) from 27.2.4 to 27.2.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.2.4...v27.2.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-10-11 09:06:38 +00:00
dependabot[bot]
99214e8c1f Bump test-unit from 3.4.7 to 3.4.8
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.7 to 3.4.8.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.7...3.4.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 09:03:11 +00:00
Maikel
dcc8dc7ead Merge pull request #8318 from filipefurtad0/fix_flaky_checkout_auth_spec
Fix flaky checkout auth spec
2021-10-11 17:18:03 +11:00
Maikel Linke
35ed7e852d Remove errornous quotes from alert text 2021-10-11 16:43:14 +11:00
Maikel Linke
b008116734 Cover alert text in spec
The `strip` method removes a trailing newline at the end.
2021-10-11 16:41:52 +11:00
Maikel Linke
02a19361fb Raise JavaScript errors within system specs
Re-raising console errors helps us to find subtle bugs.
2021-10-11 13:39:24 +11:00
Matt-Yorkley
7ab4c40a0a Merge pull request #8317 from filipefurtad0/fix_flaky_authentication_spec
Fix flaky consumer/authentication spec
2021-10-10 18:20:20 +02:00
filipefurtad0
75f773fafc Updates/moves consumer/account/settings_spec into system 2021-10-08 14:36:54 +01:00
filipefurtad0
acc0cc08c3 Updates/moves consumer/account/payments_spec into system 2021-10-08 14:31:03 +01:00
filipefurtad0
97a79a77e1 Updates/moves consumer/account/cards_spec into system 2021-10-08 14:29:41 +01:00
filipefurtad0
0d87aea9f5 Updates and moves checkout_auth_spec into system 2021-10-08 14:05:38 +01:00
filipefurtad0
a376c0b079 Updates cookie manipulation syntax to be Ferrum compliant 2021-10-08 10:28:02 +01:00
filipefurtad0
8f777b4d38 Updates authentication_spec.rb into system spec 2021-10-08 10:26:14 +01:00
Jean-Baptiste Bellet
3d87485cd3 Move shopping_spec.rb as a system spec
- Move the file to `spec/system/`
 - Replace `require 'spec_helper'` by `require 'system_helper'`
 - replace `feature` with `describe`
2021-10-08 11:06:54 +02:00
Jean-Baptiste Bellet
9bbccbbd46 Partials needs to be children of the columns div
And then have the right margins
2021-10-08 09:42:36 +02:00
Jean-Baptiste Bellet
0f7ba41896 Add the number of the step as a responsive span
that could be displayed or not (small screens)
2021-10-08 09:42:36 +02:00
Transifex-Openfoodnetwork
8c5dfea675 Updating translations for config/locales/en_US.yml 2021-10-08 12:28:21 +11:00
Matt-Yorkley
86404045f2 Update all locales with the latest Transifex translations 2021-10-07 19:04:55 +01:00
Matt-Yorkley
10fe61b71f Merge pull request #8285 from openfoodfoundation/transifex
Transifex
2021-10-07 20:01:07 +02:00
Transifex-Openfoodnetwork
1adcd61c88 Updating translations for config/locales/fr.yml 2021-10-08 03:18:25 +11:00
Transifex-Openfoodnetwork
452f4ec0b8 Updating translations for config/locales/en_FR.yml 2021-10-08 03:16:20 +11:00
Transifex-Openfoodnetwork
09b9c8e10d Updating translations for config/locales/fr.yml 2021-10-08 03:15:23 +11:00
Andy Brett
e4be521632 Merge pull request #8203 from YasuhiroYoshida/adjust-visibility-of-enterprises-on-hub
Change visibilities of hubs on group page
2021-10-07 08:00:37 -07:00
Andy Brett
40e701abcc Merge pull request #8280 from sinansonmez/50-make-home-page-labels-clickable
Make home page labels clickable
2021-10-07 07:59:52 -07:00
Nihal M. Kelanthodika
d85a109a21 Merge pull request #7973 from apricot12/HQ_address_in_business_details 2021-10-07 18:32:24 +05:30
Matt-Yorkley
bb43d82306 Merge pull request #8300 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.10
Bump @storybook/addon-controls from 6.3.9 to 6.3.10
2021-10-07 12:56:42 +02:00
Matt-Yorkley
f1b7e1b994 Merge pull request #8304 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.10
Bump @storybook/server from 6.3.9 to 6.3.10
2021-10-07 12:55:55 +02:00
dependabot[bot]
0ae87b2252 Bump @storybook/server from 6.3.9 to 6.3.10
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.9 to 6.3.10.
- [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.3.10/app/server)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 10:53:50 +00:00
dependabot[bot]
0f081422ee Bump @storybook/addon-controls from 6.3.9 to 6.3.10
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.9 to 6.3.10.
- [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.3.10/addons/controls)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 10:53:12 +00:00
Matt-Yorkley
ecac39b71f Merge pull request #8299 from openfoodfoundation/dependabot/bundler/bugsnag-6.24.0
Bump bugsnag from 6.23.0 to 6.24.0
2021-10-07 12:51:38 +02:00
Matt-Yorkley
aea07af23f Merge pull request #8298 from openfoodfoundation/dependabot/bundler/ddtrace-0.53.0
Bump ddtrace from 0.52.0 to 0.53.0
2021-10-07 12:51:25 +02:00
Matt-Yorkley
d44d6293d4 Merge pull request #8297 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.3
Bump rubocop-rails from 2.12.2 to 2.12.3
2021-10-07 12:50:59 +02:00
Matt-Yorkley
a0bea5baa9 Merge pull request #8302 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.10
Bump @storybook/addon-docs from 6.3.9 to 6.3.10
2021-10-07 12:49:37 +02:00
Matt-Yorkley
58f7955c16 Merge pull request #8306 from openfoodfoundation/revert-8301-dependabot/npm_and_yarn/stimulus-3.0.1
Revert "Bump stimulus from 2.0.0 to 3.0.1"
2021-10-07 12:42:04 +02:00
Matt-Yorkley
200bf36604 Revert "Bump stimulus from 2.0.0 to 3.0.1" 2021-10-07 12:41:51 +02:00
Matt-Yorkley
4ecb646965 Merge pull request #8305 from openfoodfoundation/revert-8303-dependabot/npm_and_yarn/webpack-cli-4.9.0
Revert "Bump webpack-cli from 3.3.12 to 4.9.0"
2021-10-07 12:41:30 +02:00
Matt-Yorkley
9282d8e1e0 Revert "Bump webpack-cli from 3.3.12 to 4.9.0" 2021-10-07 12:41:14 +02:00
Matt-Yorkley
ba99824def Merge pull request #8301 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.0.1
Bump stimulus from 2.0.0 to 3.0.1
2021-10-07 12:40:54 +02:00
Matt-Yorkley
87c679b7cc Merge pull request #8303 from openfoodfoundation/dependabot/npm_and_yarn/webpack-cli-4.9.0
Bump webpack-cli from 3.3.12 to 4.9.0
2021-10-07 12:39:08 +02:00
dependabot[bot]
832347a253 Bump webpack-cli from 3.3.12 to 4.9.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.9.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:06:54 +00:00
dependabot[bot]
9f1e1ee270 Bump @storybook/addon-docs from 6.3.9 to 6.3.10
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.9 to 6.3.10.
- [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.3.10/addons/docs)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:06:21 +00:00
dependabot[bot]
a619d7b61d Bump stimulus from 2.0.0 to 3.0.1
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 2.0.0 to 3.0.1.
- [Release notes](https://github.com/stimulusjs/stimulus/releases)
- [Changelog](https://github.com/hotwired/stimulus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stimulusjs/stimulus/compare/v2.0.0...v3.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:05:58 +00:00
dependabot[bot]
a384af6d0e Bump bugsnag from 6.23.0 to 6.24.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.23.0 to 6.24.0.
- [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.23.0...v6.24.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:04:48 +00:00
dependabot[bot]
820b7df63c Bump ddtrace from 0.52.0 to 0.53.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.52.0 to 0.53.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.52.0...v0.53.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:04:07 +00:00
dependabot[bot]
55ac7ffe5b Bump rubocop-rails from 2.12.2 to 2.12.3
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.2 to 2.12.3.
- [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.2...v2.12.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 09:03:21 +00:00
Andy Brett
fc7a25e287 Merge pull request #8290 from openfoodfoundation/dependabot/bundler/ffaker-2.20.0
Bump ffaker from 2.19.0 to 2.20.0
2021-10-06 10:55:23 -07:00
Andy Brett
5db1228aa6 Merge pull request #8278 from filipefurtad0/checkout_spec_into_system
Updates checkout_spec into system
2021-10-06 08:12:56 -07:00
Andy Brett
5da1c2f7bd Merge pull request #8288 from mkllnk/pending-changes
Translate "Save Changes"
2021-10-06 08:06:48 -07:00
Matt-Yorkley
805e12cffe Merge pull request #8291 from openfoodfoundation/dependabot/bundler/json-2.5.1
Bump json from 1.8.6 to 2.5.1
2021-10-06 11:48:44 +02:00
Nihal M. Kelanthodika
82d9b041c9 Remove unnecessary spaces and newlines 2021-10-06 15:06:57 +05:30
Nihal M. Kelanthodika
f7124ee327 Add business address form feature spec 2021-10-06 15:06:57 +05:30
Nihal M. Kelanthodika
c632442466 Update unused company field to 'unused' 2021-10-06 15:06:56 +05:30
Nihal M. Kelanthodika
b0dcf47481 Add translation for "Reset Form" button 2021-10-06 15:06:56 +05:30
Nihal M. Kelanthodika
06344ed7c4 Remove comments 2021-10-06 15:06:56 +05:30
Jean-Baptiste Bellet
aa58318723 Create a Reset form button that destroy the form itself
- Thanks to the input hidden field. Its value is false, but when clicking on Reset form, this value changes to 'true' (and then the form is cleared)
2021-10-06 15:06:56 +05:30
Jean-Baptiste Bellet
9b6cc187b6 Remove clear form checkbox (used via _destroy) 2021-10-06 15:06:56 +05:30
Jean-Baptiste Bellet
802c5c8c94 Create a secondary form button 2021-10-06 15:06:56 +05:30
Jean-Baptiste Bellet
786b198f4d Create an updateinput controller
- that update the targets input value to the value stored in data attribute
 - Add tests
2021-10-06 15:06:56 +05:30
Jean-Baptiste Bellet
49e93a6125 Add StimulusJS controllers via webpacker for the admin 2021-10-06 15:06:56 +05:30
Nihal
f6e66de52b Update phone validation to simple validation 2021-10-06 15:06:56 +05:30
Nihal
7eb0c6c33c Add module to set unused ship, bill address fields 2021-10-06 15:06:56 +05:30
Nihal
f72f182363 Redo business_address_empty? method 2021-10-06 15:06:56 +05:30
Nihal
912b869407 Re-order country/state selector 2021-10-06 15:06:56 +05:30
Nihal
5f1a326a05 Add before_validation callback to set unused addressed fields in customer, order, user, subscription, enterprise_group 2021-10-06 15:06:56 +05:30
Nihal
372326debc Updated validation to include phone and edit address_spec to requires phone 2021-10-06 15:06:56 +05:30
Nihal
c120965a8d Fix translations 2021-10-06 15:06:56 +05:30
Nihal M. Kelanthodika
c6219a47c3 Remove stray space 2021-10-06 15:06:56 +05:30
Nihal
90038ff250 Add test coverage for business_address association in enterprise model 2021-10-06 15:06:56 +05:30
Nihal Mohammed
496319b539 Reject changes to business_address if fields are empty 2021-10-06 15:06:56 +05:30
Nihal Mohammed
a7a45769d6 Update enterprises_controller and schema 2021-10-06 15:06:56 +05:30
Nihal Mohammed
7ef6671e37 Add tooltip for business address
Fix schema
2021-10-06 15:06:56 +05:30
Nihal Mohammed
9cd0314ab3 Fix business address title and border 2021-10-06 15:06:56 +05:30
Nihal Mohammed
1c72cd799d Permit :id attribute in PermittedAttributes:BusinessAddress 2021-10-06 15:06:56 +05:30
Nihal Mohammed
3cd5ed58c0 Add checkbox to clear business_address form 2021-10-06 15:06:56 +05:30
Nihal Mohammed
32d8ce78ef Re-add :country validation to spree_address model 2021-10-06 15:06:56 +05:30
Nihal Mohammed
f5743b3b36 Update invoice templates to use business address when form filled in 2021-10-06 15:06:56 +05:30
Nihal M. Kelanthodika
ed8edf0ab9 Update business_address form
Removes `{ "ng-controller" => "countryCtrl" }` from column element as its now on the parent div.

Co-authored-by: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
2021-10-06 15:06:56 +05:30
Matt-Yorkley
8393414bf5 Adapt admin enterprise form handling for both address and business_address 2021-10-06 15:06:56 +05:30
Nihal Mohammed
83524f2285 Update en.yml to include translations for business_address form 2021-10-06 15:06:56 +05:30
Nihal Mohammed
7096667c6f Add business_address form to business details section 2021-10-06 15:06:56 +05:30
Nihal Mohammed
26c7cb2bd3 Fix business_address attribute permissions 2021-10-06 15:06:56 +05:30
Nihal Mohammed
9007418455 Set belongs_to association for business_address and accept nested attributes on enterprise model 2021-10-06 15:06:56 +05:30
Nihal Mohammed
e3307fd341 Migration to add business_address_id to enterpries 2021-10-06 15:06:50 +05:30
Nihal Mohammed
56c02a2e99 Add business_address to build_resource method in enterprise_controller 2021-10-06 15:06:20 +05:30
Nihal Mohammed
783b055d55 Add business address permitted attributes 2021-10-06 15:06:20 +05:30
dependabot[bot]
8c244f2a6e Bump json from 1.8.6 to 2.5.1
Bumps [json](https://github.com/flori/json) from 1.8.6 to 2.5.1.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v1.8.6...v2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 09:04:17 +00:00
dependabot[bot]
2860576d09 Bump ffaker from 2.19.0 to 2.20.0
Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.19.0 to 2.20.0.
- [Release notes](https://github.com/ffaker/ffaker/releases)
- [Changelog](https://github.com/ffaker/ffaker/blob/main/Changelog.md)
- [Commits](https://github.com/ffaker/ffaker/compare/v2.19.0...v2.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 09:02:50 +00:00
Matt-Yorkley
b53047e0e3 Merge pull request #8287 from mkllnk/fix-variant-filter
Catch JS error on OC page
2021-10-06 10:35:02 +02:00
Maikel Linke
5b9d5a6bce Avoid console error by catching potential fails 2021-10-06 15:51:43 +11:00
Maikel Linke
eb87cdeb1c Enable translation for "Save Changes" on customers page 2021-10-06 15:51:35 +11:00
Maikel Linke
129c4c92fa Catch JS error on OC page
Calling `when variant.id in enterprise_rules` raised an error when
enterprise_rules was null.

Fixing this then revealed a missing require statement in a controller.
2021-10-06 15:29:41 +11:00
Maikel Linke
e41a0504b7 Fix coffescript typo 2021-10-06 15:22:11 +11:00
Maikel Linke
75731ed546 Avoid superfluous permalink check on site load 2021-10-06 15:22:02 +11:00
filipefurtad0
6025d43f0d Updates checkout_spec into system 2021-10-06 13:34:59 +11:00
Andy Brett
7a49b304d1 Merge pull request #8279 from Matt-Yorkley/orphaned-adjustments
Orphaned adjustments handing
2021-10-05 17:19:58 -07:00
Andy Brett
c8419940bf Merge pull request #8264 from filipefurtad0/orders_spec_update_2
Orders spec update
2021-10-05 15:50:03 -07:00
Andy Brett
4169faccf9 Merge pull request #8283 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.4
Bump mrujs from 0.5.3 to 0.5.4
2021-10-05 15:35:34 -07:00
Maikel
ddd0034fff Merge pull request #8267 from filipefurtad0/fix_negative_assertion
Switches assertion order
2021-10-06 09:33:30 +11:00
filipefurtad0
18ff3f52b7 Moves spec from feature into system folder 2021-10-06 09:15:02 +11:00
filipefurtad0
076907d56b Changes spec config from feature into system 2021-10-06 09:15:02 +11:00
filipefurtad0
5c881431d3 Switches assertions order 2021-10-06 09:15:02 +11:00
Andy Brett
f3ef3bb052 Merge pull request #8270 from achauve/8161-fix-sorting-admin-orders-by-total
Fix sorting admin orders by total
2021-10-05 14:44:59 -07:00
Andy Brett
9b9db3202e Merge pull request #8277 from sinansonmez/8223-remove-ask-checkbox
Ask checkboxes are removed from two pages
2021-10-05 14:44:27 -07:00
Andy Brett
ce63d02a3d Merge pull request #8262 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.4
Bump jest from 27.2.3 to 27.2.4
2021-10-05 14:42:14 -07:00
Matt-Yorkley
19daf1d2fb Update adjustment unit tests 2021-10-05 22:40:37 +01:00
dependabot[bot]
765b6831a9 Bump mrujs from 0.5.3 to 0.5.4
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.5.3 to 0.5.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.5.3...v0.5.4)

---
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-05 21:39:40 +00:00
Andy Brett
c2c9684e66 Merge pull request #8240 from mkllnk/fix-serializer-spec
Load referenced lib class for independent spec run
2021-10-05 14:34:40 -07:00
Andy Brett
a06326d15f Merge pull request #8239 from mkllnk/fix-reports-spec
Fix order dependent reports spec
2021-10-05 14:34:05 -07:00
Andy Brett
ec0bb63b42 Merge pull request #8179 from filipefurtad0/feature_into_system
Feature into system specs
2021-10-05 14:27:29 -07:00
Andy Brett
6aa24e4db3 Merge pull request #8248 from Matt-Yorkley/npm-pins
Pin webpack packages to respective major versions
2021-10-05 14:25:40 -07:00
Transifex-Openfoodnetwork
474651a20a Updating translations for config/locales/fr_CA.yml 2021-10-06 08:14:55 +11:00
Transifex-Openfoodnetwork
cf82a87c0b Updating translations for config/locales/en_CA.yml 2021-10-06 07:56:29 +11:00
Sinan Chaush
01ee2070eb producer id is used to select the producer 2021-10-05 21:35:18 +02:00
Matt-Yorkley
9bd89ec1ce Merge pull request #8261 from Matt-Yorkley/bump-aws-sdk
Bump aws-sdk to 2.2.0
2021-10-05 19:43:49 +02:00
Matt-Yorkley
05ba7df54f Merge pull request #8263 from Matt-Yorkley/inventory-only-setting
Fix display of "inventory only" radio buttons
2021-10-05 19:21:55 +02:00
Matt-Yorkley
17c31a22bc Merge pull request #8260 from Matt-Yorkley/paperclip-uri-deprecation
Fix deprecation in Paperclip
2021-10-05 19:20:26 +02:00
Sinan Chaush
771ee7b3dc classes are removed from the texts 2021-10-05 17:30:56 +02:00
Nihal M. Kelanthodika
4052aba00e Merge pull request #8245 from apricot12/Migrate-Migs-Payment-Method 2021-10-05 18:07:46 +05:30
dependabot[bot]
7c0b0bebf7 Bump jest from 27.2.3 to 27.2.4
Bumps [jest](https://github.com/facebook/jest) from 27.2.3 to 27.2.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.2.3...v27.2.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-10-04 20:09:36 +00:00
Andy Brett
5499d777aa Merge pull request #8276 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.9
Bump @storybook/addon-docs from 6.3.8 to 6.3.9
2021-10-04 13:03:45 -07:00
dependabot[bot]
af133930c8 Bump @storybook/addon-docs from 6.3.8 to 6.3.9
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.8 to 6.3.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.3.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-10-04 19:22:41 +00:00
Sinan Chaush
2de8ba5e8d make home page labels clickable 2021-10-04 21:11:12 +02:00
Andy Brett
407c4de406 Merge pull request #8272 from openfoodfoundation/dependabot/bundler/jwt-2.3.0
Bump jwt from 2.2.3 to 2.3.0
2021-10-04 11:37:43 -07:00
Andy Brett
ebb52510b5 Merge pull request #8275 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.9
Bump @storybook/addon-controls from 6.3.8 to 6.3.9
2021-10-04 11:22:05 -07:00
Andy Brett
291e2ca968 Merge pull request #8274 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.9
Bump @storybook/server from 6.3.8 to 6.3.9
2021-10-04 11:21:35 -07:00
Andy Brett
3b930fe6f7 Merge pull request #8273 from openfoodfoundation/dependabot/bundler/rubocop-1.22.1
Bump rubocop from 1.22.0 to 1.22.1
2021-10-04 11:21:01 -07:00
Matt-Yorkley
65f08ee8f4 Deal with edge cases where an adjustment is left referencing a deleted item 2021-10-04 17:55:27 +01:00
Sinan Chaush
7dc8500aa9 ask checkbox is removed from two pages 2021-10-04 17:08:32 +02:00
dependabot[bot]
3b55486172 Bump @storybook/addon-controls from 6.3.8 to 6.3.9
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.8 to 6.3.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.3.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-10-04 09:07:53 +00:00
dependabot[bot]
d88bceebef Bump @storybook/server from 6.3.8 to 6.3.9
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.8 to 6.3.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.3.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-10-04 09:07:17 +00:00
dependabot[bot]
12f367f47f Bump rubocop from 1.22.0 to 1.22.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.22.0 to 1.22.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.22.0...v1.22.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 09:03:48 +00:00
dependabot[bot]
fc1efe4d05 Bump jwt from 2.2.3 to 2.3.0
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.2.3...v2.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 09:03:11 +00:00
Sinan Chaush
70000db52c when creating a product, preselect the supplier if there is only one 2021-10-03 11:51:41 +02:00
Adrien Chauve
45eefb627d Fix sorting orders by total in admin/ via api/v0/orders 2021-10-01 18:32:59 +02:00
Adrien Chauve
f256bb7d28 Add new failing test on sorting orders by total (api/v0/orders) 2021-10-01 18:32:59 +02:00
Yasuhiro Yoshida
768acc4166 Add scope to only allow visible enterprises in group 2021-10-01 15:22:00 +03:00
Yasuhiro Yoshida
ace8c8768f Remove ng-if to filter out invisible enterprises from group 2021-10-01 15:21:13 +03:00
Matt-Yorkley
43f28d94b9 Update all locales with the latest Transifex translations 2021-09-30 18:22:16 +01:00
Matt-Yorkley
61fa251f6a Merge pull request #8252 from openfoodfoundation/transifex
Transifex
2021-09-30 19:00:49 +02:00
Matt-Yorkley
cb65c7c2ef Fix deprecation warning in Paperclip
Fixes deprecation warnings in Paperclip::UrlGenerator#escape_url

On a side note: we shouldn't be using Paperclip at all, and should migrate to ActiveStorage.
2021-09-30 17:29:54 +01:00
filipefurtad0
6aed6f186d Adds assertion on filtering by completion date 2021-09-30 17:29:43 +01:00
filipefurtad0
258f797680 Adds assertion on filtering by distributors 2021-09-30 17:01:25 +01:00
filipefurtad0
07e92d343c Adds assertion on displaying complete but empty orders 2021-09-30 16:22:42 +01:00
filipefurtad0
4ba69850be Adds assertion on en/dis-abling the Print Invoices button 2021-09-30 15:45:03 +01:00
filipefurtad0
3ee1cc9578 Adds assertion on en/dis-abling the Print Invoices button 2021-09-30 15:43:01 +01:00
Matt-Yorkley
76c9f38fb6 Fix display of "inventory only" radio buttons
Previously the two radio buttons were not showing which option was set; both options were blank even if one had been selected.
2021-09-30 13:30:23 +01:00
Matt-Yorkley
88a92381aa Bump aws-sdk to 2.2.0 2021-09-29 22:03:59 +01:00
Matt-Yorkley
0170351597 Merge pull request #8254 from openfoodfoundation/dependabot/npm_and_yarn/mrujs-0.5.3
Bump mrujs from 0.4.13 to 0.5.3
2021-09-29 13:54:09 +02:00
Matt-Yorkley
df7bad2cb2 Merge pull request #8241 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.0.1
Bump @hotwired/turbo from 7.0.0-rc.5 to 7.0.1
2021-09-29 13:30:51 +02:00
Matt-Yorkley
802d637b34 Merge pull request #8259 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.3
Bump jest from 27.2.2 to 27.2.3
2021-09-29 12:38:56 +02:00
Matt-Yorkley
868bb78bae Merge pull request #8258 from openfoodfoundation/dependabot/bundler/rubocop-1.22.0
Bump rubocop from 1.21.0 to 1.22.0
2021-09-29 12:38:37 +02:00
Transifex-Openfoodnetwork
e26e6e8d8b Updating translations for config/locales/ru.yml 2021-09-29 20:29:57 +10:00
dependabot[bot]
a9c02a3fce Bump jest from 27.2.2 to 27.2.3
Bumps [jest](https://github.com/facebook/jest) from 27.2.2 to 27.2.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.2.2...v27.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-29 09:06:46 +00:00
dependabot[bot]
ac4d3a91da Bump rubocop from 1.21.0 to 1.22.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.21.0...v1.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-29 09:03:06 +00:00
Andy Brett
5e658eb9dd Update all locales with the latest Transifex translations 2021-09-28 09:21:09 -07:00
filipefurtad0
81890a4e21 Replaces 'background' with 'before' (squashing)
Replaces 'background' with 'before'

Replaces 'background' with 'before' in other files

Fixes typo on products_spec.rb
2021-09-28 11:22:35 +01:00
dependabot[bot]
f7884d4929 Bump mrujs from 0.4.13 to 0.5.3
Bumps [mrujs](https://github.com/ParamagicDev/mrujs) from 0.4.13 to 0.5.3.
- [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.4.13...v0.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 09:07:07 +00:00
Transifex-Openfoodnetwork
2079bf549d Updating translations for config/locales/nb.yml 2021-09-28 11:28:18 +10:00
Transifex-Openfoodnetwork
1abca497b7 Updating translations for config/locales/en_IE.yml 2021-09-28 11:25:12 +10:00
Maikel
c9d36e6f5c Merge pull request #8204 from meronokbay/6942-fix-payment-method-fee-bug-all
Fix payment method fee bug for all calculator types
2021-09-28 08:39:05 +10:00
filipefurtad0
6f694e2cab Standardise spec block naming
The `feature` and `scenario` names are aliases only available in feature
specs and not needed. It's confusing to have different names and we can
easily move feature specs to system specs when using standard names.
2021-09-28 08:24:05 +10:00
Matt-Yorkley
0f4c8d8ecc Merge pull request #8251 from openfoodfoundation/dependabot/bundler/nokogiri-1.12.5
Bump nokogiri from 1.12.4 to 1.12.5
2021-09-27 23:13:06 +02:00
dependabot[bot]
6553136d2d Bump nokogiri from 1.12.4 to 1.12.5
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.12.4 to 1.12.5.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.12.4...v1.12.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 20:40:40 +00:00
Matt-Yorkley
9cbdc8293d Merge pull request #8244 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.2
Bump jest from 27.2.1 to 27.2.2
2021-09-27 21:36:15 +02:00
Nihal
2ad234d5aa Migrate Migs to Check 2021-09-27 21:10:57 +05:30
Matt-Yorkley
c0f7d2638b Pin webpack packages to respective major versions
Hopefully Dependabot will respect these pins...

Syntax reference: https://github.com/npm/node-semver#advanced-range-syntax
2021-09-27 15:13:21 +01:00
Matt-Yorkley
6d1d688b1d Merge pull request #8215 from openfoodfoundation/transifex
Transifex
2021-09-27 15:04:24 +02:00
dependabot[bot]
af1e26e9e1 Bump jest from 27.2.1 to 27.2.2
Bumps [jest](https://github.com/facebook/jest) from 27.2.1 to 27.2.2.
- [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.2.1...v27.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 09:07:54 +00:00
dependabot[bot]
692a21dcaf Bump @hotwired/turbo from 7.0.0-rc.5 to 7.0.1
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.0.0-rc.5 to 7.0.1.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.0.0-rc.5...v7.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 09:06:32 +00:00
Maikel Linke
f17cf1f1f4 Load referenced lib class for independent spec run
This spec file tried to access a class without loading the code. That
worked in usual spec runs when other specs were run first which
loaded the whole lib directory.
2021-09-27 17:21:35 +10:00
Maikel Linke
cb2c6835c4 Standardise default country and state
The OFN software was first written in Melbourne and a lot of spec code
relies on the state Victoria being in the database. When we imported
Spree code, it came with its default state Alabame in the USA. Having
two different defaults is confusing and caused specs to fail in rare
circumstances. Let's standardise it here which will also open the path
to removing the seeding of test data and the exclusion of states and
countries in the database cleaner.
2021-09-27 16:37:50 +10:00
Maikel Linke
a91bb6e355 Fix order dependent reports spec
Depending on the order of spec execution, it was possible that a factory
created the default state "Alabama" with the default country "USA"
instead of using the usual seed data of "Victoria" in "Australia". Some
specs rely on "Victoria" though and we now make sure that it's created
even if another spec created another country first.
2021-09-27 11:01:00 +10:00
Andy Brett
6a50f68b52 Merge pull request #8217 from filipefurtad0/orders_spec_update
Orders page spec update
2021-09-24 13:41:06 -07:00
Andy Brett
a137bdd00e Merge pull request #8220 from openfoodfoundation/dependabot/npm_and_yarn/tmpl-1.0.5
Bump tmpl from 1.0.4 to 1.0.5
2021-09-24 13:24:31 -07:00
Andy Brett
b593ef78ea Merge pull request #8226 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.0.0-rc.5
Bump @hotwired/turbo from 7.0.0-rc.4 to 7.0.0-rc.5
2021-09-24 13:23:00 -07:00
Andy Brett
9e5bc9ba0c Merge pull request #8222 from jibees/8221-show-order-with-line-items-and-finalized-ones
Show orders with line items + finalized orders
2021-09-24 13:21:09 -07:00
dependabot[bot]
1953d2164b Bump @hotwired/turbo from 7.0.0-rc.4 to 7.0.0-rc.5
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.0.0-rc.4 to 7.0.0-rc.5.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.0.0-rc.4...v7.0.0-rc.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-24 09:09:18 +00:00
Jean-Baptiste Bellet
e82e93e1cc Update test to add more case with finalized order with no line items
Those empty order but finalized must be returned by the API
2021-09-23 11:06:58 +02:00
Jean-Baptiste Bellet
78bbee49e9 Search for orders that are finalized
Thus, we display the orders that contains at least one line item (whatever its state) + the finalized orders

NB // Finalized state : complete canceled resumed awaiting_return returned
2021-09-23 11:06:15 +02:00
Maikel
5b5693dc26 Merge pull request #8180 from jibees/7504-resolve-rounded-errors
Avoid rounded with float numbers errors with javascript
2021-09-23 09:56:03 +10:00
Nihal M. Kelanthodika
f170b4241d Merge pull request #8168 from apricot12/7799-Enterprise-Fee-Report 2021-09-22 20:39:06 +05:30
Maikel
bdc7444422 Merge pull request #8213 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.1
Bump jest from 27.2.0 to 27.2.1
2021-09-22 18:13:42 +10:00
Maikel
53ffdaf6de Merge pull request #8212 from openfoodfoundation/dependabot/bundler/bootsnap-1.9.1
Bump bootsnap from 1.9.0 to 1.9.1
2021-09-22 18:13:00 +10:00
dependabot[bot]
37c6f11e05 Bump bootsnap from 1.9.0 to 1.9.1
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.9.0...v1.9.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 08:10:45 +00:00
Maikel
45fad30f7b Merge pull request #8211 from openfoodfoundation/dependabot/bundler/bugsnag-6.23.0
Bump bugsnag from 6.22.1 to 6.23.0
2021-09-22 18:09:24 +10:00
Maikel
3e689b46d0 Merge pull request #8209 from openfoodfoundation/dependabot/bundler/puma-5.5.0
Bump puma from 5.4.0 to 5.5.0
2021-09-22 17:10:42 +10:00
Maikel
98db38b0cc Merge pull request #8190 from openfoodfoundation/dependabot/npm_and_yarn/rails/webpacker-5.4.3
Bump @rails/webpacker from 5.4.2 to 5.4.3
2021-09-22 17:04:58 +10:00
Maikel
7348ceca64 Merge pull request #8189 from openfoodfoundation/dependabot/bundler/webpacker-5.4.3
Bump webpacker from 5.4.2 to 5.4.3
2021-09-22 17:04:02 +10:00
dependabot[bot]
ea21469ff6 Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 06:34:42 +00:00
filipefurtad0
6000d4c985 Declares variables with let! avoiding repedition (DRY) 2021-09-21 16:33:17 +01:00
filipefurtad0
f2bd45162b Updates base_spec_helper.rb to make system specs work 2021-09-21 16:00:41 +01:00
filipefurtad0
536d4b9894 Updates orders_spec.rb into system spec 2021-09-21 15:58:45 +01:00
Transifex-Openfoodnetwork
17d7270a32 Updating translations for config/locales/nb.yml 2021-09-21 21:31:51 +10:00
dependabot[bot]
a259444129 Bump jest from 27.2.0 to 27.2.1
Bumps [jest](https://github.com/facebook/jest) from 27.2.0 to 27.2.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.2.0...v27.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 09:06:34 +00:00
dependabot[bot]
5c3e03b86b Bump bugsnag from 6.22.1 to 6.23.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.22.1 to 6.23.0.
- [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.22.1...v6.23.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 09:03:35 +00:00
dependabot[bot]
62fd374262 Bump puma from 5.4.0 to 5.5.0
Bumps [puma](https://github.com/puma/puma) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.4.0...v5.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 09:02:31 +00:00
Maikel
02a10ede15 Merge pull request #7938 from dacook/product-image-import
Add script to import product images from URL
2021-09-20 16:57:23 +10:00
Maikel
58c0d30af3 Merge pull request #8207 from openfoodfoundation/revert-8064-Kill_stripe_connect
Revert "Kill stripe connect"
2021-09-20 08:59:16 +10:00
Maikel Linke
4336350140 Updates from Transifex 2021-09-20 08:54:17 +10:00
Maikel
a3c31f7d86 Revert "Kill stripe connect" 2021-09-20 08:39:34 +10:00
Meron Ogbai
cd992ee866 Validate preferred values all calculators 2021-09-17 18:50:29 +03:00
Andy Brett
6ee9daf768 Merge pull request #8198 from openfoodfoundation/dependabot/bundler/bootsnap-1.9.0
Bump bootsnap from 1.8.1 to 1.9.0
2021-09-17 08:50:08 -07:00
Meron Ogbai
957f834694 Rename preferred amount to preferred value 2021-09-17 18:49:57 +03:00
Yasuhiro Yoshida
8090945c34 Change visibilities of hubs on group page
Issue:
https://github.com/openfoodfoundation/openfoodnetwork/issues/5106

Hubs on group page for consumers are displayed unconditionally.
But they should only appear under the following conditions: Visible.

In addition, those that are active should only be filled with red color
when they have open order cycles.

This commit apply these rules and changes the visibility of each hub on
"Our Hubs" tab of group page for consumers accordingly.
2021-09-17 17:12:08 +03:00
Meron Ogbai
d73df78f43 Extract gateway_params to a private method 2021-09-17 16:48:53 +03:00
dependabot[bot]
d086f7694a Bump bootsnap from 1.8.1 to 1.9.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.8.1...v1.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 09:02:52 +00:00
dependabot[bot]
b2fb0366f7 Bump @rails/webpacker from 5.4.2 to 5.4.3
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: "@rails/webpacker"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 08:53:44 +00:00
Matt-Yorkley
f4c86a1b51 Merge pull request #8061 from Matt-Yorkley/turbo-checkout
Split Checkout new toys
2021-09-17 10:48:59 +02:00
Matt-Yorkley
02bcb7bcc7 Merge pull request #8192 from Matt-Yorkley/orders-path-issue
Fix order_path issue in cart page
2021-09-16 16:16:36 +02:00
Matt-Yorkley
d55a3f3340 Bump Turbo 2021-09-16 14:12:31 +01:00
Matt-Yorkley
47346e9f2c Uncomment ActionCable in application.rb
We're not directly utilising it yet, but CableReady expects it to be loaded.
2021-09-15 18:52:24 +01:00
Andy Brett
f28200164b Merge pull request #8154 from meronokbay/8098-custom-modal-order-deletion
Replaced the default alert and confirm modals in the order page by custom modals
2021-09-15 09:22:58 -07:00
Andy Brett
6e674b47ac Merge pull request #8153 from sinansonmez/6140-change-profile-link-based-on-enterprise-profile
update profile link based on enterprise profile
2021-09-15 09:22:03 -07:00
Matt-Yorkley
0c879dc4c9 Fix order_path issue in cart page
The order_path route wasn't being inferred correctly from this Spree controller, causing errors to be thrown in the cart page if the number of editable orders was precisely one:

ActionView::Template::Error: undefined method `order_path'
2021-09-15 10:54:59 +01:00
dependabot[bot]
a1f7d8753b Bump webpacker from 5.4.2 to 5.4.3
Bumps [webpacker](https://github.com/rails/webpacker) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.2...v5.4.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 09:03:58 +00:00
Nihal M. Kelanthodika
9d216f0cea Merge pull request #8160 from apricot12/8019-Delivery_report
Show order total in Delivery/Payment Method reports instead of first …
2021-09-15 13:11:43 +05:30
Maikel
16aeb16519 Merge pull request #8172 from openfoodfoundation/dependabot/bundler/activemerchant-1.123.0
Bump activemerchant from 1.121.0 to 1.123.0
2021-09-15 17:14:29 +10:00
Andy Brett
2f5f2a03dd Merge pull request #8182 from openfoodfoundation/dependabot/bundler/test-unit-3.4.7
Bump test-unit from 3.4.6 to 3.4.7
2021-09-14 11:02:48 -07:00
Andy Brett
8c78316718 Merge pull request #8181 from openfoodfoundation/dependabot/bundler/rubocop-1.21.0
Bump rubocop from 1.20.0 to 1.21.0
2021-09-14 11:02:19 -07:00
dependabot[bot]
841a7a31fa Bump test-unit from 3.4.6 to 3.4.7
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.6...3.4.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 09:03:26 +00:00
dependabot[bot]
6d9173deba Bump rubocop from 1.20.0 to 1.21.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.20.0 to 1.21.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.20.0...v1.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 09:02:19 +00:00
Jean-Baptiste Bellet
ba09618374 Avoid rounded with float numbers errors with javascript
0.7/0.001 = 699.9999999999999

Use Math.round() to avoid this.
2021-09-14 10:45:31 +02:00
Andy Brett
82a8eed652 Merge pull request #8165 from openfoodfoundation/dependabot/bundler/view_component-2.40.0
Bump view_component from 2.39.0 to 2.40.0
2021-09-13 15:26:55 -07:00
Andy Brett
77ca05ebe5 Merge pull request #8175 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.2.0
Bump jest from 27.1.1 to 27.2.0
2021-09-13 15:26:31 -07:00
Andy Brett
da912d2fdf Merge pull request #8173 from openfoodfoundation/dependabot/bundler/test-unit-3.4.6
Bump test-unit from 3.4.5 to 3.4.6
2021-09-13 15:26:08 -07:00
Andy Brett
297dc56fe5 Merge pull request #8174 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.2
Bump rubocop-rails from 2.12.0 to 2.12.2
2021-09-13 15:25:45 -07:00
dependabot[bot]
b0b91c959e Bump jest from 27.1.1 to 27.2.0
Bumps [jest](https://github.com/facebook/jest) from 27.1.1 to 27.2.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.1.1...v27.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:09:54 +00:00
dependabot[bot]
a7e9acd435 Bump rubocop-rails from 2.12.0 to 2.12.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.0 to 2.12.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.0...v2.12.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:05:04 +00:00
dependabot[bot]
d75b03debd Bump test-unit from 3.4.5 to 3.4.6
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.5 to 3.4.6.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.5...3.4.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:04:26 +00:00
dependabot[bot]
685a3eb14f Bump activemerchant from 1.121.0 to 1.123.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.121.0 to 1.123.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.121.0...v1.123.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 09:02:43 +00:00
Nihal
757b7513ef Migrate Pin gateway peyments to check 2021-09-11 16:52:32 +05:30
Meron Ogbai
94ff59ebab Make order spec click clearer 2021-09-11 13:37:14 +03:00
Meron Ogbai
a065a92616 Reorganize alert and confirm code 2021-09-11 13:36:28 +03:00
Meron Ogbai
aed84912a3 Use selector to get del element 2021-09-11 13:10:33 +03:00
Andy Brett
1ec9cce439 Merge pull request #8163 from mkllnk/migration-specs
Remove problematic migration spec
2021-09-10 10:32:29 -07:00
Nihal M. Kelanthodika
5811b6e3d1 Merge pull request #8064 from apricot12/Kill_stripe_connect
Kill stripe connect
2021-09-10 22:57:00 +05:30
Nihal
98a879a0e9 Restore removed spec to profile_storer_spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
98ff3980f8 Migration of StripeConnect to StripeSCA 2021-09-10 14:43:34 +05:30
Nihal Mohammed
eb17c208f9 Update stripe_stubs to handle stripeSCA 2021-09-10 14:43:34 +05:30
Nihal Mohammed
fa9f6432c3 Fix profile_storer.rb and profile_storer_spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
6ac835de2e Fix response for payment_profile_id in profile_storer.rb 2021-09-10 14:43:34 +05:30
Nihal Mohammed
696d434979 Removed stripe connect example and fixed JSON generation in profile_storer spec 2021-09-10 14:43:34 +05:30
Nihal Mohammed
48c1312cea Remove expectation to generate clean name for StripeConnect from payment_method_spec 2021-09-10 14:43:34 +05:30
Luis Ramos
0c240cee9a A few more removals of stripe connect related code 2021-09-10 14:43:34 +05:30
Luis Ramos
f90e34bb47 Adapt specs to use stripe_sca_payment_method factory and delete stripe_connect_payment_method 2021-09-10 14:43:34 +05:30
Luis Ramos
9de9b41575 Remove stripe connect spec, there's a similar spec for stripesca below 2021-09-10 14:43:34 +05:30
Luis Ramos
60a8ae6675 Remove Stripe Connect gateway and related code 2021-09-10 14:43:24 +05:30
Luis Ramos
5434b51f75 Switch filter to StripeSCA, this must have been an error, must be tested (manually or automatically) 2021-09-10 14:41:06 +05:30
dependabot[bot]
93118f9c32 Bump view_component from 2.39.0 to 2.40.0
Bumps [view_component](https://github.com/github/view_component) from 2.39.0 to 2.40.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.39.0...v2.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 09:02:41 +00:00
Nihal
43e6d1b933 Show order total in Delivery/Payment Method reports instead of first payment 2021-09-10 13:08:00 +05:30
Maikel Linke
10c2a1c55c Remove problematic migration spec
Unfortunately, loading the migration code also reloads some Spree models
which causes errors later on. Another spec was failing with:

  1) full-page cart viewing the cart when a product is soft-deleted shows the cart without errors
     Failure/Error: variant.instance_variable_set :@hub, @hub

     FrozenError:
       can't modify frozen NilClass: nil
     # ./lib/open_food_network/scope_variant_to_hub.rb:12:in `instance_variable_set'

The command to reproduce was:

rspec ./spec/features/consumer/shopping/cart_spec.rb[1:1:3:1]\
 ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb[1:1:1:1] --seed 0

I couldn't find a quick solution to make the migration not use app code.
Since the migration is a historical record now, it doesn't need repeated
testing.
2021-09-10 16:19:40 +10:00
Maikel
9affc6a945 Merge pull request #8108 from Matt-Yorkley/andand
Remove `andand` gem
2021-09-10 15:06:00 +10:00
Maikel Linke
e013d81e3d Simplify safe navigation operator use < and [] 2021-09-10 14:40:46 +10:00
Andy Brett
6fea506e05 Update all locales with the latest Transifex translations 2021-09-09 17:52:29 -07:00
Andy Brett
069cb043ee Merge pull request #8148 from jibees/5236-remove-incomplete-orders-from-admin-interface-2
Only shows order that actually have at least one line_item V2
2021-09-09 16:49:30 -07:00
Andy Brett
46a3214bc6 Merge pull request #8157 from openfoodfoundation/dependabot/bundler/spring-3.0.0
Bump spring from 2.1.1 to 3.0.0
2021-09-09 16:47:42 -07:00
Andy Brett
392ba6f3d1 Merge pull request #7975 from vishaldeepak/mail-customer-information
Add customer information to mail when we notify producers when required
2021-09-09 16:10:46 -07:00
Sinan Chaush
868187aaaf create helper to select correct url 2021-09-09 22:22:25 +02:00
Andy Brett
9124e03c11 Merge pull request #8144 from meronokbay/6942-fix-payment-method-fee-bug
6942 fix payment method fee bug
2021-09-09 09:28:40 -07:00
Sinan Sonmez (Chaush)
12c154934d Update app/views/spree/admin/overview/single_enterprise_dashboard.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2021-09-09 16:29:28 +02:00
Matt-Yorkley
fe57484c03 Merge pull request #8159 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.1.1
Bump jest from 27.1.0 to 27.1.1
2021-09-09 14:05:59 +02:00
Matt-Yorkley
29d2fc34ab Merge pull request #8158 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.12.0
Bump rubocop-rails from 2.11.3 to 2.12.0
2021-09-09 14:05:35 +02:00
Matt-Yorkley
b352476301 Update app/models/proxy_order.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-09-09 13:39:08 +02:00
dependabot[bot]
f3af4e586c Bump jest from 27.1.0 to 27.1.1
Bumps [jest](https://github.com/facebook/jest) from 27.1.0 to 27.1.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.1.0...v27.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:06:27 +00:00
dependabot[bot]
43f276596a Bump rubocop-rails from 2.11.3 to 2.12.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.3 to 2.12.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.3...v2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:03:55 +00:00
dependabot[bot]
dc75c5139a Bump spring from 2.1.1 to 3.0.0
Bumps [spring](https://github.com/rails/spring) from 2.1.1 to 3.0.0.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v2.1.1...v3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 09:03:34 +00:00
Meron Ogbai
4eda15fb71 Expect custom modal instead of alert in order spec 2021-09-09 11:57:56 +03:00
Meron Ogbai
95e294c9ec Use custom modals for deleting orders 2021-09-09 06:25:03 +03:00
Meron Ogbai
4806ba540f Add modals in orders page 2021-09-09 06:23:39 +03:00
Meron Ogbai
2de75ef7f4 Remove default rails confirm behavior 2021-09-09 06:22:55 +03:00
Meron Ogbai
d4f7b318e7 Add haml and css for custom modals 2021-09-09 06:21:14 +03:00
Andy Brett
f8486bcbf8 Merge pull request #7769 from Matt-Yorkley/payment-status-checking
Stripe: payment status debugging
2021-09-08 15:21:38 -07:00
Andy Brett
afa1861181 pass payment to Stripe Validator instead of the status object 2021-09-08 12:26:56 -07:00
Sinan Chaush
f883e66c96 update profile link based on enterprise profile 2021-09-08 21:10:12 +02:00
Andy Brett
de29d7e7d7 Merge pull request #8125 from jibees/5782-add-i18n-for-devise
Add devise-i18n and handle i18nization for devise controllers
2021-09-08 11:48:12 -07:00
Matt-Yorkley
44b870d248 Bump MRUJS and update syntax for new plugin architecture 2021-09-08 19:39:52 +01:00
Andy Brett
26e973828f Merge pull request #8151 from Matt-Yorkley/codecov-tasks
Remove Codecov upload tasks
2021-09-08 11:11:43 -07:00
Matt-Yorkley
48d4341e2d Merge pull request #8112 from cillian/eager-load-permissions-with-enterprise-relationships
Eager load the EnterpriseRelationship :permissions association on the enterprise permissions page
2021-09-08 19:46:14 +02:00
Matt-Yorkley
1d5077061e Remove andand
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Matt-Yorkley
2d2e0a5b24 Add unit test for not_empty scope 2021-09-08 12:18:08 +01:00
Matt-Yorkley
b53371d870 Fix not_empty scope 2021-09-08 12:14:53 +01:00
Matt-Yorkley
2b95ede1a2 Merge pull request #8115 from pacodelaluna/update-docker-configuration
Update Docker configuration to support sidekiq and webpacker
2021-09-08 12:06:08 +02:00
Matt-Yorkley
ef02197bab Remove Codecov upload tasks 2021-09-08 10:48:28 +01:00
Matt-Yorkley
086c5ab264 Replace directive with data-confirm 2021-09-08 10:34:34 +01:00
Matt-Yorkley
8bf3f72ad3 Extract CableCar responses code to a concern 2021-09-08 10:34:34 +01:00
Matt-Yorkley
5ef34347a3 Implement optional non-Angular flash messages 2021-09-08 10:34:34 +01:00
Matt-Yorkley
e48b9d84e5 Extract boilerplate code 2021-09-08 10:34:34 +01:00
Matt-Yorkley
03abc395f2 Update responses to use cable_ready 2021-09-08 10:34:34 +01:00
Matt-Yorkley
7fa9457550 Add cable_ready 2021-09-08 10:34:34 +01:00
Matt-Yorkley
edb599b426 Disable Turbo page caching 2021-09-08 10:34:34 +01:00
Matt-Yorkley
062a3abc2d Enable Turbo in the new checkout 2021-09-08 10:34:34 +01:00
Matt-Yorkley
6b028ba849 Disable Turbo site-wide 2021-09-08 10:34:34 +01:00
Matt-Yorkley
23779fd5e4 Include progressbar for mrujs form submissions 2021-09-08 10:34:34 +01:00
Matt-Yorkley
20ff594014 Set data-remote on checkout form 2021-09-08 10:34:34 +01:00
Matt-Yorkley
9be73a8ff1 Respond with HTTP error code on update failure 2021-09-08 10:34:34 +01:00
Matt-Yorkley
10f6368524 Add Angular teardown 2021-09-08 10:34:34 +01:00
Matt-Yorkley
a23171ea51 Compile Webpacker assets only once in test environment 2021-09-08 10:34:34 +01:00
Matt-Yorkley
658f0eccbb Replace ng-app with explicit Angular bootstrapping and move scripts to head 2021-09-08 10:34:34 +01:00
Jean-Baptiste Bellet
7656f5d20f Add an order with no line_items, should not be returned by API 2021-09-08 10:44:04 +02:00
Jean-Baptiste Bellet
9c86adf0f4 Add line_items to each orders
Now, API returns only orders with line_items: add to each in specs.
2021-09-08 10:43:59 +02:00
Matt-Yorkley
b29d88be25 Add progress bar styling 2021-09-08 00:05:04 +01:00
Matt-Yorkley
79efa50a34 Add Turbo and MRUJS 2021-09-08 00:05:04 +01:00
Andy Brett
3ef427aa7d Merge pull request #8076 from jibees/8009-handling-shipping-adress
Split Checkout: Handle shipping address
2021-09-07 11:15:52 -07:00
Jean-Baptiste Bellet
0ec35b1f0d Only shows order that actually have at least one line_item
Filter inside the API to shows only orders that have at least one line items
2021-09-07 17:25:46 +02:00
Matt-Yorkley
b4278aabbf Merge branch 'master' into 8009-handling-shipping-adress 2021-09-07 09:44:49 +02:00
jibees
a16430d10c Merge pull request #6 from Matt-Yorkley/8009-handling-shipping-adress
8009-handling-shipping-adress: REDUX
2021-09-07 09:03:22 +02:00
Andy Brett
ee546ffdd6 Merge pull request #8146 from Matt-Yorkley/dev-log-level
Make log_level more easily configurable in development
2021-09-06 18:05:39 -07:00
Matt-Yorkley
3bcfc673f7 Ensure selected shipping method is actually selected
Hashes with symbol keys != hashes with string keys 🙈
2021-09-06 20:58:22 +01:00
Matt-Yorkley
78e28c517b Make log_level more easily configurable in development 2021-09-06 19:13:00 +01:00
Matt-Yorkley
fb7a3a681b Validate attributes per checkout step and decouple order-advancing 2021-09-06 14:25:16 +01:00
Matt-Yorkley
71412f8d4b Update validations 2021-09-06 14:22:28 +01:00
Matt-Yorkley
c3b52ef00a Remove payments validation 2021-09-06 14:19:35 +01:00
Matt-Yorkley
cfee804339 Improve concern loading
It shouldn't need `require` or `prepend`
2021-09-06 14:19:13 +01:00
Matt-Yorkley
e3e53b1504 Ensure feature toggle works for non-logged-in users 2021-09-05 22:39:47 +01:00
Matt-Yorkley
70513ae989 Don't transition to address before page load 2021-09-05 20:19:22 +01:00
Meron Ogbai
5ca552d380 Show flash error if preferred amount isn't valid 2021-09-05 01:11:12 +03:00
Meron Ogbai
712c204bca Add error message in en.yml 2021-09-05 01:09:03 +03:00
Andy Brett
3e0509d232 Merge pull request #8141 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.8
Bump @storybook/addon-controls from 6.3.7 to 6.3.8
2021-09-04 12:16:46 -07:00
dependabot[bot]
ed2f555d84 Bump @storybook/addon-controls from 6.3.7 to 6.3.8
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.8/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-09-04 18:07:53 +00:00
Andy Brett
c0eb71f67f Merge pull request #8138 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.8
Bump @storybook/addon-docs from 6.3.7 to 6.3.8
2021-09-04 11:03:22 -07:00
dependabot[bot]
585f5a4cfa Bump @storybook/addon-docs from 6.3.7 to 6.3.8
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.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-09-04 17:22:07 +00:00
Andy Brett
8b00807a20 Merge pull request #8110 from openfoodfoundation/dependabot/bundler/bootsnap-1.8.1
Bump bootsnap from 1.7.7 to 1.8.1
2021-09-04 10:13:23 -07:00
Andy Brett
7600838490 Merge pull request #8116 from openfoodfoundation/dependabot/bundler/paper_trail-12.1.0
Bump paper_trail from 12.0.0 to 12.1.0
2021-09-04 10:11:23 -07:00
Andy Brett
4cddd031aa Merge pull request #8137 from openfoodfoundation/dependabot/bundler/test-unit-3.4.5
Bump test-unit from 3.4.4 to 3.4.5
2021-09-04 10:10:19 -07:00
Andy Brett
a9e53272c6 Merge pull request #8139 from openfoodfoundation/dependabot/npm_and_yarn/jest-27.1.0
Bump jest from 27.0.6 to 27.1.0
2021-09-04 10:10:02 -07:00
Andy Brett
85f893c7ed Merge pull request #8140 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.8
Bump @storybook/server from 6.3.7 to 6.3.8
2021-09-04 10:09:37 -07:00
dependabot[bot]
c9a631df2a Bump @storybook/server from 6.3.7 to 6.3.8
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.7 to 6.3.8.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.3.8/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.8/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-09-04 10:23:28 +00:00
dependabot[bot]
d47a089bfb Bump jest from 27.0.6 to 27.1.0
Bumps [jest](https://github.com/facebook/jest) from 27.0.6 to 27.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.0.6...v27.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 10:22:06 +00:00
dependabot[bot]
dbafbd6391 Bump test-unit from 3.4.4 to 3.4.5
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.4 to 3.4.5.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.4...3.4.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 10:13:33 +00:00
Andy Brett
75f827aee9 Merge pull request #8120 from openfoodfoundation/dependabot/bundler/test-prof-1.0.7
Bump test-prof from 1.0.6 to 1.0.7
2021-09-03 17:35:32 -07:00
Andy Brett
b2f8d978c6 Merge pull request #8107 from openfoodfoundation/dependabot/bundler/rubocop-1.20.0
Bump rubocop from 1.19.1 to 1.20.0
2021-09-03 12:05:28 -07:00
Matt-Yorkley
54987dd622 Merge pull request #8099 from jibees/8097-test-stimulus
Add jest and stimulusjs testing
2021-09-03 16:16:16 +02:00
Jean-Baptiste Bellet
ec4d5bd9a2 Remove babel warning 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
149c0d4de4 Add yarn jest to the github workflow 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
7cdf09322c First test for toggle_controller 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
310c3c4005 Define each file to be tested by jest 2021-09-03 14:14:25 +02:00
Jean-Baptiste Bellet
195464361d Install needed dependencies 2021-09-03 14:14:25 +02:00
Matt-Yorkley
86da71d6c0 Update all locales with the latest Transifex translations 2021-09-03 10:33:33 +01:00
Matt-Yorkley
fe99a5cc55 Merge pull request #8129 from Matt-Yorkley/searchable
Searchable attributes
2021-09-03 09:43:25 +02:00
Matt-Yorkley
72d494c640 Merge pull request #8127 from Matt-Yorkley/session-uri-parsing
Strip subdomains from session cookie host
2021-09-03 09:38:11 +02:00
Matt-Yorkley
fbdc38b6c4 Merge pull request #8111 from jibees/4582-remove-units-on-quantity-column-
Display variant quantity on the quantity column on the edit order page in backoffice
2021-09-02 20:45:22 +02:00
Matt-Yorkley
0459071ce3 Set RAILS_ENV=test in test suite 2021-09-02 17:29:26 +01:00
Matt-Yorkley
dc8939c35f Strip subdomains from session cookie host 2021-09-02 17:29:26 +01:00
vishaldeepak
b13b2b9b95 Customer Information on mail show be displayed depending on order cycle coordinator's customer names flag 2021-09-02 18:59:28 +05:30
Matt-Yorkley
3fc0278776 Whitelist searchable attributes on primary models 2021-09-02 14:06:15 +01:00
Matt-Yorkley
b25759670e Implement ransackable whitelisting 2021-09-02 13:43:22 +01:00
Jean-Baptiste Bellet
97fd7e3d78 Improve look and feel by adding some responsive margins 2021-09-01 17:16:30 +02:00
Jean-Baptiste Bellet
1b7c36664e Add missing i18n key for Devise
and update tests as well:
 - from feature to system
 - Add the reset password scenario
 - Add some errors scenario to the reset password scenario: token expired, token invalid, and not the same password
2021-09-01 17:16:29 +02:00
Matt-Yorkley
fd8de65749 Merge pull request #8123 from openfoodfoundation/dependabot/bundler/view_component-2.39.0
Bump view_component from 2.38.0 to 2.39.0
2021-09-01 16:52:05 +02:00
Matt-Yorkley
cab470bd86 Merge pull request #8122 from openfoodfoundation/dependabot/npm_and_yarn/tar-6.1.11
Bump tar from 6.1.5 to 6.1.11
2021-09-01 16:51:00 +02:00
Matt-Yorkley
9d6e5e9420 Remove currently unused code 2021-09-01 15:04:53 +01:00
Matt-Yorkley
1fca7d2a6c Remove error-clearing from edit action 2021-09-01 15:04:53 +01:00
Matt-Yorkley
4cff185b4b Extract params handling to service 2021-09-01 15:04:53 +01:00
Matt-Yorkley
57504f42d8 Move validations to state transitions 2021-09-01 15:04:53 +01:00
Matt-Yorkley
6acb1f6484 Tidy up view variables 2021-09-01 15:04:33 +01:00
Matt-Yorkley
9800483433 Simplify displaying selected shipping method 2021-09-01 15:04:33 +01:00
Matt-Yorkley
b7e1882bd8 Simplify setting address params 2021-09-01 15:04:33 +01:00
Matt-Yorkley
3fabe308cd Extract #shipping_and_billing_match? helper 2021-09-01 15:04:33 +01:00
Matt-Yorkley
ac4d721de0 Extract #set_payment_amount method 2021-09-01 15:04:33 +01:00
Matt-Yorkley
2786fb30ba Simplify order advancing process 2021-09-01 15:04:33 +01:00
Matt-Yorkley
978c882ed9 Don't select a random shipping method in Shipment 2021-09-01 15:04:33 +01:00
Matt-Yorkley
3dd8ed85b4 Implement manual shipping method selection 2021-09-01 14:16:32 +01:00
Matt-Yorkley
ebe2923512 Improve form outputs and error handling 2021-09-01 14:16:32 +01:00
Jean-Baptiste Bellet
19d7ca70b4 Add devise-i18n gem to handle i18nization inside devise controllers 2021-09-01 12:10:07 +02:00
dependabot[bot]
6d16b66a76 Bump view_component from 2.38.0 to 2.39.0
Bumps [view_component](https://github.com/github/view_component) from 2.38.0 to 2.39.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.38.0...v2.39.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-01 09:03:48 +00:00
dependabot[bot]
cd75fcf6c2 Bump tar from 6.1.5 to 6.1.11
Bumps [tar](https://github.com/npm/node-tar) from 6.1.5 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.5...v6.1.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 23:01:16 +00:00
Matt-Yorkley
aaf45afbfe Merge pull request #8090 from Matt-Yorkley/session-storage
Allow sessions to work across subdomains
2021-08-31 22:11:44 +02:00
dependabot[bot]
1bebe96df6 Bump test-prof from 1.0.6 to 1.0.7
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.6...v1.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 09:03:23 +00:00
Andy Brett
fba7699d0b select shipping method when advancing to payment 2021-08-31 11:00:54 +02:00
Jean-Baptiste Bellet
a1438f91e9 Display error on email (triggered by advance_order_state method) 2021-08-31 11:00:54 +02:00
Andy Brett
69ec17ef92 do not require phone number on orders 2021-08-31 10:59:13 +02:00
Matt-Yorkley
c72e0f7268 Merge pull request #8117 from openfoodfoundation/dependabot/bundler/rack-mini-profiler-2.3.3
Bump rack-mini-profiler from 2.3.2 to 2.3.3
2021-08-31 10:15:30 +02:00
dependabot[bot]
2554083557 Bump rack-mini-profiler from 2.3.2 to 2.3.3
Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases)
- [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.3.2...v2.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 09:03:59 +00:00
dependabot[bot]
ae46863d77 Bump paper_trail from 12.0.0 to 12.1.0
Bumps [paper_trail](https://github.com/airblade/paper_trail) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/airblade/paper_trail/releases)
- [Changelog](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airblade/paper_trail/compare/v12.0.0...v12.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 09:02:50 +00:00
François Turbelin
9aba846112 Add webpacker config 2021-08-29 21:49:26 +02:00
François Turbelin
4e03874e2b Update the jobs starter with sidekiq command 2021-08-29 21:49:26 +02:00
Andy Brett
ca7da94fd8 Merge pull request #8088 from jibees/8087-select-unselect-orders-in-admin
Handle select/unselect all orders in the admin orders page
2021-08-28 11:34:20 -07:00
Jean-Baptiste Bellet
5c05be22f5 As it is a quantity column, display variant quantity
(this column was confused, and was understood like a simply quantity column not the item quantity separated according to its "state")

Update specs as well
2021-08-27 15:15:14 +02:00
Cillian O'Ruanaidh
e1478e3ae8 Eager load the EnterpriseRelationship :permissions association on the enterprise permissions page
For #8028
2021-08-27 12:01:25 +01:00
dependabot[bot]
56f9c24527 Bump bootsnap from 1.7.7 to 1.8.1
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.7 to 1.8.1.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.7...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-27 09:02:52 +00:00
Andy Brett
e833921d2f Merge pull request #8106 from andrewpbrett/remove-codecov
Remove codecov
2021-08-26 10:37:49 -07:00
Andy Brett
2d511c6d18 Merge pull request #8044 from apricot12/Undo_reversing_of_email_copy_paste
Allow copy paste of email from contact tab and footer without reversing
2021-08-26 10:02:09 -07:00
Andy Brett
3fcce8574e Merge pull request #8040 from guidoDutra/7627-prevent-removing-last-item-in-order
Prevent removing last item in order
2021-08-26 10:01:42 -07:00
dependabot[bot]
dd0a162a47 Bump rubocop from 1.19.1 to 1.20.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.19.1 to 1.20.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.19.1...v1.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 09:02:03 +00:00
Jean-Baptiste Bellet
748a37f670 Terms and conditions error message 2021-08-26 09:28:31 +02:00
Jean-Baptiste Bellet
44ab87961a i18nize the global error message 2021-08-26 09:28:31 +02:00
Andy Brett
3fad554dbd remove codecov 2021-08-25 17:24:11 -07:00
Andy Brett
bee1b1a097 respect checkbox for ship address same as bill address 2021-08-25 15:22:25 -07:00
Andy Brett
759c5d6bdd don't override existing addresses on order with AddressFinder 2021-08-25 13:11:48 -07:00
Jean-Baptiste Bellet
b5024c5a16 On summary page, display shipping address as well as billing one 2021-08-25 16:31:45 +02:00
Jean-Baptiste Bellet
642e822e0e button is rounded 2021-08-25 15:58:55 +02:00
Jean-Baptiste Bellet
10ddaf4384 Last step (ie. summary) is larger than the two previous step 2021-08-25 15:53:22 +02:00
Jean-Baptiste Bellet
75390d2a48 Specify right i18n key 2021-08-25 15:29:24 +02:00
Jean-Baptiste Bellet
82ea33e9ca Do not display ship address form if not needed
ie. the shipping method does not require any address
2021-08-25 11:10:47 +02:00
vishaldeepak
813deb49a4 Add customer information to mail when we notify producers when required 2021-08-25 08:29:54 +05:30
Matt-Yorkley
c0cd68a747 Merge pull request #8084 from openfoodfoundation/dependabot/bundler/pagy-4.11.0
Bump pagy from 4.10.2 to 4.11.0
2021-08-24 23:48:13 +02:00
Andy Brett
50395d3142 Merge pull request #8096 from openfoodfoundation/dependabot/bundler/sidekiq-6.2.2
Bump sidekiq from 6.2.1 to 6.2.2
2021-08-24 13:25:59 -07:00
Andy Brett
d86148420a improve shipping_method_id handling 2021-08-24 12:29:48 -07:00
Andy Brett
7dd2c09641 ensure terms are accepted before order is placed 2021-08-24 12:29:23 -07:00
Andy Brett
3414d9f057 clear errors on ship address as well 2021-08-24 12:15:20 -07:00
Andy Brett
71076d36a1 favor dig to protect against nils 2021-08-24 11:54:02 -07:00
Andy Brett
c02b5ccd85 Fix typo in translation 2021-08-24 11:47:05 -07:00
Andy Brett
ea6739d565 guard against a nil value for @order.user 2021-08-24 11:46:50 -07:00
Andy Brett
874e1d7f02 only advance order to payment if no payment exists 2021-08-24 11:23:08 -07:00
Andy Brett
417770e716 guard against nil when populating ship address 2021-08-24 11:22:20 -07:00
Andy Brett
ea695105b5 populate ship address with bill address if no ship address 2021-08-24 10:57:36 -07:00
dependabot[bot]
43072dcfcd Bump sidekiq from 6.2.1 to 6.2.2
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.2.1...v6.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-24 09:04:07 +00:00
jibees
13e32149c1 Merge pull request #8093 from openfoodfoundation/dependabot/bundler/webpacker-5.4.2
Bump webpacker from 5.4.0 to 5.4.2
2021-08-24 10:33:13 +02:00
jibees
6766801aed Merge pull request #8094 from openfoodfoundation/dependabot/npm_and_yarn/rails/webpacker-5.4.2
Bump @rails/webpacker from 5.4.0 to 5.4.2
2021-08-24 10:32:46 +02:00
Andy Brett
1399171cc2 Merge pull request #8085 from openfoodfoundation/dependabot/bundler/webdrivers-4.6.1
Bump webdrivers from 4.6.0 to 4.6.1
2021-08-23 13:23:16 -07:00
Andy Brett
185493f846 Merge pull request #8077 from openfoodfoundation/dependabot/bundler/codecov-0.6.0
Bump codecov from 0.5.2 to 0.6.0
2021-08-23 13:22:18 -07:00
Andy Brett
4b79ee5f68 Merge pull request #8078 from openfoodfoundation/dependabot/bundler/rubocop-1.19.1
Bump rubocop from 1.19.0 to 1.19.1
2021-08-23 13:22:04 -07:00
Andy Brett
e8873ccb4f Merge pull request #8092 from filipefurtad0/improve_oc_spec
Sets OC-times in relation to the Zone time
2021-08-23 12:29:53 -07:00
Jean-Baptiste Bellet
9fd126ca0f The ship address is filled from bill address for some attributes
firstname, lastname and phone are the same between those two address. Fill it automatically.
2021-08-23 15:42:29 +02:00
Jean-Baptiste Bellet
1ecfeca88c Populate view with both shipping_method_id & ship_address_same_as_billing
... and then handle correctly the display of the form
2021-08-23 15:23:53 +02:00
dependabot[bot]
031b93af5e Bump @rails/webpacker from 5.4.0 to 5.4.2
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/v5.4.2/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: "@rails/webpacker"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 09:06:00 +00:00
dependabot[bot]
9aa6cf7804 Bump webpacker from 5.4.0 to 5.4.2
Bumps [webpacker](https://github.com/rails/webpacker) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.4.0...v5.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 09:02:13 +00:00
Jean-Baptiste Bellet
fe65359d71 Display no shipping method selected error 2021-08-23 10:16:53 +02:00
jibees
67f04856a8 Merge pull request #8083 from openfoodfoundation/dependabot/bundler/rails-6.1.4.1
Bump rails from 6.1.4 to 6.1.4.1
2021-08-23 09:42:15 +02:00
Matt-Yorkley
39372f7bd7 Update cookies policy notes and related spec
The session cookie is now named `_ofn_session_id` instead of `_session_id`.
2021-08-22 15:57:43 +01:00
Matt-Yorkley
1d472d0dec Add Rack Middleware for transitioning existing sessions
This checks if the current request has been submitted using the old session key (_session_id) and transparently migrates the session id to a new session cookie with the new settings and the new key (_ofn_session_id).
2021-08-22 15:57:43 +01:00
Matt-Yorkley
e6ac57ac3a Migrate session cookies to new setup
Currently sessions set on (www.openfoodnetwork.xxx) are not usable on the bare domain (openfoonetwork.xxx). When transitioning from one to the other, the user's session is completely lost.

This change means sessions on subdomains (including www) will be transferable.
2021-08-22 15:53:41 +01:00
filipefurtad0
cd16e8527c Sets OC-times in relation to the Zone time 2021-08-21 19:13:26 +01:00
Matt-Yorkley
697a073330 Merge pull request #8060 from Matt-Yorkley/script-split
Maps and AMS conditional loading
2021-08-21 16:35:46 +02:00
Andy Brett
3bee30ac60 clear error messages on order and bill address on first load 2021-08-20 09:18:08 -07:00
Jean-Baptiste Bellet
26c5361b0a set shipping method only if param is present 2021-08-20 09:18:08 -07:00
Jean-Baptiste Bellet
8fe0a82b75 Change ng-click to ng-change to capture ng-model updated value
- Create a feature test for this feature
2021-08-20 15:18:09 +02:00
Nihal Mohammed
92ecdb4163 Add Angular directive to undo reverse of email 2021-08-20 18:34:42 +05:30
dependabot[bot]
bd190145f6 Bump webdrivers from 4.6.0 to 4.6.1
Bumps [webdrivers](https://github.com/titusfortner/webdrivers) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/titusfortner/webdrivers/releases)
- [Changelog](https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/titusfortner/webdrivers/compare/v4.6.0...v4.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:04:50 +00:00
dependabot[bot]
d41cd695a8 Bump pagy from 4.10.2 to 4.11.0
Bumps [pagy](https://github.com/ddnexus/pagy) from 4.10.2 to 4.11.0.
- [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/4.10.2...4.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:03:47 +00:00
dependabot[bot]
3f6251fa29 Bump rails from 6.1.4 to 6.1.4.1
Bumps [rails](https://github.com/rails/rails) from 6.1.4 to 6.1.4.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4...v6.1.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 09:02:58 +00:00
Nihal Mohammed
d2dcfa5848 Undo changes 2021-08-20 13:15:44 +05:30
Andy Brett
138b7824ba remove ship address if shipping method does not require it 2021-08-19 10:18:11 -07:00
Andy Brett
dd00c30503 fill ship address with bill address if checkbox is checked 2021-08-19 10:17:51 -07:00
Andy Brett
c07046e2f6 return an error if no shipping method is selected 2021-08-19 10:16:46 -07:00
dependabot[bot]
b3deaa65f6 Bump rubocop from 1.19.0 to 1.19.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.19.0...v1.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 09:03:16 +00:00
dependabot[bot]
26143980b3 Bump codecov from 0.5.2 to 0.6.0
Bumps [codecov](https://github.com/codecov/codecov-ruby) from 0.5.2 to 0.6.0.
- [Release notes](https://github.com/codecov/codecov-ruby/releases)
- [Changelog](https://github.com/codecov/codecov-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-ruby/compare/v0.5.2...v0.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 09:02:23 +00:00
Jean-Baptiste Bellet
402bfdac30 Show/Hide shipping address form depending on the checkbox/radio state 2021-08-19 10:34:07 +02:00
Jean-Baptiste Bellet
c806b3e889 Be more generic: address is enough
as it could be billing or shipping address
2021-08-19 10:33:16 +02:00
Andy Brett
68311f8fa4 Merge pull request #8073 from openfoodfoundation/dependabot/bundler/pagy-4.10.2
Bump pagy from 4.10.1 to 4.10.2
2021-08-18 09:47:37 -07:00
Guido Oliveira
b1cd163900 Prevent removing last item in order 2021-08-18 12:00:32 -03:00
dependabot[bot]
828e06b271 Bump pagy from 4.10.1 to 4.10.2
Bumps [pagy](https://github.com/ddnexus/pagy) from 4.10.1 to 4.10.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/4.10.1...4.10.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-08-18 09:01:48 +00:00
Andy Brett
f783926deb Merge pull request #8063 from openfoodfoundation/dependabot/bundler/bullet-6.1.5
Bump bullet from 6.1.4 to 6.1.5
2021-08-17 10:30:00 -07:00
Andy Brett
28c1ba1ad4 Merge pull request #8062 from openfoodfoundation/dependabot/bundler/ffaker-2.19.0
Bump ffaker from 2.18.0 to 2.19.0
2021-08-17 10:29:18 -07:00
Andy Brett
dd84e428e3 Merge pull request #8031 from openfoodfoundation/dependabot/bundler/stripe-5.38.0
Bump stripe from 5.37.0 to 5.38.0
2021-08-17 08:41:03 -07:00
dependabot[bot]
79d45513a5 Bump bullet from 6.1.4 to 6.1.5
Bumps [bullet](https://github.com/flyerhzm/bullet) from 6.1.4 to 6.1.5.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/6.1.4...6.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-17 09:03:46 +00:00
dependabot[bot]
099a4e682d Bump ffaker from 2.18.0 to 2.19.0
Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.18.0 to 2.19.0.
- [Release notes](https://github.com/ffaker/ffaker/releases)
- [Changelog](https://github.com/ffaker/ffaker/blob/main/Changelog.md)
- [Commits](https://github.com/ffaker/ffaker/compare/v2.18.0...v2.19.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-17 09:02:15 +00:00
jibees
1ab7cb517f Merge pull request #8058 from Matt-Yorkley/n-plus-ones
Fix some N+1s
2021-08-17 10:02:20 +02:00
Matt-Yorkley
63dc188d5e Merge pull request #8032 from Matt-Yorkley/order-confirm
Split checkout backend
2021-08-16 23:12:06 +02:00
Andy Brett
36cbe7b2ce Merge pull request #8041 from openfoodfoundation/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-08-16 12:59:43 -07:00
Andy Brett
ea848f51e7 Merge pull request #8043 from openfoodfoundation/dependabot/bundler/rubocop-1.19.0
Bump rubocop from 1.18.4 to 1.19.0
2021-08-16 12:58:21 -07:00
Andy Brett
f575cba75c Merge pull request #8042 from openfoodfoundation/dependabot/bundler/view_component-2.38.0
Bump view_component from 2.37.0 to 2.38.0
2021-08-16 12:57:57 -07:00
Matt-Yorkley
7f7ba35c01 Merge pull request #8052 from openfoodfoundation/dependabot/bundler/rspec-rails-5.0.2
Bump rspec-rails from 5.0.1 to 5.0.2
2021-08-16 18:09:06 +02:00
dependabot[bot]
ec818e3571 Bump rspec-rails from 5.0.1 to 5.0.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v5.0.1...v5.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 14:58:21 +00:00
Matt-Yorkley
08123c7ea9 Merge pull request #8014 from openfoodfoundation/dependabot/bundler/puma-5.4.0
Bump puma from 5.3.2 to 5.4.0
2021-08-16 16:57:04 +02:00
Matt-Yorkley
744bd9d1be Only load Google Maps JS where it's actually needed 2021-08-16 15:31:00 +01:00
Matt-Yorkley
28bf71e77e Fix N+1 in CachedEnterpriseSerializer 2021-08-16 14:58:52 +01:00
Matt-Yorkley
20a3940605 Fix N+1 in #items_bought_by_user 2021-08-16 14:58:52 +01:00
Matt-Yorkley
a98e4417c0 Only inject taxons and properties AMS data in pages where it's actually needed 2021-08-16 13:22:06 +01:00
Matt-Yorkley
b94c586bc5 Merge pull request #7992 from jibees/7959-populate-hub-for-packing-report
Add appropriate distributors and suppliers to the packing report
2021-08-14 12:38:35 +02:00
dependabot[bot]
a48e6f6c1b Bump stripe from 5.37.0 to 5.38.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.37.0 to 5.38.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.37.0...v5.38.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-14 08:47:42 +00:00
Matt-Yorkley
5c4a225180 Merge pull request #8026 from Matt-Yorkley/angular-update
Angular version bump
2021-08-14 10:46:24 +02:00
Andy Brett
b20382ed56 Merge pull request #8022 from openfoodfoundation/dependabot/bundler/ddtrace-0.52.0
Bump ddtrace from 0.51.1 to 0.52.0
2021-08-13 14:58:06 -07:00
Matt-Yorkley
2b555691a4 Update all locales with the latest Transifex translations 2021-08-13 20:15:00 +01:00
Nihal Mohammed
2be8e15797 Allow copy paste of email from contact tab and footer without reversing 2021-08-13 15:57:59 +05:30
dependabot[bot]
48750f7cb8 Bump rubocop from 1.18.4 to 1.19.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.4 to 1.19.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.4...v1.19.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 09:03:53 +00:00
dependabot[bot]
5f1b5b679d Bump view_component from 2.37.0 to 2.38.0
Bumps [view_component](https://github.com/github/view_component) from 2.37.0 to 2.38.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.37.0...v2.38.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 09:02:44 +00:00
dependabot[bot]
8955d1bba0 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 01:10:41 +00:00
Matt-Yorkley
fb6ee65865 Remove more (currently) unused code 2021-08-12 17:24:20 +01:00
Matt-Yorkley
d1b22dfff3 Merge pull request #8024 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.7
Bump @storybook/addon-docs from 6.3.6 to 6.3.7
2021-08-12 18:22:27 +02:00
dependabot[bot]
fda068fe83 Bump @storybook/addon-docs from 6.3.6 to 6.3.7
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.6 to 6.3.7.
- [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.3.7/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-08-12 12:46:33 +00:00
Matt-Yorkley
39fb6b6f9b Merge pull request #8025 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.7
Bump @storybook/addon-controls from 6.3.6 to 6.3.7
2021-08-12 14:43:26 +02:00
dependabot[bot]
7b795c1da9 Bump @storybook/addon-controls from 6.3.6 to 6.3.7
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.6 to 6.3.7.
- [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.3.7/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-08-12 12:34:06 +00:00
Matt-Yorkley
0030bd1464 Merge pull request #8030 from openfoodfoundation/dependabot/bundler/bugsnag-6.22.1
Bump bugsnag from 6.21.0 to 6.22.1
2021-08-12 14:29:26 +02:00
Matt-Yorkley
9e26a39660 Merge pull request #8023 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.7
Bump @storybook/server from 6.3.6 to 6.3.7
2021-08-12 14:28:16 +02:00
Matt-Yorkley
ad0cc85991 Merge pull request #8021 from openfoodfoundation/dependabot/bundler/view_component-2.37.0
Bump view_component from 2.36.0 to 2.37.0
2021-08-12 14:27:54 +02:00
Matt-Yorkley
ba3d4c0c82 Merge pull request #8018 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.10.1
Bump view_component_storybook from 0.9.0 to 0.10.1
2021-08-12 14:27:07 +02:00
Matt-Yorkley
d31ab5b104 Merge pull request #8012 from openfoodfoundation/dependabot/bundler/knapsack-4.0.0
Bump knapsack from 3.1.0 to 4.0.0
2021-08-12 14:26:27 +02:00
Matt-Yorkley
30295c4390 Merge pull request #8013 from openfoodfoundation/dependabot/bundler/webmock-3.14.0
Bump webmock from 3.13.0 to 3.14.0
2021-08-12 14:26:10 +02:00
Matt-Yorkley
1d074c2151 Extract callbacks to a concern 2021-08-12 13:06:50 +01:00
Matt-Yorkley
1147c5b2ca Update saved address loading 2021-08-12 12:53:45 +01:00
Matt-Yorkley
026e51081c Clear invalid payments
When going back and changing the payment option, the previous payment gets invalidated.
2021-08-12 12:53:45 +01:00
Matt-Yorkley
98ae82147c Avoid using Angular in shipping and payment method display 2021-08-12 12:53:45 +01:00
Matt-Yorkley
41c62b97d5 Use flash.now unless redirecting 2021-08-12 12:53:45 +01:00
Matt-Yorkley
dbefd95b5e Improve order workflow shipping method selection 2021-08-12 12:53:45 +01:00
Matt-Yorkley
5fb3943634 Validate payment object exists before advancing from payment to confirmation 2021-08-12 12:53:45 +01:00
Matt-Yorkley
6c885f0f42 Declare validations together 2021-08-12 12:53:45 +01:00
Matt-Yorkley
5d9c4315d8 Remove dead code 2021-08-12 12:53:45 +01:00
Matt-Yorkley
99f0672f9d Set order amount when creating payment object 2021-08-12 12:53:45 +01:00
Matt-Yorkley
598e81ed32 Progress order to address at start of checkout 2021-08-12 12:53:45 +01:00
Matt-Yorkley
7e8daea233 Reduce data loading on steps 2021-08-12 12:53:45 +01:00
Matt-Yorkley
4916f823aa Handle order confirmation 2021-08-12 12:53:45 +01:00
Matt-Yorkley
ffc3736f4b Update fields on confirmation page 2021-08-12 12:53:45 +01:00
Matt-Yorkley
41ffffe170 Tidy up use of @checkout_step 2021-08-12 12:53:45 +01:00
Matt-Yorkley
2a12e21cf4 Merge pull request #8034 from Matt-Yorkley/live
Fix deprecated syntax for live() function
2021-08-12 13:47:50 +02:00
Matt-Yorkley
0158106f28 Merge pull request #7949 from Matt-Yorkley/producers-caching
Fragment-Cache producers AMS data
2021-08-12 13:27:41 +02:00
Matt-Yorkley
fa94392fb6 Fix deprecated syntax for live() function 2021-08-12 12:09:55 +01:00
Matt-Yorkley
3c2c3a1801 Extract helper and update tabs 2021-08-11 16:17:29 +01:00
Matt-Yorkley
070cb1abc1 Improve checkout flow logic 2021-08-11 15:54:21 +01:00
Matt-Yorkley
e91a8d603f Return a boolean in OrderWorkflow#advance_to_state
Returns true if advancing was successful, which is helpful in control flows that use the method in a conditional
2021-08-11 15:53:01 +01:00
Matt-Yorkley
4d77d4df77 Add confirm event and update workflow helpers 2021-08-11 15:53:01 +01:00
Matt-Yorkley
055c6b78af Add order confirmation step to checkout flow 2021-08-11 15:53:01 +01:00
Matt-Yorkley
d113f2a5fc Merge pull request #8004 from jibees/split-checkout-step-3
Split checkout step 3
2021-08-11 16:41:23 +02:00
Matt-Yorkley
a631d057f1 Update payment methods form 2021-08-11 15:22:28 +01:00
Matt-Yorkley
8f7c3a9369 Remove more unused AMS data injection 2021-08-11 15:22:28 +01:00
Jean-Baptiste Bellet
a873499b97 Decrease title font size on checkout
to match specifications
2021-08-11 15:22:28 +01:00
Jean-Baptiste Bellet
b66b1fcdae Add step 3 2021-08-11 15:22:26 +01:00
Jean-Baptiste Bellet
4c81f0f27b Specify name for this payment input 2021-08-11 15:20:03 +01:00
Jean-Baptiste Bellet
c286189225 Add link into success tab
to go back to previous step and edit details once completed
2021-08-11 15:20:01 +01:00
Jean-Baptiste Bellet
66892ed51a Add a success class for step that are already validated 2021-08-11 15:17:08 +01:00
Jean-Baptiste Bellet
623753a745 Add right name to the radio button input 2021-08-11 15:15:31 +01:00
dependabot[bot]
1ec523f558 Bump bugsnag from 6.21.0 to 6.22.1
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.21.0 to 6.22.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.21.0...v6.22.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 09:03:04 +00:00
Matt-Yorkley
0fefdfb619 Delete unused Angular service ofnConfirmHandler 2021-08-10 16:24:40 +01:00
Matt-Yorkley
f50d4fdee0 Update enterprises spec
The bug mentioned here is no longer present (two alert boxes opened instead of one), and the old hack for Poltergeist is no longer needed. 🎉
2021-08-10 16:22:47 +01:00
Matt-Yorkley
5d4d3d4fcf Trigger a digest cycle when opening modals with dynamic content 2021-08-10 16:22:47 +01:00
Matt-Yorkley
5fb782aeba Update $qProvider configuration
The default logic for how rejected promises are handled has changed slightly. This reinstates the previous default behaviour.
2021-08-10 16:22:47 +01:00
Matt-Yorkley
d268cc7bb7 Replace missing #lowercase function 2021-08-10 16:22:47 +01:00
Matt-Yorkley
40531d769c Update deprecated #success and #error methods on $http service 2021-08-10 16:22:47 +01:00
Matt-Yorkley
5f70275ed4 Update $locationProvider config
The defaults were changed to something our app doesn't expect. This reinstates the expected behavior
2021-08-10 16:22:47 +01:00
Matt-Yorkley
f8e0d71b15 Bump Angular to 1.8.0 2021-08-10 16:22:47 +01:00
Matt-Yorkley
85e83807cf Merge pull request #7989 from Matt-Yorkley/invoice-display
Invoice display
2021-08-10 14:14:41 +02:00
dependabot[bot]
01865cd769 Bump @storybook/server from 6.3.6 to 6.3.7
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.6 to 6.3.7.
- [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.3.7/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-08-10 09:07:11 +00:00
dependabot[bot]
045614fd0c Bump ddtrace from 0.51.1 to 0.52.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.51.1 to 0.52.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.51.1...v0.52.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 09:04:50 +00:00
dependabot[bot]
ba470aa75e Bump view_component from 2.36.0 to 2.37.0
Bumps [view_component](https://github.com/github/view_component) from 2.36.0 to 2.37.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.36.0...v2.37.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 09:03:17 +00:00
Matt-Yorkley
3db6cb2db3 Merge pull request #8005 from Matt-Yorkley/angular-tidyup
Angular tidyup
2021-08-09 18:59:53 +02:00
dependabot[bot]
9bf66a35f9 Bump view_component_storybook from 0.9.0 to 0.10.1
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.9.0 to 0.10.1.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Changelog](https://github.com/jonspalmer/view_component_storybook/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/jonspalmer/view_component_storybook/compare/v0.9.0...v0.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-09 09:03:36 +00:00
dependabot[bot]
e4611cc604 Bump puma from 5.3.2 to 5.4.0
Bumps [puma](https://github.com/puma/puma) from 5.3.2 to 5.4.0.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.3.2...v5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:04:45 +00:00
dependabot[bot]
705b0d8a71 Bump webmock from 3.13.0 to 3.14.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.13.0 to 3.14.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.13.0...v3.14.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:03:35 +00:00
dependabot[bot]
f71ae8a496 Bump knapsack from 3.1.0 to 4.0.0
Bumps [knapsack](https://github.com/KnapsackPro/knapsack) from 3.1.0 to 4.0.0.
- [Release notes](https://github.com/KnapsackPro/knapsack/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack/compare/v3.1.0...v4.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 09:03:03 +00:00
Matt-Yorkley
d122af286b Update all locales with the latest Transifex translations 2021-08-05 16:38:28 +01:00
Matt-Yorkley
f81abab355 Merge pull request #8002 from Matt-Yorkley/angular-tab-clicks
Avoid opening tabs when navigating away from page
2021-08-05 15:32:18 +02:00
Matt-Yorkley
eec829de0f Merge pull request #7974 from Matt-Yorkley/jquery2
Switch to jQuery 2
2021-08-05 14:47:24 +02:00
Matt-Yorkley
2595cb85f7 Merge pull request #8001 from Matt-Yorkley/terms-and-conditionals
Fix platform terms of service checkbox
2021-08-05 14:17:48 +02:00
Matt-Yorkley
2a5675c526 Merge pull request #7746 from Matt-Yorkley/puma
Puma
2021-08-05 11:55:05 +02:00
Matt-Yorkley
965e8b144e Merge pull request #8007 from openfoodfoundation/dependabot/npm_and_yarn/tar-6.1.5
Bump tar from 6.1.0 to 6.1.5
2021-08-05 10:45:30 +02:00
Matt-Yorkley
05dcf75ff9 Merge pull request #7990 from Matt-Yorkley/void-transactions
Cancel payments on stock shortages
2021-08-05 00:38:33 +02:00
Matt-Yorkley
a92847d80d Merge pull request #7947 from andrewpbrett/zeitwerk
Use zeitwerk for autoloading
2021-08-05 00:36:32 +02:00
dependabot[bot]
6074af349f Bump tar from 6.1.0 to 6.1.5
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.5.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.0...v6.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-04 03:22:21 +00:00
Matt-Yorkley
c18409a6f7 Merge pull request #8003 from openfoodfoundation/dependabot/bundler/bootsnap-1.7.7
Bump bootsnap from 1.7.6 to 1.7.7
2021-08-03 22:07:17 +02:00
Matt-Yorkley
d625e0b643 Merge pull request #8006 from openfoodfoundation/transifex
Transifex
2021-08-03 22:06:10 +02:00
Transifex-Openfoodnetwork
8d16c4c97f Updating translations for config/locales/en_FR.yml 2021-08-04 05:43:13 +10:00
Transifex-Openfoodnetwork
2a1b547b74 Updating translations for config/locales/fr.yml 2021-08-04 05:42:46 +10:00
Transifex-Openfoodnetwork
80a6527a5a Updating translations for config/locales/fr.yml 2021-08-04 05:39:37 +10:00
Matt-Yorkley
ec240283d9 Remove unused Array::unique override 2021-08-03 16:20:20 +01:00
Matt-Yorkley
15b6b1271a Remove event handlers in Angular directives on the $destroy event
This is a common source of memory leaks!
2021-08-03 16:20:19 +01:00
Matt-Yorkley
b15ae89944 Merge pull request #7840 from jibees/new-checkout-first-step
New checkout first + second step
2021-08-03 12:00:26 +02:00
Matt-Yorkley
623c0eada5 Reinstate removed naming on checkout routes and tidy up 2021-08-03 11:24:22 +02:00
Matt-Yorkley
937ba3ca0a Ensure previously selected shipping method is selected in form 2021-08-03 11:24:17 +02:00
Matt-Yorkley
6f2035febe Update (provisional) checkout actions boilerplate 2021-08-03 11:24:13 +02:00
Matt-Yorkley
2207aae679 Add strong params for checkout
We'll need to add more as we go
2021-08-03 11:24:08 +02:00
Matt-Yorkley
a32ca23ca5 Simplify routes and partials 2021-08-03 11:24:03 +02:00
Matt-Yorkley
aba3cf99a3 Fix address2 field 2021-08-03 11:23:58 +02:00
Matt-Yorkley
d10899d9ea Simplify use of nested field helpers 2021-08-03 11:23:53 +02:00
Matt-Yorkley
cea2433c3e Fix indentation 2021-08-03 11:23:30 +02:00
Matt-Yorkley
6b430f9440 Drop AMS injection for shipping methods
We don't need this now
2021-08-03 11:23:10 +02:00
dependabot[bot]
984a549dc3 Bump bootsnap from 1.7.6 to 1.7.7
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.6 to 1.7.7.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.6...v1.7.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-03 09:03:27 +00:00
Matt-Yorkley
4569dbe800 Remove unused smoothScrollTo directive 2021-08-02 20:58:10 +01:00
Matt-Yorkley
f5a05bf0d8 Remove angular-backstretch 2021-08-02 20:58:10 +01:00
Matt-Yorkley
54df1b3e51 Fix use of Mixin
Don't bind junk to the window object 👍
2021-08-02 20:58:10 +01:00
Matt-Yorkley
e1155277fc Remove Darkswarm from window 2021-08-02 18:59:42 +01:00
Matt-Yorkley
3acd9ed35c Merge pull request #8000 from openfoodfoundation/dependabot/bundler/i18n-js-3.9.0
Bump i18n-js from 3.8.4 to 3.9.0
2021-08-02 09:37:53 +02:00
Matt-Yorkley
ab0866b57e Avoid opening tabs when navigating away from page
Fixes a long-standing mini bug that creates little javascript console errors. Also stops pointless requests being sent to the server.
2021-08-02 08:07:15 +01:00
Matt-Yorkley
5725989343 Fix deprecated syntax in old controller helper
This syntax for rendering a file isn't valid in Rails 6.x...
2021-07-31 13:11:10 +01:00
Matt-Yorkley
1b112961d1 Handle request timeouts explicitly with rack-timeout
Puma doesn't terminate execution of long-running requests by default.
2021-07-31 13:11:10 +01:00
Matt-Yorkley
af7355a780 Merge pull request #7988 from jibees/7919-add-enterprise-fees-validation
Enterprise fee must be linked with an enterprise: add validations
2021-07-30 19:16:04 +02:00
Matt-Yorkley
27be399727 Merge pull request #7995 from jibees/5168-filter-by-shipping-method-in-OCM-report
Reports/Order Cycle Management: filter by shipping method
2021-07-30 18:29:58 +02:00
Matt-Yorkley
b7a75188d8 Simplify checkbox selectors used in checkout specs 2021-07-30 17:29:21 +01:00
Matt-Yorkley
fc8e69b5de Fix platform terms of service checkbox 2021-07-30 16:50:34 +01:00
Matt-Yorkley
7e3b9be506 Allow StripeSCA Gateway to actually void payments 2021-07-30 11:48:57 +01:00
dependabot[bot]
d1facd3656 Bump i18n-js from 3.8.4 to 3.9.0
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.8.4 to 3.9.0.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.8.4...v3.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-30 09:02:32 +00:00
jibees
e6d600cf57 Merge pull request #7998 from openfoodfoundation/dependabot/bundler/view_component-2.36.0
Bump view_component from 2.35.0 to 2.36.0
2021-07-30 09:18:31 +02:00
Matt-Yorkley
60aec2eff0 Update all locales with the latest Transifex translations 2021-07-29 18:42:50 +01:00
Matt-Yorkley
dd59ae7f69 Merge pull request #7997 from openfoodfoundation/dependabot/bundler/redis-4.4.0
Bump redis from 4.3.1 to 4.4.0
2021-07-29 19:34:25 +02:00
Matt-Yorkley
f18d075220 Merge pull request #7994 from jibees/5472-add-OC-coordinator-to-list-of-enterprises-fees
Add order cycle coordinator to the list of enterprises with fees for order cycle incoming products form
2021-07-29 19:29:00 +02:00
Matt-Yorkley
b22bcd46ff Merge pull request #7993 from openfoodfoundation/dependabot/bundler/haml-5.2.2
Bump haml from 5.2.1 to 5.2.2
2021-07-29 13:28:27 +02:00
dependabot[bot]
948bab47b8 Bump view_component from 2.35.0 to 2.36.0
Bumps [view_component](https://github.com/github/view_component) from 2.35.0 to 2.36.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.35.0...v2.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 09:03:35 +00:00
dependabot[bot]
9b11671d34 Bump redis from 4.3.1 to 4.4.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.3.1...v4.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 09:03:11 +00:00
Jean-Baptiste Bellet
09491cfc6d Only return order with the selected shipping rates is true
Same concept as

https://github.com/openfoodfoundation/openfoodnetwork/blob/master/app/services/search_orders.rb#L31
2021-07-28 17:05:50 +02:00
Matt-Yorkley
bd041a2e09 Use puma in the test suite and remove server errors hack 2021-07-28 12:43:05 +01:00
Matt-Yorkley
4fe49fe559 Switch from Unicorn to Puma 2021-07-28 12:37:23 +01:00
Jean-Baptiste Bellet
2116779527 Add order cycle coordinator to the list of enterprises with fees
- Thus, coordinator can choose to add its own fee for a specific supplier
2021-07-28 11:40:57 +02:00
dependabot[bot]
5024d3b707 Bump haml from 5.2.1 to 5.2.2
Bumps [haml](https://github.com/haml/haml) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/haml/haml/releases)
- [Changelog](https://github.com/haml/haml/blob/main/CHANGELOG.md)
- [Commits](https://github.com/haml/haml/compare/5.2.1...v5.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-28 09:02:50 +00:00
Matt-Yorkley
b113162582 Merge pull request #7984 from openfoodfoundation/dependabot/bundler/bootsnap-1.7.6
Bump bootsnap from 1.7.5 to 1.7.6
2021-07-28 10:37:20 +02:00
Matt-Yorkley
edb0960a51 Merge pull request #7950 from openfoodfoundation/dependabot/bundler/activerecord-import-1.2.0
Bump activerecord-import from 1.1.0 to 1.2.0
2021-07-28 10:35:08 +02:00
Maikel
5e1f1ca81c Merge pull request #7985 from openfoodfoundation/dependabot/bundler/i18n-js-3.8.4
Bump i18n-js from 3.8.3 to 3.8.4
2021-07-28 10:17:31 +10:00
Maikel
eeaac6fdb0 Merge pull request #7991 from openfoodfoundation/transifex
Transifex
2021-07-28 10:02:43 +10:00
Transifex-Openfoodnetwork
832f08d13a Updating translations for config/locales/de_DE.yml 2021-07-28 09:12:46 +10:00
Matt-Yorkley
e1393c96ca Correctly void transactions when payments are cancelled due to stock issues 2021-07-27 23:24:00 +01:00
Matt-Yorkley
ec84564f28 Add test coverage for TaxHelper 2021-07-27 22:09:14 +01:00
Matt-Yorkley
83f6132b6a Fix shipping tax display in regular invoice template 2021-07-27 22:01:24 +01:00
Jean-Baptiste Bellet
4acc942100 Add appropriate distributors and suppliers to the packing report
ie. the ones that are distributing/supplying products the current user is distributing/supplying

 - As the orders_and_fullfillment reports already had the right filled distributors and suppliers, use the same method: add_appropriate_distributors_and_suppliers
2021-07-27 18:06:30 +02:00
Jean-Baptiste Bellet
434f9600b7 Enterprise fee must be linked with an enterprise
Add 2 validation / errorproof options:
 - Add rails validation on `enterprise_id`  on enterprise_fee model
 - Do not add a blank option on the select: ie. user can select a blank enterprise in the form

Update tests as well
2021-07-27 15:39:40 +02:00
Matt-Yorkley
440eb2a996 Merge pull request #7987 from openfoodfoundation/transifex
Transifex
2021-07-27 14:53:23 +02:00
Transifex-Openfoodnetwork
db0063314b Updating translations for config/locales/en_FR.yml 2021-07-27 22:33:38 +10:00
Transifex-Openfoodnetwork
4e6bc33b05 Updating translations for config/locales/fr.yml 2021-07-27 22:33:04 +10:00
Matt-Yorkley
28fe72c1ec Merge pull request #7976 from openfoodfoundation/transifex
Transifex
2021-07-27 14:26:22 +02:00
Matt-Yorkley
886e03af2f Merge pull request #7805 from Matt-Yorkley/adjustments-admin
[Adjustments] Admin adjustments
2021-07-27 12:23:29 +02:00
Matt-Yorkley
9d4b34b35b Merge pull request #7977 from Matt-Yorkley/tidy-up
Spree tidy-up
2021-07-27 11:52:22 +02:00
Matt-Yorkley
9311070f26 Merge pull request #7979 from Matt-Yorkley/cuprite-update
Test suite update
2021-07-27 11:51:17 +02:00
dependabot[bot]
94e0748234 Bump i18n-js from 3.8.3 to 3.8.4
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.8.3 to 3.8.4.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.8.3...v3.8.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:03:51 +00:00
dependabot[bot]
23e336c7ac Bump bootsnap from 1.7.5 to 1.7.6
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.5 to 1.7.6.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.5...v1.7.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:03:26 +00:00
Matt-Yorkley
a26a78c9fe Merge pull request #7286 from luisramos0/am
Replace setup_intents class from active merchant v1.98 with a decorator that will change the current v1.119
2021-07-26 21:29:01 +02:00
Matt-Yorkley
c00ca35f09 Merge pull request #7972 from jibees/#7928-transform-locale-for-flatpickr
Flatpickr only use language and not locale
2021-07-26 18:31:14 +02:00
Jean-Baptiste Bellet
57d7191332 Add new step, second one: payment method
Add payment method form

- select the right form depending on the path
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
9b29997498 Add selected class on form tab depending on the current path 2021-07-26 15:47:36 +02:00
Andy Brett
3d77ba49ac pseudocode flow for steps 2021-07-26 15:47:36 +02:00
Andy Brett
939169c504 remove unused advance_to_state param 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
91c4beea0f No need to add flash error for error
as we render error on each input with error
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
151a6fd16b Add first stimulus controllers to display elements
1. Introduce a stimulus toggle_controller

 - controller: { "data-controller": "toggle" }
 - action: { "data-action": "toggle#toggle" }
 - show or not: { "data-toggle-show":  true || false  }
- targets: { "data-toggle-target": "content", style: "display: none" }
Display payment method price

2. States are populated via a new dependant_select_controller by stimulus.
Usage:

 - controller : { "data-controller": "dependant-select", "data-dependant-select-options-value": [ [1: ["option", "for", "1"], [2: ["option", "for", "2"] ] }
 - target (on the populating target):  { "data-dependant-select-target": "select" }
 - source and action (on the input that leads the dependant select): {"data-dependant-select-target": "source", "data-action": "dependant-select#handleSelectChange"}
Some improvements on readability

3. Populate ShippingMethod description thanks to "shippingmethod_controller"


+
 - Add countries and states
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
200ced62fb Load shipping methods in the Controller
needed to populate the form
2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
1076ec777c Define a method error_message_on to display error by field 2021-07-26 15:47:36 +02:00
Andy Brett
6866cecdfa start with a straight copy of CheckoutController - WIP! 2021-07-26 15:47:36 +02:00
Andy Brett
0ea968a900 add redirection to correct step 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
87a0a5846d WIP; only advance order to delivery state
Use the hidden_field_tag rails helper and move it
2021-07-26 15:47:36 +02:00
Andy Brett
af79969d96 add SplitCheckoutController and conditional route 2021-07-26 15:47:36 +02:00
Jean-Baptiste Bellet
49f026629c Add tabs for the new split checkout + first step: your details
- Add new split checkout for user with `split_checkout` feature
 - Add the first step: Your details
 - with 3 parts : Your details, Billing address and Delivery address
2021-07-26 15:47:36 +02:00
Matt-Yorkley
4dccd55490 Merge pull request #7981 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.6
Bump @storybook/addon-docs from 6.3.5 to 6.3.6
2021-07-26 14:40:30 +02:00
dependabot[bot]
5c350acb1c Bump @storybook/addon-docs from 6.3.5 to 6.3.6
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.5 to 6.3.6.
- [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.3.6/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-07-26 11:57:32 +00:00
Matt-Yorkley
110a5ed398 Merge pull request #7982 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.6
Bump @storybook/server from 6.3.5 to 6.3.6
2021-07-26 13:53:24 +02:00
Matt-Yorkley
0d4534eff4 Merge pull request #7980 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.6
Bump @storybook/addon-controls from 6.3.5 to 6.3.6
2021-07-26 13:53:10 +02:00
dependabot[bot]
b01888f092 Bump @storybook/server from 6.3.5 to 6.3.6
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.5 to 6.3.6.
- [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.3.6/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-07-26 09:11:05 +00:00
dependabot[bot]
8744441c8a Bump @storybook/addon-controls from 6.3.5 to 6.3.6
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.5 to 6.3.6.
- [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.3.6/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-07-26 09:08:26 +00:00
Matt-Yorkley
6daa37a5c0 Ensure TaxRateFinder returns an array if the given adjustment has no tax 2021-07-25 22:47:40 +01:00
Matt-Yorkley
cb114283ea Update spec/migrations/migrate_admin_tax_amounts_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-07-25 22:47:40 +01:00
Matt-Yorkley
cab36f375b Update app/services/order_tax_adjustments_fetcher.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-07-25 22:47:40 +01:00
Matt-Yorkley
091bfc710f Add test for applying multiple tax rates per tax zone 2021-07-25 22:47:40 +01:00
Matt-Yorkley
69e4670a17 Tidy up building default address objects 2021-07-25 22:47:40 +01:00
Matt-Yorkley
41757254d6 Recalculate taxes when an order's customer details are changed 2021-07-25 22:47:40 +01:00
Matt-Yorkley
d55079f474 Extract comment-method 2021-07-25 22:47:40 +01:00
Matt-Yorkley
ca6979e394 Extract call to Spree::TaxRate.match to a separate method and update tests 2021-07-25 22:47:40 +01:00
Matt-Yorkley
8f62ccb9b7 Match tax rates using rates applicable to the order 2021-07-25 22:47:40 +01:00
Matt-Yorkley
5da545c751 Improve adjustment listing in UI 2021-07-25 22:47:40 +01:00
Luis Ramos
d1f1f62f9a Add needed constant to class eval 2021-07-25 16:08:30 +01:00
Luis Ramos
02b4693068 Fix class name 2021-07-25 16:08:30 +01:00
Luis Ramos
901c1589ee Remove decorator, it's not needed now in v1.119 of active merchant 2021-07-25 16:08:30 +01:00
Luis Ramos
4057445562 Replace setup_intents class from active merchat v1.i98 with a decorator that will adapt the version in v1.119 2021-07-25 16:06:49 +01:00
Matt-Yorkley
21f26669b4 Split spec configurations into smaller parts
base_spec_helper now defines configs that are universal, whereas spec_helper is for configs that are using DatabaseCleaner and Selenium. This means we can include the base_spec_helper in both the system test setup and the regular setup but separate the other configurations for each type.
2021-07-25 12:32:36 +01:00
Matt-Yorkley
afce55dab5 Add Devise System spec helpers
This is recommended when using Devise.
2021-07-25 11:25:44 +01:00
Matt-Yorkley
38aac70705 Remove class_eval on Spree::Gateway 2021-07-24 21:28:13 +01:00
Matt-Yorkley
0764484f41 Remove class_eval in PaymentMethodDistributors 2021-07-24 21:28:13 +01:00
Matt-Yorkley
87c7fceae9 Remove dead code for Ruby 1.8... 2021-07-24 21:28:13 +01:00
Matt-Yorkley
cc1410fbb5 Remove now unused decorator loading 2021-07-24 21:28:13 +01:00
Matt-Yorkley
58f95bd34c Remove ActionController::Metal class_eval hack 2021-07-24 21:28:13 +01:00
Matt-Yorkley
7493697955 Tidy up CalculatedAdjustments in Spree::PaymentMethod 2021-07-24 21:28:13 +01:00
Matt-Yorkley
2d69810c5d Convert CalculatedAdjustments into a proper Concern and remove class_eval 2021-07-24 21:28:13 +01:00
Andy Brett
f2ec806d9c move all calculators to reload block 2021-07-24 11:54:46 -07:00
Andy Brett
afa3de8040 load calculator classes on app reload 2021-07-24 08:24:39 -07:00
Transifex-Openfoodnetwork
d5d378a604 Updating translations for config/locales/en_IE.yml 2021-07-24 23:34:08 +10:00
Andy Brett
bb8dc3f3bc add inflector for StripeSCA 2021-07-23 17:01:22 -07:00
Matt-Yorkley
cdf25ee580 Fix some syntax issues 2021-07-23 23:26:39 +01:00
Matt-Yorkley
6d42820f94 Switch to jQuery 2 2021-07-23 21:49:37 +01:00
Andy Brett
d3ef281e66 Merge pull request #7969 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.5
Bump @storybook/addon-docs from 6.3.4 to 6.3.5
2021-07-23 11:54:53 -07:00
dependabot[bot]
ba59bfd8a4 Bump @storybook/addon-docs from 6.3.4 to 6.3.5
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.4 to 6.3.5.
- [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.3.5/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-07-23 18:52:48 +00:00
Andy Brett
c15a66d2e1 Merge pull request #7970 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.5
Bump @storybook/addon-controls from 6.3.4 to 6.3.5
2021-07-23 11:47:03 -07:00
dependabot[bot]
efd5629715 Bump @storybook/addon-controls from 6.3.4 to 6.3.5
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.4 to 6.3.5.
- [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.3.5/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-07-23 18:45:48 +00:00
Andy Brett
96bcaf1b40 Merge pull request #7968 from openfoodfoundation/dependabot/bundler/rubocop-1.18.4
Bump rubocop from 1.18.3 to 1.18.4
2021-07-23 11:45:23 -07:00
Andy Brett
783d2a6a7e Merge pull request #7971 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.5
Bump @storybook/server from 6.3.4 to 6.3.5
2021-07-23 11:40:16 -07:00
Jean-Baptiste Bellet
f39cc49cd2 Create a base_locale attribute onto I18n object
- if "fr": return "fr"
 - if "fr_FR": return "fr"
2021-07-23 14:14:20 +02:00
dependabot[bot]
9c60a2c294 Bump @storybook/server from 6.3.4 to 6.3.5
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.4 to 6.3.5.
- [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.3.5/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-07-23 09:07:10 +00:00
dependabot[bot]
1990bc1ad8 Bump rubocop from 1.18.3 to 1.18.4
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.3 to 1.18.4.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.3...v1.18.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 09:01:56 +00:00
Maikel
c9159a3096 Merge pull request #7956 from filipefurtad0/add_ferrum_cuprite
Add the Ferrum-Cuprite driver to the stack
2021-07-23 10:27:41 +10:00
Matt-Yorkley
29acf957ae Update all locales with the latest Transifex translations 2021-07-22 22:16:41 +01:00
Matt-Yorkley
82d8ab0bce Merge pull request #7944 from openfoodfoundation/transifex
Transifex
2021-07-22 23:11:12 +02:00
Filipe
49aa1e189c Merge pull request #69 from Matt-Yorkley/cuprite-tidyup
Cuprite tidyup
2021-07-22 14:30:40 +01:00
Matt-Yorkley
2b4d8fbd63 Reorganise cuprite setup code 2021-07-22 11:01:51 +01:00
Matt-Yorkley
1c493c7238 Don't use feature keyword in system test 2021-07-22 10:49:14 +01:00
Matt-Yorkley
7ee6e48f17 Ignore external scripts
In some cases the browser will try to load external files like fonts, Google maps JS, Stripe JS. This can cause network issues on slow connections and add a lot of unnecessary time to each test.
2021-07-22 10:48:16 +01:00
Matt-Yorkley
0fbba0fa9d Clean up some comments 2021-07-22 10:20:57 +01:00
Matt-Yorkley
a14059a77d Adjust timeout settings for more flexibility 2021-07-22 10:18:50 +01:00
Matt-Yorkley
ac64908c2b Tidy up compiling helper 2021-07-22 10:18:18 +01:00
Filipe
b63eda8adf Merge pull request #68 from Matt-Yorkley/cuprite
Run system tests in their own action
2021-07-21 22:14:41 +01:00
Matt-Yorkley
94e476d21f Run system tests in their own action 2021-07-21 18:58:28 +01:00
filipefurtad0
85d2db52ae Sets headless: true 2021-07-21 16:42:46 +01:00
Transifex-Openfoodnetwork
13e2097272 Updating translations for config/locales/de_DE.yml 2021-07-22 01:34:15 +10:00
filipefurtad0
df7f4d0a31 Removed some unecessary comments 2021-07-21 16:25:20 +01:00
filipefurtad0
ecbab52f06 Removes unecessary CAPYBARA_APP_HOST specification 2021-07-21 15:59:08 +01:00
filipefurtad0
386480d493 Adds changes on Gemfile.lock file 2021-07-21 15:57:42 +01:00
Matt-Yorkley
daa73d1aca Merge pull request #7958 from Matt-Yorkley/pagy-overflow
Add overflow handling on pagination
2021-07-21 13:19:43 +02:00
Matt-Yorkley
7597a58f53 Add overflow handling on pagination 2021-07-21 09:55:42 +01:00
Maikel Linke
cd99b502d8 Update translations 2021-07-21 11:15:39 +10:00
Andy Brett
ba6dd01446 Merge pull request #7957 from Matt-Yorkley/uglifier
Use :harmony option with Uglifier when minimizing javascript
2021-07-20 12:35:36 -07:00
Matt-Yorkley
98ea70bfa0 Use harmony option with Uglifier when minimizing javascript
Resolves a bug where the asset pipeline tries to minify assets that have already been minified by Webpack
2021-07-20 19:11:50 +01:00
jibees
40abefa908 Merge pull request #7955 from Matt-Yorkley/stimulus-js
Add StimulusJS
2021-07-20 17:44:04 +02:00
filipefurtad0
ec07a3cd3d Add the Ferrum-Cuprite driver to the stack 2021-07-20 15:52:21 +01:00
Matt-Yorkley
6882201533 Add StimulusJS and example controller 2021-07-20 15:22:16 +01:00
Transifex-Openfoodnetwork
32a7537cff Updating translations for config/locales/es.yml 2021-07-20 23:38:11 +10:00
Transifex-Openfoodnetwork
94e30b5416 Updating translations for config/locales/ca.yml 2021-07-20 23:37:29 +10:00
Transifex-Openfoodnetwork
71d6680b8b Updating translations for config/locales/en_FR.yml 2021-07-20 17:26:26 +10:00
Transifex-Openfoodnetwork
69a26be0b4 Updating translations for config/locales/fr.yml 2021-07-20 17:26:09 +10:00
Maikel
86500dc2aa Merge pull request #7948 from Matt-Yorkley/remove-foundation-js
Remove Foundation js
2021-07-20 14:57:29 +10:00
Andy Brett
a93eef38c0 Merge pull request #7923 from vishaldeepak/tooltip-order-cycle-subscription
Tooltip added for 'New Schedule' and 'New Order Cycle'
2021-07-19 19:32:09 -07:00
Andy Brett
f60e7a97fd Merge pull request #7953 from filipefurtad0/customer_email_validation
Adds test for valid_email2 email validation
2021-07-19 19:16:36 -07:00
Maikel
b38ad54e15 Merge pull request #7940 from openfoodfoundation/dependabot/bundler/stripe-5.37.0
Bump stripe from 5.36.0 to 5.37.0
2021-07-20 11:08:01 +10:00
filipefurtad0
0e85811cab Adds test for valid_email2 email validation 2021-07-19 18:26:52 +01:00
Matt-Yorkley
51f86cfef4 Merge pull request #7941 from apricot12/revert-7307-Show_notification_setting
Revert 7307 - Profile only producers need the notifications field
2021-07-19 12:07:26 +02:00
dependabot[bot]
fa75d7c440 Bump activerecord-import from 1.1.0 to 1.2.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.1.0 to 1.2.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.1.0...v1.2.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>
2021-07-19 09:02:31 +00:00
Transifex-Openfoodnetwork
f0946edfe0 Updating translations for config/locales/fr_CA.yml 2021-07-19 03:11:22 +10:00
Matt-Yorkley
ce24aef5aa Add easy toggle for caching in dev with Redis 2021-07-18 13:45:28 +01:00
Matt-Yorkley
a739e78ff7 Cache producers AMS data 2021-07-18 12:23:31 +01:00
Matt-Yorkley
03863d2bb2 Delete some other dead frontend code 2021-07-18 11:25:01 +01:00
Matt-Yorkley
e2bcb80ac4 Remove Foundation framework JS from Darkswarm 2021-07-18 11:25:01 +01:00
Andy Brett
84c3b39e15 use zeitwerk for autoloading 2021-07-17 16:41:35 -07:00
Andy Brett
c6743d8c6b Merge pull request #7800 from pacodelaluna/improve-dfc-logic
Improve DFC Provider logic to use existing business logic
2021-07-16 15:56:09 -07:00
Transifex-Openfoodnetwork
c684fb8357 Updating translations for config/locales/en_GB.yml 2021-07-16 21:33:15 +10:00
David Cook
c156d0c2e6 Add script to import product images from URL
With new ImageImporter.

Co-authored-by: Maikel <maikel@email.org.au>
2021-07-16 11:36:49 +10:00
Maikel Linke
fd8766ec77 Update translations 2021-07-16 10:41:08 +10:00
Maikel
3e66f475e5 Merge pull request #7925 from openfoodfoundation/transifex
Transifex
2021-07-16 10:32:46 +10:00
Maikel
6de27703af Merge pull request #7915 from vishaldeepak/payment-state-translation
Fixed Bug on payment transalation state
2021-07-16 10:29:53 +10:00
Maikel
f448c95bbe Merge pull request #7886 from apricot12/invalid_customer_email_subscription_fail
Add valid_email2 gem for email validation to fix subscription failures with invalid emails.
2021-07-16 10:20:37 +10:00
François Turbelin
39bb25e959 Adjust supplied_products id before better data matching 2021-07-15 21:17:14 +02:00
Nihal Mohammed
3793585c38 Revert changes made in #7307 2021-07-16 00:28:40 +05:30
dependabot[bot]
7ef95f82c0 Bump stripe from 5.36.0 to 5.37.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.36.0 to 5.37.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.36.0...v5.37.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-15 09:04:16 +00:00
Transifex-Openfoodnetwork
a46145f44f Updating translations for config/locales/ru.yml 2021-07-15 18:45:17 +10:00
Transifex-Openfoodnetwork
20d4cb1366 Updating translations for config/locales/es.yml 2021-07-15 03:46:05 +10:00
Transifex-Openfoodnetwork
f269fb9104 Updating translations for config/locales/ca.yml 2021-07-15 03:45:09 +10:00
Andy Brett
ac0c1f3c70 Merge pull request #7823 from apricot12/Migrate_Kaminari_to_Pagy_for_pagination
Migrate kaminari to pagy for pagination
2021-07-14 10:11:11 -07:00
Andy Brett
a58e0fe217 Merge pull request #7926 from luisramos0/rubocop_fix
Update Rubocop todo files
2021-07-14 10:05:54 -07:00
Andy Brett
09790b35ef Merge pull request #7927 from openfoodfoundation/dependabot/bundler/ddtrace-0.51.1
Bump ddtrace from 0.51.0 to 0.51.1
2021-07-14 10:03:50 -07:00
François Turbelin
c4a7c05c05 Use check_enterprise filter in a better way 2021-07-14 14:59:19 +02:00
François Turbelin
155d05265d Use manually generated values to test urls 2021-07-14 14:24:10 +02:00
Matt-Yorkley
4b4450d34f Update conditional pagination in Api::OrdersController 2021-07-14 13:19:02 +01:00
Matt-Yorkley
447165f8a1 Update #expect calls to count products correctly 2021-07-14 13:19:02 +01:00
Matt-Yorkley
c1b85b7409 Revert removal of default argument in #fetchResults 2021-07-14 13:19:02 +01:00
Matt-Yorkley
cc5b310694 Fix javascript errors where $scope.filteredLineItems hasn't been initialized yet 2021-07-14 13:19:02 +01:00
Nihal Mohammed
1ac2e1a8a6 Try reverting shopping_spec 2021-07-14 13:19:02 +01:00
Nihal Mohammed
2acc339341 Update shoppign spec 2021-07-14 13:19:02 +01:00
Nihal Mohammed
894a11c9c1 Update shopping spec to fix CI error 2021-07-14 13:18:01 +01:00
Nihal Mohammed
5864e2d36e Update states controller spec 2021-07-14 13:18:01 +01:00
Nihal Mohammed
6bd28bcad8 Update products_renderer for pagy pagination 2021-07-14 13:17:33 +01:00
Matt-Yorkley
4187380225 Customise partial used for showing pagination links 2021-07-14 13:17:33 +01:00
Matt-Yorkley
786cb06c7d Drop duplicate pagination buttons on top of tax zones config page
Showing these buttons at both the top and bottom is inconsistent with other pages like admin/users that have a similar layout and UI; they only show the buttons on the bottom.
2021-07-14 13:17:33 +01:00
Matt-Yorkley
60595059e2 Drop unused options from Pagy initializer 2021-07-14 13:17:33 +01:00
Matt-Yorkley
41f9f07a80 Simplify cases where pagination is conditional and pagination data may or may not be used 2021-07-14 13:17:33 +01:00
Matt-Yorkley
e5afa3a26e Simplify #pagy calls without default item counts
Pagy will pick up the :per_page param by default now, so we don't need to specify `items: params[:per_page]` unless we want to use something beyond that param's value.
2021-07-14 13:17:33 +01:00
Matt-Yorkley
b3c4a38b0f Enable 'pagy/extras/items' for customising items parameter 2021-07-14 13:17:33 +01:00
Matt-Yorkley
18d98500e9 Update pagination in Admin::ZonesController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
a821117b83 Update pagination in Admin::UsersController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
a146782bcd Update pagination in Api::StatesController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
eba60a6130 Deal with Api::OrdersController and SearchOrders service 2021-07-14 13:17:33 +01:00
Matt-Yorkley
3213c30a37 Update pagination in Api::ExchangeProductsController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
6fe68322da Update pagination in Admin::BulkLineItemsController 2021-07-14 13:17:33 +01:00
Matt-Yorkley
1dddaf9b14 Remove dead code in Admin::ProductsController
This is related to some of the data-loading for index actions inherited from Spree's Admin::ResourceController, but we don't actually use it any more...
2021-07-14 13:17:33 +01:00
Nihal Mohammed
e5bdaa603a Setup pagy 2021-07-14 13:17:33 +01:00
François Turbelin
9d1b059835 Fix typo in supplied_products_controller comment 2021-07-14 14:08:09 +02:00
vishaldeepak
b70ba7085a Tooltip added for 'New Schedule' and 'New Order Cycle' in Order Cycles tab of admin 2021-07-14 15:15:12 +05:30
dependabot[bot]
97e8d1d708 Bump ddtrace from 0.51.0 to 0.51.1
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.51.0 to 0.51.1.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/v0.51.1/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.51.0...v0.51.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-14 09:02:16 +00:00
Maikel
6e25dec617 Merge pull request #7921 from openfoodfoundation/dependabot/bundler/ddtrace-0.51.0
Bump ddtrace from 0.50.0 to 0.51.0
2021-07-14 15:26:01 +10:00
Maikel
9b5e70dc17 Merge pull request #7916 from openfoodfoundation/dependabot/bundler/addressable-2.8.0
Bump addressable from 2.7.0 to 2.8.0
2021-07-14 15:24:26 +10:00
Maikel
529ea20289 Merge pull request #7913 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.0.0
Bump shoulda-matchers from 4.5.1 to 5.0.0
2021-07-14 15:23:04 +10:00
Maikel
95e5bf16dd Merge pull request #7898 from psychoslave/fit/schema
Update schema after recent migrations
2021-07-14 15:19:51 +10:00
Maikel
3e15e87b11 Merge pull request #7909 from shen-sat/7470-add-shipping-category-feature-test
7470 add shipping category feature test
2021-07-14 14:29:29 +10:00
Luis Ramos
1fb162bb4c Result of running rubocop -a, safe auto correct 2021-07-13 23:06:56 +01:00
Luis Ramos
04ac55b91e Move nesting blocks rule from 4 to 3, same exception list 2021-07-13 22:55:17 +01:00
Luis Ramos
08a4536a6a Update rubocop manual todo
After this commit we can run rubocop and get no offenses
2021-07-13 22:52:57 +01:00
Luis Ramos
01fe6abeed Result of rubocop -a, safe autocorrect 2021-07-13 22:38:05 +01:00
Luis Ramos
a7944af73d Update rubocop todo file 2021-07-13 22:32:28 +01:00
Andy Brett
094ef92638 Merge pull request #7920 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.9.0
Bump view_component_storybook from 0.8.0 to 0.9.0
2021-07-13 14:06:38 -07:00
Andy Brett
98e4136be5 Merge pull request #7912 from openfoodfoundation/dependabot/bundler/stripe-5.36.0
Bump stripe from 5.35.0 to 5.36.0
2021-07-13 14:04:21 -07:00
Transifex-Openfoodnetwork
61598fc971 Updating translations for config/locales/en_CA.yml 2021-07-14 05:40:31 +10:00
Transifex-Openfoodnetwork
e4a7fe7cb2 Updating translations for config/locales/de_DE.yml 2021-07-14 05:12:41 +10:00
Transifex-Openfoodnetwork
8ba0ac0b8f Updating translations for config/locales/en_FR.yml 2021-07-14 01:53:29 +10:00
Transifex-Openfoodnetwork
511bb73278 Updating translations for config/locales/fr.yml 2021-07-14 01:53:21 +10:00
Mathieu Lovato Stumpf Guntz
2522ac4ad5 Merge branch 'master' into fit/schema 2021-07-13 16:45:40 +02:00
Mathieu Lovato Stumpf Guntz
89f97ba0ec integrate db/schema.rb changes 2021-07-13 16:43:55 +02:00
Andy Brett
ef4454ddba Merge pull request #7892 from andrewpbrett/grouped-tax-invoices
Remove duplicative tax line on invoices
2021-07-13 06:30:30 -07:00
Matt-Yorkley
0d16be3f94 Merge pull request #7779 from Matt-Yorkley/stripe-stock-check
Stripe stock check
2021-07-13 14:46:34 +02:00
Matt-Yorkley
70dde65687 Merge pull request #7917 from andrewpbrett/fix-chrome-autocomplete
Use `autocomplete: off` on bulk product page form
2021-07-13 13:22:15 +02:00
dependabot[bot]
33cfee2f9f Bump ddtrace from 0.50.0 to 0.51.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.50.0 to 0.51.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.50.0...v0.51.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:03:20 +00:00
dependabot[bot]
8f2403394e Bump view_component_storybook from 0.8.0 to 0.9.0
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Commits](https://github.com/jonspalmer/view_component_storybook/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:02:14 +00:00
Shen Sat
2f9751f7ea Fix typo and remove WebHelper 2021-07-13 08:54:19 +01:00
Andy Brett
b475476a22 Update all locales with the latest Transifex translations 2021-07-12 15:45:59 -07:00
Andy Brett
01bfd4bd9d Merge pull request #7911 from openfoodfoundation/transifex
Transifex
2021-07-12 15:43:21 -07:00
Andy Brett
128a2127c9 use autocomplete: off on bulk product page form 2021-07-12 14:41:57 -07:00
dependabot[bot]
22860839e6 Bump addressable from 2.7.0 to 2.8.0
Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/sporkmonger/addressable/releases)
- [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 17:22:56 +00:00
Andy Brett
117f0b41a2 Merge pull request #7908 from Matt-Yorkley/pry-warnings
Fix deprecation issues with pry-byebug
2021-07-12 10:22:06 -07:00
Andy Brett
5efc3dc221 Merge pull request #7914 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.3
Bump rubocop-rails from 2.11.2 to 2.11.3
2021-07-12 09:50:40 -07:00
Andy Brett
7d399b4c6d Remove duplicative line item for taxes 2021-07-12 09:16:28 -07:00
vishaldeepak
691853843d Fixed Bug on payment transalation state 2021-07-12 15:45:27 +05:30
dependabot[bot]
08529b3e7e Bump rubocop-rails from 2.11.2 to 2.11.3
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.2 to 2.11.3.
- [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.11.2...v2.11.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:07:00 +00:00
dependabot[bot]
d576f3ea96 Bump shoulda-matchers from 4.5.1 to 5.0.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 4.5.1 to 5.0.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v4.5.1...v5.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:04:59 +00:00
dependabot[bot]
63597b0221 Bump stripe from 5.35.0 to 5.36.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.35.0 to 5.36.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.35.0...v5.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 09:02:50 +00:00
Transifex-Openfoodnetwork
afbd2b520e Updating translations for config/locales/en_GB.yml 2021-07-12 18:13:42 +10:00
Matt-Yorkley
8e1631bfc7 Set adjustments associated with voided payments to ineligible.
Otherwise we can end up with duplicate transaction fees for voided payments.
2021-07-12 08:28:32 +01:00
Shen Sat
63cb82717b Add feature test for shipping categories 2021-07-11 19:42:41 +01:00
Matt-Yorkley
cb1fd77531 Fix deprecation issues with pry-byebug
The latest version of pry-byebug and the latest version of pry have some weird compatibility issues. The solution requires downgrading pry slightly and upgrading pry-byebug. Fixes:
```
lib/ruby/gems/2.7.0/gems/pry-byebug-3.8.0/lib/pry-byebug/control_d_handler.rb:5:
warning: control_d_handler's arity of 2 parameters was deprecated (eval_string, pry_instance).Now it gets passed just 1 parameter (pry_instance)
```
2021-07-11 18:40:59 +01:00
Matt-Yorkley
77e4a6c465 Migrate admin adjustment tax amounts 2021-07-09 21:50:12 +01:00
Matt-Yorkley
200dde18e8 Update admin adjustment taxes in OrderAdjustmentsFetcher spec 2021-07-09 21:49:36 +01:00
Matt-Yorkley
fe92c31f4a Update AdjustmentsController specs 2021-07-09 21:49:36 +01:00
Matt-Yorkley
cb039fd880 Delete dead code Adjustment#display_included_tax 2021-07-09 21:49:36 +01:00
Matt-Yorkley
3ae31ec1ce Simplify tax adjustment sums in Order::Updater 2021-07-09 21:49:36 +01:00
Matt-Yorkley
12c9914d1b Delete old Adjustment scopes #with_tax and #without_tax 2021-07-09 21:49:36 +01:00
Matt-Yorkley
0876f2ae0d Remove tax rate guessing from TaxRateFinder
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
f2e63fff2e Delete dead code TaxRate: #compute_tax and #with_tax_included_in_price
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
33fc5bbaa2 Delete dead code TaxRate#compute_tax
🎉
2021-07-09 21:49:36 +01:00
Matt-Yorkley
b3f5780862 Refactor OrderTaxAdjustmentsFetcher
Note: we're only dealing with tax adjustments here, and each adjustment has a single associated tax rate, not multiple.
2021-07-09 21:49:35 +01:00
Matt-Yorkley
c60554a14a Update display of associated tax amounts 2021-07-09 21:49:35 +01:00
Matt-Yorkley
ad1b9f3f2f Update Adjustment#has_tax? 2021-07-09 21:49:35 +01:00
Matt-Yorkley
c16e008ba1 Delete dead code Adjustment#set_absolute_included_tax! 2021-07-09 21:49:35 +01:00
Matt-Yorkley
9215d3292b Remove edit/delete buttons for shipping and payment adjustments 2021-07-09 21:49:35 +01:00
Matt-Yorkley
ea9724a671 Remove dead code #adjustment_tax_amount and #no_tax_adjustments? 2021-07-09 21:49:35 +01:00
Matt-Yorkley
02fc3089d6 Remove dead code OrderTaxAdjustmentsFetcher#all 2021-07-09 21:49:35 +01:00
Matt-Yorkley
18e5fd19fa Update admin adjustment edit forms 2021-07-09 21:49:35 +01:00
Matt-Yorkley
f037bda1de Replace callback for applying tax to an admin adjustment
🎉
2021-07-09 21:49:35 +01:00
Matt-Yorkley
0c369b618d Remove code that guesses what the tax rate might be
🎉
2021-07-09 21:49:35 +01:00
Matt-Yorkley
65eb33ad9e Only update totals and states in AdjustmentsController
Avoids unnecessary updating of all other adjustments
2021-07-09 21:49:35 +01:00
Matt-Yorkley
e8d610f9df Remove dead code AdjustmentsController#enable_updates 2021-07-09 21:49:35 +01:00
Andy Brett
718f9c4af8 Merge pull request #7848 from jibees/7842-locale-management-on-user_passwords-controller
Handle lang management on user passwords controller
2021-07-09 08:55:09 -07:00
Matt-Yorkley
db7c397345 Merge pull request #7906 from openfoodfoundation/transifex
Transifex
2021-07-09 16:53:44 +02:00
Transifex-Openfoodnetwork
e19a407a39 Updating translations for config/locales/ru.yml 2021-07-09 23:31:56 +10:00
Transifex-Openfoodnetwork
3c104158db Updating translations for config/locales/ru.yml 2021-07-09 23:28:55 +10:00
Transifex-Openfoodnetwork
d9e0a6a04f Updating translations for config/locales/fr.yml 2021-07-09 23:28:44 +10:00
Transifex-Openfoodnetwork
99f127148e Updating translations for config/locales/ru.yml 2021-07-09 23:26:43 +10:00
Transifex-Openfoodnetwork
cce6ba65dd Updating translations for config/locales/fr.yml 2021-07-09 23:25:43 +10:00
Transifex-Openfoodnetwork
bb6162059d Updating translations for config/locales/en_FR.yml 2021-07-09 23:25:34 +10:00
Matt-Yorkley
32a2610e7d Refactor arguments for PaymentIntentValidator 2021-07-09 13:42:41 +01:00
Matt-Yorkley
e1846b1030 Extract Stripe payment helper methods to a service 2021-07-09 13:42:40 +01:00
Matt-Yorkley
dcc808a8b9 Improve #stripe_status return value for failed actions 2021-07-09 13:41:54 +01:00
Matt-Yorkley
986d068e28 Add #stripe_captured? method to Payment 2021-07-09 13:41:54 +01:00
Matt-Yorkley
65d9325287 Add #stripe_status helper method to Payment
This method could definitely be used elsewhere, but is currently most useful in debugging; at any time in the console you can bring up a payment object and call #stripe_status on it, and it'll make a live call to Stripe and tell you exactly what state the payment is in on the Stripe side.
2021-07-09 13:41:03 +01:00
Matt-Yorkley
e5a85caef6 Refactor Stripe::PaymentIntentValidator
This makes the interface a lot simpler and moves the fetching of the information it requires inside the service itself.
2021-07-09 13:39:52 +01:00
Matt-Yorkley
e6d9545c30 Use :incomplete scope when voiding payments that can't be processed due to stock changes 2021-07-09 13:31:00 +01:00
Transifex-Openfoodnetwork
4162215582 Updating translations for config/locales/fr.yml 2021-07-09 22:30:01 +10:00
Matt-Yorkley
2b8b690892 Tidy up :valid scope in Spree::Payment 2021-07-09 13:28:38 +01:00
Matt-Yorkley
b4a9a6fea5 Add :incomplete scope in Spree::Payment 2021-07-09 13:28:19 +01:00
Transifex-Openfoodnetwork
cf66d96746 Updating translations for config/locales/en_FR.yml 2021-07-09 22:27:37 +10:00
Transifex-Openfoodnetwork
c82db9716c Updating translations for config/locales/fr.yml 2021-07-09 22:26:57 +10:00
Matt-Yorkley
b1db06a3c6 Allow payments in requires_authorization state to be voided 2021-07-09 13:24:37 +01:00
Matt-Yorkley
a199f80ed4 Add test for insufficient stock behavior after Stripe redirect 2021-07-09 13:14:43 +01:00
Matt-Yorkley
2cd6b05aba Use Order::Contents service in test setup 2021-07-09 13:14:43 +01:00
Matt-Yorkley
9bcf0d5b38 Handle Stripe payments when checkout fails due to stock issues
This can occur when stock is reduced after the user is redirected to Stripe and before they are redirected back. The stock is insufficient, the order is not complete, the user is bounced back to the cart, but a *pending* Stripe payment is left on the order.
2021-07-09 13:13:20 +01:00
Matt-Yorkley
9795734dc8 Merge pull request #7903 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.4
Bump @storybook/addon-controls from 6.3.3 to 6.3.4
2021-07-09 12:41:48 +02:00
Matt-Yorkley
e5242bab49 Merge pull request #7902 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.4
Bump @storybook/server from 6.3.3 to 6.3.4
2021-07-09 12:41:30 +02:00
Matt-Yorkley
d4052a0e62 Merge pull request #7893 from guidoDutra/1861-add-shopfront-sort-placeholder-translations
Add translations to shopfront sorting placeholders
2021-07-09 12:37:40 +02:00
dependabot[bot]
b5b4f6df82 Bump @storybook/addon-controls from 6.3.3 to 6.3.4
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.3 to 6.3.4.
- [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.3.4/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-07-09 09:07:59 +00:00
dependabot[bot]
d89ae67c4d Bump @storybook/server from 6.3.3 to 6.3.4
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.3 to 6.3.4.
- [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.3.4/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-07-09 09:05:47 +00:00
jibees
a225a4e440 Merge pull request #7901 from openfoodfoundation/revert-7821-dependabot/npm_and_yarn/webpack-cli-4.7.2
Revert "Bump webpack-cli from 3.3.12 to 4.7.2"
2021-07-09 11:02:15 +02:00
Matt-Yorkley
626ced812a Revert "Bump webpack-cli from 3.3.12 to 4.7.2" 2021-07-09 10:38:47 +02:00
Maikel
75bdb82b5c Merge pull request #7900 from openfoodfoundation/transifex
Transifex
2021-07-09 17:19:08 +10:00
Transifex-Openfoodnetwork
74ba812061 Updating translations for config/locales/ru.yml 2021-07-09 16:23:32 +10:00
Andy Brett
c966c3b8d7 Merge pull request #7889 from openfoodfoundation/transifex
Transifex
2021-07-08 17:16:36 -07:00
Andy Brett
762d0ca338 Merge pull request #7899 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.4
Bump @storybook/addon-docs from 6.3.2 to 6.3.4
2021-07-08 16:55:17 -07:00
dependabot[bot]
131b22576b Bump @storybook/addon-docs from 6.3.2 to 6.3.4
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.2 to 6.3.4.
- [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.3.4/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-07-08 23:34:47 +00:00
Andy Brett
704da21c60 Merge pull request #7897 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.3
Bump @storybook/server from 6.3.2 to 6.3.3
2021-07-08 16:29:27 -07:00
Andy Brett
8bbb150b07 Merge pull request #7896 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.3
Bump @storybook/addon-controls from 6.3.2 to 6.3.3
2021-07-08 16:29:12 -07:00
Mathieu Lovato Stumpf Guntz
9670ca0fbb Update schema after recent migrations
Add table `terms_of_service_files` and a `tax_category_id` field
2021-07-08 19:10:53 +02:00
dependabot[bot]
76f91e7854 Bump @storybook/server from 6.3.2 to 6.3.3
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.2 to 6.3.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.3.3/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-07-08 09:06:23 +00:00
dependabot[bot]
f911f66ead Bump @storybook/addon-controls from 6.3.2 to 6.3.3
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.2 to 6.3.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.3.3/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-07-08 09:05:45 +00:00
Jean-Baptiste Bellet
1a8a12fb0c Filter language to not display the current lang in the dropdown
No need to set a lang that is actually already set
2021-07-08 09:15:09 +02:00
Guido Oliveira
9bc41cf04f Add translations to shopfront sorting placeholders 2021-07-07 14:39:10 -03:00
Andy Brett
869532d094 Merge pull request #7888 from openfoodfoundation/dependabot/bundler/rubocop-1.18.3
Bump rubocop from 1.18.2 to 1.18.3
2021-07-07 09:36:57 -07:00
Nihal Mohammed
db88121ed8 Update Customer model to validate email with valid_email2 gem 2021-07-07 20:30:06 +05:30
Nihal Mohammed
262baf1870 Add valid_email2 gem to Gemfile and run bundle install 2021-07-07 20:00:00 +05:30
Transifex-Openfoodnetwork
277a2a4d58 Updating translations for config/locales/de_DE.yml 2021-07-07 22:50:38 +10:00
dependabot[bot]
11a748b94e Bump rubocop from 1.18.2 to 1.18.3
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.2 to 1.18.3.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.2...v1.18.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 09:04:35 +00:00
Andy Brett
46cd05c54a Merge pull request #7712 from guidoDutra/1861-enable-shopfront-sorting-by-producer
Enable sorting by producer in shopfront
2021-07-06 09:27:42 -07:00
Andy Brett
ff3784ad3f Merge pull request #7851 from apricot12/view_deleted_payments_in_admin
Allow viewing of payments made with deleted pyment methods in admin
2021-07-06 07:24:42 -07:00
Andy Brett
4f18cf6645 Merge pull request #7882 from openfoodfoundation/dependabot/bundler/view_component-2.35.0
Bump view_component from 2.34.0 to 2.35.0
2021-07-06 06:43:38 -07:00
Jean-Baptiste Bellet
aa982fe8df Create a new method to change the lang of the app
- The old method (link to `?locale=#{l.to_s}`) was not functional for path that already has query params in current path (such as `/user/spree_user/password/edit?reset_password_token=`) ;
 - This seems that the best way to handle this, is to create a new route, new method that effectively set the lang (not the locale actually...) and then redirect_back (ie. using the HTTP_REFERER, with a fallback to `/`)

s
2021-07-06 10:09:37 +02:00
Andy Brett
6a126835cc Merge pull request #7881 from openfoodfoundation/dependabot/bundler/rubocop-1.18.2
Bump rubocop from 1.18.1 to 1.18.2
2021-07-05 10:30:01 -07:00
Pau Pérez Fabregat
c95ce5eb12 Merge pull request #7867 from coopdevs/enable-simplecov-in-dev
Fix coverage in development skipping Codecov
2021-07-05 15:23:29 +02:00
dependabot[bot]
86717f7b25 Bump view_component from 2.34.0 to 2.35.0
Bumps [view_component](https://github.com/github/view_component) from 2.34.0 to 2.35.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.34.0...v2.35.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 09:03:26 +00:00
dependabot[bot]
35fb4c03a7 Bump rubocop from 1.18.1 to 1.18.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.1...v1.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 09:02:47 +00:00
Andy Brett
f1cf828f34 Merge pull request #7550 from openfoodfoundation/dependabot/bundler/paper_trail-12.0.0
Bump paper_trail from 10.3.1 to 12.0.0
2021-07-02 10:14:53 -07:00
Andy Brett
ddf6d0b7e2 Merge pull request #7874 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.2
Bump rubocop-rails from 2.11.1 to 2.11.2
2021-07-02 07:19:49 -07:00
Matt-Yorkley
b1324c6269 Merge pull request #7745 from Matt-Yorkley/dotenv
Dotenv
2021-07-02 15:03:15 +02:00
dependabot[bot]
26123510a6 Bump rubocop-rails from 2.11.1 to 2.11.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.1 to 2.11.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.11.1...v2.11.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 09:04:00 +00:00
Andy Brett
3e860f6d54 Merge pull request #7781 from andrewpbrett/decouple-payments
Decouple payments
2021-07-01 18:07:01 -07:00
Matt-Yorkley
97a087707d Merge pull request #7873 from openfoodfoundation/transifex
Transifex
2021-07-01 18:57:56 +02:00
Transifex-Openfoodnetwork
f065df669a Updating translations for config/locales/de_DE.yml 2021-07-02 02:28:44 +10:00
Transifex-Openfoodnetwork
a2196b08a3 Updating translations for config/locales/en_IE.yml 2021-07-02 02:28:42 +10:00
Transifex-Openfoodnetwork
aa7d08dff7 Updating translations for config/locales/en_FR.yml 2021-07-02 02:25:41 +10:00
Transifex-Openfoodnetwork
fab3486669 Updating translations for config/locales/en_GB.yml 2021-07-02 02:25:38 +10:00
Transifex-Openfoodnetwork
71e97b3eba Updating translations for config/locales/es.yml 2021-07-02 02:25:35 +10:00
Pau Pérez Fabregat
021f33645d Merge pull request #7629 from viktorsmari/remove-bin-from-gitignore
Stop gitignoring the bin/ folder
2021-07-01 18:04:01 +02:00
Andy Brett
058ba2bb8c Merge pull request #7862 from openfoodfoundation/dependabot/bundler/stripe-5.35.0
Bump stripe from 5.34.0 to 5.35.0
2021-07-01 08:50:29 -07:00
Andy Brett
a5ead1da86 Merge pull request #7870 from andrewpbrett/revert-webpack-again
Revert "Bump webpack from 5.41.0 to 5.41.1"
2021-07-01 08:46:41 -07:00
Andy Brett
0af845a02d Revert "Bump webpack from 5.41.0 to 5.41.1"
This reverts commit 1a8a0f33d0.
2021-07-01 08:45:34 -07:00
Andy Brett
79eef161f5 Merge pull request #7866 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.2
Bump @storybook/addon-docs from 6.3.1 to 6.3.2
2021-07-01 08:03:03 -07:00
Matt-Yorkley
0005a77115 Update all locales with the latest Transifex translations 2021-07-01 16:01:24 +01:00
Matt-Yorkley
a0b9eff2c1 Merge pull request #7699 from guidoDutra/1971-inventory-page-field-validation
Add validation to inventory page fields
2021-07-01 16:59:20 +02:00
dependabot[bot]
c571767cfb Bump @storybook/addon-docs from 6.3.1 to 6.3.2
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.1 to 6.3.2.
- [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.3.2/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-07-01 14:58:58 +00:00
Andy Brett
b9bb43054a Merge pull request #7863 from openfoodfoundation/dependabot/bundler/good_migrations-0.1.0
Bump good_migrations from 0.0.2 to 0.1.0
2021-07-01 07:51:27 -07:00
Andy Brett
8fb51165bc Merge pull request #7865 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.2
Bump @storybook/addon-controls from 6.3.1 to 6.3.2
2021-07-01 07:49:47 -07:00
Nihal Mohammed
5e7d4bf0c3 Allow viewing of payments made with deleted pyment methods in admin 2021-07-01 19:29:16 +05:30
Pau Pérez Fabregat
f6e0b9af0e Merge pull request #7646 from apricot12/advanced_settings_button_OC_edits
Add advanced settings button to incoming and outgoing pages in OC cyc…
2021-07-01 15:37:16 +02:00
Matt-Yorkley
d2ebda8844 Merge pull request #7856 from andrewpbrett/raise-on-missing-translations
Update config to address deprecation warning for missing translations
2021-07-01 14:22:23 +02:00
Pau Pérez Fabregat
8883aa13ad Merge pull request #7814 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-8.1.0
Bump acts-as-taggable-on from 8.0.0 to 8.1.0
2021-07-01 14:00:17 +02:00
Matt-Yorkley
12f7e2d685 Set nicer Redis defaults for dev environment
In Staging and Production we have two Redis instances running on two different ports. In dev that probably won't be set up, and Redis will be on port 6379 by default. These defaults mean it will work nicely out of the box.
2021-07-01 12:59:11 +01:00
Matt-Yorkley
083f512aae Refactor Sidekiq settings and set expiry in development
This means old cache entries will be automatically removed instead of perpetually filling up the local Redis instance in dev.
2021-07-01 12:59:11 +01:00
Matt-Yorkley
5a06ba651a Add dev and test Dotenv files
These can now be defined separately and overridden locally 🎉
2021-07-01 12:59:11 +01:00
Matt-Yorkley
d31208d1e5 Switch from Figaro to Dotenv for ENV var management 2021-07-01 12:59:11 +01:00
dependabot[bot]
7b2f2ef690 Bump @storybook/addon-controls from 6.3.1 to 6.3.2
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.1 to 6.3.2.
- [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.3.2/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-07-01 11:58:26 +00:00
Pau Pérez Fabregat
13dfbb9a0c Merge pull request #7859 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.41.1
Bump webpack from 5.41.0 to 5.41.1
2021-07-01 13:55:47 +02:00
Pau Pérez Fabregat
8b12fd4af1 Merge pull request #7864 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.2
Bump @storybook/server from 6.3.1 to 6.3.2
2021-07-01 13:55:24 +02:00
Pau Pérez Fabregat
f071ab2038 Merge pull request #7807 from mkllnk/rbenv-install
Add convenience script to install Ruby
2021-07-01 13:53:54 +02:00
Pau Perez
f49e5a8610 Fix coverage in development skipping Codecov
The way we have it set up, Simplecov generates a report in Codecov's format
and tries to send it to them, which fails.

This gets us back to the former Simplecov setup. This lets you check the
visual coverage report navigating to `coverage/index.html`.
2021-07-01 13:34:16 +02:00
dependabot[bot]
16d0235a6e Bump @storybook/server from 6.3.1 to 6.3.2
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.1 to 6.3.2.
- [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.3.2/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-07-01 09:05:40 +00:00
dependabot[bot]
ea8cb9ce7d Bump good_migrations from 0.0.2 to 0.1.0
Bumps [good_migrations](https://github.com/testdouble/good-migrations) from 0.0.2 to 0.1.0.
- [Release notes](https://github.com/testdouble/good-migrations/releases)
- [Changelog](https://github.com/testdouble/good-migrations/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testdouble/good-migrations/compare/v0.0.2...v0.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 09:04:42 +00:00
dependabot[bot]
00b6b58b4d Bump stripe from 5.34.0 to 5.35.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.34.0 to 5.35.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.34.0...v5.35.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 09:04:14 +00:00
Maikel Linke
23ebe91d32 Spec current version tracking of order cycles
The paper_trail gem doesn't quite work as expected with our
implementation. We need some more code or an additional gem:

https://github.com/westonganger/paper_trail-association_tracking
2021-07-01 14:56:05 +10:00
dependabot[bot]
007dbc858f Bump paper_trail from 10.3.1 to 12.0.0
Bumps [paper_trail](https://github.com/airblade/paper_trail) from 10.3.1 to 12.0.0.
- [Release notes](https://github.com/airblade/paper_trail/releases)
- [Changelog](https://github.com/paper-trail-gem/paper_trail/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airblade/paper_trail/compare/v10.3.1...v12.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 14:47:28 +10:00
Andy Brett
e9a00eb0d4 Merge pull request #7310 from cillian/resumed-order-actions-menu
Make sure the Resend Confirmation and Send/Print Invoice links display for resumed orders
2021-06-30 10:43:07 -07:00
Andy Brett
7451f06fe1 Merge pull request #7307 from cillian/hide-notifications-setting-for-profiles
Don't show the Notifications setting for profile only enterprises in the Users section
2021-06-30 10:14:14 -07:00
Nihal Mohammed
f7795ca21a Fix failing specs 2021-06-30 09:50:38 -07:00
Nihal Mohammed
cd0b97bf0a Update i18n configs 2021-06-30 09:50:38 -07:00
Nihal Mohammed
18282a6f73 Add advanced settings button to incoming and outgoing pages in OC cycle edit 2021-06-30 09:50:38 -07:00
Nihal Mohammed
c335ec3b29 # This is a combination of 5 commits.tree d6d4f31283e42c44c9c4d116567ce7b1a99a13ab
parent b680697af6
author Nihal Mohammed <mnihal64@outlook.com> 1621004464 +0530
committer Nihal Mohammed <mnihal64@outlook.com> 1621022463 +0530

# This is a combination of 4 commits.
# This is the 1st commit message:

Add advanced settings button to incoming and outgoing pages in OC cycle edit

# This is the commit message #2:

Remove extra header text

# This is the commit message #3:

Moved repeating code blocks to partial

# This is the commit message #4:

Refactored code

# This is the commit message #5:

Delete _advanced_settings_hidden.html.haml
2021-06-30 09:50:38 -07:00
Cillian O'Ruanaidh
2bb406fe6a Don't show the Notifications setting for profile only enterprises in the Users settings section
If a enterprise has only set up a profile they won't be getting any order notification emails so showing this setting could be confusing.

#1797
2021-06-30 09:48:08 -07:00
dependabot[bot]
1a8a0f33d0 Bump webpack from 5.41.0 to 5.41.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.41.0 to 5.41.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.41.0...v5.41.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 16:47:01 +00:00
Andy Brett
7eac465b18 Merge pull request #7861 from andrewpbrett/revert-webpack
Revert "Bump webpack from 4.46.0 to 5.41.0"
2021-06-30 09:41:45 -07:00
Andy Brett
404a2d3a2d Revert "Bump webpack from 4.46.0 to 5.41.0"
This reverts commit e753f47291.
2021-06-30 09:26:15 -07:00
Andy Brett
47e954afcb Merge pull request #7858 from openfoodfoundation/dependabot/bundler/rubocop-1.18.1
Bump rubocop from 1.18.0 to 1.18.1
2021-06-30 08:04:56 -07:00
Viktor Smari
c95c2f5772 Add files generated by spring binstub --all 2021-06-30 13:35:09 +02:00
Viktor Smari
14a1992d52 Stop ignoring the /bin folder
New rails apps do not ignore the bin folder.
When running rails app:update, the bin folder also gets update.
This also allows us to use bin/rails to run rails, or bin/yarn etc.
Tip: create an alias r=./bin/rails
2021-06-30 13:33:11 +02:00
dependabot[bot]
e98ad9096d Bump rubocop from 1.18.0 to 1.18.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.0...v1.18.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 09:04:54 +00:00
Matt-Yorkley
7489fd98bf Merge pull request #7837 from openfoodfoundation/dependabot/bundler/rails-6.1.4
Bump rails from 6.1.3.2 to 6.1.4
2021-06-29 21:32:07 +02:00
Matt-Yorkley
189d007304 Merge pull request #7850 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.41.0
Bump webpack from 4.46.0 to 5.41.0
2021-06-29 21:28:04 +02:00
Andy Brett
a97b5b7c90 rename payment state machine events to be verbs 2021-06-29 11:54:51 -07:00
Andy Brett
9b1da14380 mark payment failed after failed authorization 2021-06-29 11:54:51 -07:00
Andy Brett
f61fbee52a refactor to advance_to_state method
this leaves `advance_order!` as is since it's not directly touched by this PR and the metaprogramming looks like it would decrease readability
2021-06-29 11:54:51 -07:00
Andy Brett
aa8067f96b process payments separately from completing the order 2021-06-29 11:54:48 -07:00
Andy Brett
d2701226b6 complete order immediately before adding payment 2021-06-29 11:45:33 -07:00
dependabot[bot]
4bbdcc109d Bump rails from 6.0.3.7 to 6.1.4
Bumps [rails](https://github.com/rails/rails) from 6.0.3.7 to 6.1.4.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.0.3.7...v6.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 17:33:32 +00:00
dependabot[bot]
09254215a5 Bump acts-as-taggable-on from 8.0.0 to 8.1.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/mbleigh/acts-as-taggable-on/releases)
- [Changelog](https://github.com/mbleigh/acts-as-taggable-on/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mbleigh/acts-as-taggable-on/compare/v8.0.0...v8.1.0)

---
updated-dependencies:
- dependency-name: acts-as-taggable-on
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 17:22:37 +00:00
Andy Brett
63fcb40f6c update config to address deprecation warning for missing translations config 2021-06-29 10:22:25 -07:00
Andy Brett
1a6257257a Merge pull request #7608 from luisramos0/rails61
[Rails 6.1] Upgrade to rails 6.1
2021-06-29 10:21:15 -07:00
Andy Brett
e24d2e5077 address deprecation warning 2021-06-29 09:17:31 -07:00
Andy Brett
eb724bbe10 Merge pull request #7849 from openfoodfoundation/dependabot/bundler/rubocop-1.18.0
Bump rubocop from 1.17.0 to 1.18.0
2021-06-29 06:48:44 -07:00
dependabot[bot]
e753f47291 Bump webpack from 4.46.0 to 5.41.0
Bumps [webpack](https://github.com/webpack/webpack) from 4.46.0 to 5.41.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.46.0...v5.41.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 09:08:03 +00:00
dependabot[bot]
df353aa006 Bump rubocop from 1.17.0 to 1.18.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.17.0...v1.18.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-29 09:05:09 +00:00
Andy Brett
7b87476986 Merge pull request #7804 from Matt-Yorkley/default-taxrate-check
Ignore potential error in dev where default tax rate is nil
2021-06-28 10:35:09 -07:00
Andy Brett
837c9bd7d8 Merge pull request #7826 from openfoodfoundation/dependabot/bundler/knapsack-3.1.0
Bump knapsack from 1.22.0 to 3.1.0
2021-06-28 10:34:01 -07:00
Andy Brett
394043dcc2 Merge pull request #7817 from openfoodfoundation/dependabot/bundler/webpacker-5.4.0
Bump webpacker from 5.3.0 to 5.4.0
2021-06-28 10:32:54 -07:00
Andy Brett
bc8ba48100 Merge pull request #7846 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.1
Bump @storybook/addon-docs from 6.3.0 to 6.3.1
2021-06-28 08:51:33 -07:00
dependabot[bot]
1b93d7a45f Bump @storybook/addon-docs from 6.3.0 to 6.3.1
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.3.0 to 6.3.1.
- [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.3.1/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-06-28 15:50:42 +00:00
Andy Brett
1137341591 Merge pull request #7845 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.1
Bump @storybook/server from 6.3.0 to 6.3.1
2021-06-28 08:46:30 -07:00
Pau Pérez Fabregat
4db0075de3 Merge pull request #7821 from openfoodfoundation/dependabot/npm_and_yarn/webpack-cli-4.7.2
Bump webpack-cli from 3.3.12 to 4.7.2
2021-06-28 17:23:04 +02:00
dependabot[bot]
2a6a3fd64a Bump @storybook/server from 6.3.0 to 6.3.1
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.3.0 to 6.3.1.
- [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.3.1/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-06-28 15:15:44 +00:00
Pau Pérez Fabregat
9055e186b6 Merge pull request #7847 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.1
Bump @storybook/addon-controls from 6.3.0 to 6.3.1
2021-06-28 17:11:20 +02:00
dependabot[bot]
965ee4a88f Bump @storybook/addon-controls from 6.3.0 to 6.3.1
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.3.0 to 6.3.1.
- [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.3.1/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-06-28 09:09:34 +00:00
Jean-Baptiste Bellet
0a6d959742 Set locale to the user passwords controller
- Thus this use the same locale that the one which was set previously (if it's different from the browser one)
2021-06-28 10:19:46 +02:00
Andy Brett
cbc0cb707d Merge pull request #7816 from mkllnk/customer-import
Add example script for importing customers
2021-06-25 10:16:54 -07:00
Andy Brett
0e0e9402dd Merge pull request #7836 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.1
Bump rubocop-rails from 2.11.0 to 2.11.1
2021-06-25 09:32:20 -07:00
Transifex-Openfoodnetwork
71609a6489 Updating translations for config/locales/en_IE.yml 2021-06-25 22:28:54 +10:00
dependabot[bot]
5b2a7bf7e7 Bump rubocop-rails from 2.11.0 to 2.11.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.11.0...v2.11.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-25 09:02:06 +00:00
Andy Brett
8ec6b8682f Merge pull request #7831 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.3.0
Bump @storybook/server from 6.2.9 to 6.3.0
2021-06-24 12:24:40 -07:00
Andy Brett
a1efa685f9 Merge pull request #7830 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.3.0
Bump @storybook/addon-controls from 6.2.9 to 6.3.0
2021-06-24 12:24:13 -07:00
dependabot[bot]
03b43e3302 Bump @storybook/addon-controls from 6.2.9 to 6.3.0
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.2.9 to 6.3.0.
- [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.3.0/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-06-24 19:22:02 +00:00
dependabot[bot]
75d0be410f Bump @storybook/server from 6.2.9 to 6.3.0
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.2.9 to 6.3.0.
- [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.3.0/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-06-24 19:21:19 +00:00
Andy Brett
afe92dfcad Merge pull request #7827 from openfoodfoundation/dependabot/bundler/bugsnag-6.21.0
Bump bugsnag from 6.20.0 to 6.21.0
2021-06-24 12:20:57 -07:00
Andy Brett
5dea7d218a Merge pull request #7828 from openfoodfoundation/dependabot/bundler/test-prof-1.0.6
Bump test-prof from 1.0.5 to 1.0.6
2021-06-24 12:19:40 -07:00
Andy Brett
28c2601a24 Merge pull request #7829 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.3.0
Bump @storybook/addon-docs from 6.2.9 to 6.3.0
2021-06-24 12:17:40 -07:00
Andy Brett
07a2a584c3 remove calls to ssl_allowed as well 2021-06-24 12:06:34 -07:00
Andy Brett
334b9b520a removed deprecated calls to force_ssl; rely on config.force_ssl 2021-06-24 11:58:33 -07:00
Andy Brett
0c03ca26af Merge pull request #7832 from openfoodfoundation/RachL-patch-1
Update links to welcoming new people boards
2021-06-24 09:14:43 -07:00
Andy Brett
9a9dd6a308 Merge pull request #7768 from apricot12/delete_shipped_orders_from_BOM
Hide shipped orders from BOM
2021-06-24 09:09:54 -07:00
Andy Brett
df0c98d013 Merge branch 'master' into rails61 2021-06-24 08:02:58 -07:00
Nihal Mohammed
5a94e3b644 Remove duplicate shipment_state conditions from BOM spec 2021-06-24 20:01:19 +05:30
Transifex-Openfoodnetwork
f707284c6c Updating translations for config/locales/ru.yml 2021-06-24 23:38:03 +10:00
Nihal Mohammed
edca260af4 Hide shipped orders from BOM and update specs 2021-06-24 18:26:39 +05:30
Rachel Arnould
636d449de1 Update links to welcoming new people boards
Updating links
2021-06-24 12:22:06 +02:00
dependabot[bot]
2f58f932a7 Bump @storybook/addon-docs from 6.2.9 to 6.3.0
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.2.9 to 6.3.0.
- [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.3.0/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-06-24 09:05:34 +00:00
dependabot[bot]
68aa42860e Bump test-prof from 1.0.5 to 1.0.6
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.5...v1.0.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:05:28 +00:00
dependabot[bot]
c4fbb2e715 Bump bugsnag from 6.20.0 to 6.21.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.20.0 to 6.21.0.
- [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.20.0...v6.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:05:02 +00:00
dependabot[bot]
dca51ec298 Bump knapsack from 1.22.0 to 3.1.0
Bumps [knapsack](https://github.com/KnapsackPro/knapsack) from 1.22.0 to 3.1.0.
- [Release notes](https://github.com/KnapsackPro/knapsack/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack/compare/v1.22.0...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-24 09:04:04 +00:00
Andy Brett
e37a065f10 Merge pull request #7281 from coopdevs/refactor-subs-placement-job
Refactor subs placement job
2021-06-23 11:47:50 -07:00
Andy Brett
92216cc1c7 Merge pull request #7761 from apricot12/show_variant_SKU_in_xero
Show product variant SKU in Xero report
2021-06-23 08:59:15 -07:00
Andy Brett
ca7b1f047b Merge pull request #7780 from apricot12/new_payment_method_html_bug
Fix HTML bug on new payment method page
2021-06-23 08:58:45 -07:00
Pau Perez
1125ac635b Make test not too dangerously play with time
We could get hurt and introduce flakiness in the build.
2021-06-23 13:47:42 +02:00
Pau Perez
1f3560e964 Pass in the order when it's already initialized
At `CapQuantity`'s instantiation time the proxy's order is not yet
initialized, and so `CapQuantity` was checking against nil all the time.

This went unnoticed because the job's specs were not integration-level
tests and were stubbing way too many things.
2021-06-23 13:47:42 +02:00
Pau Perez
648023750b Move tests exercising the service to its spec file
These are bypassing the job to only test the service, so there's no
point on doing that. They can test the service alone.
2021-06-23 13:45:43 +02:00
François Turbelin
06c19641b4 Remove return on case 2021-06-22 20:44:51 +02:00
Andy Brett
49dbca71b8 Merge pull request #7748 from openfoodfoundation/dependabot/bundler/stripe-5.34.0
Bump stripe from 5.33.0 to 5.34.0
2021-06-22 11:18:20 -07:00
Andy Brett
ec8a892e13 Merge pull request #7820 from openfoodfoundation/dependabot/npm_and_yarn/rails/webpacker-5.4.0
Bump @rails/webpacker from 5.3.0 to 5.4.0
2021-06-22 10:41:41 -07:00
Andy Brett
a69d89130f Merge pull request #7819 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.11.0
Bump rubocop-rails from 2.10.1 to 2.11.0
2021-06-22 10:31:13 -07:00
dependabot[bot]
3ddc142ee9 Bump webpack-cli from 3.3.12 to 4.7.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.7.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.7.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:06:57 +00:00
dependabot[bot]
d75bc2fd14 Bump @rails/webpacker from 5.3.0 to 5.4.0
Bumps [@rails/webpacker](https://github.com/rails/webpacker) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.3.0...v5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:06:37 +00:00
dependabot[bot]
6e88090b89 Bump rubocop-rails from 2.10.1 to 2.11.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.10.1...v2.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:03:42 +00:00
dependabot[bot]
cfb81d7f94 Bump webpacker from 5.3.0 to 5.4.0
Bumps [webpacker](https://github.com/rails/webpacker) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/webpacker/compare/v5.3.0...v5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:02:36 +00:00
Maikel Linke
a6753b832c Add example script for importing customers 2021-06-22 13:46:34 +10:00
Transifex-Openfoodnetwork
2eb67cf61b Updating translations for config/locales/de_DE.yml 2021-06-22 07:46:31 +10:00
Andy Brett
fea5c27437 Merge pull request #7775 from Matt-Yorkley/webpacker
Add Webpacker
2021-06-21 11:15:28 -07:00
Andy Brett
9db14a5e8c Merge pull request #7815 from Matt-Yorkley/dev-retries
Move Rspec retries count to CI config and remove in local environment
2021-06-21 09:09:44 -07:00
Matt-Yorkley
99035a250b Move Rspec retries count to CI config and remove in local environment
When running tests locally we want them to fail immediately

Reference: https://github.com/NoRedInk/rspec-retry#environment-variables
2021-06-21 11:21:11 +01:00
Transifex-Openfoodnetwork
27c6a842bd Updating translations for config/locales/es.yml 2021-06-21 18:41:34 +10:00
Transifex-Openfoodnetwork
3cb6f77cbb Updating translations for config/locales/ca.yml 2021-06-21 18:41:21 +10:00
Pau Perez
475474b179 Replace order reloads with association set up 2021-06-21 10:30:12 +02:00
Pau Perez
073c4bc1ae Reload order so line items are visible in spec 2021-06-21 10:30:12 +02:00
Pau Perez
e052f36cc6 Rubocop -a 2021-06-21 10:30:12 +02:00
Pau Perez
827faef690 Fix call to #record_and_log_error 2021-06-21 10:30:12 +02:00
Pau Perez
b69aeae892 Rename PlaceOrder to PlaceProxyOrder
As discussed in
https://github.com/openfoodfoundation/openfoodnetwork/pull/7281#discussion_r650183813.
2021-06-21 10:30:12 +02:00
Pau Perez
f92ca964db Improve service name
As discussed in
https://github.com/openfoodfoundation/openfoodnetwork/pull/7281#discussion_r650069982.
2021-06-21 10:30:12 +02:00
Transifex-Openfoodnetwork
030ad350b6 Updating translations for config/locales/en_GB.yml 2021-06-21 18:17:46 +10:00
Pau Perez
8bcb19f293 Split method into higher-level smaller methods 2021-06-21 09:49:07 +02:00
Pau Perez
f61cdb6608 Extract CapQuantityAndStoreChanges service
This is a responsiblity of its own that makes the job's tests really
complex.
2021-06-21 09:49:07 +02:00
Pau Perez
431f30bb52 Fix proxy_order.placed_at test and deal with time
Relying on Rails' `freeze_time` is much more reliable than this brittle
magic number. It turns out Timecop is not needed for this case anymore.
See
https://frontdeveloper.pl/2020/03/how-we-migrated-from-timecop-to-built-in-rails-5-2-time-helpers/.
2021-06-21 09:47:49 +02:00
Pau Perez
f785851236 Use time with zone 2021-06-21 09:47:49 +02:00
Pau Perez
fcb013eb2a Extract subs placement job logic into new service
While doing that we pass stock changes to the service but we
lazy-evaluate them. This way we don't fetch all this data from DB when
it might not be used due to an early return.

Also, this makes it possible to save the stock-related logic for later.

Finally, when changing things to rely on `#initialize_order`'s boolean
return value I noticed though, that we were evaluating
`proxy_order.order` too early.  When instantiating the service object it
won't exist yet.
2021-06-21 09:47:49 +02:00
Transifex-Openfoodnetwork
5ff13b6e3e Updating translations for config/locales/en_FR.yml 2021-06-21 17:28:50 +10:00
Transifex-Openfoodnetwork
3e0ff968bd Updating translations for config/locales/fr.yml 2021-06-21 17:26:28 +10:00
Matt-Yorkley
6c3c46b0f5 Add foreman and Procfile 2021-06-19 17:51:18 +01:00
Matt-Yorkley
0acd4fc9a1 Change Webpacker default path name
In the current version of Webpacker all assets are kept under a new path called `app/javascript`. This is a really stupid name, as it can contain all kinds of assets that are *not* javascript at all, like SCSS. It's common practise to rename this to something sensible like `app/webpacker` or `app/frontend`...
2021-06-19 17:51:18 +01:00
Matt-Yorkley
a074f627b2 Add Webpacker
Most of this is automatically generated by the rake task: `bundle exec rake webpacker:install`

Docs: https://github.com/rails/webpacker/tree/5-x-stable
2021-06-19 17:51:18 +01:00
Andy Brett
3d65929a74 Merge pull request #7808 from mkllnk/sass-gem
Remove explicit dependency on sass gem
2021-06-19 09:05:21 -07:00
Transifex-Openfoodnetwork
d89a0e2cd9 Updating translations for config/locales/en_CA.yml 2021-06-19 02:05:04 +10:00
Pau Perez
198d4be18f Update all locales with the latest Transifex translations 2021-06-18 18:05:03 +02:00
Transifex-Openfoodnetwork
ecad6c1982 Updating translations for config/locales/ru.yml 2021-06-19 01:41:57 +10:00
Pau Pérez Fabregat
42e26f3328 Merge pull request #7708 from andrewpbrett/payment-states
Add `requires_authorization` Payment state
2021-06-18 17:04:03 +02:00
Pau Perez
cb23cda9e9 Update all locales with the latest Transifex translations 2021-06-18 15:05:26 +02:00
Transifex-Openfoodnetwork
4255dd9141 Updating translations for config/locales/es.yml 2021-06-18 22:57:08 +10:00
Transifex-Openfoodnetwork
654bde6207 Updating translations for config/locales/ca.yml 2021-06-18 22:56:45 +10:00
Pau Pérez Fabregat
4ecbf51b33 Merge pull request #7802 from Matt-Yorkley/confirmation-mails
Add a delay on sending order confirmation emails
2021-06-18 12:27:24 +02:00
Pau Pérez Fabregat
837e65d72a Merge pull request #7792 from openfoodfoundation/dependabot/npm_and_yarn/postcss-7.0.36
Bump postcss from 7.0.35 to 7.0.36
2021-06-18 12:24:33 +02:00
Pau Pérez Fabregat
aa9a85159e Merge pull request #7806 from mkllnk/feature-toggles
Remove custom feature toggles
2021-06-18 12:23:21 +02:00
Pau Pérez Fabregat
db993652c4 Merge branch 'master' into payment-states 2021-06-18 12:20:26 +02:00
Pau Pérez Fabregat
b500486f6b Merge pull request #7211 from jibees/4207-add-query-params-in-url
Orders list : save filters params
2021-06-18 11:19:26 +02:00
Pau Pérez Fabregat
11a7316b9d Merge pull request #7759 from apricot12/fix_duplicate_refund
Disable credit button on click
2021-06-18 09:27:45 +02:00
Pau Pérez Fabregat
75ed148490 Merge pull request #7803 from openfoodfoundation/transifex
Transifex
2021-06-18 09:26:47 +02:00
Transifex-Openfoodnetwork
2f82afcb07 Updating translations for config/locales/en_FR.yml 2021-06-18 16:58:14 +10:00
Transifex-Openfoodnetwork
fcf6f1929b Updating translations for config/locales/fr.yml 2021-06-18 16:58:00 +10:00
Pau Pérez Fabregat
6f90a7b07f Merge pull request #7720 from luisramos0/rubocop_auto_correct
Executed rubocop autocorrect (-a for safe corrections plus adding frozen_string_literal comment to all files)
2021-06-18 08:48:03 +02:00
Transifex-Openfoodnetwork
36fa34a39e Updating translations for config/locales/es.yml 2021-06-18 16:44:01 +10:00
Transifex-Openfoodnetwork
d516b1d885 Updating translations for config/locales/ca.yml 2021-06-18 16:43:55 +10:00
Maikel Linke
2027590a8a Remove explicit dependency on sass gem
We still depend on it via compass and foundation-rails but it's not
explicit any more.

The sass gem has been deprecated in favour of the faster sassc gem.
But sassc has been deprecated in favour of dart-sass which is an npm
package.

https://github.com/sass/ruby-sass#ruby-sass-has-reached-end-of-life
https://github.com/sass/sassc#sassc

This is confusing but we don't have to worry about it because it's not
a direct dependency and other gems can solve the dependency selection
for us, I think. 😄
2021-06-18 15:49:43 +10:00
Maikel Linke
2c8bead8a0 Add convenience script to update Ruby 2021-06-18 15:13:00 +10:00
Andy Brett
d9aa1b054a update payments to be in requires_authorization state in specs 2021-06-17 18:10:41 -07:00
Maikel Linke
a8eecf963d Remove unused custom FeatureToggle implementation
Flipper is now our only source of truth regarding feature toggles.
2021-06-18 10:46:51 +10:00
Maikel Linke
bba85e5e79 Remove feature toggling via ENV vars
We don't use ENV vars for feature toggles any more. Flipper is much
easier to manage.
2021-06-18 10:46:51 +10:00
Maikel Linke
a712f254e0 Remove Australian custom homepage content
This was activated with a feature toggle. But when we re-implemented the
feature toggles, we accidentally broke this one and it hasn't been
active for two months. Nobody complained and it doesn't seem to be
needed while developers are keen to remove instance-specific
customisations anyway.
2021-06-18 10:46:50 +10:00
Luis Ramos
5a05a21dad Revert to false so strings can be mutated in this class 2021-06-17 23:07:54 +01:00
Luis Ramos
f95b0e3c54 Revert frozen string literal comment in codecov config 2021-06-17 23:07:41 +01:00
Luis Ramos
755222a35d Revert to false so strings can be mutated in this class 2021-06-17 23:07:35 +01:00
Luis Ramos
e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Luis Ramos
4fe9a936f0 Regenerate rubocop_todo 2021-06-17 22:32:59 +01:00
Luis Ramos
a253228b96 Add some rubocop disable commands in the code to avoid future wrong rubocop auto corrections 2021-06-17 22:26:54 +01:00
Andy Brett
b41302d5d8 update state transitions for new requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
dd0375aed4 clear authorization url after failing the payment 2021-06-17 14:23:59 -07:00
Andy Brett
d3cca04703 update spec 2021-06-17 14:23:59 -07:00
Andy Brett
3e32abe64f add colors and translations for requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
dc1a24339c update can_resend_auth_email 2021-06-17 14:23:59 -07:00
Andy Brett
95f123d137 update success response in payment spec 2021-06-17 14:23:59 -07:00
Andy Brett
b016337d4f add requires_authorization as a possible payment_state on Orders 2021-06-17 14:23:59 -07:00
Andy Brett
24a60cd108 add translation key 2021-06-17 14:23:59 -07:00
Andy Brett
2699e17b63 update specs to create payment in requires_authorization state 2021-06-17 14:23:59 -07:00
Andy Brett
527f4e2cb3 move payment to requires_authorization if cvv_result is present 2021-06-17 14:23:59 -07:00
Andy Brett
a6cec20056 update success_response in payment_spec 2021-06-17 14:23:59 -07:00
Andy Brett
31738ceb49 rename and consolidate authorization? methods 2021-06-17 14:23:59 -07:00
Andy Brett
674ca3026b change states after failure/requiring auth 2021-06-17 14:23:58 -07:00
Andy Brett
a3d9f1f3cc create requires_authorization payment state and migration 2021-06-17 14:23:58 -07:00
Andy Brett
4d2235c9cc Merge pull request #7794 from openfoodfoundation/dependabot/bundler/bigdecimal-3.0.2
Bump bigdecimal from 1.4.2 to 3.0.2
2021-06-17 14:21:55 -07:00
Luis Ramos
de76a1d41e Manually fix rubocop issue (unsafe auto correct would be wrong) 2021-06-17 22:20:28 +01:00
Luis Ramos
23627c5453 Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
9290 issues fixed
2021-06-17 22:19:26 +01:00
Andy Brett
5a25de1c82 Merge pull request #7760 from apricot12/remove_unused_partial_paypal
Remove unused partial paypal
2021-06-17 13:21:33 -07:00
Andy Brett
355b5ab56f Merge pull request #7788 from jibees/5735-flaky-spec-on-variant-override
Uncomment flaky (?) spec
2021-06-17 12:55:16 -07:00
Andy Brett
bcd0173ed0 Merge pull request #7305 from cillian/add-distributor-to-shipment-email
Add enterprise name to subject and body of shipment shipped email
2021-06-17 12:53:09 -07:00
Andy Brett
7c694e3cf3 Merge pull request #7771 from openfoodfoundation/dependabot/bundler/activemerchant-1.121.0
Bump activemerchant from 1.120.0 to 1.121.0
2021-06-17 12:52:21 -07:00
Jean-Baptiste Bellet
89ea9913e6 Checkbox is correctly handled with null value (and not false)
- It's better to read the comment juste below the line... 😠 (https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498)
 - Add appropriate spec so it is now correctly tested!
2021-06-17 21:40:25 +02:00
Matt-Yorkley
c821380ff1 Merge pull request #7749 from apricot12/remove_paypal_refund_button
Remove refund button from paypal completed order tab
2021-06-17 21:37:51 +02:00
Guido Oliveira
0f2fd47ca0 Fix supplier loader issue in enterprise controller 2021-06-17 13:57:19 -03:00
Guido Oliveira
92031120e3 Create service for select2 autocomplete 2021-06-17 13:54:18 -03:00
Matt-Yorkley
e4e84b0a86 Remove old warning on BigDecimal gem 2021-06-17 16:05:12 +01:00
Matt-Yorkley
a7d873356d Fix shady use of BigDecimal 2021-06-17 15:51:06 +01:00
Matt-Yorkley
148349f0f3 Ignore potential error where default tax rate is nil
If the current tax rates are badly *misconfigured*, and an included-tax rate is being applied but a *default* rate does not exist (there are validations to stop this case from occurring, see DefaultTaxZoneValidator), this line can throw an error. This situation will not actually arise in production, but can happen fairly easily in dev or with staging data when switching datasets, and when it does it's kind of annoying.

Note: the logic in the check here is still good; if there's no default tax rate we check if the order's tax zone matches the zone for the current tax rate, which is correct.
2021-06-17 12:47:41 +01:00
Transifex-Openfoodnetwork
ba7b53051a Updating translations for config/locales/es.yml 2021-06-17 20:30:36 +10:00
Transifex-Openfoodnetwork
5803c0fe50 Updating translations for config/locales/fr.yml 2021-06-17 20:27:31 +10:00
Transifex-Openfoodnetwork
2e701656d2 Updating translations for config/locales/en_US.yml 2021-06-17 20:27:29 +10:00
Pau Pérez Fabregat
a8efbffca6 Merge pull request #7429 from Matt-Yorkley/adjustments-taxrate
[Adjustments] TaxRate changes
2021-06-17 11:51:01 +02:00
Pau Pérez Fabregat
ef724d2de8 Merge pull request #7758 from jibees/7710-manage-comma-as-decimal-separator-in-unit-value-field
[UnitPrice] Manage comma as decimal separator in unit value field
2021-06-17 11:46:22 +02:00
Matt-Yorkley
bb848811e6 Add a delay on sending order confirmation emails
There's a race condition here that means the order's address is not always present when the email is first sent, but it *is* present shortly after. The fix in this commit is a temporary solution.
2021-06-17 09:35:25 +01:00
François Turbelin
7f0c5b8a7a Fix controller specs with be_successful 2021-06-17 09:43:17 +02:00
Matt-Yorkley
6ebc6bcd6f Merge pull request #7797 from luisramos0/bundler
Upgrade to bundler 2
2021-06-17 09:18:13 +02:00
François Turbelin
bcd2790649 Fix failing spec 2021-06-17 09:18:05 +02:00
François Turbelin
7918c2f37c Cosmetics 2021-06-17 08:50:52 +02:00
François Turbelin
1ef7247311 Use a service to fetch variants in the engine 2021-06-17 08:50:52 +02:00
François Turbelin
235a2574dc Add spec for SuppliedProduct serializer 2021-06-17 08:50:52 +02:00
François Turbelin
4dc07d9872 Add spec for CatalogItem serializer 2021-06-17 08:50:52 +02:00
François Turbelin
a87c46843c Factorize serializer code into Base inherited class 2021-06-17 08:50:52 +02:00
François Turbelin
7ff69d5e6d Fix entreprise missing issue on Persons controller 2021-06-17 08:50:52 +02:00
dependabot[bot]
9653b0a965 Bump activemerchant from 1.120.0 to 1.121.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.120.0 to 1.121.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.120.0...v1.121.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-17 00:26:49 +00:00
Andy Brett
aca3a76854 Merge pull request #7793 from openfoodfoundation/dependabot/bundler/ransack-2.4.2
Bump ransack from 2.4.1 to 2.4.2
2021-06-16 17:12:17 -07:00
Andy Brett
d38cf1da1f Merge pull request #7795 from openfoodfoundation/dependabot/bundler/rubocop-1.17.0
Bump rubocop from 1.16.1 to 1.17.0
2021-06-16 17:10:48 -07:00
Luis Ramos
a226aedaec Upgrade to bundler 2 2021-06-16 21:50:01 +01:00
Guido Oliveira
baca89c575 allow select producers for ordering 2021-06-16 15:02:27 -03:00
Guido Oliveira
c5471fc25c enable ordering shopfront by producer id 2021-06-16 15:02:27 -03:00
dependabot[bot]
b39ed424f6 Bump rubocop from 1.16.1 to 1.17.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.16.1 to 1.17.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.16.1...v1.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:20:57 +00:00
dependabot[bot]
e4cf6421bd Bump bigdecimal from 1.4.2 to 3.0.2
Bumps [bigdecimal](https://github.com/ruby/bigdecimal) from 1.4.2 to 3.0.2.
- [Release notes](https://github.com/ruby/bigdecimal/releases)
- [Changelog](https://github.com/ruby/bigdecimal/blob/v3.0.2/CHANGES.md)
- [Commits](https://github.com/ruby/bigdecimal/compare/v1.4.2...v3.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:18:50 +00:00
dependabot[bot]
0776fcf5cc Bump ransack from 2.4.1 to 2.4.2
Bumps [ransack](https://github.com/activerecord-hackery/ransack) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/activerecord-hackery/ransack/releases)
- [Changelog](https://github.com/activerecord-hackery/ransack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/activerecord-hackery/ransack/compare/2.4.1...v2.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-16 05:17:11 +00:00
Andy Brett
59358443b4 Merge pull request #7786 from andrewpbrett/add-web-console
Add web-console gem for debugging in development
2021-06-15 13:10:25 -07:00
Andy Brett
c4911b1947 add web console for debugging in development 2021-06-15 13:00:22 -07:00
dependabot[bot]
6c24d4bc1a Bump postcss from 7.0.35 to 7.0.36
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-15 19:08:24 +00:00
Matt-Yorkley
8753076dcd Merge pull request #7737 from luisramos0/ruby273
Upgrade to ruby 2.7.3
2021-06-15 21:07:38 +02:00
Jean-Baptiste Bellet
7f5e58bcc3 Uncomment flaky (?) spec 2021-06-15 13:51:40 +02:00
Maikel
d839313cf5 Merge pull request #7782 from openfoodfoundation/dependabot/bundler/redis-4.3.1
Bump redis from 4.2.5 to 4.3.1
2021-06-15 17:17:59 +10:00
Pau Pérez Fabregat
f51f304818 Merge pull request #7778 from openfoodfoundation/transifex
Transifex
2021-06-15 09:12:11 +02:00
Transifex-Openfoodnetwork
7f09fd4c19 Updating translations for config/locales/en_US.yml 2021-06-15 10:23:53 +10:00
Andy Brett
87692b06e6 remove deprecated update_attributes method call 2021-06-14 15:13:51 -07:00
Andy Brett
b8617e0a5a Merge pull request #7783 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.4
Bump karma from 6.3.3 to 6.3.4
2021-06-14 09:18:55 -07:00
Transifex-Openfoodnetwork
6701afcdce Updating translations for config/locales/en_GB.yml 2021-06-14 18:10:03 +10:00
dependabot[bot]
fbf0e48a07 Bump karma from 6.3.3 to 6.3.4
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.3 to 6.3.4.
- [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.3...v6.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:57:07 +00:00
dependabot[bot]
e4087e9c65 Bump redis from 4.2.5 to 4.3.1
Bumps [redis](https://github.com/redis/redis-rb) from 4.2.5 to 4.3.1.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.2.5...v4.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 06:05:07 +00:00
Andy Brett
c790373804 resolve gemfile conflict 2021-06-13 18:29:57 -07:00
Luis Ramos
43401e4b5e Fix double spree scope in i18n
Fix taken from spree: efba9f1a02
2021-06-13 18:19:29 -07:00
Luis Ramos
5948c20326 Fix spec by adding mocked response 2021-06-13 18:19:29 -07:00
Luis Ramos
74aabbbb5f Upgrade to rails 6.1 2021-06-13 18:19:26 -07:00
Nihal Mohammed
522a7384e7 Fix HTML bug on new payment method page and update providers_controller spec 2021-06-12 01:47:08 +05:30
Andy Brett
0eea932778 Merge pull request #7757 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-8.0.0
Bump acts-as-taggable-on from 7.0.0 to 8.0.0
2021-06-11 07:39:57 -07:00
Jean-Baptiste Bellet
db8f8a2675 Create internal methods with regexp test
- Make it more easily readable and add unit tests
2021-06-11 10:40:02 +02:00
Transifex-Openfoodnetwork
3ef5953db2 Updating translations for config/locales/en_FR.yml 2021-06-11 18:38:36 +10:00
Transifex-Openfoodnetwork
586c97b22c Updating translations for config/locales/fr.yml 2021-06-11 18:37:04 +10:00
Transifex-Openfoodnetwork
d54cb9182f Updating translations for config/locales/ca.yml 2021-06-11 18:19:44 +10:00
Transifex-Openfoodnetwork
3257f16667 Updating translations for config/locales/es.yml 2021-06-11 18:17:41 +10:00
Jean-Baptiste Bellet
178c0a441b Move unlocalize_currency filter to a PriceParser service
- It's no longer a filter but more a service: it's therefore more logic.
2021-06-11 10:01:19 +02:00
Maikel Linke
4faf76794d Update translations from Transifex 2021-06-11 09:44:47 +10:00
Maikel
56570ec604 Merge pull request #7755 from openfoodfoundation/transifex
Transifex
2021-06-11 09:41:22 +10:00
Andy Brett
4047f135f7 Merge pull request #7747 from openfoodfoundation/dependabot/bundler/pdf-reader-2.5.0
Bump pdf-reader from 2.4.2 to 2.5.0
2021-06-10 14:49:35 -07:00
Matt-Yorkley
690cbe3ad3 Merge pull request #7468 from mkllnk/6328-tos-tracking
6328 tos tracking
2021-06-10 19:48:13 +02:00
Matt-Yorkley
04e76ed506 Merge pull request #7776 from openfoodfoundation/dependabot/npm_and_yarn/ssri-6.0.2
Bump ssri from 6.0.1 to 6.0.2
2021-06-10 19:45:00 +02:00
Andy Brett
d22f807084 Merge pull request #7773 from Matt-Yorkley/rspec-retries
Set Capybara retry count to 3 and remove conditional
2021-06-10 09:52:50 -07:00
Andy Brett
75440856af Merge pull request #7770 from openfoodfoundation/dependabot/bundler/rubocop-1.16.1
Bump rubocop from 1.16.0 to 1.16.1
2021-06-10 09:51:35 -07:00
dependabot[bot]
c614b92c5f Bump ssri from 6.0.1 to 6.0.2
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 16:51:16 +00:00
Andy Brett
84e3db30f1 Merge pull request #7772 from openfoodfoundation/dependabot/bundler/view_component-2.34.0
Bump view_component from 2.33.0 to 2.34.0
2021-06-10 09:50:42 -07:00
Matt-Yorkley
937cede9b8 Fix tax adjustment label
:amount is actually a property on the TaxRate object itself that refers to the rate (eg 10% expressed as 0.10), and is not the same as the adjustment amount being passed in to this method (eg: $4.28)
2021-06-10 17:16:45 +01:00
Matt-Yorkley
50b5fc7545 Set Capybara retry count to 3 and remove conditional
This is a slippery slope and there's perfectly reasonable arguments against doing this, but on a practical level I think retrying the occasional flaky spec (and adding an extra 10 seconds or so on to the build time) is categorically better than failing the build and having to restart the whole thing (potentially multiple times).
2021-06-10 11:39:05 +01:00
Matt-Yorkley
f36c01abf6 Merge pull request #7765 from mkllnk/7764-heartbeat-job
Avoid false alarms due to delayed HeartbeatJob
2021-06-10 11:15:42 +02:00
dependabot[bot]
d259771ce9 Bump view_component from 2.33.0 to 2.34.0
Bumps [view_component](https://github.com/github/view_component) from 2.33.0 to 2.34.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.33.0...v2.34.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 05:11:51 +00:00
dependabot[bot]
9fd0b096bd Bump rubocop from 1.16.0 to 1.16.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.16.0 to 1.16.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.16.0...v1.16.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 05:07:28 +00:00
Transifex-Openfoodnetwork
1bbc765028 Updating translations for config/locales/ru.yml 2021-06-10 05:21:49 +10:00
Transifex-Openfoodnetwork
a232722f64 Updating translations for config/locales/ru.yml 2021-06-10 05:18:45 +10:00
Andy Brett
2c1ffa929c Merge pull request #7766 from mkllnk/schema
Update schema file description
2021-06-09 08:45:06 -07:00
Andy Brett
2b66d270c0 Merge pull request #7704 from coopdevs/drop-master-variant-leftovers
Drop product.price from /api/order_cycles/:id/products
2021-06-09 08:20:44 -07:00
Transifex-Openfoodnetwork
0e19232f45 Updating translations for config/locales/ca.yml 2021-06-09 17:22:50 +10:00
Transifex-Openfoodnetwork
f4d9e8e520 Updating translations for config/locales/es.yml 2021-06-09 17:22:39 +10:00
Transifex-Openfoodnetwork
d0041334fa Updating translations for config/locales/en_FR.yml 2021-06-09 16:42:33 +10:00
Transifex-Openfoodnetwork
3b68d8a94e Updating translations for config/locales/fr.yml 2021-06-09 16:41:46 +10:00
Maikel Linke
fc8e22b82e Update schema file description
I ran `rake db:migrate` and Rails updated this section. Let's use or we
have to constantly checkout the schema after migrations or we'll have
unrelated changes in future pull requests.
2021-06-09 16:02:05 +10:00
Maikel
6caae9e886 Merge pull request #7694 from coopdevs/split-confirm-order-job
Split ConfirmOrderJob to avoid blocking DJ worker
2021-06-09 14:11:10 +10:00
Andy Brett
d145d3a8ec add create/delete specs for admin and non-admin users 2021-06-09 14:06:55 +10:00
Andy Brett
d4e9c0afdc spec TOS service object 2021-06-09 14:06:55 +10:00
Andy Brett
e0cdf4ff49 refactor to TOS service 2021-06-09 14:06:54 +10:00
Andy Brett
a4bb697787 add spec for trying to create TOS with no file 2021-06-09 14:06:54 +10:00
Maikel Linke
3e2f81d640 Add helper to view spec needing it 2021-06-09 14:06:54 +10:00
Andy Brett
768c56400c add TOS helper to application_controller.rb 2021-06-09 14:06:54 +10:00
Maikel Linke
af314cbbdf Allow fast checkout without re-accepting old terms
We did that for the shop's terms already and now do it for the platform
terms as well.
2021-06-09 14:06:54 +10:00
Maikel Linke
17a3d23d68 Handle user clicking upload button early 2021-06-09 14:06:54 +10:00
Maikel Linke
e3be519b25 Style TOS page to be usable
It's not pretty but only used by instance managers, very rarely.
2021-06-09 14:06:54 +10:00
Maikel Linke
51ad8f8065 Remove old UI to edit Terms of service
It's now completely replaced by file uploads on a separate page.
2021-06-09 14:06:54 +10:00
Maikel Linke
960b829ece Link to last uploaded Terms of service 2021-06-09 14:06:54 +10:00
Maikel Linke
23999c96bf Unify all links to platform Terms of service
DRY code and have more consistency. We always use "Terms of service" now
and not "Terms of Service" or "Terms and conditions". The latter is used
for the shop's terms, not the platform terms.
2021-06-09 14:06:54 +10:00
Maikel Linke
3b3ba70670 Safeguard deletion of ToS with alert 2021-06-09 14:06:54 +10:00
Maikel Linke
690118c2bd Add delete method to terms of service files 2021-06-09 14:06:54 +10:00
Maikel Linke
3bee9cb951 Add Rails action #new to ToS 2021-06-09 14:06:54 +10:00
Maikel Linke
abe76ccf0f Add upload of Terms of Service files
Admins can upload files and view the most recent (current) one.
2021-06-09 14:06:54 +10:00
Maikel Linke
ed4f61acd7 Add title to TOS config page 2021-06-09 14:06:53 +10:00
Maikel Linke
007b8cd888 Add new admin page for TOS files
Just the basic Rails setup without any functionality yet.
2021-06-09 14:06:53 +10:00
Maikel Linke
1f63bb15eb Remove executable bit from spec 2021-06-09 14:06:53 +10:00
Maikel Linke
9027f8b604 Add attachment to TOS record 2021-06-09 14:06:53 +10:00
Maikel Linke
c4317c5707 Add model TermsOfServiceFile
We want to enable instance managers to upload TOS files.

I also added the rails_helper which is a new convention. It can contain
more Rails specific configuration we currently have in the spec_helper.
2021-06-09 14:06:09 +10:00
Maikel Linke
a0835eae54 Avoid false alarms due to delayed HeartbeatJob
When Sidekiq was restarted, the scheduler's time was reset and jobs were
executed later. Now we trigger the HeartbeatJob straight after a Sidekiq
boot and we shouldn't see any false alarms in our monitoring.
2021-06-09 12:05:18 +10:00
Maikel
2556921110 Merge pull request #7718 from openfoodfoundation/dependabot/bundler/sidekiq-scheduler-3.1.0
Bump sidekiq-scheduler from 3.0.1 to 3.1.0
2021-06-09 12:03:31 +10:00
Andy Brett
fcbe42f080 Merge pull request #7756 from openfoodfoundation/dependabot/bundler/ddtrace-0.50.0
Bump ddtrace from 0.49.0 to 0.50.0
2021-06-08 14:59:22 -07:00
Andy Brett
b6f6407c31 Merge pull request #7660 from jibees/7499-remove-feature-toggle-for-unit-price
Remove feature toggle around unit_price
2021-06-08 10:39:32 -07:00
Andy Brett
82ec04552c Merge pull request #7693 from andrewpbrett/add-password-translation
Add translation keys for password messages
2021-06-08 10:35:41 -07:00
Andy Brett
fe62a0a2a7 Merge pull request #7697 from jibees/7689-trigger-a-change-when-hour/minute-inputs-are-modified
Datetimepicker for order cycles: add keyup event listener on hour/minute inputs
2021-06-08 10:32:07 -07:00
Andy Brett
ba6ebdee15 Merge pull request #7686 from shen-sat/7470-add-delete-action-test-to-shipping-categories-controller-spec
[7470] Add delete action test to ShippingCategoriesController spec
2021-06-08 10:31:26 -07:00
Andy Brett
ede966f2d1 Merge pull request #7640 from apricot12/closed_OC_bheaviour
Checkout made to redirect to shop front when OC closed
2021-06-08 10:30:13 -07:00
Andy Brett
74d93e324c Merge pull request #7661 from romale/products_import_date_translation
Missed import_date translation key
2021-06-08 10:26:13 -07:00
dependabot[bot]
3ff60ede2a Bump stripe from 5.33.0 to 5.34.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.33.0 to 5.34.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.33.0...v5.34.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 17:06:20 +00:00
Andy Brett
37b3f7aa3f Merge pull request #7743 from openfoodfoundation/dependabot/bundler/test-unit-3.4.4
Bump test-unit from 3.4.2 to 3.4.4
2021-06-08 10:05:01 -07:00
Nihal Mohammed
3b73f72ac2 Show product variant SKU in Xero report 2021-06-08 19:53:55 +05:30
Nihal Mohammed
3b4baab01a Remove unused _paypal_complete partial 2021-06-08 16:31:26 +05:30
Matt-Yorkley
9921e9c72b Merge pull request #7754 from Matt-Yorkley/stripe-issues
Stripe 3DS issues
2021-06-08 11:33:54 +02:00
Nihal Mohammed
4476d7f69e Disable credit button on click 2021-06-08 14:41:25 +05:30
Jean-Baptiste Bellet
6cf0c73453 Use our unlocalizeCurrencyFilter to parse unit value field
- More tolerant (can handle `,` or `.` as decimal separator, remove thousands separator) to return a `number`
2021-06-08 10:55:43 +02:00
Jean-Baptiste Bellet
d3c2158121 Handle comma as decimal separator in the unit value field
- Add comma as a decimal separator in the regexp
 - Do not use parseFloat but our `unlocalizeCurrencyFilter` which is more tolerant
2021-06-08 09:51:30 +02:00
Jean-Baptiste Bellet
0cb2739139 Handle case when price is not a number
And return a `null` if so.
2021-06-08 09:46:24 +02:00
dependabot[bot]
0cca01345c Bump acts-as-taggable-on from 7.0.0 to 8.0.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/mbleigh/acts-as-taggable-on/releases)
- [Changelog](https://github.com/mbleigh/acts-as-taggable-on/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mbleigh/acts-as-taggable-on/compare/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: acts-as-taggable-on
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 05:12:23 +00:00
dependabot[bot]
6edb80ea29 Bump ddtrace from 0.49.0 to 0.50.0
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.49.0 to 0.50.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.49.0...v0.50.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 05:10:49 +00:00
Matt-Yorkley
15b386bce3 Set :execute_threed option to explicitly handle 3DS responses 2021-06-07 22:48:54 +01:00
Transifex-Openfoodnetwork
225edbf745 Updating translations for config/locales/fr_CA.yml 2021-06-08 07:13:36 +10:00
Transifex-Openfoodnetwork
e8fb5d39a1 Updating translations for config/locales/en_CA.yml 2021-06-08 06:39:23 +10:00
Matt-Yorkley
3544b7de7a Remove Stripe Decorator
The method being overridden here is the same in the upstream
2021-06-07 20:44:58 +01:00
Jean-Baptiste Bellet
e3f56556cf Remove feature toggle around unit_price and enable it 2021-06-07 20:53:45 +02:00
Matt-Yorkley
8e0a84a502 Merge pull request #7729 from Matt-Yorkley/delayed-cleanup
Delayed::Cleanup
2021-06-07 19:11:37 +02:00
Jean-Baptiste Bellet
3ebba9502a Handle more cases with decimal/thousands separator
- ',' or '.' can be used as decimal separator (defined in the application configuration)
 - Remove thousands separator if it's detected as so (use regexp to match)
2021-06-07 16:53:20 +02:00
Nihal Mohammed
a5190ec5d7 Remove refund button from paypal completed order tab 2021-06-07 16:07:31 +05:30
dependabot[bot]
90f1e3a80d Bump pdf-reader from 2.4.2 to 2.5.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.4.2 to 2.5.0.
- [Release notes](https://github.com/yob/pdf-reader/releases)
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.4.2...v2.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 05:42:29 +00:00
Matt-Yorkley
5bfe079262 Update Xero Invoices test setup
Uses the new format of enterprise fee taxes
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7b641ace23 Update Xero Invoices scopes for taxable fees
Taxable enterprise fee adjustments now have a tax_category
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7bcb0bcaa8 Eager-load the adjustment's adjustable
Reduces the total migration time by ~15%. Requires including some more models, as order objects are now being eager-loaded as part of the polymorphic associations.
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7ecd67a3fe Skip orphaned adjustments
There are a handful of enterprise fee adjustments on line items in production data where the line item has actually been deleted and no longer exists, but the fee adjustment is still in the database.
2021-06-06 20:20:41 +01:00
Matt-Yorkley
d9f459d94a Update db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-06-06 20:20:41 +01:00
Matt-Yorkley
76756923ba Use non-legacy-tax example in paypal items spec 2021-06-06 20:20:41 +01:00
Matt-Yorkley
401dd99225 Update stubbing of default country id in TaxRate tests 2021-06-06 20:20:41 +01:00
Matt-Yorkley
e21ef3f182 Add test coverage to #create_tax_charge! with legacy taxes 2021-06-06 20:20:41 +01:00
Matt-Yorkley
9e1d8ab369 Introduce legacy tax handing in Order::Updater whenever order totals change
This will remove legacy tax adjustments, recalculate any relevant taxes for items in the order and re-apply them in non-legacy tax adjustments
2021-06-06 20:20:41 +01:00
Matt-Yorkley
00988dc1e7 Use :order_with_totals factory in payments controller spec
This factory makes an order that actually has a line item 👍
2021-06-06 20:20:41 +01:00
Matt-Yorkley
7007de752d Update BulkLineItemsController spec now that taxes on enterprise fees are updated correctly
Tax on fees previously stayed the same unless the fees were deleted recreated from scratch, instead of updating when the fee amounts changed
2021-06-06 20:20:41 +01:00
Matt-Yorkley
832fbb7d5d Update data migration model definitions
The good_migrations gem was not working with polymorphic associations.
2021-06-06 20:18:05 +01:00
Matt-Yorkley
dc7c674a0e Switch to ApplicationRecord in migation spec
Fixes:

An error occurred while loading ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb.
Failure/Error: require_relative '../../db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts'

TypeError:
  superclass mismatch for class Adjustment
# ./db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb:2:in `<class:MigrateEnterpriseFeeTaxAmounts>'
# ./db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb:1:in `<top (required)>'
# ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb:4:in `require_relative'
# ./spec/migrations/migrate_enterprise_fee_tax_amounts_spec.rb:4:in `<top (required)>'
# -e:1:in `<main>'
2021-06-06 20:18:05 +01:00
Matt-Yorkley
bfea47802e Move fee tax call outside of lock and simplify order updating 2021-06-06 20:18:05 +01:00
Matt-Yorkley
28ebb303af Simplify order interface 2021-06-06 20:17:03 +01:00
Matt-Yorkley
f20cf509d3 Add missing Spree translation 2021-06-06 20:17:03 +01:00
Matt-Yorkley
3f9a3b41da Refactor and improve EnterpriseFeeApplicator spec 2021-06-06 20:17:03 +01:00
Matt-Yorkley
38811b5a28 Add Bugsnag message if legacy taxes are used 2021-06-06 20:17:03 +01:00
Matt-Yorkley
f791f6fa20 Add test coverage to recalculating fees and taxes on completed orders 2021-06-06 20:17:03 +01:00
Matt-Yorkley
c84f9e56fb Tax enterprise fee adjustments when calling #recreate_all_fees! 2021-06-06 20:17:03 +01:00
Matt-Yorkley
355837547e Add test coverage for legacy additional taxes in OrderTaxAdjustmentsFetcher
OrderTaxAdjustmentsFetcher is used in various places to display the taxes on an order. This test validates that legacy taxes are still returned and displayed as normal.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
0f5c39317a Re-apply taxes in Admin::OrdersController#update
Ensures taxes are updated properly when hitting the "Update and Recalculate Fees" button on the order edit page.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
43877f4e34 Add unit tests for data migration 2021-06-06 20:16:03 +01:00
Matt-Yorkley
b427fd6876 Add data migration for enterprise fee tax amounts 2021-06-06 20:16:03 +01:00
Matt-Yorkley
a31487a86d Clear any legacy taxes when applying tax to an order
#create_tax_charge! adds tax (adjustments) to all taxable items on an order. If an order order has legacy taxes (lump-sum tax adjustments on the order object), we remove them here before re-applying taxes (using the new setup).
2021-06-06 20:16:03 +01:00
Matt-Yorkley
84a40e6ae0 Improve Order#enterpise_fee_tax 2021-06-06 20:16:03 +01:00
Matt-Yorkley
19f32b7825 Update checkout tax display test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
93e422ec59 Update order fee tax test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
6e9ae0b0db Update tax totals calculation in Order::Updater
Line items, shipments, and fees now all have taxes recorded in a uniform way, so we can drop more complexity here (and the number of queries).
2021-06-06 20:16:03 +01:00
Matt-Yorkley
a1438bdb3d Update enterprise fee tax adjustment specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
510f74f654 Update OrderTaxAdjustmentsFetcher
Taxes on Enterprise Fees are now recorded in proper tax adjustments, so they don't need special treatment.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
52452f7939 Update default tax calculator
Line items, shipments and fees can now all be calculated in the same way when applying tax.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
b3240f859a Add tax category id to adjustments 2021-06-06 20:16:03 +01:00
Matt-Yorkley
2de442f44d Move taxing of enterprise fees to TaxRate 2021-06-06 20:16:03 +01:00
Matt-Yorkley
c2211c501d Improve test setup in Xero Invoices spec 2021-06-06 20:16:03 +01:00
Matt-Yorkley
6c340f8ed4 Update SalesTax test setup 2021-06-06 20:16:03 +01:00
Matt-Yorkley
a22cc96ea5 Simplify DefaultTax calculator
This logic is handled in TaxRate and doesn't need to be duplicated here.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
8c9733d8da Remove included tax check from CalculatedAdjustments
This is handled in TaxRate now.
2021-06-06 20:16:03 +01:00
Matt-Yorkley
ff9ad96b74 Update TaxRate specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
8479d4ff7c Update outdated calls to TaxRate#adjust in specs 2021-06-06 20:16:03 +01:00
Matt-Yorkley
d450aff607 Update Order#create_tax_charge!
TaxRate#adjust now handles individual items instead of the whole order 🎉 We can use this elsewhere too, for example to re-apply taxes on a single line item, we can do: Spree::TaxRate.adjust(order, [line_item])
2021-06-06 20:16:03 +01:00
Matt-Yorkley
1c28b9783f Bring in Spree::TaxRate test coverage 2021-06-06 20:16:03 +01:00
Matt-Yorkley
f92c082df8 Refactor tax adjustment create_label method 2021-06-06 20:16:03 +01:00
Matt-Yorkley
d69f714032 Bring in changes to TaxRate#adjust 2021-06-06 20:16:03 +01:00
Matt-Yorkley
50d0952dd5 Bring in TaxRate#potentially_applicable method and add eager-loading 2021-06-06 20:16:03 +01:00
Matt-Yorkley
82e38b0156 Merge pull request #7623 from Matt-Yorkley/order-contents
Use OrderContents to update line items
2021-06-05 17:11:45 +02:00
Luis Ramos
5453a1c0fa Adapt importer error to new ruby version 2.7 2021-06-04 22:42:27 +01:00
Luis Ramos
18231cd950 Adding bigdecimal to avoid errors with BigDecimal
v1.4.2 is the version that works for us, see here for more details: https://github.com/ruby/bigdecimal/issues/127
2021-06-04 22:42:27 +01:00
Luis Ramos
5629dfbe09 Fix warning: deprecated Object#=~ is called 2021-06-04 22:42:27 +01:00
Luis Ramos
21b80db0ee Fix json v1.8.6 common.rb warning
Using this patch https://github.com/flori/json/issues/399#issuecomment-734863279

We can upgrade to json v2 but to do that we need to switch from aws-sdk-v1 to aws-sdk-s3 first
2021-06-04 22:42:27 +01:00
Luis Ramos
c22799bda1 Replace gsub! with gsub so that strings are not modified 2021-06-04 22:42:22 +01:00
Luis Ramos
2b187c0547 Upgrade to ruby 2.7.3 2021-06-04 22:29:49 +01:00
Andy Brett
640aa11f3b Merge pull request #7744 from luisramos0/byebug
Move byebug to test gem group so we can use it in specs
2021-06-04 13:17:43 -07:00
Luis Ramos
b939a292df Move byebug to test gem group so we can use it in specs 2021-06-04 20:59:50 +01:00
Matt-Yorkley
099ef5d358 Add more explicit tests on updating shipping fees in Api::ShipmentsController 2021-06-04 18:19:27 +01:00
Guido Oliveira
65b760b119 Add validations to variant_override model 2021-06-04 14:11:22 -03:00
dependabot[bot]
6de0682439 Bump test-unit from 3.4.2 to 3.4.4
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.2 to 3.4.4.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.2...3.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 16:57:41 +00:00
Matt-Yorkley
efcf71fd2b Use OrderContents in cart spec test setups 2021-06-04 17:26:49 +01:00
Matt-Yorkley
acf7c0c4d8 Use :order_with_totals factory in CustomersController spec 2021-06-04 17:10:50 +01:00
Matt-Yorkley
443b180f32 Update order totals in :order_with_totals factory 2021-06-04 17:10:50 +01:00
Matt-Yorkley
3222d4980d Improve comment on #ensure_updated_shipments 2021-06-04 17:10:50 +01:00
Matt-Yorkley
e246eed99d Move #restart_chceckout_flow out of Order class 2021-06-04 17:10:50 +01:00
Matt-Yorkley
b69d61dd77 Remove #order_update! call from method used in order after_save callbacks
This method gets called twice every time we save a completed order, calling order_update! twice...
2021-06-04 17:10:50 +01:00
Matt-Yorkley
2d76c2730a Update shipment updating 2021-06-04 17:10:50 +01:00
Matt-Yorkley
6b364dc420 Update specs on shipping fee changes and mark as pending
The shipping fee and it's tax actually don't get updated correctly here (in master).
2021-06-04 17:10:50 +01:00
Matt-Yorkley
d5b20d5446 Add specs for Order#ensure_updated_shipments 2021-06-04 17:10:50 +01:00
Matt-Yorkley
05c001807e Add variant override specs for Stock::AvailabilityValidator 2021-06-04 17:10:50 +01:00
Matt-Yorkley
011da05712 Add more test coverage to OrderContents 2021-06-04 17:10:50 +01:00
Matt-Yorkley
2e96982e60 Refactor conditional
CartService#populate already returns the value of the #valid? method by default.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
6abe0b375c Refactor stock levels check in CartController 2021-06-04 17:10:50 +01:00
Matt-Yorkley
dc6be6f06b Don't resubmit the whole cart contents for no reason.
There's a couple of places where this was causing a cart update submission where it wasn't needed, eg the items had not actually changed. The conditional here was designed to stop that from happening, but it was actually passing every time (the conditional logic was not actually catching the case it was supposed to).

This is really expensive!
2021-06-04 17:10:50 +01:00
Matt-Yorkley
47e2976fd1 Update CartService specs 2021-06-04 17:10:50 +01:00
Matt-Yorkley
38ce9eb0c4 Update line item removal in CartService when the line item doesn't exist 2021-06-04 17:10:50 +01:00
Matt-Yorkley
3b52b173e8 Delete more dead code in CartService 2021-06-04 17:10:50 +01:00
Matt-Yorkley
b8ccee5f30 Simplify use of #to_i in variant data hash 2021-06-04 17:10:50 +01:00
Matt-Yorkley
0cfe7fdc45 Move required logic into OrderContents and improve spec 2021-06-04 17:10:50 +01:00
Matt-Yorkley
42ff2307fa Update specs that use removed #add_variant and #remove_variant methods in test setup 2021-06-04 17:10:50 +01:00
Matt-Yorkley
b25e7fcb89 Delete tests for removed Order #add_variant and #remove_variant methods 2021-06-04 17:10:50 +01:00
Matt-Yorkley
79aebed40e Bring OrderContents#update_cart tests from upstream and tidy up 2021-06-04 17:10:50 +01:00
Matt-Yorkley
f5c08baabb Use OrderContents in LineItemsController and move enterprise fee updating logic 2021-06-04 17:10:50 +01:00
Matt-Yorkley
a883b2cf63 Remove dead code CartService#cart_remove 2021-06-04 17:10:50 +01:00
Matt-Yorkley
398d4b2612 Tidy up public interface of CartService
We don't need this extra hash to be passed around
2021-06-04 17:10:50 +01:00
Matt-Yorkley
4a7c0e8297 Remove variant early if we're deleting them and they're already loaded 2021-06-04 17:10:50 +01:00
Matt-Yorkley
67df6728f6 Fix Order line items association definition
Populating the cart was throwing an "Association Mismatch" error D:
2021-06-04 17:10:50 +01:00
Matt-Yorkley
0178cd7530 Adapt OrderContents to allow use with frontend cart service and updating :max_quantity
The cart service and it's surrounding logic is a bit messy, as it jumps through hoops to add extra logic for the :max_quantity attribute used with the "group buy" feature.

This is the last bit of code where an order's line items could be changed where we were not using OrderContents.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
cb92231835 Clarify behavior via variable names
This is a small semantic thing to clarify that we're not adding to / incrementing the quantity here, we're setting it to the given value. In other places where we change line items on an order we are actually adding the given value to the existing quantity.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
6e8fd3c3f8 Simplify CartService interface
There's only one place this method is called, and the "overwrite" argument is always explicitly true. It doesn't need to be there if it's mandatory.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
6451ef173c Use OrderContents when removing line items with soft-deleted variants in CartService 2021-06-04 17:10:50 +01:00
Matt-Yorkley
7af5e8931f Adapt OrderContents for use with BulkLineItemsController#update 2021-06-04 17:10:50 +01:00
Matt-Yorkley
9045cc7d65 Use OrderContents in CartService for removing line items from cart 2021-06-04 17:10:50 +01:00
Matt-Yorkley
5ff8436c1a Adapt OrderContents#remove to allow deleting line item without passing a quantity 2021-06-04 17:10:50 +01:00
Matt-Yorkley
a5ccaf9595 Remove unnecessary code in BulkLineItemsController
This method isn't called from anywhere else
2021-06-04 17:10:50 +01:00
Matt-Yorkley
423c140670 Remove pointless currency code in Order and CartService
The currency will always be the currency of the variant, there's no need to pass this value around.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
e8ef183623 Delete dead code Order#set_variant_attributes 2021-06-04 17:10:50 +01:00
Matt-Yorkley
000e2c07f8 Use OrderContents in OrdersController 2021-06-04 17:10:50 +01:00
Matt-Yorkley
c1c69b00b4 Update order explicitly in OrderSyncer 2021-06-04 17:10:50 +01:00
Matt-Yorkley
d5edf03042 Update reports_spec test setup 2021-06-04 17:10:50 +01:00
Matt-Yorkley
305ac037fe Use OrderContents in customers controller spec 2021-06-04 17:10:50 +01:00
Matt-Yorkley
23910dbab4 Use OrderContents in BulkLineItemsController
We should move towards *all* operations on an order's line items being done exclusively through this service.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
632f4228f0 Bring in line item fetching refactor 2021-06-04 17:10:50 +01:00
Matt-Yorkley
1268cb565c Extract method 2021-06-04 17:10:50 +01:00
Matt-Yorkley
c55e47f6af Remove superfluous updates in OrderFeesHandler 2021-06-04 17:10:50 +01:00
Matt-Yorkley
03fc63ad14 Remove #order_update! from line item after_save callback 2021-06-04 17:10:50 +01:00
Matt-Yorkley
a124141537 Move Shipment#line_items to private 2021-06-04 17:10:50 +01:00
Matt-Yorkley
0fabb5bc2f Don't pluck variant_ids multiple times (once for each line item) 2021-06-04 17:10:50 +01:00
Matt-Yorkley
1fff81c214 Remove call to OrderInventory#verify
This already gets called in after_save and after_destroy in Spree::LineItem.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
67264c047f Delete dead code #editable_by?
This is junk Spree code from 2010. 11 years old! The method that previous called this was removed long ago...
2021-06-04 17:10:50 +01:00
Matt-Yorkley
34eaf6f0f2 DRY shipment updating 2021-06-04 17:10:50 +01:00
Matt-Yorkley
8405a7672d Bring in shipment updating 2021-06-04 17:10:50 +01:00
Matt-Yorkley
66a3246a23 Move order updating 2021-06-04 17:10:50 +01:00
Matt-Yorkley
34482f6710 Bring OrderContents#update_cart from Spree 2.2 2021-06-04 17:10:50 +01:00
Matt-Yorkley
f550d1e9f3 Bring Order#ensure_updated_shipments from Spree 2.2 2021-06-04 17:10:50 +01:00
Matt-Yorkley
d99e598e7a Delete dead code in CartController
The two conditionals in #populate_variant_attributes here are never actually true, so the subsequent code paths are never reached.
2021-06-04 17:10:50 +01:00
Matt-Yorkley
eb59b691d8 Move hash parsing outside of order lock 2021-06-04 17:10:50 +01:00
Matt-Yorkley
d5d76d9b9a Move private controller methods to private 2021-06-04 17:10:50 +01:00
Andy Brett
3c933befbb Merge pull request #7607 from luisramos0/rails6_select2_upgrade
[Rails 6.1] Upgrade thor
2021-06-04 07:45:47 -07:00
Andy Brett
fc4a40ec8b Merge pull request #7668 from openfoodfoundation/dependabot/bundler/stripe-5.33.0
Bump stripe from 5.32.1 to 5.33.0
2021-06-04 07:45:02 -07:00
Andy Brett
d197b81351 Merge pull request #7606 from luisramos0/deprecation
[Rails 6.1] Fix deprecation warning in rails 6.0
2021-06-04 07:42:50 -07:00
Andy Brett
b1f619a90a Merge pull request #7715 from openfoodfoundation/dependabot/bundler/activemerchant-1.120.0
Bump activemerchant from 1.119.0 to 1.120.0
2021-06-04 07:40:24 -07:00
Andy Brett
f70c1f0644 Merge pull request #7611 from luisramos0/rails61_arel
[Rails 6.1] Adapt code to circunvent security constraint on rails 6.1
2021-06-04 07:36:23 -07:00
Andy Brett
b23530be4c Merge pull request #7736 from Matt-Yorkley/ssl-in-dev
Remove Spree::Config[:allow_ssl_in_development_and_test]
2021-06-04 07:21:05 -07:00
dependabot[bot]
1fe74c9690 Bump activemerchant from 1.119.0 to 1.120.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.119.0 to 1.120.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.119.0...v1.120.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 14:20:09 +00:00
Andy Brett
5d39155519 Merge pull request #7739 from openfoodfoundation/dependabot/bundler/rails-6.0.3.7
Bump rails from 6.0.3.6 to 6.0.3.7
2021-06-04 07:18:59 -07:00
Pau Perez
dfe83e5c51 Do not return master variant in api/ocs/products
`product.master` seems to always be `null` on
/api/v0/order_cycles/:id/products JSON response. That's because the
first of the underlying AR relation,
`order_cycle.variants_distributed_by(distributor)`, does not include
master variants. They are not in OC exchanges.
2021-06-04 12:10:52 +02:00
Pau Perez
e7166ba5d4 Drop product.price from /api/ocs/:id/products
Its serializer it's only used by this endpoint and
app/assets/javascripts/templates/shop_variant.html.haml doesn't rely on
the response's product.price but the variant's price.

Because our DB schema allows NULL on spree_prices.amount, a master
variant without a price can cause the shopfront not to load products.
This was the case in
https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/60adfcc31cf9740007f82fc9.
2021-06-04 12:10:52 +02:00
dependabot[bot]
b6c9d4d6a9 Bump rails from 6.0.3.6 to 6.0.3.7
Bumps [rails](https://github.com/rails/rails) from 6.0.3.6 to 6.0.3.7.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.0.3.6...v6.0.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 05:30:32 +00:00
Maikel
0c92a594f4 Merge pull request #7717 from coopdevs/fix-docker-jemalloc-sidekiq
Fix docker Jemalloc + Sidekiq setup
2021-06-04 13:16:53 +10:00
Maikel
4dacdb180f Merge pull request #7617 from luisramos0/layout61
[Rails 6.1] Make admin layout path relative
2021-06-04 12:26:40 +10:00
Andy Brett
c1ad4243bb Update all locales with the latest Transifex translations 2021-06-03 18:21:21 -07:00
Luis Ramos
66934af579 Upgrade to thor v1 2021-06-03 20:54:55 +01:00
Andy Brett
9f3ddfc88b Merge pull request #7735 from Matt-Yorkley/bootsnap-reloaded
Add bootsnap gem (again)
2021-06-03 12:54:22 -07:00
Luis Ramos
466f7030c6 Depend on select2-rails without the thor v0.14 requirement 2021-06-03 20:54:07 +01:00
Matt-Yorkley
7d38bec26d Remove Spree::Config[:allow_ssl_in_development_and_test]
Unconditionally disables forced https-redirects in dev and test
2021-06-03 20:52:09 +01:00
Matt-Yorkley
67d7d225cc Add bootsnap gem 2021-06-03 19:03:18 +01:00
Andy Brett
24edad15ae Merge pull request #7727 from openfoodfoundation/dependabot/bundler/view_component-2.33.0
Bump view_component from 2.32.0 to 2.33.0
2021-06-03 09:57:36 -07:00
Andy Brett
6d56a0791f Merge pull request #7728 from Matt-Yorkley/papertrail-deprecation
Remove papertrail initializer
2021-06-03 09:52:56 -07:00
dependabot[bot]
cd1d77c572 Bump view_component from 2.32.0 to 2.33.0
Bumps [view_component](https://github.com/github/view_component) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.32.0...v2.33.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-03 16:43:45 +00:00
dependabot[bot]
69690f1e37 Bump stripe from 5.30.0 to 5.33.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.30.0 to 5.33.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.30.0...v5.33.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-03 16:43:38 +00:00
Andy Brett
2dddd625a1 Merge pull request #7554 from luisramos0/rails6
[Rails 6.0] Upgrade to rails 6.0
2021-06-03 09:42:33 -07:00
Matt-Yorkley
d66b6f7192 Fix InvoicesController spec and change from pending to active 2021-06-03 12:51:15 +01:00
Matt-Yorkley
ba592c1ca3 Switch JobLogger to using the default Rails logger
Logging in background jobs with Sidekiq all ultimately get sent to STDOUT now anyway, which is redirected to `/log/sidekiq.log` via the Sidekiq systemd service.
2021-06-03 12:48:18 +01:00
Matt-Yorkley
0ede0acc6a Remove DelayedJob references 2021-06-03 12:45:23 +01:00
Matt-Yorkley
5b676e8f93 Remove papertrail initializer
This setting is now deprecated and triggers this message:

Association Tracking for PaperTrail has been extracted to a separate gem. To use it, please add `paper_trail-association_tracking` to your Gemfile. If you don't use it (most people don't, that's the default) and you set `track_associations = false` somewhere (probably a rails initializer) you can remove that line now.
2021-06-03 11:33:33 +01:00
Pau Perez
5d91f5f398 Document Redis as a requirement 2021-06-03 10:11:05 +02:00
Pau Pérez Fabregat
62959cc883 Merge pull request #7724 from openfoodfoundation/transifex
Transifex
2021-06-03 09:34:51 +02:00
Andy Brett
bab4b404f4 Merge pull request #7722 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.3.3
Bump karma from 6.3.2 to 6.3.3
2021-06-02 15:01:46 -07:00
Andy Brett
5ecd24d66a Merge pull request #7721 from openfoodfoundation/dependabot/bundler/rubocop-1.16.0
Bump rubocop from 1.15.0 to 1.16.0
2021-06-02 15:00:55 -07:00
Transifex-Openfoodnetwork
db373a826b Updating translations for config/locales/en_IE.yml 2021-06-03 02:38:20 +10:00
Shen
80ae211b72 Use correct syntax for change matcher in spec/controllers/spree/admin/shipping_categories_controller_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2021-06-02 13:17:49 +01:00
Shen Sat
99a4be134b Add delete action test to ShippingCategoriesController spec 2021-06-02 13:17:49 +01:00
dependabot[bot]
1ddfd2a4f7 Bump karma from 6.3.2 to 6.3.3
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.2 to 6.3.3.
- [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.2...v6.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 05:32:51 +00:00
dependabot[bot]
d972f6e041 Bump rubocop from 1.15.0 to 1.16.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.15.0...v1.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 05:12:04 +00:00
Luis Ramos
cf756c5774 Added action cable to gemfile by running bundle install
After rebase Action cable was missing from Gemfile.lock
2021-06-01 22:34:04 +01:00
Luis Ramos
4252bd0bb1 For some reason report helper is not available on this view now, so we call Spree::Money directly 2021-06-01 22:34:04 +01:00
Luis Ramos
cb6e626193 Remove require rails/all, this is already done in application.rb where we are loading only the rails modules we need 2021-06-01 22:34:04 +01:00
Andy Brett
77c384633b specify payment intent ID in stripe stub 2021-06-01 22:34:04 +01:00
Luis Ramos
64de303b59 Move compass-rails back to 4.0
This must have been a mistake when managing initial conflicts in rails6 branch
2021-06-01 22:34:04 +01:00
Matt-Yorkley
88cae21ab4 Disable currently unused modules and add notes
We should migrate to ActiveStorage soon, but we're not using it yet. ActionText is cool but we also don't currently use it. ActionMailbox is not something we need at all.
2021-06-01 22:34:04 +01:00
Matt-Yorkley
66e4986944 Bring modules list from rails/all to application.rb
This is the default list in Rails 6.0
2021-06-01 22:34:04 +01:00
Andy Brett
b3e08b47b9 set Stripe api key directly instead of using allow 2021-06-01 22:33:12 +01:00
Luis Ramos
85508f45b4 Replace be_success on test_reponse with status 200
In rails 6 response.success? is not supported.
2021-06-01 22:33:12 +01:00
Luis Ramos
f07cc32be0 Remove authorization token from stripe stubs 2021-06-01 22:33:12 +01:00
Luis Ramos
2c43522bf9 change devise config to use secret_key_Base instead of secret_token as pepper 2021-06-01 22:33:12 +01:00
Luis Ramos
adf35f8e18 Fix sass-rails compass-rails compatibility problem 2021-06-01 22:33:12 +01:00
Luis Ramos
04ff4fa47c Update to rails 6.0 and resolve Gemfile conflicts 2021-06-01 22:33:12 +01:00
Matt-Yorkley
0d30e3359f Merge pull request #7081 from openfoodfoundation/dependabot/bundler/database_cleaner-2.0.1
Bump database_cleaner from 1.99.0 to 2.0.1
2021-06-01 21:59:27 +02:00
Matt-Yorkley
b1bfac5144 Update all locales with the latest Transifex translations 2021-06-01 19:10:58 +01:00
Matt-Yorkley
30e2be13f0 Update spec/lib/open_food_network/i18n_config_spec.rb 2021-06-01 18:50:04 +01:00
Luis Ramos
dc1cdf4254 Add required DB cleaner setup code 2021-06-01 18:50:04 +01:00
dependabot[bot]
c4bd9208ce Bump database_cleaner from 1.99.0 to 2.0.1
Bumps [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) from 1.99.0 to 2.0.1.
- [Release notes](https://github.com/DatabaseCleaner/database_cleaner/releases)
- [Changelog](https://github.com/DatabaseCleaner/database_cleaner/blob/main/History.rdoc)
- [Commits](https://github.com/DatabaseCleaner/database_cleaner/compare/v1.99.0...v2.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-01 18:50:04 +01:00
Pau Pérez Fabregat
01f8aff3e0 Merge pull request #7716 from coopdevs/pick-up-site-name-from-env
Allow :site_name to be picked up from ENV vars
2021-06-01 13:50:36 +02:00
Jean-Baptiste Bellet
60f3ebca62 Check whether the changes made by the keyboard are taken into account in datetimepicker
- User can change minute directly with keyboard, and without closing the datetimepicker, the modification should be catch and then a label "You have unsaved changes" with the "Save changes" button should appear
2021-06-01 12:05:03 +02:00
Jean-Baptiste Bellet
0db7df6c14 Add keyup event listener on hour/minute inputs
- To set the date (and trigger the onChange event) when the user is typing through its keyboard
2021-06-01 12:04:55 +02:00
Pau Perez
74a8b3038a Split ConfirmOrderJob to avoid blocking a worker
This unties this two email notifications so that they are picked up by
a DJ worker independently. This should avoid the blocking the worker experiences (remember we
still have a single one in all instances) when waiting between the two
deliveries. See the flamegraph:
https://app.datadoghq.com/apm/traces?end=1622015605459&paused=true&query=env%3Aproduction%20service%3Adelayed_job%20operation_name%3Adelayed_job%20resource_name%3AConfirmOrderJob%20%40duration%3A%3E%3D5s&start=1622009898303&streamTraces=true&trace=AQAAAXmngbg_woqc_QAAAABBWG1uZ2IwVkFBRHVDbWJkN25QTUVuY28&traceID=2916038355421570548&spanID=2005781139590273685.

Overall, both operations may take longer but other jobs can be processed
in between. Also, if any of the two fails, the other won't be affected.
2021-06-01 11:43:00 +02:00
Jean-Baptiste Bellet
f73e5c74fb Handle null/undefined cases for price 2021-06-01 11:40:02 +02:00
dependabot[bot]
de1d4fa4eb Bump sidekiq-scheduler from 3.0.1 to 3.1.0
Bumps [sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/moove-it/sidekiq-scheduler/releases)
- [Commits](https://github.com/moove-it/sidekiq-scheduler/compare/v3.0.1...v3.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-01 05:31:12 +00:00
Pau Perez
07fd5cb29c Configure Sidekiq in development also 2021-05-31 17:04:14 +02:00
Pau Perez
ee7da14019 Provide Redis docker container 2021-05-31 17:04:14 +02:00
Pau Perez
e5adbf1f08 Fix jemalloc installation 2021-05-31 16:54:35 +02:00
Matt-Yorkley
7f9179193e Merge pull request #7713 from openfoodfoundation/dependabot/npm_and_yarn/ws-7.4.6
Bump ws from 7.4.4 to 7.4.6
2021-05-31 16:07:05 +02:00
Pau Perez
3be0e1c13a Allow :site_name to be picked up from ENV vars
This mimics what we did in 6377736f4. This way provisioning an instance
from scratch doesn't require configuring things from the backoffice,
which will simplify the roll out of
https://github.com/openfoodfoundation/ofn-install/pull/734.
2021-05-31 15:50:54 +02:00
Pau Pérez Fabregat
18c020535a Merge pull request #7711 from Matt-Yorkley/sidekiq
Sidekiq!
2021-05-31 15:11:45 +02:00
Matt-Yorkley
8d1fcc06fd Remove logfile config
This setting was removed in Sidekiq 6.0, logs are handled a bit differently now. The logging works though 👍
2021-05-31 10:46:43 +01:00
Matt-Yorkley
2b6a72ffb4 Remove DelayedJob web UI 2021-05-31 10:10:36 +01:00
Pau Pérez Fabregat
157d86c94f Merge pull request #7714 from openfoodfoundation/dependabot/bundler/test-unit-3.4.2
Bump test-unit from 3.4.1 to 3.4.2
2021-05-31 11:04:42 +02:00
Pau Pérez Fabregat
d41de06809 Merge pull request #7707 from openfoodfoundation/transifex
Transifex
2021-05-31 10:59:04 +02:00
Jean-Baptiste Bellet
7008b5ec7b Make a more generic solution: KeyValueMapStore
- As QueryPersistence, stored in the localStorage too but it is now more generic and has nothing to do with Query
 - Add some js unit testing
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
f167b09397 Add distributor and order cycle selectors in the test 2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
54c645e33a Add tests for clearing all filters feature
- and check each filter is well reinitialized
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
385446807d Add a clear filters button
- This button clear all stored filters and then update results
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
ea2cb4e6c0 Update flatpickr input value if ng-model change 2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
303bf5420e Add select2WatchNgModel directive
- Select2 components cannot handle ng-model correctly: they do not update if the ng-model change. Add a directive to watch the ng-model and update the component value
2021-05-31 10:44:21 +02:00
Jean-Baptiste Bellet
58a96c6500 Add missing ] char to be consistant 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
4f50afc188 Change shipping_method_id storage: in the query 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
e388238a25 Add tests for saving filter params in Orders list 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
1674c6a252 Improve HTML to improve tests readability
- Specify `for` attribute to `<label />` element
- Initialize component with its default value

So, it's linked to its `<input />`
2021-05-31 10:44:12 +02:00
Matt-Yorkley
93ebfb6a4f Improve checking for presence of saved filters 2021-05-31 10:44:12 +02:00
Matt-Yorkley
47404b1dc8 Improve handling of nils 2021-05-31 10:44:12 +02:00
Matt-Yorkley
c24ceac063 Extract default-setting to comment method 2021-05-31 10:44:12 +02:00
Jean-Baptiste Bellet
c5a2d183d8 Save filter params to sessionStorage for orders list
- Use sessionStorage to save the filters params each time a filter is modified
2021-05-31 10:44:12 +02:00
Transifex-Openfoodnetwork
d730f21dc7 Updating translations for config/locales/en_GB.yml 2021-05-31 17:54:39 +10:00
dependabot[bot]
49dfaa20ab Bump test-unit from 3.4.1 to 3.4.2
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.4.1...3.4.2)

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 05:51:25 +00:00
Jean-Baptiste Bellet
325b97b683 Add tests around invoice printing in PDF
- use PDF Reader to read pdf and get its content
 - check with we print the payment description information section with the right value
2021-05-19 11:55:46 +02:00
Jean-Baptiste Bellet
7ab065e8cd Add section at the bottom of invoice: Payment Description at Checkout
- If there is any payments, we use the last one to retrieve the payment method description
Use the first completed payment to display payment description
Completed is state = "checkout" or state = "completed"
Squash w/ "Add section at the bottom of invoice: Payment Description at Checkout"

Squash w "Add section at the bottom of invoice: Payment Description a"
2021-05-19 11:55:38 +02:00
Jean-Baptiste Bellet
aea0670268 Add method payment_method to get the payment method from a payment
- Method `payment_method_name` now use `payment_method`
2021-05-19 11:55:38 +02:00
Shen Sat
cb914e4729 Change wording in create_admin_user to be more descriptive 2021-05-19 08:45:40 +01:00
Shen Sat
ab027d6af6 Change money initializer to use ENV vars instead of Spree::Config 2021-05-19 08:44:55 +01:00
Shen Sat
6a8ee544e8 Change readme to strong encourage running setup script 2021-05-19 08:44:10 +01:00
alex
4a5cb7f628 Missed import_date translation 2021-05-18 18:30:59 +03:00
Luis Ramos
3f020ec855 Circunvent security contraint on rails 61 2021-05-14 00:13:38 +01:00
Luis Ramos
3d2155b60e Use Arel.sql to curcunvent security restriction on rails 6.1 2021-05-13 23:55:08 +01:00
Nihal Mohammed
0b12b398ba Update spec test for the changed redirect path 2021-05-14 03:32:14 +05:30
Nihal Mohammed
122577b11b Checkout made to redirect to shop front when OC closed 2021-05-14 02:58:41 +05:30
Luis Ramos
b265fbf9a0 Remove initial slash from admin layout, this fixes a problem with layouts cant be loaded from absolute paths 2021-05-11 22:34:15 +01:00
Luis Ramos
f29f525d90 Adapt code to circunvent security constraint on rails 6.1 2021-05-10 23:39:17 +01:00
Luis Ramos
d308e20871 Fix deprecation warning in rails 6.0
Warning: Class level methods will no longer inherit scoping from create in Rails 6.1
2021-05-10 21:03:24 +01:00
Pau Perez
ed6b7f1ab4 Split apt packages list into a name per line
This super long line was hard to read.
2021-05-10 19:57:24 +02:00
Pau Perez
4453123944 Compile Ruby with jemalloc 2021-05-10 19:31:04 +02:00
Matt-Yorkley
122ba385f7 Move line item rendering to collection in cart page
Improvement from upstream Spree commit. Brings a big performance boost to rendering, especially with larger numbers of items in the cart. 50%+ reduction in rendering times reported.
2021-05-10 11:50:31 +01:00
François Turbelin
e86b6443f2 Add a comment to explain nesting on catalog_item 2021-04-05 20:38:19 +02:00
François Turbelin
bf4bb854b1 Change offeres_to to offers_to for method naming 2021-04-05 20:38:19 +02:00
François Turbelin
779241db7a Improve documentation 2021-04-05 20:38:19 +02:00
François Turbelin
11f1f6cff1 Add more onliner before in specs 2021-04-05 20:38:19 +02:00
François Turbelin
7ad6e1b76a Remove brakets for describe in specs 2021-04-05 20:38:19 +02:00
François Turbelin
d414122efd Rename check_entreprise to set_entreprise 2021-04-05 20:38:19 +02:00
Cillian O'Ruanaidh
7e2d9ff381 The Resend Confirmation and Send/Print Invoice links should display for resumed orders too
These are links inside the Actions drop down menu on the edit order view. Before they were missing if an order was in a resumed state.

Fixes #5946
2021-04-02 15:41:59 +01:00
Cillian O'Ruanaidh
413896af5d Add enterprise name to subject and body of shipment shipped email
Fixes #7052
2021-04-02 11:44:40 +01:00
1279 changed files with 23577 additions and 9533 deletions

1
.browserslistrc Normal file
View File

@@ -0,0 +1 @@
defaults

70
.env Normal file
View File

@@ -0,0 +1,70 @@
# Default ENV vars (primarily for the development environment).
# Create `.env.development.local` or `.env.test.local` to add any local overrides.
# Time zone must match the operating system time zone in order to pass all tests.
# This string is the key for the MAPPING hash constant in ActiveSupport::TimeZone.
# Documentation including the hash="https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
TIMEZONE="Melbourne"
# Default country for dropdowns etc. See for codes="http://en.wikipedia.org/wiki/ISO_3166-1
DEFAULT_COUNTRY_CODE="AU"
# Locale for translation.
LOCALE="en"
# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES="en,es"
# Spree zone.
CHECKOUT_ZONE="Australia"
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.
CURRENCY="AUD"
# The whenever gem can set the `MAILTO` variable for our cron jobs.
# You can define an email address to notify if any job outputs something.
# But you need a working mail server setup so that the message is delivered.
# See: config/schedule.rb
# SCHEDULE_NOTIFICATIONS="admin@example.com"
# Mail settings
MAIL_HOST="example.com"
MAIL_DOMAIN="example.com"
MAIL_PORT="25"
SMTP_USERNAME="ofn"
SMTP_PASSWORD="f00d"
# Optional mail settings
# MAIL_SECURE_CONNECTION="TLS' # 'None' (default), 'SSL' or 'TLS'
# MAILS_FROM="hello@example.com"
# MAIL_BCC="manager@example.com"
# Javascript error reporting via Bugsnag.
# BUGSNAG_JS_KEY=""
# SingleSignOn login for Discourse
#
# DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance.
# DISCOURSE_SSO_SECRET=""
#
# DISCOURSE_URL must be the URL of your Discourse instance.
# DISCOURSE_URL="https://noticeboard.openfoodnetwork.org.au"
# 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
# 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
# STRIPE_INSTANCE_PUBLISHABLE_KEY="pk_test_xxxx" # This can be a test key or a live key
# STRIPE_CLIENT_ID="ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET="whsec_xxxx"
# Feature toggles
#
# Adding user emails separated by commas will enable them the use of certain features. See
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS="ofn@example.com,superadmin@example.com"

7
.env.development Normal file
View File

@@ -0,0 +1,7 @@
# ENV vars for the development environment
# Override locally with `.env.development.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

4
.env.test Normal file
View File

@@ -0,0 +1,4 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

5
.github/codecov.yml vendored
View File

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

View File

@@ -9,9 +9,11 @@ env:
DISABLE_KNAPSACK: true
TIMEZONE: UTC
COVERAGE: true
RSPEC_RETRY_RETRY_COUNT: 3
RAILS_ENV: test
jobs:
test-controllers-and-serializers:
rspec:
runs-on: ubuntu-18.04
services:
postgres:
@@ -26,6 +28,21 @@ jobs:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
matrix:
specs:
- "spec/controllers"
- "spec/models"
- "spec/features/admin/[a-o0-9]*_spec.rb"
- "spec/features/admin/[p-z]*_spec.rb"
- "spec/features/admin/*/*_spec.rb"
- "spec/features/consumer"
- "spec/lib"
- "spec/migrations"
- "spec/serializers"
- "spec/system"
- "engines/*/spec"
fail-fast: false
steps:
- uses: actions/checkout@v2
@@ -46,239 +63,11 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run controller tests
run: bundle exec rspec --profile -- spec/controllers spec/serializers
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-models:
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '14.15.5'
- 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 RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run tests
run: bundle exec rspec --profile -- spec/models
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-admin-features-1:
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '14.15.5'
- 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 RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run admin feature tests
run: bundle exec rspec --profile -- spec/features/admin/[a-o0-9]*_spec.rb
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-admin-features-2:
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '14.15.5'
- 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 RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run admin feature tests
run: bundle exec rspec --profile -- spec/features/admin/[p-z]*_spec.rb
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-consumer-features:
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '14.15.5'
- 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 RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run consumer feature tests
run: bundle exec rspec --profile -- spec/features/consumer
- name: Codecov
uses: codecov/codecov-action@v1.3.1
test-engines-etc:
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '14.15.5'
- 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 RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run JS tests
run: RAILS_ENV=test bundle exec rake karma:run
# Migration tests need to be run in a separate task.
# See: https://github.com/openfoodfoundation/openfoodnetwork/pull/6924#issuecomment-813056525
- name: Run migration tests
run: bundle exec rspec --pattern "spec/{migrations}/**/*_spec.rb"
- name: Run all other tests
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations"]
run: bundle exec rspec --profile -- ${{ matrix.specs }}
test-the-rest:
runs-on: ubuntu-18.04
@@ -315,11 +104,14 @@ jobs:
- name: Set up database
run: |
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run admin feature folders, engines, lib
run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/features/admin/*/*_spec.rb,spec/lib/{,/*/**}/*_spec.rb"
- name: Run JS tests
run: bundle exec rake karma:run
- name: Codecov
uses: codecov/codecov-action@v1.5.0
- name: Run jest tests
run: yarn jest
- name: Run all other tests
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations,system"]

10
.gitignore vendored
View File

@@ -2,6 +2,9 @@
.rbenv-version
.python-version
.byebug_history
.env.local
.env.development.local
.env.test.local
.swp
*.swo
*.swp
@@ -46,5 +49,10 @@ vendor/bundle/
coverage
/reports/
!/reports/README.md
bin/
/spec/components/stories/**/*.stories.json
/public/packs
/public/packs-test
/yarn-error.log
yarn-debug.log*
.yarn-integrity

View File

@@ -18,49 +18,22 @@
#
# This process probably doesn't need repeating. Otherwise there is plenty
# of room for improvements and automation.
Layout/LineLength:
Max: 100
Exclude:
- app/controllers/spree/admin/products_controller.rb
- app/controllers/spree/admin/reports_controller.rb
- app/controllers/spree/paypal_controller.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/order_management/spec/services/order_management/reports/bulk_coop/bulk_coop_report_spec.rb
- lib/open_food_network/reports/line_items.rb
- spec/controllers/spree/admin/orders/invoices_spec.rb
- spec/controllers/spree/admin/tax_rates_controller_spec.rb
- spec/controllers/user_passwords_controller_spec.rb
- spec/features/admin/configuration/general_settings_spec.rb
- spec/features/consumer/shopping/unit_price_spec.rb
- spec/helpers/admin/orders_helper_spec.rb
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
- spec/lib/stripe/authorize_response_patcher_spec.rb
- spec/services/bulk_invoice_service_spec.rb
- spec/services/content_sanitizer_spec.rb
- spec/services/process_payment_intent_spec.rb
- spec/support/features/datepicker_helper.rb
- 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/enterprise_relationships_controller.rb
- app/controllers/admin/enterprise_roles_controller.rb
- app/controllers/admin/enterprises_controller.rb
- app/controllers/admin/inventory_items_controller.rb
- app/controllers/admin/manager_invitations_controller.rb
- app/controllers/admin/product_import_controller.rb
- app/controllers/admin/schedules_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/enterprise_attachment_controller.rb
- app/controllers/api/product_images_controller.rb
- app/controllers/spree/paypal_controller_decorator.rb
- app/controllers/stripe/callbacks_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/checkout_helper.rb
- app/helpers/enterprises_helper.rb
- app/helpers/markdown_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/orders_helper.rb
- app/jobs/subscription_confirm_job.rb
@@ -69,110 +42,91 @@ Layout/LineLength:
- app/models/concerns/order_shipment.rb
- app/models/concerns/product_stock.rb
- app/models/concerns/variant_stock.rb
- app/models/content_configuration.rb
- app/models/customer.rb
- app/models/enterprise_group.rb
- app/models/enterprise_role.rb
- app/models/inventory_item.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/gateway/stripe_connect.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/product.rb
- app/models/spree/user.rb
- app/models/spree/variant.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/default_stock_location.rb
- app/services/embedded_page_service.rb
- app/services/order_cycle_form.rb
- app/services/order_factory.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/config/routes.rb
- engines/web/spec/features/consumer/cookies_spec.rb
- Gemfile
- lib/discourse/single_sign_on.rb
- lib/open_food_network/available_payment_method_filter.rb
- lib/open_food_network/bulk_coop_report.rb
- lib/open_food_network/customers_report.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/group_buy_report.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/stripe/credit_card_clone_finder.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/customers_controller_spec.rb
- spec/controllers/admin/enterprises_controller_spec.rb
- spec/controllers/admin/inventory_items_controller_spec.rb
- spec/controllers/admin/manager_invitations_controller_spec.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/admin/proxy_orders_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/base_controller_spec.rb
- spec/controllers/api/exchange_products_controller_spec.rb
- spec/controllers/api/logos_controller_spec.rb
- spec/controllers/api/order_cycles_controller_spec.rb
- spec/controllers/api/orders_controller_spec.rb
- spec/controllers/api/product_images_controller_spec.rb
- spec/controllers/api/products_controller_spec.rb
- spec/controllers/api/promo_images_controller_spec.rb
- spec/controllers/api/states_controller_spec.rb
- spec/controllers/api/terms_and_conditions_controller_spec.rb
- spec/controllers/api/variants_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/shop_controller_spec.rb
- spec/controllers/shops_controller_spec.rb
- spec/controllers/spree/admin/adjustments_controller_spec.rb
- spec/controllers/spree/admin/base_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/products_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/spree/users_controller_spec.rb
- spec/controllers/spree/user_sessions_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/line_item_factory.rb
- spec/factories/order_factory.rb
- spec/factories/shipment_factory.rb
- spec/factories/stock_location_factory.rb
- spec/factories/user_factory.rb
- spec/features/admin/adjustments_spec.rb
- spec/features/admin/bulk_order_management_spec.rb
- spec/features/admin/bulk_product_update_spec.rb
@@ -180,13 +134,10 @@ Layout/LineLength:
- spec/features/admin/customers_spec.rb
- spec/features/admin/enterprise_fees_spec.rb
- spec/features/admin/enterprise_relationships_spec.rb
- spec/features/admin/enterprise_roles_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/enterprise_user_spec.rb
- spec/features/admin/multilingual_spec.rb
- spec/features/admin/order_cycles/complex_creating_specific_time_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
@@ -195,6 +146,7 @@ Layout/LineLength:
- 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
@@ -204,76 +156,49 @@ Layout/LineLength:
- spec/features/admin/tag_rules_spec.rb
- spec/features/admin/users_spec.rb
- spec/features/admin/variant_overrides_spec.rb
- spec/features/consumer/account/cards_spec.rb
- spec/features/consumer/account/settings_spec.rb
- spec/features/consumer/account_spec.rb
- spec/features/consumer/authentication_spec.rb
- spec/features/consumer/caching/darkswarm_caching_spec.rb
- spec/features/consumer/caching/shops_caching_spec.rb
- spec/features/consumer/groups_spec.rb
- spec/features/consumer/multilingual_spec.rb
- spec/features/consumer/producers_spec.rb
- spec/features/consumer/registration_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_groups_spec.rb
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
- spec/features/consumer/shopping/orders_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/admin/subscriptions_helper_spec.rb
- spec/helpers/checkout_helper_spec.rb
- spec/helpers/enterprises_helper_spec.rb
- spec/helpers/groups_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/confirm_order_job_spec.rb
- spec/jobs/subscription_confirm_job_spec.rb
- spec/jobs/subscription_placement_job_spec.rb
- spec/lib/open_food_network/address_finder_spec.rb
- spec/lib/open_food_network/customers_report_spec.rb
- spec/lib/open_food_network/enterprise_fee_applicator_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/lettuce_share_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/orders_and_fulfillments_report_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/open_food_network/xero_invoices_report_spec.rb
- spec/lib/spree/core/calculated_adjustments_spec.rb
- spec/lib/stripe/account_connector_spec.rb
- spec/lib/stripe/webhook_handler_spec.rb
- spec/lib/stripe/authorize_response_patcher_spec.rb
- spec/mailers/order_mailer_spec.rb
- spec/mailers/producer_mailer_spec.rb
- spec/mailers/subscription_mailer_spec.rb
- spec/models/calculator/flexi_rate_spec.rb
- spec/models/calculator/price_sack_spec.rb
- spec/models/calculator/weight_spec.rb
- spec/models/column_preference_spec.rb
- spec/models/concerns/order_shipment_spec.rb
- spec/models/concerns/product_stock_spec.rb
- spec/models/customer_spec.rb
- spec/models/enterprise_caching_spec.rb
- spec/models/enterprise_fee_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/product_import/reset_absent_spec.rb
- spec/models/proxy_order_spec.rb
- spec/models/spree/ability_spec.rb
- spec/models/spree/address_spec.rb
- spec/models/spree/adjustment_spec.rb
@@ -284,92 +209,50 @@ Layout/LineLength:
- spec/models/spree/order/checkout_spec.rb
- spec/models/spree/order_inventory_spec.rb
- spec/models/spree/order_spec.rb
- spec/models/spree/order/state_machine_spec.rb
- spec/models/spree/payment_method_spec.rb
- spec/models/spree/payment_spec.rb
- spec/models/spree/product_set_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/return_authorization_spec.rb
- spec/models/spree/shipping_method_spec.rb
- spec/models/spree/stock_item_spec.rb
- spec/models/spree/taxon_spec.rb
- spec/models/spree/tax_rate_spec.rb
- spec/models/spree/user_spec.rb
- spec/models/spree/variant_spec.rb
- spec/models/stripe_account_spec.rb
- spec/models/tag_rule/discount_order_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/performance/orders_controller_spec.rb
- spec/performance/shop_controller_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/customer_serializer_spec.rb
- spec/serializers/api/admin/exchange_serializer_spec.rb
- spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
- spec/serializers/api/admin/subscription_customer_serializer_spec.rb
- spec/serializers/api/admin/variant_override_serializer_spec.rb
- spec/serializers/api/current_order_serializer_spec.rb
- spec/serializers/api/enterprise_shopfront_serializer_spec.rb
- spec/serializers/api/order_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_products_spec.rb
- spec/services/order_cycle_distributed_variants_spec.rb
- spec/services/order_cycle_form_spec.rb
- spec/services/order_factory_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/services/variant_units/option_value_namer_spec.rb
- spec/spec_helper.rb
- spec/support/cancan_helper.rb
- spec/support/delayed_job_helper.rb
- spec/support/matchers/delegate_matchers.rb
- spec/support/features/datepicker_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/support/request/shop_workflow.rb
- spec/support/request/stripe_stubs.rb
- spec/support/request/web_helper.rb
- spec/support/seeds.rb
- spec/swagger_helper.rb
- spec/views/spree/admin/payment_methods/index.html.haml_spec.rb
Metrics/AbcSize:
Max: 15
Exclude:
- app/controllers/admin/schedules_controller.rb
- app/controllers/checkout_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/shipping_methods_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/helpers/spree/base_helper.rb
- app/jobs/subscription_placement_job.rb
- app/models/order_cycle.rb
- app/models/product_import/unit_converter.rb
- app/models/spree/gateway/pay_pal_express.rb
- app/serializers/api/admin/enterprise_serializer.rb
- app/services/order_factory.rb
- app/services/variants_stock_levels.rb
- engines/order_management/app/services/order_management/subscriptions/form.rb
- lib/open_food_network/enterprise_fee_calculator.rb
- lib/open_food_network/order_grouper.rb
- lib/spree/core/controller_helpers/auth.rb
- lib/spree/core/controller_helpers/common.rb
- lib/spree/core/product_duplicator.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/profile_storer.rb
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/admin/customers_controller.rb
- app/controllers/admin/enterprise_fees_controller.rb
@@ -377,19 +260,23 @@ Metrics/AbcSize:
- 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/enterprises_controller.rb
- app/controllers/api/product_images_controller.rb
- app/controllers/api/products_controller.rb
- app/controllers/api/shipments_controller.rb
- app/controllers/api/taxons_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/application_controller.rb
- app/controllers/cart_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
@@ -398,14 +285,14 @@ Metrics/AbcSize:
- 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_decorator.rb
- app/controllers/spree/paypal_controller.rb
- app/controllers/spree/user_passwords_controller.rb
- app/controllers/spree/user_registrations_controller.rb
- app/controllers/spree/users_controller.rb
- app/controllers/spree/user_sessions_controller.rb
- app/controllers/stripe/callbacks_controller.rb
@@ -417,21 +304,26 @@ Metrics/AbcSize:
- 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_contents.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/payment/processing.rb
@@ -446,13 +338,18 @@ Metrics/AbcSize:
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- app/models/spree/zone.rb
- app/serializers/api/product_serializer.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/sets/model_set.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
@@ -460,11 +357,12 @@ Metrics/AbcSize:
- 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_decorator.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
@@ -472,6 +370,7 @@ Metrics/AbcSize:
- 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
@@ -483,15 +382,18 @@ Metrics/AbcSize:
- 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/controller_helpers/ssl.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/spree/money.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
@@ -523,17 +425,15 @@ Metrics/BlockLength:
"scenario"
]
Exclude:
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
- spec/features/admin/tag_rules_spec.rb
- 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/spree/core/controller_helpers/ssl.rb
- lib/tasks/data.rake
- spec/controllers/spree/admin/invoices_controller_spec.rb
- 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
@@ -544,12 +444,13 @@ Metrics/BlockLength:
- 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/models/tag_rule/discount_order_spec.rb
- spec/requests/api/orders_spec.rb
- spec/spec_helper.rb
- spec/support/delayed_job_helper.rb
- spec/support/cancan_helper.rb
- spec/support/matchers/select2_matchers.rb
- spec/support/matchers/table_matchers.rb
- spec/swagger_helper.rb
@@ -557,30 +458,14 @@ Metrics/BlockLength:
Metrics/CyclomaticComplexity:
Max: 6
Exclude:
- app/controllers/admin/resource_controller.rb
- 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/users_controller.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/order_inventory.rb
- app/models/spree/order.rb
- app/models/spree/shipment.rb
- app/models/spree/tax_rate.rb
- app/models/spree/variant.rb
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
- lib/active_merchant/billing/gateways/stripe_decorator.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/controller_helpers/common.rb
- lib/stripe/authorize_response_patcher.rb
- lib/stripe/credit_card_clone_destroyer.rb
- spec/support/i18n_translations_checker.rb
- app/controllers/admin/enterprise_fees_controller.rb
- app/controllers/admin/enterprises_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
@@ -588,78 +473,88 @@ Metrics/CyclomaticComplexity:
- 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/payment_method.rb
- app/models/spree/order_inventory.rb
- app/models/spree/payment.rb
- app/models/spree/preference.rb
- app/models/spree/preferences/preferable.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
- app/services/sets/variant_override_set.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/spree/core/calculated_adjustments.rb
- lib/spree/core/controller_helpers/order.rb
- lib/spree/core/controller_helpers/respond_with.rb
- lib/spree/core/controller_helpers/ssl.rb
- lib/spree/localized_number.rb
- spec/models/product_importer_spec.rb
Metrics/PerceivedComplexity:
Max: 7
Exclude:
- app/controllers/spree/admin/payment_methods_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/admin/users_controller.rb
- app/models/product_import/entry_validator.rb
- app/models/spree/order_inventory.rb
- app/models/spree/shipment.rb
- app/models/spree/variant.rb
- lib/active_merchant/billing/gateways/stripe_decorator.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/variants_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.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/core/controller_helpers/ssl.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
@@ -669,11 +564,11 @@ Metrics/MethodLength:
- app/controllers/admin/resource_controller.rb
- app/controllers/admin/stripe_accounts_controller.rb
- app/controllers/admin/subscriptions_controller.rb
- app/controllers/api/products_controller.rb
- app/controllers/api/shipments_controller.rb
- app/controllers/api/taxons_controller.rb
- app/controllers/api/variants_controller.rb
- app/controllers/cart_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
@@ -687,7 +582,7 @@ Metrics/MethodLength:
- 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_decorator.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
@@ -698,6 +593,7 @@ Metrics/MethodLength:
- 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
@@ -709,28 +605,30 @@ Metrics/MethodLength:
- 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_method.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/product_decorator.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/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
@@ -756,7 +654,6 @@ Metrics/MethodLength:
- 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/rack_request_blocker.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
@@ -778,32 +675,27 @@ Metrics/MethodLength:
- spec/features/consumer/shopping/variant_overrides_spec.rb
- spec/models/product_importer_spec.rb
- spec/support/i18n_translations_checker.rb
- app/controllers/admin/bulk_line_items_controller.rb
- app/controllers/spree/paypal_controller.rb
- app/jobs/subscription_placement_job.rb
- app/models/spree/gateway/pay_pal_express.rb
Metrics/ClassLength:
Max: 100
Exclude:
- app/controllers/admin/customers_controller.rb
- app/controllers/spree/admin/payments_controller.rb
- app/controllers/spree/paypal_controller.rb
- engines/order_management/app/services/order_management/order/updater.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/products_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
@@ -818,12 +710,15 @@ Metrics/ClassLength:
- 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
@@ -844,20 +739,19 @@ Metrics/ModuleLength:
- 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
- engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb
- lib/open_food_network/column_preference_defaults.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/api/orders_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/credit_card_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:
@@ -867,9 +761,16 @@ Metrics/ParameterLists:
- 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/taxon.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 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

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
2.5.8
2.7.3

6
.simplecov Normal file → Executable file
View File

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

View File

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

View File

@@ -8,6 +8,7 @@ The fastest way to make it work locally is to use Docker, you only need to setup
Otherwise, for a local setup you will need:
* Ruby and bundler (check current Ruby version in [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file)
* PostgreSQL database
* Redis (for background jobs)
* Chrome (for testing)
The following guides will provide OS-specific step-by-step instructions to get these requirements installed:
@@ -47,7 +48,11 @@ $ sudo -u postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PASSWORD 'f0
This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting section](#creating-the-database) for an alternative.
Once done, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot.
Next, it is _strongly recommended_ to run the setup script.
```sh
$ script/setup
```
If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot.
Now, your dreams of spinning up a development server can be realised:

76
Gemfile
View File

@@ -1,27 +1,31 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby "2.5.8"
ruby "2.7.3"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'rails', '~> 5.2'
gem 'dotenv-rails', require: 'dotenv/rails-now' # Load ENV vars before other gems
gem 'rails', '~> 6.1.4'
gem 'activemerchant', '>= 1.78.0'
gem 'angular-rails-templates', '>= 0.3.0'
gem 'awesome_nested_set'
gem 'ransack', '2.4.1'
gem 'ransack', '2.4.2'
gem 'responders'
gem 'sass', '<= 4.7.1'
gem 'sass-rails', '< 6.0.0'
gem 'sass-rails', '< 5.1.0' # this restriction originates from the compass-rails's version
gem 'webpacker', '~> 5'
gem 'i18n'
gem 'i18n-js', '~> 3.8.3'
gem 'i18n-js', '~> 3.9.0'
gem 'rails-i18n'
gem 'rails_safe_tasks', '~> 1.0'
gem "activerecord-import"
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-5"
gem "fog-aws", ">= 0.6.0"
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-6"
gem "fog-aws", "~> 2.0" # db2fog does not support v3
gem "valid_email2"
gem "catalog", path: "./engines/catalog"
gem 'dfc_provider', path: './engines/dfc_provider'
@@ -45,20 +49,16 @@ gem 'paypal-sdk-merchant', '1.117.2'
gem 'stripe'
gem 'devise'
gem 'devise-i18n'
gem 'devise-encryptable'
gem 'devise-token_authenticatable'
gem 'jwt', '~> 2.2'
gem 'jwt', '~> 2.3'
gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
gem 'daemons'
gem 'delayed_job_active_record'
gem 'delayed_job_web'
gem 'pagy', '~> 5.0'
gem 'kaminari', '~> 1.2.1'
gem 'andand'
gem 'angularjs-rails', '1.5.5'
gem 'aws-sdk', '1.67.0'
gem 'angularjs-rails', '1.8.0'
gem 'aws-sdk', '2.2.0'
gem 'bugsnag'
gem 'haml'
gem 'redcarpet'
@@ -68,22 +68,28 @@ gem 'actionpack-action_caching'
# AMS is deprecated, we will introduce an alternative at some point
gem "active_model_serializers", "0.8.4"
gem 'activerecord-session_store'
gem 'acts-as-taggable-on', '~> 7.0'
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 'figaro'
gem 'geocoder'
gem 'gmaps4rails'
gem 'mimemagic', '> 0.3.5'
gem 'paper_trail', '~> 10.3.1'
gem 'paperclip', '~> 3.4.1'
gem 'paper_trail', '~> 12.1.0'
gem 'rack-rewrite'
gem 'rack-ssl', require: 'rack/ssl'
gem 'roadie-rails', '~> 2.2.0'
gem 'roadie-rails'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'puma'
gem 'hiredis'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem "cable_ready", "5.0.0.pre2"
gem 'combine_pdf'
gem 'wicked_pdf'
@@ -94,7 +100,7 @@ gem 'roo', '~> 2.8.3'
gem 'whenever', require: false
gem 'test-unit', '~> 3.4'
gem 'test-unit', '~> 3.5'
gem 'coffee-rails', '~> 5.0.0'
gem 'compass-rails'
@@ -108,10 +114,9 @@ gem 'foundation-icons-sass-rails'
gem 'foundation-rails', '= 5.5.2.1'
gem 'jquery-migrate-rails'
gem 'jquery-rails', '4.4.0'
gem 'jquery-ui-rails', '~> 4.2'
gem 'select2-rails', '~> 3.4.7'
gem "select2-rails", github: "openfoodfoundation/select2-rails", branch: "v349_with_thor_v1"
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', branch: 'ofn-rails-4'
@@ -125,7 +130,8 @@ gem "view_component", require: "view_component/engine"
group :production, :staging do
gem 'ddtrace'
gem 'unicorn-worker-killer'
gem 'rack-timeout'
gem 'sd_notify' # For better Systemd process management. Used by Puma.
end
group :test, :development do
@@ -145,36 +151,34 @@ group :test, :development do
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'unicorn-rails'
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
gem 'test-prof'
gem 'webmock'
gem 'rails-controller-testing'
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
end
group :development do
gem 'byebug'
gem 'debugger-linecache'
gem 'pry'
gem 'pry-byebug'
gem 'foreman'
gem 'pry', '~> 0.13.0'
gem 'pry-byebug', '~> 3.9.0'
gem 'rubocop'
gem 'rubocop-rails'
gem 'spring'
gem 'spring-commands-rspec'
gem 'web-console'
gem "view_component_storybook", require: "view_component/storybook/engine"
# 1.0.9 fixed openssl issues on macOS https://github.com/eventmachine/eventmachine/issues/602
# While we don't require this gem directly, no dependents forced the upgrade to a version
# greater than 1.0.9, so we just required the latest available version here.
gem 'eventmachine', '>= 1.2.3'
gem 'rack-mini-profiler', '< 3.0.0'
end

View File

@@ -6,13 +6,13 @@ GIT
GIT
remote: https://github.com/openfoodfoundation/db2fog.git
revision: 8ceef362c64e6573d62d26db5ebb0c0f33cd3d61
branch: rails-5
revision: 5b63343847452f52aa42f7fc169d6ab3af57cda3
branch: rails-6
specs:
db2fog (0.9.1)
activerecord (>= 3.2.0, < 6.0)
db2fog (0.9.2)
activerecord (>= 3.2.0, < 7.0)
fog-core (~> 1.0)
rails (>= 3.2.0, < 6.0)
rails (>= 3.2.0, < 7.0)
GIT
remote: https://github.com/openfoodfoundation/ofn-qz.git
@@ -21,6 +21,15 @@ GIT
specs:
ofn-qz (0.1.0)
GIT
remote: https://github.com/openfoodfoundation/select2-rails.git
revision: fc240e85fbdf1878ff3c39d972c0cd9a312f5ed4
branch: v349_with_thor_v1
specs:
select2-rails (3.4.9)
sass-rails
thor (>= 0.14)
PATH
remote: engines/catalog
specs:
@@ -47,48 +56,63 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
Ascii85 (1.1.0)
actioncable (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
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)
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)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.4.1)
actionview (= 6.1.4.1)
activesupport (= 6.1.4.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actionview (5.2.6)
activesupport (= 5.2.6)
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)
nokogiri (>= 1.8.5)
actionview (6.1.4.1)
activesupport (= 6.1.4.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (5.2.6)
activesupport (= 5.2.6)
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
globalid (>= 0.3.6)
activemerchant (1.119.0)
activemerchant (1.123.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activerecord-import (1.1.0)
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)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -98,22 +122,26 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
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)
marcel (~> 1.0.0)
activesupport (5.2.6)
mini_mime (>= 1.1.0)
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
acts-as-taggable-on (7.0.0)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
acts-as-taggable-on (8.1.0)
activerecord (>= 5.0, < 6.2)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
andand (1.3.3)
afm (0.2.2)
angular-rails-templates (1.1.0)
railties (>= 4.2, < 7)
sprockets (>= 3.0, < 5)
@@ -121,25 +149,32 @@ GEM
angular_rails_csrf (4.5.0)
railties (>= 3, < 7)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.5.5)
arel (9.0.0)
angularjs-rails (1.8.0)
ast (2.4.2)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
awesome_print (1.9.2)
aws-sdk (1.67.0)
aws-sdk-v1 (= 1.67.0)
aws-sdk-v1 (1.67.0)
json (~> 1.4)
nokogiri (~> 1)
aws-sdk (2.2.0)
aws-sdk-resources (= 2.2.0)
aws-sdk-core (2.2.0)
jmespath (~> 1.0)
aws-sdk-resources (2.2.0)
aws-sdk-core (= 2.2.0)
bcrypt (3.1.16)
bugsnag (6.20.0)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.9.1)
msgpack (~> 1.0)
bugsnag (6.24.0)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (6.1.4)
bullet (6.1.5)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cable_ready (5.0.0.pre2)
rails (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.35.3)
addressable
@@ -149,13 +184,14 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
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.5.2)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
coffee-rails (5.0.0)
@@ -183,29 +219,27 @@ GEM
compass (~> 1.0.0)
sass-rails (< 5.1)
sprockets (< 4.0)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.9.0)
addressable
daemons (1.4.0)
dalli (2.7.11)
database_cleaner (1.99.0)
ddtrace (0.49.0)
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)
msgpack
debugger-linecache (1.2.0)
delayed_job (4.1.9)
activesupport (>= 3.0, < 6.2)
delayed_job_active_record (4.1.6)
activerecord (>= 3.0, < 6.2)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.4.4)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
rack-protection (>= 1.5.5)
sinatra (>= 1.4.4)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@@ -214,28 +248,43 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-i18n (1.10.0)
devise (>= 4.8.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
docile (1.3.5)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
e2mmap (0.1.0)
erubi (1.10.0)
eventmachine (1.2.7)
excon (0.79.0)
et-orbi (1.2.4)
tzinfo
excon (0.81.0)
execjs (2.7.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (1.3.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
ffaker (2.18.0)
ffi (1.15.0)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
faraday-net_http_persistent (1.1.0)
ferrum (0.11)
addressable (~> 2.5)
cliver (~> 0.3)
concurrent-ruby (~> 1.1)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.20.0)
ffi (1.15.4)
flipper (0.20.4)
flipper-active_record (0.20.4)
activerecord (>= 5.0, < 7)
@@ -260,6 +309,7 @@ GEM
fog-xml (0.1.3)
fog-core
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)
@@ -267,66 +317,55 @@ GEM
foundation-rails (5.5.2.1)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
fugit (1.4.5)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.6.7)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
geocoder (1.7.0)
globalid (0.5.2)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
good_migrations (0.0.2)
good_migrations (0.1.0)
activerecord (>= 3.1)
railties (>= 3.1)
haml (5.2.1)
haml (5.2.2)
temple (>= 0.8.0)
tilt
hashdiff (1.0.1)
hashery (2.1.2)
highline (2.0.3)
hiredis (0.6.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
i18n-js (3.8.3)
i18n-js (3.9.0)
i18n (>= 0.6.6)
immigrant (0.3.6)
activerecord (>= 3.0)
ipaddress (0.8.3)
jquery-migrate-rails (1.2.1)
jmespath (1.4.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (1.8.6)
json (2.6.0)
json-schema (2.8.1)
addressable (>= 2.4)
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jwt (2.2.3)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
kgio (2.11.3)
knapsack (1.22.0)
jwt (2.3.0)
knapsack (4.0.0)
rake
launchy (2.4.3)
addressable (~> 2.3)
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
libv8-node (15.14.0.0)
loofah (2.9.1)
libv8-node (15.14.0.1)
loofah (2.12.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -335,12 +374,12 @@ GEM
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mime-types-data (3.2021.0225)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_mime (1.1.0)
mini_portile2 (2.5.1)
mini_portile2 (2.6.1)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.14.4)
@@ -352,11 +391,9 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.7)
nokogiri (1.11.4)
mini_portile2 (~> 2.5.0)
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
@@ -365,8 +402,9 @@ GEM
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
paper_trail (10.3.1)
activerecord (>= 4.2)
pagy (5.0.1)
paper_trail (12.1.0)
activerecord (>= 5.2)
request_store (~> 1.1)
paperclip (3.4.2)
activemodel (>= 3.0.0)
@@ -374,18 +412,24 @@ GEM
activesupport (>= 3.0.0)
cocaine (~> 0.5.0)
mime-types
parallel (1.20.1)
parallel (1.21.0)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.0.1.1)
parser (3.0.2.0)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.5.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
pg (1.2.3)
power_assert (2.0.0)
power_assert (2.0.1)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
@@ -393,29 +437,37 @@ GEM
byebug (~> 11.0)
pry (~> 0.13.0)
public_suffix (4.0.6)
puma (5.5.2)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.5.2)
rack (2.2.3)
rack-mini-profiler (2.3.2)
rack-mini-profiler (2.3.3)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
rack-proxy (0.7.0)
rack
rack-rewrite (1.5.1)
rack-ssl (1.4.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.2.6)
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)
bundler (>= 1.15.0)
railties (= 6.1.4.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -424,30 +476,29 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
rails-i18n (5.1.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (>= 6.0.0, < 7)
rails_safe_tasks (1.0.0)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
raindrops (0.19.1)
rake (13.0.3)
ransack (2.4.1)
rake (13.0.6)
ransack (2.4.2)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
i18n
rb-fsevent (0.10.4)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.2.5)
redis (4.5.1)
regexp_parser (2.1.1)
request_store (1.5.0)
rack (>= 1.4)
@@ -476,7 +527,7 @@ GEM
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.1)
rspec-rails (5.0.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -500,52 +551,60 @@ GEM
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (1.15.0)
rubocop (1.22.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.5.0, < 2.0)
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.5.0)
rubocop-ast (1.12.0)
parser (>= 3.0.1.1)
rubocop-rails (2.10.1)
rubocop-rails (2.12.4)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
ruby2_keywords (0.0.4)
rubyzip (2.3.2)
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass-rails (5.0.8)
railties (>= 5.2.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
select2-rails (3.4.9)
sass-rails
thor (~> 0.14)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
sd_notify (0.1.1)
selenium-webdriver (4.0.2)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
semantic_range (3.0.0)
shoulda-matchers (5.0.0)
activesupport (>= 5.2.0)
sidekiq (6.2.2)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-scheduler (3.1.0)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
tilt (>= 1.4.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
spring (2.1.1)
simplecov_json_formatter (0.1.3)
spring (3.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
@@ -563,45 +622,53 @@ GEM
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stringex (2.8.5)
stripe (5.30.0)
stripe (5.39.0)
temple (0.8.2)
test-prof (1.0.5)
test-unit (3.4.1)
test-prof (1.0.7)
test-unit (3.5.0)
power_assert
thor (0.20.3)
thread_safe (0.3.6)
thor (1.1.0)
thread-local (1.1.0)
thwait (0.2.0)
e2mmap
tilt (2.0.10)
timecop (0.9.4)
tzinfo (1.2.9)
thread_safe (~> 0.1)
ttfunk (1.7.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.0.0)
unicorn (6.0.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-rails (2.2.1)
rack
unicorn
unicorn-worker-killer (0.4.5)
get_process_mem (~> 0)
unicorn (>= 4, < 7)
uniform_notifier (1.14.1)
view_component (2.31.1)
activesupport (>= 5.0.0, < 7.0)
view_component_storybook (0.8.0)
view_component (>= 2.2)
unicode-display_width (2.1.0)
uniform_notifier (1.14.2)
valid_email2 (4.0.0)
activemodel (>= 3.2)
mail (~> 2.5)
view_component (2.40.0)
activesupport (>= 5.0.0, < 8.0)
method_source (~> 1.0)
view_component_storybook (0.10.1)
view_component (>= 2.36)
warden (1.2.9)
rack (>= 2.0.9)
webdrivers (4.6.0)
web-console (4.1.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (4.7.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.13.0)
addressable (>= 2.3.6)
selenium-webdriver (> 3.141, < 5.0)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.7.3)
webpacker (5.4.3)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
@@ -612,6 +679,7 @@ GEM
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.2)
PLATFORMS
ruby
@@ -623,19 +691,21 @@ DEPENDENCIES
activerecord-import
activerecord-postgresql-adapter
activerecord-session_store
acts-as-taggable-on (~> 7.0)
acts-as-taggable-on (~> 8.1)
acts_as_list (= 1.0.4)
andand
angular-rails-templates (>= 0.3.0)
angular_rails_csrf
angularjs-file-upload-rails (~> 2.4.1)
angularjs-rails (= 1.5.5)
angularjs-rails (= 1.8.0)
awesome_nested_set
awesome_print
aws-sdk (= 1.67.0)
aws-sdk (= 2.2.0)
bigdecimal (= 3.0.2)
bootsnap
bugsnag
bullet
byebug
cable_ready (= 5.0.0.pre2)
cancancan (~> 1.15.0)
capybara
catalog!
@@ -643,27 +713,26 @@ DEPENDENCIES
coffee-rails (~> 5.0.0)
combine_pdf
compass-rails
cuprite
custom_error_message!
daemons
dalli
database_cleaner
db2fog!
ddtrace
debugger-linecache
delayed_job_active_record
delayed_job_web
devise
devise-encryptable
devise-i18n
devise-token_authenticatable
dfc_provider!
eventmachine (>= 1.2.3)
dotenv-rails
factory_bot_rails (= 6.2.0)
ffaker
figaro
flipper
flipper-active_record
flipper-ui
fog-aws (>= 0.6.0)
fog-aws (~> 2.0)
foreman
foundation-icons-sass-rails
foundation-rails (= 5.5.2.1)
fuubar (~> 2.5.1)
@@ -674,15 +743,13 @@ DEPENDENCIES
highline (= 2.0.3)
hiredis
i18n
i18n-js (~> 3.8.3)
i18n-js (~> 3.9.0)
immigrant
jquery-migrate-rails
jquery-rails (= 4.4.0)
jquery-ui-rails (~> 4.2)
json
json_spec (~> 1.1.4)
jwt (~> 2.2)
kaminari (~> 1.2.1)
jwt (~> 2.3)
knapsack
letter_opener (>= 1.4.1)
mimemagic (> 0.3.5)
@@ -691,36 +758,42 @@ DEPENDENCIES
oauth2 (~> 1.4.7)
ofn-qz!
order_management!
paper_trail (~> 10.3.1)
pagy (~> 5.0)
paper_trail (~> 12.1.0)
paperclip (~> 3.4.1)
paranoia (~> 2.4)
paypal-sdk-merchant (= 1.117.2)
pdf-reader
pg (~> 1.2.3)
pry
pry-byebug
pry (~> 0.13.0)
pry-byebug (~> 3.9.0)
puma
rack-mini-profiler (< 3.0.0)
rack-rewrite
rack-ssl
rails (~> 5.2)
rack-timeout
rails (~> 6.1.4)
rails-controller-testing
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (= 2.4.1)
ransack (= 2.4.2)
redcarpet
redis (>= 4.0)
responders
roadie-rails (~> 2.2.0)
roadie-rails
roo (~> 2.8.3)
rspec-rails (>= 3.5.2)
rspec-retry
rswag
rubocop
rubocop-rails
sass (<= 4.7.1)
sass-rails (< 6.0.0)
select2-rails (~> 3.4.7)
sass-rails (< 5.1.0)
sd_notify
select2-rails!
selenium-webdriver
shoulda-matchers
sidekiq
sidekiq-scheduler
simplecov
spring
spring-commands-rspec
@@ -728,22 +801,23 @@ DEPENDENCIES
stringex (~> 2.8.5)
stripe
test-prof
test-unit (~> 3.4)
test-unit (~> 3.5)
timecop
uglifier (>= 1.0.3)
unicorn-rails
unicorn-worker-killer
valid_email2
view_component
view_component_storybook
web!
web-console
webdrivers
webmock
webpacker (~> 5)
whenever
wicked_pdf
wkhtmltopdf-binary
RUBY VERSION
ruby 2.5.8p224
ruby 2.7.3p183
BUNDLED WITH
1.17.3
2.1.4

5
Procfile Normal file
View File

@@ -0,0 +1,5 @@
# Foreman Procfile. Start all dev server processes with: `foreman start`
rails: bundle exec rails s -p 3000
webpack: ./bin/webpack-dev-server
sidekiq: bundle exec sidekiq -q mailers -q default

View File

@@ -34,7 +34,7 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration
## Testing
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/openfoodfoundation/openfoodnetwork/projects/31) for some good first issues, both on manual and automated testing (RSpec/Capybara).
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/orgs/openfoodfoundation/projects/1) for some good first issues, both on manual and automated testing (RSpec/Capybara).
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
@@ -47,5 +47,5 @@ Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
[ofn-handbook]: https://ofn-user-guide.gitbook.io/ofn-handbook/
[ofn-install]: https://github.com/openfoodfoundation/ofn-install
[super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide
[welcome-dev]: https://github.com/openfoodfoundation/openfoodnetwork/projects/27
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/2
[zenhub]: https://www.zenhub.com/extension

View File

@@ -8,6 +8,6 @@ require_relative 'config/application'
Openfoodnetwork::Application.load_tasks
unless ENV['DISABLE_KNAPSACK']
Knapsack.load_tasks if defined?(Knapsack)
if !ENV['DISABLE_KNAPSACK'] && defined?(Knapsack)
Knapsack.load_tasks
end

View File

@@ -0,0 +1,3 @@
<svg viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.08646 2.11037L11.1222 4.40105C11.208 4.49756 11.208 4.65501 11.1222 4.75151L6.19306 10.2979L4.09861 10.5595C3.81875 10.595 3.58177 10.3284 3.61337 10.0135L3.84583 7.65677L8.775 2.11037C8.86076 2.01387 9.00069 2.01387 9.08646 2.11037ZM12.7427 1.52881L11.6413 0.28951C11.2983 -0.0965032 10.7408 -0.0965032 10.3955 0.28951L9.59653 1.18851C9.51076 1.28502 9.51076 1.44247 9.59653 1.53897L11.6323 3.82965C11.7181 3.92616 11.858 3.92616 11.9438 3.82965L12.7427 2.93065C13.0858 2.5421 13.0858 1.91483 12.7427 1.52881ZM8.66667 8.78941V11.3747H1.44444V3.2481H6.6309C6.70312 3.2481 6.77083 3.21508 6.82274 3.15921L7.72552 2.14339C7.89705 1.95038 7.77517 1.62278 7.53368 1.62278H1.08333C0.485243 1.62278 0 2.16878 0 2.84177V11.781C0 12.454 0.485243 13 1.08333 13H9.02778C9.62587 13 10.1111 12.454 10.1111 11.781V7.77359C10.1111 7.50186 9.81997 7.36726 9.64844 7.55773L8.74566 8.57355C8.69601 8.63196 8.66667 8.70815 8.66667 8.78941Z" fill="#4CB5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -8,6 +8,9 @@ angular.module("ofn.admin", [
"admin.dropdown",
"admin.products",
"admin.taxons",
"infinite-scroll"
]).config ($httpProvider) ->
"infinite-scroll",
"admin.orders"
]).config ($httpProvider, $locationProvider, $qProvider) ->
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
$locationProvider.hashPrefix('')
$qProvider.errorOnUnhandledRejections(false)

View File

@@ -6,8 +6,7 @@
//
// jquery and angular
//= require jquery
//= require jquery-migrate-min
//= require jquery2
//= require jquery_ujs
//= require jquery.ui.all
//= require jquery.powertip
@@ -110,5 +109,8 @@
// foundation
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
// LocalStorage
//= require ../shared/angular-local-storage.js
// requires the rest of the JS code in this folder
//= require_tree .

View File

@@ -148,7 +148,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$http(
method: "DELETE"
url: "/api/v0/products/" + product.id
).success (data) ->
).then (response) ->
$scope.products.splice $scope.products.indexOf(product), 1
DirtyProducts.deleteProduct product.id
$scope.displayDirtyProducts()
@@ -163,7 +163,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$http(
method: "DELETE"
url: "/api/v0/products/" + product.permalink_live + "/variants/" + variant.id
).success (data) ->
).then (response) ->
$scope.removeVariant(product, variant)
else
alert(t("delete_product_variant"))
@@ -221,16 +221,16 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
import_date: $scope.q.importDateFilter
page: $scope.page
per_page: $scope.per_page
).success((data) ->
).then((response) ->
DirtyProducts.clear()
BulkProducts.updateVariantLists(data.products || [])
BulkProducts.updateVariantLists(response.data.products || [])
$timeout -> $scope.displaySuccess()
).error (data, status) ->
if status == 400 && data.errors?
errorsString = ErrorsParser.toString(data.errors, status)
).catch (response) ->
if response.status == 400 && response.data.errors?
errorsString = ErrorsParser.toString(response.data.errors, response.status)
$scope.displayFailure t("products_update_error") + "\n" + errorsString
else
$scope.displayFailure t("products_update_error_data") + status
$scope.displayFailure t("products_update_error_data") + response.status
$scope.cancel = (destination) ->
$window.location = destination

View File

@@ -1,4 +1,4 @@
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
angular.module("admin.customers").directive 'editAddressDialog', ($rootScope, $compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -18,6 +18,7 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
scope.customer = data
scope.errors = []
template.dialog('close')
$rootScope.$evalAsync()
StatusMessage.display('success', t('admin.customers.index.update_address_success'))
else
scope.errors.push(t('admin.customers.index.update_address_error'))
@@ -33,4 +34,4 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
template = $compile($templateCache.get('admin/edit_address_dialog.html'))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
scope.$apply()
$rootScope.$evalAsync()

View File

@@ -1,4 +1,4 @@
angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
angular.module("admin.customers").directive 'newCustomerDialog', ($rootScope, $compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -20,6 +20,7 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
scope.email = ""
scope.submitted = false
template.dialog('close')
$rootScope.$evalAsync()
, (response) ->
if response.data.errors
scope.errors.push(error) for error in response.data.errors
@@ -37,5 +38,6 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
element.bind 'click', (e) ->
if CurrentShop.shop.id
template.dialog('open')
$rootScope.$evalAsync()
else
alert(t('js.customers.select_shop'))

View File

@@ -0,0 +1,8 @@
angular.module("ofn.admin").directive "select2WatchNgModel", () ->
restrict: 'E'
scope: true
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$render = () ->
newValue = ngModel.$viewValue;
element.children(".select2").select2("val", newValue)

View File

@@ -10,5 +10,5 @@ angular.module('admin.enterpriseFees').controller 'enterpriseFeesCtrl', ($scope,
url += '&' + match[0]
url
$http.get($scope.enterpriseFeesUrl()).success (data) ->
$scope.enterprise_fees = data
$http.get($scope.enterpriseFeesUrl()).then (response) ->
$scope.enterprise_fees = response.data

View File

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

View File

@@ -1,12 +1,14 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage, RequestMonitor) ->
$scope.Enterprise = enterprise
$scope.Enterprises = Enterprises
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear
$scope.menu = SideMenu
$scope.newManager = { id: null, email: (t('add_manager')) }
$scope.StatusMessage = StatusMessage
$scope.RequestMonitor = RequestMonitor
$scope.$watch 'enterprise_form.$dirty', (newValue) ->
StatusMessage.display 'notice', t('admin.unsaved_changes') if newValue
@@ -59,11 +61,11 @@ angular.module("admin.enterprises")
$scope.invite_errors = $scope.invite_success = null
email = $scope.newUser
$http.post("/admin/manager_invitations", {email: email, enterprise_id: $scope.Enterprise.id}).success (data)->
$scope.addManager({id: data.user, email: email})
$http.post("/admin/manager_invitations", {email: email, enterprise_id: $scope.Enterprise.id}).then (response)->
$scope.addManager({id: response.data.user, email: email})
$scope.invite_success = t('user_invited', email: email)
.error (data) ->
$scope.invite_errors = data.errors
.catch (response) ->
$scope.invite_errors = response.data.errors
$scope.resetModal = ->
$scope.newUser = $scope.invite_errors = $scope.invite_success = null
@@ -90,3 +92,6 @@ angular.module("admin.enterprises")
$scope.translation = (key) ->
t('js.admin.enterprises.form.images.' + key)
$scope.loadSuppliers = ->
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")

View File

@@ -9,6 +9,10 @@ angular.module("admin.enterprises")
$scope.checking = false
$scope.$watch "Enterprise.permalink", (newValue, oldValue) ->
if newValue == initialPermalink
$scope.availability = ""
return
$scope.checking = true
pendingRequest = PermalinkChecker.check(newValue)

View File

@@ -0,0 +1,18 @@
angular.module("admin.enterprises").directive "ofnProducerAutocomplete", (Enterprises, AutocompleteSelect2) ->
scope: true
link: (scope,element,attrs) ->
scope.loadSuppliers() if !scope.suppliers
multiple = scope.$eval attrs.multipleSelection
placeholder = attrs.placeholder
initialSelection = scope.$eval attrs.ngModel
setTimeout ->
scope.suppliers.$promise.then (data) ->
AutocompleteSelect2.autocomplete(
multiple,
placeholder,
element,
(-> Enterprises.findByID(initialSelection)),
(-> Enterprises.findByIDs(initialSelection)),
((term) -> Enterprises.findByTerm(scope.suppliers, term))
)

View File

@@ -1,4 +1,4 @@
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($compile, $templateCache, DialogDefaults, $timeout) ->
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($rootScope, $compile, $templateCache, DialogDefaults, $timeout) ->
restrict: 'A'
scope: true
@@ -10,13 +10,14 @@ angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($com
if scope.template.dialog
scope.template.dialog(DialogDefaults)
scope.template.dialog('open')
scope.$apply()
$rootScope.$evalAsync()
element.bind 'click', scope.hold_file_input_and_show_warning_modal
# When the user presses continue in the warning modal, we open the browser file input dialog
scope.continue = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
# unbind warning modal handler and click file input again to open the browser file input dialog
element.unbind('click').trigger('click')
@@ -27,4 +28,5 @@ angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($com
scope.close = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -15,26 +15,26 @@ angular.module("admin.enterprises").factory 'PermalinkChecker', ($q, $http) ->
Accept: 'application/javascript'
timeout: deferredAbort.promise
)
.success( (data) =>
if data.length > @MAX_PERMALINK_LENGTH || !data.match(/^[\w-]+$/)
.then( (response) =>
if response.data.length > @MAX_PERMALINK_LENGTH || !response.data.match(/^[\w-]+$/)
deferredRequest.resolve
permalink: permalink
available: t('js.error')
else
deferredRequest.resolve
permalink: data
permalink: response.data
available: t('available')
).error (data,status) =>
if status == 409
).catch (response) =>
if response.status == 409
deferredRequest.resolve
permalink: data
permalink: response.data
available: t('js.unavailable')
else
# Something went wrong or request was aborted
deferredRequest.reject()
deferredRequest.promise.finally ->
request = deferredRequest.promise = null;
request = deferredRequest.promise = null
deferredRequest.promise

View File

@@ -35,7 +35,7 @@ angular.module("admin.indexUtils").factory 'Columns', ($rootScope, $http, $injec
data:
action_name: action_name
column_preferences: (preference for column_name, preference of @columns)
.success (data) =>
for column in data
.then (response) =>
for column in response.data
angular.extend(@columns[column.column_name], column)
angular.extend(@savedColumns[column.column_name], column)

View File

@@ -1,9 +1,9 @@
angular.module("admin.indexUtils").factory "dataFetcher", ($http, $q, RequestMonitor) ->
return (dataLocation) ->
deferred = $q.defer()
RequestMonitor.load $http.get(dataLocation).success((data) ->
deferred.resolve data
).error ->
RequestMonitor.load $http.get(dataLocation).then((response) ->
deferred.resolve response.data
).catch ->
deferred.reject()
deferred.promise

View File

@@ -31,6 +31,8 @@ angular.module("admin.indexUtils").factory "pendingChanges", ($q, resources, Sta
form.$setPristine() if form?
else
StatusMessage.display('failure', t('js.oh_no'))
.catch ->
StatusMessage.display('failure', t('js.oh_no'))
all
submit: (change) ->

View File

@@ -52,6 +52,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.loadOrders = ->
RequestMonitor.load $scope.orders = Orders.index(
"q[state_not_eq]": "canceled",
"q[shipment_state_not_eq]": "shipped",
"q[completed_at_not_null]": "true",
"q[distributor_id_eq]": $scope.distributorFilter,
"q[order_cycle_id_eq]": $scope.orderCycleFilter,
@@ -62,6 +63,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.loadLineItems = ->
RequestMonitor.load LineItems.index(
"q[order_state_not_eq]": "canceled",
"q[order_shipment_state_not_eq]": "shipped",
"q[order_completed_at_not_null]": "true",
"q[order_distributor_id_eq]": $scope.distributorFilter,
"q[variant_product_supplier_id_eq]": $scope.supplierFilter,
@@ -127,12 +129,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.selectedUnitsVariant = unitsVariant
$scope.sumUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.final_weight_volume
, 0
$scope.sumMaxUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
sum + lineItem.max_quantity * lineItem.units_variant.unit_value
, 0

View File

@@ -1,4 +1,4 @@
angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($scope, $controller, $location, Enterprise, OrderCycle, ExchangeProduct, ocInstance) ->
angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($scope, $rootScope, $controller, $location, Enterprise, OrderCycle, ExchangeProduct, ocInstance) ->
$controller('AdminOrderCycleExchangesCtrl', {$scope: $scope, ocInstance: ocInstance, $location: $location})
$scope.view = 'incoming'
@@ -28,4 +28,4 @@ angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($
$scope.selectAllVariants = (exchange, selected) ->
$scope.loadAllExchangeProducts(exchange).then ->
$scope.setExchangeVariants(exchange, $scope.suppliedVariants(exchange.enterprise_id), selected)
$scope.$apply()
$rootScope.$evalAsync()

View File

@@ -18,7 +18,7 @@ angular.module('admin.orderCycles')
OrderCycle.exchangeDirection(exchange)
$scope.enterprisesWithFees = ->
$scope.enterprises[id] for id in OrderCycle.participatingEnterpriseIds() when $scope.enterpriseFeesForEnterprise(id).length > 0
$scope.enterprises[id] for id in [OrderCycle.participatingEnterpriseIds()..., [OrderCycle.order_cycle.coordinator_id]...] when $scope.enterpriseFeesForEnterprise(id).length > 0
$scope.removeExchange = ($event, exchange) ->
$event.preventDefault()

View File

@@ -1,4 +1,4 @@
angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compile, $injector, $templateCache, DialogDefaults, OrderCycles, Schedules) ->
angular.module("admin.orderCycles").directive 'scheduleDialog', ($rootScope, $window, $compile, $injector, $templateCache, DialogDefaults, OrderCycles, Schedules) ->
restrict: 'A'
scope:
scheduleId: '@'
@@ -22,9 +22,11 @@ angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compi
scope.template.dialog(angular.extend(settings,{width: $window.innerWidth * 0.6}))
scope.template.dialog(close: -> scope.template.remove())
scope.template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
scope.template.dialog('close')
$rootScope.$evalAsync()
return
scope.delete = ->
@@ -55,6 +57,7 @@ angular.module("admin.orderCycles").directive 'scheduleDialog', ($window, $compi
if data.id
scope.submitted = false
scope.template.dialog('close')
$rootScope.$evalAsync()
, (response) ->
if response.data.errors
scope.errors.push(error) for error in response.data.errors

View File

@@ -1,3 +1,7 @@
angular.module("admin.orderCycles").filter "visibleVariants", ->
return (variants, exchange, rules) ->
return (variant for variant in variants when variant.id in rules[exchange.enterprise_id])
enterprise_rules = rules[exchange.enterprise_id]
if enterprise_rules
(variant for variant in variants when variant.id in enterprise_rules)
else
[]

View File

@@ -3,12 +3,18 @@ angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.e
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
flatpickr(element, Object.assign({},
fp = flatpickr(element, Object.assign({},
window.FLATPICKR_DATETIME_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
instance.input.dispatchEvent(new Event('focus', { bubbles: true }));
}));
fp.minuteElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setMinutes(e.target.value), true)
fp.hourElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setHours(e.target.value), true)
.directive 'ofnOnChange', ->
(scope, element, attrs) ->

View File

@@ -8,19 +8,19 @@ angular.module("admin.orders").controller "bulkInvoiceCtrl", ($scope, $http, $ti
$scope.poll_wait = 5 # 5 Seconds between each check
$scope.poll_retries = 80 # Maximum checks before stopping
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).success (data) ->
$scope.invoice_id = data
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).then (response) ->
$scope.invoice_id = response.data
$scope.pollBulkInvoice()
$scope.pollBulkInvoice = ->
$timeout($scope.nextPoll, $scope.poll_wait * 1000)
$scope.nextPoll = ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').success (data) ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').then (response) ->
$scope.loading = false
$scope.message = t('js.admin.orders.index.bulk_invoice_created')
.error (data) ->
.catch (response) ->
$scope.poll++
if $scope.poll > $scope.poll_retries

View File

@@ -1,4 +1,4 @@
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter) ->
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter, $location, KeyValueMapStore) ->
$scope.RequestMonitor = RequestMonitor
$scope.pagination = Orders.pagination
$scope.orders = Orders.all
@@ -15,39 +15,54 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
$scope.poll = 0
$scope.rowStatus = {}
KeyValueMapStore.localStorageKey = 'ordersFilters'
KeyValueMapStore.storableKeys = ["q", "sorting", "page", "per_page"]
$scope.initialise = ->
unless KeyValueMapStore.restoreValues($scope)
$scope.setDefaults()
$scope.fetchResults()
$scope.setDefaults = ->
$scope.per_page = 15
$scope.q = {
completed_at_not_null: true
}
$scope.clearFilters = () ->
KeyValueMapStore.clearKeyValueMap()
$scope.setDefaults()
$scope.fetchResults()
$scope.fetchResults = (page=1) ->
startDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_gteq'], ' 00:00:00')
endDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_lteq'], ' 23:59:59')
startDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_gteq, ' 00:00:00')
endDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_lteq, ' 23:59:59')
$scope.resetSelected()
params = {
'q[completed_at_gteq]': startDateWithTime,
'q[completed_at_lteq]': endDateWithTime,
'q[state_eq]': $scope['q']['state_eq'],
'q[number_cont]': $scope['q']['number_cont'],
'q[email_cont]': $scope['q']['email_cont'],
'q[bill_address_firstname_start]': $scope['q']['bill_address_firstname_start'],
'q[bill_address_lastname_start]': $scope['q']['bill_address_lastname_start'],
'q[state_eq]': $scope.q?.state_eq,
'q[number_cont]': $scope.q?.number_cont,
'q[email_cont]': $scope.q?.email_cont,
'q[bill_address_firstname_start]': $scope.q?.bill_address_firstname_start,
'q[bill_address_lastname_start]': $scope.q?.bill_address_lastname_start,
# Set default checkbox values to null. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498
'q[completed_at_not_null]': $scope['q']['completed_at_not_null'] || null,
'q[distributor_id_in][]': $scope['q']['distributor_id_in'],
'q[order_cycle_id_in][]': $scope['q']['order_cycle_id_in'],
'q[completed_at_not_null]': $scope.q?.completed_at_not_null || null,
'q[distributor_id_in][]': $scope.q?.distributor_id_in,
'q[order_cycle_id_in][]': $scope.q?.order_cycle_id_in,
'q[s]': $scope.sorting || 'completed_at desc',
shipping_method_id: $scope.shipping_method_id,
shipping_method_id: $scope.q?.shipping_method_id,
per_page: $scope.per_page,
page: page
}
KeyValueMapStore.setStoredValues($scope)
RequestMonitor.load(Orders.index(params).$promise)
$scope.appendStringIfNotEmpty = (baseString, stringToAppend) ->
return baseString unless baseString
return baseString if baseString.endsWith(stringToAppend)
baseString + stringToAppend

View File

@@ -1 +1 @@
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation'])
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation', "OFNShared"])

View File

@@ -2,6 +2,6 @@ angular.module("admin.paymentMethods").controller "ProvidersCtrl", ($scope, paym
if paymentMethod.type
$scope.include_html = "/admin/payment_methods/show_provider_preferences?" +
"provider_type=#{paymentMethod.type};" +
"pm_id=#{paymentMethod.id};"
"pm_id=#{paymentMethod.id || ''};"
else
$scope.include_html = ""

View File

@@ -5,9 +5,9 @@ angular.module("admin.paymentMethods").controller "StripeController", ($scope, $
$scope.$watch "paymentMethod.preferred_enterprise_id", (newID, oldID) ->
return unless newID?
$scope.stripe_account = {}
$http.get("/admin/stripe_accounts/status.json?enterprise_id=#{newID}").success (data) ->
angular.extend($scope.stripe_account, data)
.error (response) ->
$http.get("/admin/stripe_accounts/status.json?enterprise_id=#{newID}").then (response) ->
angular.extend($scope.stripe_account, response.data)
.catch (response) ->
$scope.stripe_account.status = "request_failed"
$scope.current_enterprise_stripe_path = ->

View File

@@ -84,14 +84,14 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'end': end
'filepath': ams_data.filepath
'settings': ams_data.importSettings
).success((data, status) ->
angular.merge($scope.entries, angular.fromJson(data['entries']))
$scope.sortUpdates(data['reset_counts'])
).then((response) ->
angular.merge($scope.entries, angular.fromJson(response.data['entries']))
$scope.sortUpdates(response.data['reset_counts'])
$scope.updateProgress()
).error((data, status) ->
$scope.exception = data
console.error(data)
).catch((response) ->
$scope.exception = response.data
console.error(response.data)
)
$scope.sortUpdates = (data) ->
@@ -110,19 +110,19 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'end': end
'filepath': ams_data.filepath
'settings': ams_data.importSettings
).success((data, status) ->
$scope.sortResults(data['results'])
).then((response) ->
$scope.sortResults(response.data['results'])
angular.forEach data['updated_ids'], (id) ->
angular.forEach response.data['updated_ids'], (id) ->
$scope.updated_ids.push(id)
angular.forEach data['errors'], (error) ->
angular.forEach response.data['errors'], (error) ->
$scope.update_errors.push(error)
$scope.updateProgress()
).error((data, status) ->
$scope.exception = data
console.error(data)
).catch((response) ->
$scope.exception = response.data
console.error(response.data)
)
$scope.sortResults = (results) ->
@@ -151,10 +151,10 @@ angular.module("admin.productImport").controller "ImportFormCtrl", ($scope, $htt
'reset_absent': true,
'updated_ids': $scope.updated_ids,
'enterprises_to_reset': enterprises_to_reset
).success((data, status) ->
$scope.updates.products_reset = data
).error((data, status) ->
console.error(data)
).then((response) ->
$scope.updates.products_reset = response.data
).catch((response) ->
console.error(response.data)
)
$scope.updateProgress = () ->

View File

@@ -1,5 +1,5 @@
angular.module("admin.products")
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices) ->
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices, PriceParser) ->
$scope.product = { master: {} }
$scope.product.master.product = $scope.product
$scope.placeholder_text = ""
@@ -26,9 +26,9 @@ angular.module("admin.products")
$scope.processUnitValueWithDescription = ->
if $scope.product.master.hasOwnProperty("unit_value_with_description")
match = $scope.product.master.unit_value_with_description.match(/^([\d\.]+(?= *|$)|)( *)(.*)$/)
match = $scope.product.master.unit_value_with_description.match(/^([\d\.,]+(?= *|$)|)( *)(.*)$/)
if match
$scope.product.master.unit_value = parseFloat(match[1])
$scope.product.master.unit_value = PriceParser.parse(match[1])
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_description = match[3]

View File

@@ -1,4 +1,4 @@
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices) ->
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices, PriceParser) ->
$scope.unitName = (scale, type) ->
VariantUnitManager.getUnitName(scale, type)
@@ -23,7 +23,7 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
$scope.updateValue = ->
unit_value_human = angular.element('#unit_value_human').val()
$scope.unit_value = unit_value_human * $scope.scale
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
variant_unit_value = angular.element('#variant_unit_value').val()
$scope.unit_value_human = variant_unit_value / $scope.scale

View File

@@ -48,7 +48,7 @@ angular.module("admin.products").factory "OptionValueNamer", (VariantUnitManager
option_value_value_unit_scaled: ->
[unit_scale, unit_name] = @scale_for_unit_value()
value = @variant.unit_value / unit_scale
value = Math.round((@variant.unit_value / unit_scale) * 100) / 100
[value, unit_name]

View File

@@ -1,6 +1,7 @@
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter) ->
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, PriceParser) ->
class UnitPrices
@displayableUnitPrice: (price, scale, unit_type, unit_value, variant_unit_name) ->
price = PriceParser.parse(price)
if price && !isNaN(price) && unit_type && unit_value
value = localizeCurrencyFilter(UnitPrices.price(price, scale, unit_type, unit_value, variant_unit_name))
unit = UnitPrices.unit(scale, unit_type, variant_unit_name)
@@ -29,4 +30,4 @@ angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, loca
else if unit_type == "weight"
"kg"
else if unit_type == "volume"
"L"
"L"

View File

@@ -1,4 +1,4 @@
angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource) ->
angular.module("admin.resources").factory 'Enterprises', ($q, $filter, EnterpriseResource) ->
new class Enterprises
byID: {}
pristineByID: {}
@@ -50,6 +50,17 @@ angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource
))
deferred.promise
findByID: (id) ->
@byID[id]
# For finding multiple Enterprises represented by comma delimited string
findByIDs: (ids) ->
@byID[id] for id in ids.split(",") when @byID[id]
findByTerm: (enterprises, term) ->
$filter('filter')(enterprises, term)
removeLogo: performActionOnEnterpriseResource(EnterpriseResource.removeLogo)
removePromoImage: performActionOnEnterpriseResource(EnterpriseResource.removePromoImage)
removeTermsAndConditions: performActionOnEnterpriseResource(EnterpriseResource.removeTermsAndConditions)

View File

@@ -10,8 +10,8 @@ angular.module("ofn.admin").factory "BulkProducts", (ProductResource, dataFetche
angular.extend(@pagination, data.pagination)
cloneProduct: (product) ->
$http.post("/api/v0/products/" + product.id + "/clone").success (data) =>
dataFetcher("/api/v0/products/" + data.id + "?template=bulk_show").then (newProduct) =>
$http.post("/api/v0/products/" + product.id + "/clone").then (response) =>
dataFetcher("/api/v0/products/" + response.data.id + "?template=bulk_show").then (newProduct) =>
@unpackProduct newProduct
@insertProductAfter(product, newProduct)

View File

@@ -1,24 +0,0 @@
angular.module("ofn.admin").factory "ofnConfirmHandler", (pendingChanges, $compile, $q) ->
return (scope, callback) ->
template = "<div id='dialog-div' style='padding: 10px'><h6>" + t('js.services.unsaved_changes_message') + "</h6></div>"
dialogDiv = $compile(template)(scope)
return ->
if pendingChanges.changeCount(pendingChanges.pendingChanges) > 0
dialogDiv.dialog
dialogClass: "no-close"
resizable: false
height: 140
modal: true
buttons:
"SAVE": ->
dialogDiv = $(this)
$q.all(pendingChanges.submitAll()).then ->
callback()
dialogDiv.dialog "close"
"IGNORE": ->
callback()
$(this).dialog "close"
scope.$apply()
dialogDiv.dialog "open"
else
callback()

View File

@@ -13,15 +13,15 @@ angular.module("ofn.admin").factory 'EnterpriseRelationships', ($http, enterpris
create: (parent_id, child_id, permissions) ->
permissions = (name for name, enabled of permissions when enabled)
$http.post('/admin/enterprise_relationships', {enterprise_relationship: {parent_id: parent_id, child_id: child_id, permissions_list: permissions}}).success (data, status) =>
@enterprise_relationships.unshift(data)
$http.post('/admin/enterprise_relationships', {enterprise_relationship: {parent_id: parent_id, child_id: child_id, permissions_list: permissions}}).then (response) =>
@enterprise_relationships.unshift(response.data)
@create_errors = ""
.error (response, status) =>
@create_errors = response.errors
.catch (response) =>
@create_errors = response.data.errors
delete: (er) ->
$http.delete('/admin/enterprise_relationships/' + er.id).success (data) =>
$http.delete('/admin/enterprise_relationships/' + er.id).then (response) =>
@enterprise_relationships.splice @enterprise_relationships.indexOf(er), 1
permission_presentation: (permission) ->

View File

@@ -6,13 +6,13 @@ angular.module("ofn.admin").factory 'EnterpriseRoles', ($http, enterpriseRoles)
@enterprise_roles = enterpriseRoles
create: (user_id, enterprise_id) ->
$http.post('/admin/enterprise_roles', {enterprise_role: {user_id: user_id, enterprise_id: enterprise_id}}).success (data, status) =>
@enterprise_roles.unshift(data)
$http.post('/admin/enterprise_roles', {enterprise_role: {user_id: user_id, enterprise_id: enterprise_id}}).then (response) =>
@enterprise_roles.unshift(response.data)
@create_errors = ""
.error (response, status) =>
@create_errors = response.errors
.catch (response) =>
@create_errors = response.data.errors
delete: (er) ->
$http.delete('/admin/enterprise_roles/' + er.id).success (data) =>
$http.delete('/admin/enterprise_roles/' + er.id).then (response) =>
@enterprise_roles.splice @enterprise_roles.indexOf(er), 1

View File

@@ -0,0 +1,29 @@
angular.module("admin.indexUtils").factory 'KeyValueMapStore', (localStorageService)->
new class KeyValueMapStore
localStorageKey: ''
storableKeys: []
constructor: ->
localStorageService.setStorageType("sessionStorage")
getStoredKeyValueMap: ->
localStorageService.get(@localStorageKey) || {}
setStoredValues: (source) ->
keyValueMap = {}
for key in @storableKeys
keyValueMap[key] = source[key]
localStorageService.set(@localStorageKey, keyValueMap)
restoreValues: (target) ->
storedKeyValueMap = @getStoredKeyValueMap()
return false if _.isEmpty(storedKeyValueMap)
for k,v of storedKeyValueMap
target[k] = v
return true
clearKeyValueMap: () ->
localStorageService.remove(@localStorageKey)

View File

@@ -1,16 +1,17 @@
$(function() {
var calculator_select = $('select#calc_type')
var original_calc_type = calculator_select.attr('value');
var calculator_select = $('select#calc_type');
var original_calc_type = calculator_select.val();
$('.calculator-settings-warning').hide();
calculator_select.change(function() {
if (calculator_select.attr('value') == original_calc_type) {
calculator_select.on("change", function() {
if (calculator_select.val() === original_calc_type) {
$('div.calculator-settings').show();
$('.calculator-settings-warning').hide();
$('.calculator-settings').find('input,textarea').prop("disabled", false);
} else {
$('div.calculator-settings').hide();
$('.calculator-settings-warning').show();
$('.calculator-settings').find('input,texttarea').prop("disabled", true);
$('.calculator-settings').find('input,textarea').prop("disabled", true);
}
});
})

View File

@@ -2,6 +2,9 @@
$(document).ready(function() {
initAlert()
initConfirm()
if ($('#variant_autocomplete_template').length > 0) {
window.variantTemplate = Handlebars.compile($('#variant_autocomplete_template').text());
window.variantStockTemplate = Handlebars.compile($('#variant_autocomplete_stock_template').text());
@@ -45,7 +48,7 @@ $(document).ready(function() {
if (quantity > maxQuantity) {
quantity = maxQuantity;
save.parents('tr').find('input.line_item_quantity').val(maxQuantity);
alert(t("js.admin.orders.quantity_adjusted"));
ofnAlert(t("js.admin.orders.quantity_adjusted"));
}
toggleItemEdit();
@@ -54,8 +57,9 @@ $(document).ready(function() {
}
$('a.save-item').click(handle_save_click);
handle_delete_click = function(){
var del = $(this);
handle_delete_click = function(elementSelector){
var del = $(elementSelector);
del.hide()
var shipment_number = del.data('shipment-number');
var variant_id = del.data('variant-id');
@@ -63,37 +67,48 @@ $(document).ready(function() {
adjustItems(shipment_number, variant_id, 0);
}
$('a.delete-item').click(handle_delete_click);
$('a.delete-item').click((event) => {
ofnConfirm(() => {
handle_delete_click('#custom-confirm');
});
});
}
});
adjustItems = function(shipment_number, variant_id, quantity){
var shipment = _.findWhere(shipments, {number: shipment_number + ''});
var inventory_units = _.where(shipment.inventory_units, {variant_id: variant_id});
var shipment = _.findWhere(shipments, {number: shipment_number + ''});
var inventory_units = _.where(shipment.inventory_units, {variant_id: variant_id});
var url = Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number;
if (quantity == 0 && inventory_units.length == shipment.inventory_units.length) {
ofnAlert(t("js.admin.orders.cannot_remove_last_item"));
return;
}
var new_quantity = 0;
if(inventory_units.length<quantity){
url += "/add"
new_quantity = (quantity - inventory_units.length);
}else if(inventory_units.length>quantity){
url += "/remove"
new_quantity = (inventory_units.length - quantity);
}
url += '.json';
var url = Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number;
if (new_quantity == 0) {
alert(t("js.admin.orders.quantity_unchanged"));
} else {
$.ajax({
type: "PUT",
url: Spree.url(url),
data: { variant_id: variant_id, quantity: new_quantity }
}).done(function( msg ) {
window.location.reload();
});
}
var new_quantity = 0;
if (inventory_units.length < quantity) {
url += "/add";
new_quantity = (quantity - inventory_units.length);
} else if (inventory_units.length > quantity) {
url += "/remove"
new_quantity = (inventory_units.length - quantity);
}
url += '.json';
if (new_quantity == 0) {
ofnAlert(t("js.admin.orders.quantity_unchanged"));
} else {
$.ajax({
type: "PUT",
url: Spree.url(url),
data: { variant_id: variant_id, quantity: new_quantity }
}).done(function( msg ) {
window.location.reload();
});
}
}
toggleTrackingEdit = function(){
@@ -147,3 +162,27 @@ addVariantFromStockLocation = function() {
}
return 1
}
initAlert = function() {
$('#custom-alert .confirm').click(function(e) {
$('#custom-alert').hide();
})
}
initConfirm = function() {
$('#custom-confirm button.cancel').click(function(e) {
$('#custom-confirm').hide();
});
}
ofnAlert = function(message) {
$('#custom-alert .message').text(message);
$('#custom-alert').show();
}
ofnConfirm = function(callback) {
$('#custom-confirm').data($(event.target).data());
$('#custom-confirm button.confirm').click(callback);
$('#custom-confirm').show();
}

View File

@@ -1,4 +1,4 @@
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($compile, $window, $templateCache, DialogDefaults, shops) ->
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($rootScope, $compile, $window, $templateCache, DialogDefaults, shops) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -26,3 +26,4 @@ angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($compi
scope.newSubscription()
else
template.dialog('open')
$rootScope.$evalAsync()

View File

@@ -52,7 +52,7 @@ angular.module("admin.tagRules").controller "TagRulesCtrl", ($scope, $http, $fil
$http
method: "DELETE"
url: "/admin/enterprises/#{enterprise.id}/tag_rules/#{tagRule.id}.json"
.success ->
.then ->
tagGroup.rules.splice(index, 1)
$scope.updateRuleCounts()
$scope.enterprise_form.$setDirty()

View File

@@ -1,4 +1,4 @@
angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templateCache, DialogDefaults) ->
angular.module("admin.tagRules").directive 'newTagRuleDialog', ($rootScope, $compile, $templateCache, DialogDefaults) ->
restrict: 'A'
scope:
tagGroup: '='
@@ -22,8 +22,10 @@ angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templ
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
template.dialog('open')
$rootScope.$evalAsync()
scope.addRule = (tagGroup, ruleType) ->
scope.addNewRuleTo(tagGroup, ruleType)
template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -1,30 +1,17 @@
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, $sanitize) ->
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, AutocompleteSelect2) ->
# Adapted from Spree's existing taxon autocompletion
scope: true
link: (scope,element,attrs) ->
multiple = scope.$eval attrs.multipleSelection
placeholder = attrs.placeholder
initalSelection = scope.$eval attrs.ngModel
initialSelection = scope.$eval attrs.ngModel
setTimeout ->
element.select2
placeholder: placeholder
multiple: multiple
initSelection: (element, callback) ->
if multiple
callback Taxons.findByIDs(initalSelection)
else
callback Taxons.findByID(initalSelection)
query: (query) ->
query.callback { results: Taxons.findByTerm(query.term) }
formatResult: (taxon) ->
$sanitize(taxon.name)
formatSelection: (taxon) ->
taxon.name
#Allows drag and drop
if multiple
element.select2("container").find("ul.select2-choices").sortable
containment: 'parent'
start: -> element.select2("onSortStart")
update: -> element.select2("onSortEnd")
AutocompleteSelect2.autocomplete(
multiple,
placeholder,
element,
(-> Taxons.findByID(initialSelection)),
(-> Taxons.findByIDs(initialSelection)),
((term) -> Taxons.findByTerm(term))
)

View File

@@ -9,9 +9,9 @@ angular.module("admin.users").directive "resendUserEmailConfirmation", ($http) -
element.bind "click", ->
return if sent
scope.status = "sending"
$http.post("/user/spree_user/confirmation", {spree_user: {email: scope.email}}).success (data) ->
$http.post("/user/spree_user/confirmation", {spree_user: {email: scope.email}}).then (response) ->
sent = true
element.addClass "action--disabled"
scope.status = "done"
.error (data) ->
.catch (response) ->
scope.status = "failed"

View File

@@ -12,7 +12,7 @@ $(document).ready(function() {
altInput: true,
altFormat: Spree.translations.flatpickr_date_format,
dateFormat: "Y-m-d",
locale: I18n.locale,
locale: I18n.base_locale,
plugins: [
ShortcutButtonsPlugin({
button: [{

View File

@@ -2,10 +2,13 @@ angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
flatpickr(element, Object.assign(
flapickrInstance = flatpickr(element, Object.assign(
{},
$window.FLATPICKR_DATE_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
}
));
ngModel.$render = () ->
newValue = ngModel.$viewValue;
flapickrInstance?.setDate(newValue)

View File

@@ -1,4 +1,4 @@
angular.module("admin.utils").directive 'helpModal', ($compile, $templateCache, $window, DialogDefaults) ->
angular.module("admin.utils").directive 'helpModal', ($rootScope, $compile, $templateCache, $window, DialogDefaults) ->
restrict: 'C'
scope:
template: '@'
@@ -10,8 +10,11 @@ angular.module("admin.utils").directive 'helpModal', ($compile, $templateCache,
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) -> template.dialog('open')
element.bind 'click', (e) ->
template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
template.dialog('close')
$rootScope.$evalAsync()
return

View File

@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "ofnWithTip", ($sanitize)->
element.attr('data-powertip', $sanitize(attrs.ofnWithTip))
element.powerTip
smartPlacement: true
placement: element.attr('powertip-location')
fadeInTime: 50
fadeOutTime: 50
intentPollInterval: 300

View File

@@ -0,0 +1,31 @@
angular.module("admin.utils").factory 'AutocompleteSelect2', ($sanitize) ->
scope: true
autocomplete: (
multiple,
placeholder,
element,
findByID,
findByIDs,
findByTerm
) ->
element.select2
placeholder: placeholder
multiple: multiple
initSelection: (element, callback) ->
if multiple
callback findByIDs()
else
callback findByID()
query: (query) ->
query.callback { results: findByTerm(query.term) }
formatResult: (item) ->
$sanitize(item.name)
formatSelection: (item) ->
item.name
#Allows drag and drop
if multiple
element.select2("container").find("ul.select2-choices").sortable
containment: 'parent'
start: -> element.select2("onSortStart")
update: -> element.select2("onSortEnd")

View File

@@ -10,12 +10,15 @@ angular.module("admin.utils").factory 'ConfirmDialog', ($rootScope, $q, $compile
template = $compile($templateCache.get('admin/confirm_dialog.html'))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
$rootScope.$evalAsync()
scope.confirm = ->
deferred.resolve()
template.dialog('close')
$rootScope.$evalAsync()
null
scope.close = ->
deferred.reject()
template.dialog('close')
$rootScope.$evalAsync()
null
deferred.promise

View File

@@ -15,8 +15,10 @@ angular.module("admin.utils").factory 'InfoDialog', ($rootScope, $q, $compile, $
template = $compile($templateCache.get(templateUrl))(scope)
template.dialog(DialogDefaults)
template.dialog('open')
$rootScope.$evalAsync()
scope.close = ->
deferred.resolve()
template.dialog('close')
$rootScope.$evalAsync()
null
deferred.promise

View File

@@ -0,0 +1,31 @@
angular.module("admin.utils").factory "PriceParser", ->
new class PriceParser
parse: (price) =>
return null unless price
# used decimal and thousands separators from currency configuration
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
# Replace comma used as a decimal separator and remplace by "."
price = this.replaceCommaByFinalPoint(price)
# Remove configured thousands separator if it is actually a thousands separator
price = this.removeThousandsSeparator(price, thousands_separator)
if (decimal_separator == ",")
price = price.replace(",", ".")
price = parseFloat(price)
return null if isNaN(price)
return price
replaceCommaByFinalPoint : (price) =>
if price.match(/^[0-9]*(,{1})[0-9]{1,2}$/g) then price.replace(",", ".") else price
removeThousandsSeparator : (price, thousands_separator) =>
if (new RegExp("^([0-9]*(" + thousands_separator + "{1})[0-9]{3}[0-9\.,]*)*$", "g").test(price))
price.replaceAll(thousands_separator, '')
else
price

View File

@@ -62,14 +62,14 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
else
StatusMessage.display 'progress', t('js.saving')
DirtyVariantOverrides.save()
.success (updatedVos) ->
.then (updatedVos) ->
DirtyVariantOverrides.clear()
VariantOverrides.updateIds updatedVos
VariantOverrides.updateIds updatedVos.data
$scope.variant_overrides_form.$setPristine()
StatusMessage.display 'success', t('js.changes_saved')
VariantOverrides.updateData updatedVos # Refresh page data
.error (data, status) ->
StatusMessage.display 'failure', $scope.updateError(data, status)
VariantOverrides.updateData updatedVos.data # Refresh page data
.catch (response) ->
StatusMessage.display 'failure', $scope.updateError(response.data, response.status)
$scope.updateError = (data, status) ->
@@ -98,11 +98,11 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
method: "POST"
url: "/admin/variant_overrides/bulk_reset"
data: { hub_id: $scope.hub_id }
.success (updatedVos) ->
VariantOverrides.updateData updatedVos
.then (updatedVos) ->
VariantOverrides.updateData updatedVos.data
StatusMessage.display 'success', t('js.variant_overrides.stock_reset')
.error (data, status) ->
$timeout -> StatusMessage.display 'failure', $scope.updateError(data, status)
.catch (response) ->
$timeout -> StatusMessage.display 'failure', $scope.updateError(response.data, response.status)
# Variant override count_on_hand field placeholder logic:
# on_demand true -- Show "On Demand"

View File

@@ -1,4 +1,4 @@
#= require jquery
#= require jquery2
#= require jquery_ujs
#= require jquery.ui.all
#
@@ -28,7 +28,6 @@
#= require angular-rails-templates
#= require_tree ../templates
#
#= require angular-backstretch.js
#= require angular-flash.min.js
#
#= require moment/min/moment.min.js
@@ -51,14 +50,27 @@
#
#= require modernizr
#
#= require foundation
#= require ./darkswarm
#= require ./overrides
#= require_tree ./mixins
#= require_tree ./directives
#= require_tree .
$ ->
# Hacky fix for issue - http://foundation.zurb.com/forum/posts/2112-foundation-5100-syntax-error-in-js
Foundation.set_namespace ""
$(document).foundation()
document.addEventListener "turbo:load", ->
window.injector = angular.bootstrap document.body, ["Darkswarm"]
true
document.addEventListener "turbo:before-render", ->
if window.injector
rootscope = window.injector.get("$rootScope")
rootscope?.$destroy()
rootscope = null
window.injector = null
true
document.addEventListener "ajax:beforeSend", (event) =>
window.Turbo.navigator.adapter.progressBar.setValue(0)
window.Turbo.navigator.adapter.progressBar.show()
document.addEventListener "ajax:complete", (event) =>
window.Turbo.navigator.adapter.progressBar.setValue(100)
window.Turbo.navigator.adapter.progressBar.hide()

View File

@@ -7,13 +7,3 @@ $ ->
($ 'form#update-cart').submit ->
($ 'form#update-cart #update-button').attr('disabled', true)
# Temporarily handles the cart showing stuff
$(document).ready ->
$('.cart_adjustment').hide()
$('td.cart-adjustments a').click ->
$('.cart_adjustment').toggle()
$(this).html(t('item_handling_fees'))
false

View File

@@ -1,19 +1,19 @@
Darkswarm.controller "ForgotCtrl", ($scope, $http, $location, AuthenticationService) ->
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}).success (data)->
$http.post("/user/spree_user/password", {spree_user: $scope.spree_user}).then (response)->
$scope.sent = true
.error (data, status) ->
$scope.errors = data.error
$scope.user_unconfirmed = (status == 401)
.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()}).success (data)->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).then (response)->
$scope.messages = t('devise.confirmations.send_instructions')
.error (data) ->
.catch (response) ->
$scope.errors = t('devise.confirmations.failed_to_send')

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
angular.module('Darkswarm').controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
$scope.path = "/login"
$scope.modalMessage = null
@@ -10,20 +10,20 @@ Darkswarm.controller "LoginCtrl", ($scope, $timeout, $location, $http, $window,
$scope.submit = ->
Loading.message = t 'logging_in'
$http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).success (data)->
$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
.error (data) ->
.catch (response) ->
Loading.clear()
$scope.errors = data.message || data.error
$scope.user_unconfirmed = (data.error == t('devise.failure.unconfirmed'))
$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()}).success (data)->
$http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).then (response)->
$scope.messages = t('devise.confirmations.send_instructions')
.error (data) ->
.catch (response) ->
$scope.errors = t('devise.confirmations.failed_to_send')
$timeout ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
angular.module('Darkswarm').controller "SignupCtrl", ($scope, $http, $window, $location, Redirections, AuthenticationService) ->
$scope.path = "/signup"
$scope.spree_user.password_confirmation = ''
@@ -8,8 +8,8 @@ Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirecti
password: null
$scope.submit = ->
$http.post("/user/spree_user", {spree_user: $scope.spree_user, return_url: $location.absUrl()}).success (data)->
$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')
.error (data) ->
$scope.errors = data
.catch (response) ->
$scope.errors = response.data

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
angular.module('Darkswarm').controller "AuthenticationCtrl", ($scope, AuthenticationService, SpreeUser)->
$scope.open = AuthenticationService.open
$scope.toggle = AuthenticationService.toggle

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CartCtrl", ($scope, Cart, CurrentHub) ->
angular.module('Darkswarm').controller "CartCtrl", ($scope, Cart, CurrentHub) ->
$scope.Cart = Cart
$scope.CurrentHub = CurrentHub
$scope.max_characters = 20

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
angular.module('Darkswarm').controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
$scope.Cart = Cart
$scope.showCartSidebar = false

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CartFormCtrl", ($scope) ->
angular.module('Darkswarm').controller "CartFormCtrl", ($scope) ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
angular.module('Darkswarm').controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
$scope.accordionSections = ["details", "billing", "shipping", "payment"]
$scope.accordion = { details: true, billing: true, shipping: true, payment: true }

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "BillingCtrl", ($scope, $timeout) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "BillingCtrl", ($scope, $timeout, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.name = "billing"
$scope.nextPanel = "shipping"

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
angular.module('Darkswarm').controller "CheckoutCtrl", ($scope, localStorageService, Checkout, CurrentUser, CurrentHub, AuthenticationService, SpreeUser, $http) ->
$scope.Checkout = Checkout
$scope.submitted = false
@@ -35,8 +35,8 @@ Darkswarm.controller "CheckoutCtrl", ($scope, localStorageService, Checkout, Cur
$scope.$broadcast 'purchaseFormInvalid', $scope.formdata
$scope.ensureUserIsGuest = (callback = null) ->
$http.post("/user/registered_email", {email: $scope.order.email}).success (data)->
if data.registered == true
$http.post("/user/registered_email", {email: $scope.order.email}).then (response)->
if response.data.registered == true
$scope.promptLogin()
else
$scope.validateForm() if $scope.submitted

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "CountryCtrl", ($scope, availableCountries) ->
angular.module('Darkswarm').controller "CountryCtrl", ($scope, availableCountries) ->
$scope.countries = availableCountries

View File

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

View File

@@ -1,5 +1,5 @@
Darkswarm.controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "PaymentCtrl", ($scope, $timeout, savedCreditCards, Dates, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.savedCreditCards = savedCreditCards
$scope.name = "payment"

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "ShippingCtrl", ($scope, $timeout, ShippingMethods) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "ShippingCtrl", ($scope, $timeout, ShippingMethods, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.ShippingMethods = ShippingMethods
$scope.name = "shipping"
$scope.nextPanel = "payment"

View File

@@ -1,5 +1,6 @@
Darkswarm.controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards) ->
angular.extend(this, new FieldsetMixin($scope))
angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, CreditCard, CreditCards, $controller) ->
angular.extend this, $controller('FieldsetMixin', {$scope: $scope})
$scope.savedCreditCards = CreditCards.saved
$scope.confirmSetDefault = CreditCards.confirmSetDefault
$scope.CreditCard = CreditCard

View File

@@ -1,2 +1,2 @@
Darkswarm.controller "CurrentHubCtrl", ($scope, CurrentHub) ->
angular.module('Darkswarm').controller "CurrentHubCtrl", ($scope, CurrentHub) ->
$scope.CurrentHub = CurrentHub

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
angular.module('Darkswarm').controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
$scope.showBought = false
$scope.removeEnabled = true

View File

@@ -1,4 +1,4 @@
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, enterpriseMatchesNameQueryFilter, distanceWithinKmFilter) ->
$scope.Enterprises = Enterprises
$scope.producers_to_filter = Enterprises.producers
$scope.filterSelectors = FilterSelectorsService.createSelectors()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
angular.module('Darkswarm').controller "GroupEnterprisesCtrl", ($scope, Search, FilterSelectorsService, EnterpriseModal) ->
$scope.filterSelectors = FilterSelectorsService.createSelectors()
$scope.query = Search.search()
$scope.openModal = EnterpriseModal.open

View File

@@ -1,3 +1,3 @@
Darkswarm.controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
angular.module('Darkswarm').controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
$scope.Enterprises = Enterprises
$scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
angular.module('Darkswarm').controller "GroupTabsCtrl", ($scope, $controller, Navigation) ->
angular.extend this, $controller('TabsCtrl', {$scope: $scope})
$scope.tabs =

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "GroupsCtrl", ($scope, Groups, Search) ->
angular.module('Darkswarm').controller "GroupsCtrl", ($scope, Groups, Search) ->
$scope.Groups = Groups
$scope.order = 'position'
$scope.query = Search.search()

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HomeCtrl", ($scope) ->
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
$scope.brandStoryExpanded = false
$scope.toggleBrandStory = ->

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
angular.module('Darkswarm').controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http, $timeout) ->
$scope.shopfront_loading = false
$scope.enterprise_details = []
@@ -9,6 +9,8 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
# Toggles shopfront tabs open/closed. Fetches enterprise details from the api, diplays them and adds them
# to $scope.enterprise_details, or simply displays the details again if previously fetched
$scope.toggle = (event) ->
return if event.target.closest("a")
if $scope.open()
$scope.toggle_tab(event)
return
@@ -25,12 +27,12 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
$scope.toggle_tab(event)
$http.get("/api/v0/shops/" + $scope.hub.id)
.success (data) ->
.then (response) ->
$scope.shopfront_loading = false
$scope.hub = data
$scope.hub = response.data
$scope.enterprise_details[$scope.hub.id] = $scope.hub
.error (data) ->
console.error(data)
.catch (response) ->
console.error(response.data)
$scope.toggle_tab = (event) ->
HashNavigation.toggle $scope.hub.hash if event && !angular.element(event.target).inheritedData('is-link')

View File

@@ -1,3 +1,3 @@
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
angular.module('Darkswarm').controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
$scope.OfnMap = OfnMap
$scope.map = angular.copy MapConfiguration.options

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