Compare commits

...

280 Commits

Author SHA1 Message Date
dependabot[bot]
34867fb85a Bump bigdecimal from 3.3.1 to 4.0.1
Bumps [bigdecimal](https://github.com/ruby/bigdecimal) from 3.3.1 to 4.0.1.
- [Release notes](https://github.com/ruby/bigdecimal/releases)
- [Changelog](https://github.com/ruby/bigdecimal/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/bigdecimal/compare/v3.3.1...v4.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:34:54 +00:00
Gaetan Craig-Riou
b5315c2123 Merge pull request #13925 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.4.6
Bump tom-select from 2.4.5 to 2.4.6
2026-02-17 09:56:09 +11:00
Gaetan Craig-Riou
97ce4eaccd Merge pull request #13928 from openfoodfoundation/dependabot/bundler/pry-0.16.0
Bump pry from 0.15.2 to 0.16.0
2026-02-17 09:48:40 +11:00
Gaetan Craig-Riou
8814427677 Merge pull request #13927 from openfoodfoundation/dependabot/bundler/bootsnap-1.22.0
Bump bootsnap from 1.19.0 to 1.22.0
2026-02-17 09:47:13 +11:00
Gaetan Craig-Riou
4b69e192ec Merge pull request #13926 from openfoodfoundation/dependabot/bundler/rubocop-rspec-3.9.0
Bump rubocop-rspec from 3.8.0 to 3.9.0
2026-02-17 09:45:46 +11:00
dependabot[bot]
9c99f4868c Bump pry from 0.15.2 to 0.16.0
Bumps [pry](https://github.com/pry/pry) from 0.15.2 to 0.16.0.
- [Release notes](https://github.com/pry/pry/releases)
- [Changelog](https://github.com/pry/pry/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pry/pry/compare/v0.15.2...v0.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 10:22:39 +00:00
dependabot[bot]
39d59c3a5f Bump bootsnap from 1.19.0 to 1.22.0
Bumps [bootsnap](https://github.com/rails/bootsnap) from 1.19.0 to 1.22.0.
- [Release notes](https://github.com/rails/bootsnap/releases)
- [Changelog](https://github.com/rails/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/bootsnap/compare/v1.19.0...v1.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 10:21:52 +00:00
dependabot[bot]
ad9a12da0e Bump rubocop-rspec from 3.8.0 to 3.9.0
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.8.0 to 3.9.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.8.0...v3.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 10:20:43 +00:00
dependabot[bot]
9968776726 Bump tom-select from 2.4.5 to 2.4.6
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.4.5 to 2.4.6.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.4.5...v2.4.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 10:20:27 +00:00
Gaetan Craig-Riou
d99a88817d Merge pull request #13825 from openfoodfoundation/dependabot/bundler/omniauth-rails_csrf_protection-2.0.1
Bump omniauth-rails_csrf_protection from 1.0.2 to 2.0.1
2026-02-16 11:52:16 +11:00
dependabot[bot]
1b36cce816 Bump omniauth-rails_csrf_protection from 1.0.2 to 2.0.1
Bumps [omniauth-rails_csrf_protection](https://github.com/cookpad/omniauth-rails_csrf_protection) from 1.0.2 to 2.0.1.
- [Release notes](https://github.com/cookpad/omniauth-rails_csrf_protection/releases)
- [Commits](https://github.com/cookpad/omniauth-rails_csrf_protection/compare/v1.0.2...v2.0.1)

---
updated-dependencies:
- dependency-name: omniauth-rails_csrf_protection
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 00:30:33 +00:00
Gaetan Craig-Riou
4b157abd4d Merge pull request #13809 from openfoodfoundation/dependabot/bundler/active_storage_validations-3.0.3
Bump active_storage_validations from 3.0.2 to 3.0.3
2026-02-16 11:28:41 +11:00
Gaetan Craig-Riou
dc494bb0f9 Merge pull request #13801 from openfoodfoundation/dependabot/bundler/bullet-8.1.0
Bump bullet from 8.0.8 to 8.1.0
2026-02-16 11:12:39 +11:00
dependabot[bot]
b3e7b12b86 Bump active_storage_validations from 1.1.4 to 3.0.3
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.1.4 to 3.0.3.
- [Release notes](https://github.com/igorkasyanchuk/active_storage_validations/releases)
- [Changelog](https://github.com/igorkasyanchuk/active_storage_validations/blob/master/CHANGES.md)
- [Commits](https://github.com/igorkasyanchuk/active_storage_validations/commits/3.0.03)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-15 23:47:01 +00:00
dependabot[bot]
b69e6827cc Bump bullet from 8.0.8 to 8.1.0
Bumps [bullet](https://github.com/flyerhzm/bullet) from 8.0.8 to 8.1.0.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/8.0.8...8.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-15 23:46:31 +00:00
Gaetan Craig-Riou
340f459912 Merge pull request #13791 from openfoodfoundation/dependabot/bundler/responders-3.2.0
Bump responders from 3.1.1 to 3.2.0
2026-02-16 10:44:39 +11:00
dependabot[bot]
33a96d5a0f Bump responders from 3.1.1 to 3.2.0
Bumps [responders](https://github.com/heartcombo/responders) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/heartcombo/responders/releases)
- [Changelog](https://github.com/heartcombo/responders/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heartcombo/responders/compare/v3.1.1...v3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-15 22:49:10 +00:00
Gaetan Craig-Riou
93d6db9d44 Merge pull request #13924 from openfoodfoundation/dependabot/npm_and_yarn/sass-loader-16.0.7
Bump sass-loader from 16.0.6 to 16.0.7
2026-02-16 09:42:37 +11:00
dependabot[bot]
c1068af0ba Bump sass-loader from 16.0.6 to 16.0.7
Bumps [sass-loader](https://github.com/webpack/sass-loader) from 16.0.6 to 16.0.7.
- [Release notes](https://github.com/webpack/sass-loader/releases)
- [Changelog](https://github.com/webpack/sass-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/sass-loader/compare/v16.0.6...v16.0.7)

---
updated-dependencies:
- dependency-name: sass-loader
  dependency-version: 16.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 09:32:32 +00:00
Gaetan Craig-Riou
2557a4de39 Merge pull request #13921 from openfoodfoundation/dependabot/npm_and_yarn/qs-6.14.2
Bump qs from 6.14.1 to 6.14.2
2026-02-13 12:27:04 +11:00
dependabot[bot]
ab1f43f1ac Bump qs from 6.14.1 to 6.14.2
Bumps [qs](https://github.com/ljharb/qs) from 6.14.1 to 6.14.2.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.14.1...v6.14.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 01:17:44 +00:00
Maikel
f921524588 Merge pull request #13923 from rioug/upgrade-redit-github-action
Upgrade redis-github-action to 1.8.1
2026-02-13 11:45:13 +11:00
Gaetan Craig-Riou
5cbd507c1e Upgrade redis-github-action to 1.8.1
The version we were using, uses an obsolete version of Docker
2026-02-13 10:20:51 +11:00
Gaetan Craig-Riou
532bfaaa2d Merge pull request #13919 from pacodelaluna/allow-s3-compatible-provider-for-db2fog-config
Allow S3-compatible provider for db2fog configuration
2026-02-13 10:07:20 +11:00
Gaetan Craig-Riou
70b31a4212 Merge pull request #13918 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.105.0
Bump webpack from 5.104.1 to 5.105.0
2026-02-13 09:49:06 +11:00
François Turbelin
b21224d5ff Allow s3-compatible provider for db2fog configuration 2026-02-11 13:35:22 +01:00
dependabot[bot]
4744d7b741 Bump webpack from 5.104.1 to 5.105.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.104.1 to 5.105.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.104.1...v5.105.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 09:33:05 +00:00
Gaetan Craig-Riou
ac1dd74e23 Merge pull request #13914 from openfoodfoundation/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.29.0
Bump @babel/plugin-transform-runtime from 7.28.5 to 7.29.0
2026-02-11 10:13:13 +11:00
Gaetan Craig-Riou
970f486ec0 Merge pull request #13913 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.4.5
Bump tom-select from 2.4.3 to 2.4.5
2026-02-11 10:12:11 +11:00
dependabot[bot]
8c244e8b56 Bump @babel/plugin-transform-runtime from 7.28.5 to 7.29.0
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.28.5 to 7.29.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.0/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-version: 7.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 09:33:14 +00:00
dependabot[bot]
c3cc01c677 Bump tom-select from 2.4.3 to 2.4.5
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.4.3 to 2.4.5.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.4.3...v2.4.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 09:32:51 +00:00
Gaetan Craig-Riou
c63e60d782 Merge pull request #13910 from openfoodfoundation/dependabot/npm_and_yarn/babel/core-7.29.0
Bump @babel/core from 7.28.6 to 7.29.0
2026-02-10 09:24:06 +11:00
dependabot[bot]
11e8c9456d Bump @babel/core from 7.28.6 to 7.29.0
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.28.6 to 7.29.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.0/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 22:10:18 +00:00
Gaetan Craig-Riou
860a21f86f Merge pull request #13909 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.29.0
Bump @babel/preset-env from 7.28.6 to 7.29.0
2026-02-10 09:09:09 +11:00
dependabot[bot]
d24af18ff4 Bump @babel/preset-env from 7.28.6 to 7.29.0
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.28.6 to 7.29.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.0/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 10:39:41 +00:00
David Cook
33b191f439 Merge pull request #13908 from chahmedejaz/bugfix/13776-datetime-format-for-finnish
Update Finnish date and datetime formats in locale file
2026-02-09 10:41:22 +11:00
Ahmed Ejaz
a690d39864 Update Finnish date and datetime formats in locale file 2026-02-08 18:41:49 +05:00
Gaetan Craig-Riou
d33cabd6b2 Update all locales with the latest Transifex translations 2026-02-06 12:32:23 +11:00
Gaetan Craig-Riou
7b21a9d30f Merge pull request #13261 from ashishp91/13220-orders-fulfillment-report-product-name-issue
Fix Orders and fulfillment report fetches product name from product list (and not from order)
2026-02-06 12:28:40 +11:00
David Cook
c00e7eeecf Add missing spec 2026-02-06 12:17:03 +11:00
David Cook
afdb044386 Load names from line item where available.
I'm not sure why Arel complained about SQL in the SELECT clause (fields), but not the GROUP BY clause (key_fields). Maybe because it's not susceptible to user injection.

I'm also not sure why I couldn't use the aliases defined in SELECT in the GROUP BY clause, but hey this seems to work.
2026-02-06 12:17:03 +11:00
Ashish Gaur
b98552003c 13220 Add Product name in Order LineItem and update it during order creation
13220 Fixes affiliate sales spec

13220 Use before_create to update product name

13220 Fixes rubocop warnings

13220 Update product_name in line_item in specs

13220 Fix before_create lint

13220 Add spec for checking product_name is not set in reports

13220 Fixes rubocop issue

13220 Add migrations for updating the existing line items

13220 Fixing lint issues

13220 Set product_name in line_item before doing validation

13220 Fix linter issues

13220 Fixes spec

13220 Fixes linter issues

13220 Review comments

13220 Review comments

13220 Add default product name

13220 Use product_name instead of variant product name when using line item

13220 Fix specs

13220 Revert change in affiliate_sales_data_spec

CL-13220 Store variant name in line_item

13220 Default variant name to original variant's full name for line_items

13220 Add missing frozen string literal

13220 Add spec for full_variant_name

13220 Remove UpdateProductNameInLineItems and AddNotNullToProductNameInLineItems migrations

13220 Remove presence validation for product_name

13220 Use full_product_name which defaults to variant product name if empty
2026-02-06 12:17:03 +11:00
David Cook
38f1754738 Add spec
This duplicates the  'returns data' spec above, but will be revelant in the following commits.
2026-02-06 12:17:03 +11:00
Maikel
ad23735384 Merge pull request #13907 from rioug/use-wicked_pdf-fork
Use wicked pdf fork
2026-02-06 11:23:58 +11:00
Gaetan Craig-Riou
6fd78d4647 Fix typo 2026-02-06 10:46:10 +11:00
Gaetan Craig-Riou
cd3a80c502 Move to using our fork of wicked_pdf
The lastest release wicked pdf does not include a fix to make it
workwith Shakapacker V8 : bce498de54
To we are using our fork for now, which includes said fix
2026-02-06 10:44:00 +11:00
Sigmund Petersen
f8c88ea8c7 Merge pull request #13859 from rioug/10298-upgrade-to-shakapaker_v8
Upgrade to shakapaker v8
2026-02-04 12:51:42 +01:00
Maikel
4ba55c4067 Merge pull request #13898 from dacook/js-error-handler
Fix function call
2026-02-04 12:44:41 +11:00
Maikel
813249bad7 Merge pull request #13897 from arunguleria/13893-products-table-layout-changes
13893-hiding too many columns in Admin product list, the table layout breaks
2026-02-04 12:42:17 +11:00
Gaetan Craig-Riou
9f2c35d407 Merge pull request #13901 from openfoodfoundation/dependabot/npm_and_yarn/qs-6.14.1
Bump qs from 6.14.0 to 6.14.1
2026-02-04 10:05:51 +11:00
Maikel
79af9efd29 Merge pull request #13857 from rioug/10298-remove-rails-sass
Remove rails-sass dependency
2026-02-04 09:55:29 +11:00
Rachel Arnould
b731f9b9e4 Merge pull request #12997 from wandji20/wb-OFN-12794-user
Remove Cable Ready responses from User related controllers
2026-02-03 15:51:11 +01:00
dependabot[bot]
da90cdd9f6 Bump qs from 6.14.0 to 6.14.1
Bumps [qs](https://github.com/ljharb/qs) from 6.14.0 to 6.14.1.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.14.0...v6.14.1)

---
updated-dependencies:
- dependency-name: qs
  dependency-version: 6.14.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 11:31:06 +00:00
Rachel Arnould
f86c925209 Merge pull request #13883 from mkllnk/taler
Add Taler payment method
2026-02-03 12:30:00 +01:00
David Cook
0040e4d454 Fix script
rm: tmp/product_import-20250505-81606-9pucu5: is a directory
2026-02-03 11:33:02 +11:00
David Cook
876d37d19a Fix function call
This function got renamed in 01d5830480, but this call got missed.

I would like to add a spec to cover this, but am not sure exactly how to set it up right now.
I also notice that usage occurs after the preventDefault, and one before. I'm not sure if that matters. I have myself to blame for that inconsistency 🤦
2026-02-02 17:08:24 +11:00
Arun Guleria
36d617bceb 13893-hiding too many columns in Admin product list, the table layout breaks 2026-02-02 10:47:02 +05:30
Gaetan Craig-Riou
7c0528ad83 Merge pull request #13896 from mkllnk/cooldown
Add 7 day cooldown to Dependabot updates
2026-02-02 15:43:34 +11:00
Maikel Linke
f25d51e772 Add 7 day cooldown to Dependabot updates
This should make us less vulnerable to supply chain attacks:

- https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
2026-02-02 14:41:30 +11:00
Maikel Linke
7b559e2f83 Update all locales with the latest Transifex translations 2026-01-30 14:08:36 +11:00
Gaetan Craig-Riou
a94ccd4493 Merge pull request #13889 from openfoodfoundation/dependabot/npm_and_yarn/css-loader-7.1.3
Bump css-loader from 7.1.2 to 7.1.3
2026-01-30 09:41:52 +11:00
Gaetan Craig-Riou
fc6ed9ab4b Merge pull request #13888 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.7.5
Bump @floating-ui/dom from 1.7.4 to 1.7.5
2026-01-30 09:41:02 +11:00
Maikel Linke
c115ab7a0d Translate Taler payment status to error message 2026-01-29 15:07:28 +11:00
Maikel Linke
f3428494fc Better name method spec 2026-01-29 15:07:28 +11:00
Maikel Linke
d748972fca Resolve flaky spec with defined order 2026-01-29 15:07:28 +11:00
Maikel Linke
b9c7925008 Complete Taler payment success scenario 2026-01-29 15:07:28 +11:00
Maikel Linke
c11b93a4dc Demo Taler flow without validating payment yet 2026-01-29 15:07:28 +11:00
Maikel Linke
61e0688392 Demonstrate retrieving the payment Taler URL 2026-01-29 15:07:27 +11:00
Maikel Linke
5971cdc6e2 Add new taler gem 2026-01-29 15:07:27 +11:00
Maikel Linke
b3a1d1269a Add Taler as payment method
It doesn't take payments yet but can be selected during checkout.
2026-01-29 15:07:27 +11:00
Maikel Linke
a0011bd2e9 Remove orphaned translations of payment methods 2026-01-29 15:07:27 +11:00
dependabot[bot]
2219513c93 Bump css-loader from 7.1.2 to 7.1.3
Bumps [css-loader](https://github.com/webpack/css-loader) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/webpack/css-loader/releases)
- [Changelog](https://github.com/webpack/css-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/css-loader/compare/v7.1.2...v7.1.3)

---
updated-dependencies:
- dependency-name: css-loader
  dependency-version: 7.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-28 09:33:05 +00:00
dependabot[bot]
fb713d8721 Bump @floating-ui/dom from 1.7.4 to 1.7.5
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/HEAD/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-28 09:32:53 +00:00
David Cook
90761e0766 Merge pull request #13886 from mkllnk/setup
Fail setup script when nodenv is missing
2026-01-28 14:03:55 +11:00
Maikel Linke
6fb4048bfd Add context: this script will be used to deploy production 2026-01-28 13:47:18 +11:00
Maikel Linke
c3def926f1 Fail setup script when nodenv is missing 2026-01-28 10:40:40 +11:00
Maikel
d6cde5c793 Merge pull request #13873 from mkllnk/cleanup
Clean up tmp dev files
2026-01-28 10:38:58 +11:00
David Cook
756e876f61 Update ERD 2026-01-27 14:53:22 +11:00
Gaetan Craig-Riou
5e57325ce2 Use ruby platform for bundler 2026-01-27 09:53:39 +11:00
Gaetan Craig-Riou
cd956dadda Use factory to create address
It removes dependency on hard coded country and state id
2026-01-27 09:23:32 +11:00
Rachel Arnould
2a3b076170 Merge pull request #13826 from chahmedejaz/task/13744-add-none-option-in-tags-filter
Allow to select "none" in variant tags dropdown
2026-01-26 22:29:59 +01:00
Gaetan Craig-Riou
e6d556c809 Update locale cache key to invalidate cache 2026-01-26 14:56:10 +11:00
Gaetan Craig-Riou
f35b2be228 Upgrade dependencies 2026-01-26 14:56:06 +11:00
Gaetan Craig-Riou
cc9cb966b5 Fix images/font path
Now `additional_paths` are stripped like `source_path`
2026-01-26 14:54:48 +11:00
Gaetan Craig-Riou
34f9e08824 Add yarn as the package manager 2026-01-26 14:54:48 +11:00
Gaetan Craig-Riou
7d5db81017 Upgrade to Shakapacker 8.4.0 2026-01-26 14:54:48 +11:00
Gaetan Craig-Riou
1b03528aca Switch to v349_with-relaxed-dependencies for select2
It allows us to remove dependency on `rails-sass`
Sass files are handled by `shakapacker/wepack`, so we no use for
`rails-sass`
2026-01-26 14:51:32 +11:00
Gaetan Craig-Riou
9a90e46b78 Move mail css back to be managed by wepack
It wil allow us to remove dependency on `rails-sass`, and `sass` which
are not maintained anymore.
More or less revert this PR: https://github.com/openfoodfoundation/openfoodnetwork/pull/12743
2026-01-26 14:50:31 +11:00
Gaetan Craig-Riou
7e4886ad67 Merge pull request #13878 from openfoodfoundation/dependabot/npm_and_yarn/sass-embedded-1.97.3
Bump sass-embedded from 1.97.2 to 1.97.3
2026-01-26 14:27:15 +11:00
dependabot[bot]
9297dbfa63 Bump sass-embedded from 1.97.2 to 1.97.3
Bumps [sass-embedded](https://github.com/sass/embedded-host-node) from 1.97.2 to 1.97.3.
- [Changelog](https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/embedded-host-node/compare/1.97.2...1.97.3)

---
updated-dependencies:
- dependency-name: sass-embedded
  dependency-version: 1.97.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 00:15:46 +00:00
Maikel
7bfe51d067 Merge pull request #13849 from rioug/10298-upgrade-to-shakapaker_v7
Upgrade to shakapaker v7
2026-01-26 11:14:31 +11:00
Ahmed Ejaz
6ad49cc080 Update all locales with the latest Transifex translations 2026-01-26 03:50:53 +05:00
Rachel Arnould
2a7e8816c0 Merge pull request #13834 from mkllnk/pay-methods
Simplify code listing available payment method types
2026-01-23 22:52:29 +01:00
Gaetan Craig-Riou
988f903164 Update locale cache key to invalidate cache 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
108e313e48 Remove ci config that was missed during rebase 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
e502aad7c9 Coffee scripts are managed by sproket
There is no need to add coffee script dependencies for webpack
2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
9af57e1fc4 Remove deprecated config options 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
a0c23825b8 Top level dir is not stripped anymore for static assets 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
4e5238d1bb Update dependencies 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
26b8f62325 Fix wepack config, move to generateWebpackConfig 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
ee087f9eff Change spelling to Shakapacker 2026-01-23 16:23:14 +01:00
Gaetan Craig-Riou
3152362b9d Upgrade to Shakapacker 7.2.3 2026-01-23 16:23:14 +01:00
Rachel Arnould
601c921b4b Merge pull request #13831 from dacook/affiliate-sales-data
[DFC Anonymized orders endpoint] Fix unit_type for affiliate sales data
2026-01-23 15:59:49 +01:00
Gaetan Craig-Riou
39fbf01e98 Merge pull request #13876 from openfoodfoundation/dependabot/npm_and_yarn/mini-css-extract-plugin-2.10.0
Bump mini-css-extract-plugin from 2.9.4 to 2.10.0
2026-01-23 10:20:46 +11:00
Gaetan Craig-Riou
69586ae5ae Merge pull request #13875 from openfoodfoundation/dependabot/npm_and_yarn/webpack-5.104.1
Bump webpack from 5.104.0 to 5.104.1
2026-01-23 10:19:27 +11:00
Gaetan Craig-Riou
c87eb05c0e Merge pull request #13874 from openfoodfoundation/dependabot/npm_and_yarn/babel/core-7.28.6
Bump @babel/core from 7.28.5 to 7.28.6
2026-01-23 10:18:30 +11:00
Gaetan Craig-Riou
a1f363c53b Merge pull request #13868 from mkllnk/spec-helper
Merge and simplify rspec config
2026-01-23 10:14:53 +11:00
dependabot[bot]
76c6362db0 Bump mini-css-extract-plugin from 2.9.4 to 2.10.0
Bumps [mini-css-extract-plugin](https://github.com/webpack/mini-css-extract-plugin) from 2.9.4 to 2.10.0.
- [Release notes](https://github.com/webpack/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack/mini-css-extract-plugin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/mini-css-extract-plugin/compare/v2.9.4...v2.10.0)

---
updated-dependencies:
- dependency-name: mini-css-extract-plugin
  dependency-version: 2.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-22 09:32:58 +00:00
dependabot[bot]
5c3308de36 Bump webpack from 5.104.0 to 5.104.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.104.0 to 5.104.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.104.0...v5.104.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-22 09:32:50 +00:00
dependabot[bot]
a82b2c2799 Bump @babel/core from 7.28.5 to 7.28.6
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.28.5 to 7.28.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.6/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-22 09:32:43 +00:00
Maikel
4895010fe0 Merge pull request #13872 from openfoodfoundation/dependabot/npm_and_yarn/lodash-4.17.23
Bump lodash from 4.17.21 to 4.17.23
2026-01-22 14:36:50 +11:00
Maikel
962097f237 Merge pull request #13871 from openfoodfoundation/dependabot/npm_and_yarn/postcss-preset-env-10.6.1
Bump postcss-preset-env from 10.5.0 to 10.6.1
2026-01-22 14:35:59 +11:00
Maikel
941707a0df Merge pull request #13870 from openfoodfoundation/dependabot/npm_and_yarn/sass-embedded-1.97.2
Bump sass-embedded from 1.96.0 to 1.97.2
2026-01-22 14:34:31 +11:00
Maikel Linke
85439b4b54 Delete even more tmp dev files 2026-01-22 13:58:46 +11:00
David Cook
30804da259 Fix spec
The controller now responds with a standard HTTP redirect, instead of an app-specific redirect encoded in the body.
2026-01-22 12:45:07 +11:00
Maikel Linke
35724bec81 Delete generated JS for tests on update 2026-01-22 12:39:10 +11:00
David Cook
1e2b8bad3f Fix linter error 2026-01-22 12:32:12 +11:00
Maikel Linke
6cbc6fbca3 Remove precompiled assets on update 2026-01-22 12:27:04 +11:00
David Cook
88a0737916 Return correct http code for bad login params
This tells our generic ajax (Turbo) error handling to ignore the error and let the application display the response as usual.
2026-01-22 12:26:24 +11:00
Maikel Linke
b0b03cbb5f Delete old screenshots when updating app 2026-01-22 12:26:08 +11:00
wandji20
f5823bd618 Refactor to render turbo responses inline 2026-01-22 12:06:56 +11:00
wandji20
d9453979b1 Small improvements 2026-01-22 12:06:56 +11:00
wandji20
2cde74b91a Handle user confirmation with turbo stream 2026-01-22 12:06:56 +11:00
wandji20
3fd007fa3d Handle user password with turbo stream 2026-01-22 12:06:56 +11:00
wandji20
e3431c7954 Handle user sessions with turbo stream 2026-01-22 12:06:56 +11:00
wandji20
9fa715c709 Handle user registration with turbo stream 2026-01-22 12:06:56 +11:00
David Cook
f7e119d06f Merge pull request #13869 from openfoodfoundation/dependabot/npm_and_yarn/cross-spawn-7.0.6
Bump cross-spawn from 7.0.3 to 7.0.6
2026-01-22 10:19:18 +11:00
dependabot[bot]
52ee5929cf Bump lodash from 4.17.21 to 4.17.23
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-21 23:05:03 +00:00
dependabot[bot]
1e58882217 Bump postcss-preset-env from 10.5.0 to 10.6.1
Bumps [postcss-preset-env](https://github.com/csstools/postcss-plugins/tree/HEAD/plugin-packs/postcss-preset-env) from 10.5.0 to 10.6.1.
- [Changelog](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/CHANGELOG.md)
- [Commits](https://github.com/csstools/postcss-plugins/commits/HEAD/plugin-packs/postcss-preset-env)

---
updated-dependencies:
- dependency-name: postcss-preset-env
  dependency-version: 10.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-21 09:32:46 +00:00
dependabot[bot]
ca23f12451 Bump sass-embedded from 1.96.0 to 1.97.2
Bumps [sass-embedded](https://github.com/sass/embedded-host-node) from 1.96.0 to 1.97.2.
- [Changelog](https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/embedded-host-node/compare/1.96.0...1.97.2)

---
updated-dependencies:
- dependency-name: sass-embedded
  dependency-version: 1.97.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-21 09:32:39 +00:00
David Cook
cce37aa915 Add explanation for magic number 2026-01-21 17:09:33 +11:00
dependabot[bot]
f808fe9685 Bump cross-spawn from 7.0.3 to 7.0.6
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-version: 7.0.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-21 05:18:48 +00:00
Gaetan Craig-Riou
dd5db396b4 Merge pull request #13828 from rioug/10298-upgrade-to-shakapaker
Upgrade to shakapaker
2026-01-21 16:17:50 +11:00
David Cook
e121a799ed Refer to unit from variant
variant_unit was moved to variant as part of product refactor.
Old products probably still had a value there, but new ones would have been appearing with nil.
2026-01-21 16:10:30 +11:00
David Cook
5dfef4a3ae Add specs for data, with product and variant grouping
Oh and by the way, we missed something in the product refactor.
2026-01-21 16:10:30 +11:00
David Cook
8236603f76 Add ability to specify variant for order
I will need this in the following commit. For existing specs where no variant is specified, a product with variant will be created (I think this is what the line item factory would have done before).
2026-01-21 16:10:30 +11:00
Gaetan Craig-Riou
315d52961a Add "v1" to locale cache key
This is to invalidate existing locale cache key, so it will pick up
image path changes in cached fragment with locale
2026-01-21 14:29:46 +11:00
Maikel Linke
dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00
Maikel Linke
3455ceb722 Use standard spec_helper filename 2026-01-21 12:09:12 +11:00
Maikel Linke
7361b2da0b Move related rspec config to one place 2026-01-21 12:09:12 +11:00
Maikel Linke
3ebacbc31a Move require statement to the right file 2026-01-21 12:09:11 +11:00
David Cook
c0bcf177e7 Merge pull request #13861 from mkllnk/bump-ruby
Bump Ruby from 3.3.10 to 3.4.8
2026-01-20 16:34:31 +11:00
David Cook
8dfede11c6 Merge pull request #13862 from mkllnk/allow_checkout_on_gateway_error
Remove unused switch to allow checkout on failures
2026-01-20 12:25:03 +11:00
Maikel Linke
bac123f223 Remove unused switch to allow checkout on failures
The inherited payment logic is complicated enough. Removing this dead
code makes it slightly simpler.
2026-01-19 14:35:54 +11:00
Maikel Linke
fdc775ae6d Style arguments forwarding 2026-01-19 10:55:24 +11:00
Maikel Linke
26b39d6626 Add convenience script to bump ruby version 2026-01-19 10:40:01 +11:00
Maikel Linke
8953e8481d Remove unnecessary bundler install script
Bundler does the same already.
2026-01-19 10:40:01 +11:00
Maikel Linke
1ce76a3166 Bump Ruby from 3.3.10p183 to 3.4.8p72 2026-01-19 10:34:34 +11:00
Maikel Linke
1c703905fe Remove now redundant install of bundler 2026-01-19 10:34:34 +11:00
David Cook
feed223ab4 Merge pull request #13528 from dacook/vine-expiry-message-13495
[VINE] Show helpful message if voucher expired
2026-01-19 09:20:18 +11:00
Gaetan Craig-Riou
90f962a886 Use compiler_strategy mtime for test environment
It fixes the issue for CI as it's faster than the digest strategy:
https://github.com/shakacode/shakapacker/blob/main/docs/configuration.md#compiler_strategy
2026-01-16 13:47:23 +11:00
Gaetan Craig-Riou
82f6484031 Add comment explaning why defer loading is disabled 2026-01-16 12:30:57 +11:00
Gaetan Craig-Riou
282fb44da4 Update all locales with the latest Transifex translations 2026-01-16 10:05:27 +11:00
Gaetan Craig-Riou
82f40d2e93 Merge pull request #13821 from piyyu/fix-import-multiple-products
Fix “Import multiple products” button route on empty products page
2026-01-16 09:55:33 +11:00
Gaetan Craig-Riou
cae1655ec3 Merge pull request #13848 from dacook/cleanup-tmp-ctrl
Remove unused file
2026-01-14 16:23:11 +11:00
Ahmed Ejaz
e8e48f7c64 use double quotes for the string value 2026-01-13 12:59:28 +05:00
David Cook
26702e6f0d Remove unused file
Low-hanging fruit 🍇
2026-01-13 14:59:26 +11:00
Gaetan Craig-Riou
8cd9e94148 Use a separate config for webpacker on CI
For some reason having webpack compile turned on for the test
environment makes system test slow, resulting in lots of failure. Assets
are precompiled for system test, so there isn't any compilation on each
request, but still test are slow.
To fix the issue, we use a separate config file for CI where webpack
compile is set turned off.
2026-01-13 14:35:36 +11:00
Gaetan Craig-Riou
a934b60f67 Make sure shipping modal gets closed
Also check the modal is not showing instead of checking it's hidden
2026-01-13 14:34:50 +11:00
Maikel
7fc9a6bf93 Merge pull request #13829 from mkllnk/ruby-3.3
Bump ruby from 3.2.9p265 to 3.3.10p183
2026-01-13 12:22:28 +11:00
David Cook
781bf940f6 Merge pull request #13837 from mkllnk/fix-seeds
Fix database seeding with admin user
2026-01-13 12:02:32 +11:00
Maikel Linke
92382ca473 Remove outdated warning
We only create a user when seeding the database and we check that
there's no user already. We don't have a use case for adding an admin
user to a database with user data.

It also referred to a spree task that doesn't exist in our code base.
2026-01-13 11:02:49 +11:00
Maikel Linke
76a3e913df Remove unnecessary load 2026-01-13 11:00:02 +11:00
Maikel Linke
23ab6bb489 Create seed admin user without prompting for details
We don't really need it. In development, we use default values. And when
preparing a new server, we set env vars.

This fixes a broken dependency on HighLine. I found removal easier than
fixing something we don't use.
2026-01-13 10:59:31 +11:00
Ahmed Ejaz
fd3c1c1343 Add "None" option to tags filter in product search 2026-01-13 02:13:51 +05:00
David Cook
368da19993 Display more specific invalid_voucher message to customer
It was implemented with error code  409 in https://github.com/openfoodfoundation/vine/pull/112
2026-01-12 17:14:57 +11:00
David Cook
419f4490d6 Recognise certain voucher errors
I considered using the vine error message as the translation key (ie I18n.t(vine_voucher_validator_service.errors.#{message.parameterize.underscore}), but thought it might be more predictable to have keys explicitly defined and whitelisted like this.

These error message are still squashed by the controller, we'll deal with that next.
2026-01-12 16:25:57 +11:00
Gaetan Craig-Riou
39245d55e2 Turn defer off when loading javascript script
It seems that we have functionality that depends on the order the
scripts are executed. Using defer breaks that.
Using defer is better performance wise so we should try to address this
eventually, might need to wait till we get rid of angular.
2026-01-12 15:56:03 +11:00
Gaetan Craig-Riou
fe8200b7e8 Move babel config back to it's own file
It's need for jest to work properly.
2026-01-12 15:56:03 +11:00
David Cook
c799f15067 Update ruby-build with homebrew if installed
This is commonly used on Mac.
2026-01-12 15:09:49 +11:00
David Cook
54f1047dcb Merge pull request #13830 from mkllnk/highline
Bump highline from 2.0.3 to 3.1.2 to support newer rubies
2026-01-12 11:14:06 +11:00
Maikel
c1e599deef Merge pull request #13833 from mkllnk/nodenv
Add instructions how to install nodenv
2026-01-12 10:40:54 +11:00
Maikel Linke
f3c60148c1 Simplify filtering of Stripe 2026-01-09 16:54:25 +11:00
Maikel Linke
2e08c9c44e Simplify with defined order of payment methods 2026-01-09 16:54:21 +11:00
Maikel Linke
93f2af7e7d Lazy load payment method classes
This avoids any class reloading issues in dev, simplifies most of the
code path and opens up for refactoring.

The only reason we still load the class is to call `clean_name` on it
for the translation key. We can probably do better.
2026-01-09 16:54:02 +11:00
Maikel Linke
cb7a4b67ce Replace custom lookup with default Rails feature
Rails renders an error when you try to supply an invalid value. Our code
is safe without an allow-list and the UX doesn't allow you to select an
invalid value.
2026-01-09 16:53:06 +11:00
Maikel Linke
41a8d06326 Remove duplicate definition of payment providers 2026-01-09 15:16:36 +11:00
Maikel Linke
a957df1205 Use I18n API for readability 2026-01-09 15:16:36 +11:00
Maikel Linke
a1bdfa0a20 Move list of payment methods to where it is used 2026-01-09 15:16:36 +11:00
Maikel Linke
1adf94093e Merge related initializer code
The division came likely from Spree times.
2026-01-09 15:16:35 +11:00
Maikel Linke
476daf0d30 Add instructions how to install nodenv 2026-01-09 13:47:41 +11:00
Maikel Linke
18ef5cc69a Update all locales with the latest Transifex translations 2026-01-09 12:04:46 +11:00
Maikel
a69528c432 Merge pull request #13803 from pacodelaluna/add-cloud-storage-configuration-for-s3-compatible-alternatives
Add a new cloud storage configuration for s3-compatible alternatives
2026-01-09 12:03:08 +11:00
Maikel
9dfecde6a7 Merge pull request #13765 from rioug/variant-tag-clean-old-flipper-groups
[Variant tags] Remove flipper groups that are not used anymore
2026-01-09 12:01:08 +11:00
Filipe
c73f28b434 Merge pull request #13815 from mkllnk/secrets
Replace deprecated Rails secrets with credentials
2026-01-08 18:46:33 +00:00
Filipe
0cd9fa91a8 Merge pull request #13798 from rioug/13790-upgrade-stripe
Upgrade stripe to version 15
2026-01-08 18:25:11 +00:00
François Turbelin
252943e9de Adjust context using allow method for Application Record spec 2026-01-08 13:08:09 +00:00
François Turbelin
cab4b2fb28 Add a new cloud storage configuration for s3-compatible alternatives 2026-01-08 13:08:09 +00:00
Filipe
80bd6defcb Merge pull request #13789 from prikeshsavla/13537-upgrade-active-storage-validations-gem
Upgraded gem active_storage_validations to 3.0.2 and fixed any upgrade related issues
2026-01-08 13:06:53 +00:00
Filipe
bd367cb154 Merge pull request #13795 from prikeshsavla/13392-fix-producer-name-text-encoding
Fix encoding issue using ng-bind-html
2026-01-08 12:03:00 +00:00
Filipe
d0f48687e2 Merge pull request #13777 from rioug/13481-webhook-payment
Payment status change webhook
2026-01-08 11:26:41 +00:00
Filipe
25063d2c4d Merge pull request #13649 from deivid-rodriguez/fix-removal-flash-message-translations
Improve translations of some flash messages
2026-01-07 16:33:34 +00:00
Maikel
bad04b70a9 Merge pull request #13832 from dacook/pr-template-headings
Increase PR headings to level 2
2026-01-07 17:19:36 +11:00
David Cook
5479572a08 Increase headings to level 2
h4 is rendered as bold text the same size as content.
2026-01-07 17:00:34 +11:00
Maikel Linke
79a9dbcf68 Bump highline from 2.0.3 to 3.1.2 to support newer rubies 2026-01-07 14:12:59 +11:00
Maikel Linke
61c7c26822 Remove version restriction on highline
It came from a very old version of the Spree code.
2026-01-07 14:09:42 +11:00
Maikel Linke
969dcae8d0 Remove unnecessary require statement 2026-01-07 14:08:10 +11:00
Maikel Linke
ce5a95ff4f Bump bundler from 2.4.19 to 2.5.22 (default gem) 2026-01-07 12:24:03 +11:00
Maikel Linke
0d5330d388 Bump ruby from 3.2.9p265 to 3.3.10p183 2026-01-07 12:21:13 +11:00
Gaetan Craig-Riou
3676acf244 Fix font link 2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
caf6b087c1 Clean up wepacker config
Disable overlayi, it covers the whole page as we have lots of warning
2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
24d6c1e386 Remove support for IE 11
Stimulus doesn't support IE 11 : https://stimulus.hotwired.dev/handbook/installing#browser-support
2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
a120e390d0 Remove added config, not needed anymore 2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
98a2bf5d47 image_pack_path is now available from Shackapaker 2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
bb0c1e7a0f Quiet sass deprecations warning for dependencies
We are not planning to upgrade foundation-sites
2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
55a15b914c Upgrade to shakapacker 6.6.0 2026-01-06 14:31:44 +11:00
Gaetan Craig-Riou
8ce14a55c8 Fix dependencies version, and update config
Trying to stay as close as possible to the default config
2026-01-06 14:31:43 +11:00
Gaetan Craig-Riou
d1f47f6956 Rename bin scripts to match new name 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
2d50dace20 Move to shakapacker 6 and install dependencies 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
bbbbe71bc4 Remove deprecated ~prefix
https://github.com/webpack/sass-loader/blob/main/README.md#the-style-new-api-by-default-since-16-version-and-outputstyle-old-api-options-in-production-mode
2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
b3dc76b8cf Fix configuration and scss to get webpack to compile
Move the Postcss config hack to postcss.config.js
2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
ad4b26e86d Add missing dependency for asset compilation 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
c2a7a89381 Move extensions configuration to webpack.config.js 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
68e3623861 Use default babel config, set up on package.json 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
577aa55f98 Move browserlist settings to package.json 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
b8e62b3d84 Add coffeeScript dependency 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
dbb8e07b9a Add Sass integration
We are still using the old `ruby-sass` because it's a dependency from
`rails-sass` which is a dependcy from `select2`. It looks like the
master branch on the ofn fork get rid of the dependency, so we should
upgrading.
2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
19550ed4fe Add postcss integration 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
4d0c710e3b Add css integration 2026-01-06 14:31:32 +11:00
Gaetan Craig-Riou
fccde70690 Upgrading to webpacker v6.0.0.rc.6
Migration guide : https://github.com/shakacode/shakapacker/blob/main/docs/v6_upgrade.md#how-to-upgrade-to-webpacker-v600rc6-from-v5
Setp 1,2,3,4
2026-01-06 14:31:25 +11:00
Ahmed Ejaz
b8de75b1ef Add "None" option to tags filter and update search functionality
- Implemented apply_tags_filter method to handle "None" option in tag searches.
- Updated tags select field to include "None" option in the filters.
- Enhanced search_by_tag method in specs  to accept multiple tags and raise an error if none are provided.
- Added tests for searching by "None" tag and combinations with other tags.
2026-01-06 02:39:56 +05:00
Gaetan Craig-Riou
06bfd07fec Merge pull request #13824 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.1.16
Bump trix from 2.1.15 to 2.1.16
2026-01-05 11:12:11 +11:00
Maikel
e98cf78b4c Merge pull request #13819 from openfoodfoundation/dependabot/bundler/haml_lint-0.68.0
Bump haml_lint from 0.67.0 to 0.68.0
2026-01-02 16:50:21 +11:00
dependabot[bot]
13229cc0c1 Bump trix from 2.1.15 to 2.1.16
Bumps [trix](https://github.com/basecamp/trix) from 2.1.15 to 2.1.16.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.1.15...v2.1.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-31 09:01:27 +00:00
piyyu
0f59333cd9 Fix import multiple products button route 2025-12-26 02:10:46 +05:30
piyyu
ad4ce14486 Fix import multiple products button route 2025-12-26 00:11:09 +05:30
dependabot[bot]
3173c79e8f Bump haml_lint from 0.67.0 to 0.68.0
Bumps [haml_lint](https://github.com/sds/haml-lint) from 0.67.0 to 0.68.0.
- [Release notes](https://github.com/sds/haml-lint/releases)
- [Changelog](https://github.com/sds/haml-lint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sds/haml-lint/compare/v0.67.0...v0.68.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-22 09:04:24 +00:00
David Cook
ca14d557c1 Merge pull request #13814 from mkllnk/dfc-events-unauthorised
Correctly respond to unauthorised requests on DFC events endpoint
2025-12-22 10:42:23 +11:00
Gaetan Craig-Riou
59a3a5bd92 Merge pull request #13816 from openfoodfoundation/dependabot/bundler/dotenv-3.2.0
Bump dotenv from 3.1.8 to 3.2.0
2025-12-22 09:44:15 +11:00
dependabot[bot]
a226088f5c Bump dotenv from 3.1.8 to 3.2.0
Bumps [dotenv](https://github.com/bkeepers/dotenv) from 3.1.8 to 3.2.0.
- [Release notes](https://github.com/bkeepers/dotenv/releases)
- [Changelog](https://github.com/bkeepers/dotenv/blob/main/Changelog.md)
- [Commits](https://github.com/bkeepers/dotenv/compare/v3.1.8...v3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-19 09:04:48 +00:00
Maikel Linke
e91fab5702 Remove legacy config for secret key 2025-12-19 14:22:25 +11:00
Maikel Linke
e09853af0c Replace deprecated Rails secrets
Use new credentials interface.
2025-12-19 13:28:05 +11:00
Maikel
c65fcc1072 Merge pull request #13812 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.208.0
Bump aws-sdk-s3 from 1.207.0 to 1.208.0
2025-12-19 10:41:27 +11:00
Maikel
3bb68ec07e Merge pull request #13811 from openfoodfoundation/dependabot/bundler/webmock-3.26.1
Bump webmock from 3.25.1 to 3.26.1
2025-12-19 10:39:45 +11:00
Maikel Linke
2c97638aa1 Enhance readability 2025-12-19 10:21:02 +11:00
Maikel Linke
ceee9671d9 Replace method with name conflict causing error 2025-12-19 10:16:46 +11:00
dependabot[bot]
6b494be7ff Bump aws-sdk-s3 from 1.207.0 to 1.208.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.207.0 to 1.208.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-version: 1.208.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-18 19:38:08 +00:00
dependabot[bot]
a6855e6bc1 Bump webmock from 3.25.1 to 3.26.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.25.1 to 3.26.1.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.25.1...v3.26.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-17 09:01:49 +00:00
Gaetan Craig-Riou
7ca43eb4a1 Merge pull request #13810 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.207.0
Bump aws-sdk-s3 from 1.206.0 to 1.207.0
2025-12-17 10:21:50 +11:00
dependabot[bot]
74b5ac559f Bump aws-sdk-s3 from 1.206.0 to 1.207.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.206.0 to 1.207.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 09:02:51 +00:00
Maikel
07c236497c Merge pull request #13808 from openfoodfoundation/dependabot/bundler/vcr-6.3.1
Bump vcr from 6.2.0 to 6.3.1
2025-12-16 14:50:27 +11:00
Filipe
caf2ff9bb4 Merge pull request #13752 from deivid-rodriguez/always_generate_button_tags
Always generate `<button>` tags, rather than `<input>` of type "button"
2025-12-15 18:46:38 +00:00
Filipe
1b2a17d7e4 Merge pull request #13754 from deivid-rodriguez/no-changes-after-delete-customer
Properly handle changes in `code` attribute when a customer is deleted
2025-12-15 17:58:04 +00:00
Filipe
ce46115139 Merge pull request #13648 from deivid-rodriguez/improve-enterprise-removal
Improve enterprise removal
2025-12-15 16:54:05 +00:00
dependabot[bot]
9fd2ff7620 Bump vcr from 6.2.0 to 6.3.1
Bumps [vcr](https://github.com/vcr/vcr) from 6.2.0 to 6.3.1.
- [Release notes](https://github.com/vcr/vcr/releases)
- [Changelog](https://github.com/vcr/vcr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vcr/vcr/compare/v6.2.0...v6.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:02:43 +00:00
Gaetan Craig-Riou
98a25c1c7f Merge pull request #13805 from openfoodfoundation/dependabot/bundler/newrelic_rpm-9.24.0
Bump newrelic_rpm from 9.23.0 to 9.24.0
2025-12-15 09:26:49 +11:00
dependabot[bot]
12b86a35af Bump newrelic_rpm from 9.23.0 to 9.24.0
Bumps [newrelic_rpm](https://github.com/newrelic/newrelic-ruby-agent) from 9.23.0 to 9.24.0.
- [Release notes](https://github.com/newrelic/newrelic-ruby-agent/releases)
- [Changelog](https://github.com/newrelic/newrelic-ruby-agent/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/newrelic/newrelic-ruby-agent/compare/9.23.0...9.24.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-12 09:02:49 +00:00
Gaetan Craig-Riou
e1f4210aa8 Upgrade stripe to version 15 2025-12-10 16:16:32 +11:00
Gaetan Craig-Riou
584b976dff Per review, small code improvment 2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
4073238654 Per review, fix test webhook
- only show button for payment status changed webhook
- update translation
2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
d7505bcef4 Add Payments::WebhookPayload to manage payload data
It includes test data so any change in the payload should not affect
the test webhook enpoint functionality
2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
f6a7225c47 Per review, remove the ensure 2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
377f33b64f Use a better selector to pick table row 2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
73b27f14ab Per review, fix comment 2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
0b497fbb77 Fix order payment spec 2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
5e4df41ec8 Add button to send test data to endpoint
It will allow a user to easily test the endpoint
2025-12-10 10:28:12 +11:00
Gaetan Craig-Riou
72085be896 Format account.scss with prettier 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
e0bc8f9cdc Fix webhook endpoints controller spec 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
efcb442a80 Add spec to test notification is triggered 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
a38023475c Trigger payment webhook when a payment status changes
It used ActiveSupport::Notifications and a listener :
StatusChangedListenerService to trigger the WebhookService
2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
4a6ba29b99 Add Payments::WebhookService
It enqueues jobs to post the generated payload to the various configured
webhook endpoints for payment status change
2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
7f961d90c2 Enable active_job.use_big_decimal_serializer
It prevents the following deprecation warning:
DEPRECATION WARNING: Primitive serialization of BigDecimal job arguments is deprecated as it may serialize via .to_s using certain queue adapters.
       Enable config.active_job.use_big_decimal_serializer to use BigDecimalSerializer instead, which will be mandatory in Rails 7.2.
2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
0ac4021729 Update spec to include payment status webhook 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
ac662de789 Fix spec use actual translation 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
23c57cb354 Add UI to manage payment staus webhook endpoint 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
d6ef56af6e Fix existing code to support webhook_type 2025-12-10 10:28:11 +11:00
Gaetan Craig-Riou
059e36318e Add type to WebhookEnpoints
Add migration to update existing endpoint to "order_cycle_opened" type
2025-12-10 10:28:08 +11:00
Gaetan Craig-Riou
7a72121b1b Remove flipper groups that are not used anymore 2025-12-10 10:25:33 +11:00
Prikesh Savla
c01cca33c7 Fix encoding issue for Producer name to allow special characters in the text using ng-bind-html 2025-12-09 11:43:12 +05:30
Prikesh Savla
631306cfb3 Extended imageImport and ImageBuilder to get the content type of the file for the attacment for avoiding issues for files without extensions.
Updated config/locale/en.yml for the active_storage_validations related error messages
2025-12-09 08:06:29 +05:30
Prikesh Savla
f4d59305d7 Upgraded gem active_storage_validations from 1.1.2 to 3.0.2 and fixed any upgrade related issues
Changed all references of processable_image to processable_file which was a breaking change from v1 to v2 https://github.com/igorkasyanchuk/active_storage_validations/tree/3.0.2?tab=readme-ov-file#upgrading-from-1x-to-2x

Also it upgraded the way of validating files from just the file name and content type, so tests also needed to change for file upload checks

Refactored all the similar file image validator content type in Spree::Image::ACCEPTED_CONTENT_TYPES and Updated ImageBuilder.import method to use the url.path when getting filename.
2025-12-08 22:12:01 +05:30
David Rodríguez
c526e72539 Improve enterprise removal (failure case)
Make sure failure to delete due to dependent objects is handled through
activemodel errors and not by rescuing
`ActiveRecord::DeleteRestrictionError` exceptions.

Previously we would display two alert prompts, and we would weirdly
display the content of our 500 error page on top of the screen.

Now, we display a flash error message explaining the reason to fail to
remove it.
2025-11-27 19:10:15 +01:00
David Rodríguez
e217a6fca8 Make enterprise unit specs about removal consistent
And not dependent on implementation details.
2025-11-27 19:09:45 +01:00
David Rodríguez
6aa7ef3c21 Improve enterprise removal (success case)
Make enterprise removal use turbo, which provides the following
benefits:

* More responsive removal since there's no full page reload.
* A success flash message (previously nothing was displayed).
* No double alert prompt.

It also goes in the direction of removing mrujs in favor of turbo.
2025-11-27 19:09:35 +01:00
David Rodríguez
bf0e5c0d44 Let "Tag Rule" and "Voucher" be translated in flash messages 2025-11-26 12:18:06 +01:00
David Rodríguez
6bd2f5af8d Use Spree.t directly for translating the successfully_removed flash message
Since none of the current keys have a `%{resource}` parameter.
2025-11-26 12:18:06 +01:00
David Rodríguez
7bf54088a6 Use Spree.t directly for translating the not_found message
Since none of the current keys interpolate a `%{resource}` parameter.
2025-11-26 12:18:06 +01:00
David Rodríguez
4792040240 Cover tax category removal with a spec 2025-11-26 12:18:05 +01:00
David Rodríguez
dc631026d4 Properly handle changes in code attribute when a customer is deleted
Previously, `null` and empty value would be confused when a customer is
removed, resulting in incorrect pending changes being added, and thus a
"You have unsaved changes" message getting displayed and the save button
not getting disabled.
2025-11-25 07:44:00 +01:00
David Rodríguez
c05532c166 Always generate <button> tags, rather than <input> of type "button" 2025-11-24 12:11:03 +01:00
808 changed files with 12866 additions and 14840 deletions

View File

@@ -1,2 +0,0 @@
defaults
IE 11

1
.gitattributes vendored
View File

@@ -8,4 +8,3 @@
# Same thing for following files, but they don't have an sh extension
pre-commit eol=lf
webpack-dev-server eol=lf
install-bundler eol=lf

View File

@@ -1,4 +1,4 @@
#### What? Why?
## What? Why?
- Closes # <!-- Insert issue number here. -->
@@ -7,7 +7,7 @@
#### What should we test?
## What should we test?
<!-- List which features should be tested and how.
This can be similar to the Steps to Reproduce in the issue.
Also think of other parts of the app which could be affected
@@ -16,7 +16,7 @@
- Visit ... page.
-
#### Release notes
## Release notes
<!-- Please select one for your PR and delete the other. -->
@@ -33,12 +33,12 @@ Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
#### Dependencies
## Dependencies
<!-- Does this PR depend on another one?
Add the link or remove this section. -->
#### Documentation updates
## Documentation updates
<!-- Are there any wiki pages that need updating after merging this PR?
List them here or remove this section. -->

View File

@@ -31,6 +31,8 @@ updates:
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 7
# Only specific requirements are specified in Gemfile, so don't touch it.
versioning-strategy: lockfile-only
@@ -39,6 +41,8 @@ updates:
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 7
# Only specific requirements are specified in package.json, so don't touch it.
versioning-strategy: lockfile-only

View File

@@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
uses: supercharge/redis-github-action@1.8.1
with:
redis-version: 6
@@ -124,7 +124,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
uses: supercharge/redis-github-action@1.8.1
with:
redis-version: 6
@@ -211,7 +211,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
uses: supercharge/redis-github-action@1.8.1
with:
redis-version: 6
@@ -290,7 +290,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
uses: supercharge/redis-github-action@1.8.1
with:
redis-version: 6

2
.rspec
View File

@@ -1 +1 @@
--require base_spec_helper
--require spec_helper

View File

@@ -1 +1 @@
3.2.9
3.4.8

View File

@@ -1,4 +1,4 @@
FROM ruby:3.2.9-alpine3.19 AS base
FROM ruby:3.4.8-alpine3.19 AS base
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
TZ=Europe/London \
@@ -31,4 +31,4 @@ FROM development-base
COPY . $RAILS_ROOT
COPY Gemfile Gemfile.lock ./
RUN bundle install --jobs "$(nproc)"
COPY --from=yarn-dependencies $RAILS_ROOT/node_modules ./node_modules
COPY --from=yarn-dependencies $RAILS_ROOT/node_modules ./node_modules

View File

@@ -83,11 +83,8 @@ RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.z
# Copy code and install app dependencies
COPY . /usr/src/app/
# Install Bundler
RUN ./script/install-bundler
# Install front-end dependencies
RUN yarn install
# Run bundler install in parallel with the amount of available CPUs
RUN bundle install --jobs="$(nproc)"
RUN bundle install --jobs="$(nproc)"

12
Gemfile
View File

@@ -18,7 +18,7 @@ gem 'activemerchant'
gem 'angular-rails-templates'
gem 'ransack', '~> 4.1.0'
gem 'responders'
gem 'webpacker', '~> 5'
gem 'shakapacker', '8.4.0'
# Indirect dependency but we access it directly in JS specs.
# It turns out to be hard to upgrade but please do if you can.
@@ -49,7 +49,7 @@ gem 'acts_as_list', '1.0.4'
gem 'cancancan', '~> 1.15.0'
gem 'digest'
gem 'ffaker'
gem 'highline', '2.0.3' # Necessary for the install generator
gem 'highline'
gem 'json'
gem 'monetize', '~> 1.11'
gem 'paranoia', '~> 2.4'
@@ -57,7 +57,8 @@ gem 'state_machines-activerecord'
gem 'stringex', '~> 2.8.5', require: false
gem 'paypal-sdk-merchant', '1.117.2'
gem 'stripe', '~> 13'
gem 'stripe', '~> 15'
gem "taler"
gem 'devise'
gem 'devise-encryptable'
@@ -111,7 +112,7 @@ gem "turbo_power"
gem "turbo-rails"
gem 'combine_pdf'
gem 'wicked_pdf'
gem 'wicked_pdf', github: "openfoodfoundation/wicked_pdf", branch: "master"
gem 'wkhtmltopdf-binary'
gem 'immigrant'
@@ -126,7 +127,8 @@ gem 'angular_rails_csrf'
gem 'jquery-rails', '4.4.0'
gem 'jquery-ui-rails', '~> 4.2'
gem "select2-rails", github: "openfoodfoundation/select2-rails", branch: "v349_with_thor_v1"
gem "select2-rails", github: "openfoodfoundation/select2-rails",
branch: "v349_with-relaxed-dependencies"
gem 'good_migrations'

View File

@@ -10,13 +10,21 @@ GIT
GIT
remote: https://github.com/openfoodfoundation/select2-rails.git
revision: fc240e85fbdf1878ff3c39d972c0cd9a312f5ed4
branch: v349_with_thor_v1
revision: 9693e0cc5b04938da46692d3fa83aa8934791981
branch: v349_with-relaxed-dependencies
specs:
select2-rails (3.4.9)
sass-rails
thor (>= 0.14)
GIT
remote: https://github.com/openfoodfoundation/wicked_pdf.git
revision: bce498de547cdf00d037fdbec29fae844d69ee8e
branch: master
specs:
wicked_pdf (2.8.1)
activesupport
ostruct
GIT
remote: https://github.com/podia/stimulus_reflex_testing.git
revision: abac2ee34de347c589795b4d1a8e83e0baafb201
@@ -104,11 +112,12 @@ GEM
rails-html-sanitizer (~> 1.6)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
active_storage_validations (1.1.4)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
active_storage_validations (3.0.3)
activejob (>= 6.1.4)
activemodel (>= 6.1.4)
activestorage (>= 6.1.4)
activesupport (>= 6.1.4)
marcel (>= 1.0.3)
activejob (7.1.6)
activesupport (= 7.1.6)
globalid (>= 0.3.6)
@@ -158,8 +167,8 @@ GEM
zeitwerk (>= 2.4, < 3.0)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
aes_key_wrap (1.1.0)
afm (0.2.2)
angular-rails-templates (1.4.0)
@@ -176,8 +185,8 @@ GEM
ast (2.4.3)
attr_required (1.0.2)
aws-eventstream (1.4.0)
aws-partitions (1.1191.0)
aws-sdk-core (3.239.2)
aws-partitions (1.1196.0)
aws-sdk-core (3.240.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -188,7 +197,7 @@ GEM
aws-sdk-kms (1.118.0)
aws-sdk-core (~> 3, >= 3.239.1)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.206.0)
aws-sdk-s3 (1.208.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
@@ -198,15 +207,15 @@ GEM
bcp47_spec (0.2.1)
bcrypt (3.1.20)
benchmark (0.5.0)
bigdecimal (3.3.1)
bigdecimal (4.0.1)
bindata (2.5.1)
bindex (0.8.1)
bootsnap (1.19.0)
bootsnap (1.22.0)
msgpack (~> 1.2)
bugsnag (6.28.0)
concurrent-ruby (~> 1.0)
builder (3.3.0)
bullet (8.0.8)
bullet (8.1.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cable_ready (5.0.6)
@@ -233,7 +242,7 @@ GEM
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
cgi (0.5.0)
cgi (0.5.1)
childprocess (5.0.0)
choice (0.2.0)
chronic (0.10.2)
@@ -248,10 +257,10 @@ GEM
combine_pdf (1.0.31)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.3.5)
concurrent-ruby (1.3.6)
connection_pool (2.5.5)
cookiejar (0.3.4)
crack (1.0.0)
crack (1.0.1)
bigdecimal
rexml
crass (1.0.6)
@@ -269,7 +278,7 @@ GEM
database_cleaner-core (2.0.1)
datafoodconsortium-connector (1.2.0)
virtual_assembly-semantizer (~> 1.0, >= 1.0.5)
date (3.5.0)
date (3.5.1)
debug (1.11.0)
irb (~> 1.10)
reline (>= 0.3.8)
@@ -289,7 +298,7 @@ GEM
diff-lcs (1.6.2)
digest (3.2.1)
docile (1.4.1)
dotenv (3.1.8)
dotenv (3.2.0)
drb (2.2.3)
em-http-request (1.1.7)
addressable (>= 2.3.4)
@@ -304,7 +313,7 @@ GEM
eventmachine (>= 1.0.0.beta.1)
email_validator (2.2.4)
activemodel
erb (6.0.0)
erb (6.0.1)
erubi (1.13.1)
et-orbi (1.3.0)
tzinfo
@@ -379,7 +388,7 @@ GEM
temple (>= 0.8.2)
thor
tilt
haml_lint (0.67.0)
haml_lint (0.68.0)
haml (>= 5.0)
parallel (~> 1.10)
rainbow
@@ -387,8 +396,10 @@ GEM
sysexits (~> 1.1)
hashdiff (1.2.1)
hashery (2.1.2)
hashie (5.0.0)
highline (2.0.3)
hashie (5.1.0)
logger
highline (3.1.2)
reline
htmlentities (4.4.2)
http_parser.rb (0.8.0)
i18n (1.14.7)
@@ -415,10 +426,11 @@ GEM
activerecord (>= 3.0)
invisible_captcha (2.3.0)
rails (>= 5.2)
io-console (0.8.1)
io-console (0.8.2)
ipaddress (0.8.3)
irb (1.15.3)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
@@ -468,7 +480,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
loofah (2.24.1)
loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.9.0)
@@ -491,7 +503,8 @@ GEM
logger
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.26.2)
minitest (6.0.1)
prism (~> 1.5)
monetize (1.13.0)
money (~> 6.12)
money (6.16.0)
@@ -511,9 +524,9 @@ GEM
timeout
net-smtp (0.5.1)
net-protocol
newrelic_rpm (9.23.0)
newrelic_rpm (9.24.0)
nio4r (2.7.5)
nokogiri (1.18.10)
nokogiri (1.19.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri-html5-inference (0.3.0)
@@ -530,7 +543,7 @@ GEM
logger
rack (>= 2.2.3)
rack-protection
omniauth-rails_csrf_protection (1.0.2)
omniauth-rails_csrf_protection (2.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth_openid_connect (0.8.0)
@@ -551,6 +564,7 @@ GEM
webfinger (~> 2.0)
orm_adapter (0.5.0)
ostruct (0.6.1)
package_json (0.2.0)
pagy (9.4.0)
paper_trail (17.0.0)
activerecord (>= 7.1)
@@ -558,7 +572,7 @@ GEM
parallel (1.27.0)
paranoia (2.6.4)
activerecord (>= 5.1, < 7.2)
parser (3.3.10.0)
parser (3.3.10.1)
ast (~> 2.4.1)
racc
paypal-sdk-core (0.3.4)
@@ -576,15 +590,16 @@ GEM
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.6.0)
prism (1.9.0)
private_address_check (0.5.0)
pry (0.15.2)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
psych (5.2.6)
reline (>= 0.6.0)
psych (5.3.1)
date
stringio
public_suffix (6.0.2)
public_suffix (7.0.0)
puffing-billy (4.0.2)
addressable (~> 2.5)
em-http-request (~> 1.1, >= 1.1.0)
@@ -613,7 +628,7 @@ GEM
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.6)
rack-proxy (0.7.7)
rack
rack-rewrite (1.5.1)
rack-session (1.0.2)
@@ -676,19 +691,13 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdf (3.3.4)
rdf (3.3.1)
bcp47_spec (~> 0.2)
bigdecimal (~> 3.1, >= 3.1.5)
link_header (~> 0.0, >= 0.0.8)
logger (~> 1.5)
ostruct (~> 0.6)
readline (~> 0.0)
rdoc (6.16.0)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
tsort
readline (0.0.4)
reline
redcarpet (3.6.1)
redis (5.4.1)
redis-client (>= 0.22.0)
@@ -699,9 +708,9 @@ GEM
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
responders (3.2.0)
actionpack (>= 7.0)
railties (>= 7.0)
rexml (3.4.4)
roadie (5.2.1)
css_parser (~> 1.4)
@@ -767,9 +776,9 @@ GEM
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.48.0)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
prism (~> 1.7)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
@@ -782,7 +791,7 @@ GEM
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.8.0)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.81)
rubocop-rspec_rails (2.32.0)
@@ -803,23 +812,23 @@ GEM
sanitize (7.0.0)
crass (~> 1.0.2)
nokogiri (>= 1.16.8)
sass (3.4.25)
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)
sd_notify (0.1.1)
securerandom (0.4.1)
semantic_range (3.0.0)
semantic_range (3.1.0)
shakapacker (8.4.0)
activesupport (>= 5.2)
package_json
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
shoulda-matchers (7.0.1)
activesupport (>= 7.1)
sidekiq (7.2.4)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.19.0)
sidekiq (7.3.10)
base64
connection_pool (>= 2.3.0, < 3)
logger
rack (>= 2.2.4, < 3.3)
redis-client (>= 0.23.0, < 1)
sidekiq-scheduler (5.0.3)
rufus-scheduler (~> 3.2)
sidekiq (>= 6, < 8)
@@ -867,24 +876,24 @@ GEM
railties (>= 5.2)
redis (>= 4.0, < 6.0)
stringex (2.8.6)
stringio (3.1.8)
stripe (13.5.1)
stringio (3.2.0)
stripe (15.5.0)
swd (2.0.3)
activesupport (>= 3)
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
sysexits (1.2.0)
temple (0.8.2)
taler (0.1.0)
temple (0.10.4)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.4.0)
thor (1.5.0)
thread-local (1.1.0)
tilt (2.6.1)
timeout (0.4.4)
timeout (0.6.0)
tsort (0.2.0)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
ttfunk (1.7.0)
turbo-rails (2.0.20)
actionpack (>= 7.1.0)
railties (>= 7.1.0)
@@ -902,8 +911,8 @@ GEM
simplecov_json_formatter
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uniform_notifier (1.17.0)
unicode-emoji (4.2.0)
uniform_notifier (1.18.0)
uri (1.1.1)
valid_email2 (5.2.3)
activemodel (>= 3.2)
@@ -913,7 +922,8 @@ GEM
public_suffix
validates_lengths_from_database (0.8.0)
activerecord (>= 4)
vcr (6.2.0)
vcr (6.3.1)
base64
view_component (4.1.1)
actionview (>= 7.1.0, < 8.2)
activesupport (>= 7.1.0, < 8.2)
@@ -935,15 +945,10 @@ GEM
activesupport
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.25.1)
webmock (3.26.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.9.2)
websocket-driver (0.7.7)
base64
@@ -951,14 +956,11 @@ GEM
websocket-extensions (0.1.5)
whenever (1.1.0)
chronic (>= 0.6.3)
wicked_pdf (2.8.2)
activesupport
ostruct
wkhtmltopdf-binary (0.12.6.10)
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.7.3)
zeitwerk (2.7.4)
PLATFORMS
ruby
@@ -1016,7 +1018,7 @@ DEPENDENCIES
good_migrations
haml
haml_lint
highline (= 2.0.3)
highline
i18n
i18n-js (~> 3.9.0)
i18n-tasks
@@ -1080,6 +1082,7 @@ DEPENDENCIES
rubocop-rspec_rails
sd_notify
select2-rails!
shakapacker (= 8.4.0)
shoulda-matchers
sidekiq
sidekiq-scheduler
@@ -1093,7 +1096,8 @@ DEPENDENCIES
stimulus_reflex
stimulus_reflex_testing!
stringex (~> 2.8.5)
stripe (~> 13)
stripe (~> 15)
taler
turbo-rails
turbo_power
undercover
@@ -1105,13 +1109,12 @@ DEPENDENCIES
web!
web-console
webmock
webpacker (~> 5)
whenever
wicked_pdf
wicked_pdf!
wkhtmltopdf-binary
RUBY VERSION
ruby 3.2.9p265
ruby 3.4.8p72
BUNDLED WITH
2.4.19
4.0.3

View File

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

View File

@@ -1,5 +1,5 @@
# Foreman Procfile for Docker env. Start all dev server processes with: `bundle exec foreman start -f Procfile.docker`
webpack: WEBPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/webpack-dev-server
webpack: SHAKAPACKER_DEV_SERVER_HOST=0.0.0.0 ./bin/shakapacker-dev-server
sidekiq: DEV_CACHING=true bundle exec sidekiq -q mailers -q default
rails: WEBPACKER_DEV_SERVER_HOST=0.0.0.0 DEV_CACHING=true bundle exec rails s -p 3000 -b 0.0.0.0
rails: SHAKAPACKER_DEV_SERVER_HOST=0.0.0.0 DEV_CACHING=true bundle exec rails s -p 3000 -b 0.0.0.0

View File

@@ -38,16 +38,13 @@ angular.module("admin.indexUtils").directive "objForUpdate", (switchClass, pendi
# To ensure the customer is still updated, we check on the $destroy event to see if
# the attribute has changed, if so we queue up the change.
scope.$on '$destroy', (value) ->
# No update
return if scope.object()[scope.attr] is scope.savedValue
currentValue = scope.object()[scope.attr] || ""
# For some reason the code attribute is removed from the object when cleared, so we add
# an emptyvalue so it gets updated properly
if scope.attr is "code" and scope.object()[scope.attr] is undefined
scope.object()["code"] = ""
# No update
return if currentValue is scope.savedValue
# Queuing up change
addPendingChange(scope.attr, scope.object()[scope.attr])
addPendingChange(scope.attr, currentValue)
# private

View File

@@ -1,2 +0,0 @@
angular.module('Darkswarm').controller "TmpCtrl", ($scope)->
$scope.test = {foo: "bar"}

View File

@@ -1 +0,0 @@
@import './mail/all.scss';

View File

@@ -1,3 +0,0 @@
@import '../../../webpacker/css/admin/globals/palette.scss';
@import 'email';
@import 'payments_list';

View File

@@ -1,4 +1,4 @@
= render ConfirmModalComponent.new(id: dom_id(@order, :ship), confirm_reflexes: "click->Admin::OrdersReflex#ship", controller: "orders", reflex: "Admin::Orders#ship") do
= render ConfirmModalComponent.new(id: dom_id(@order, :ship), confirm_actions: "click->modal#close", confirm_reflexes: "click->Admin::OrdersReflex#ship", controller: "orders", reflex: "Admin::Orders#ship") do
%div{class: "margin-bottom-30"}
%p= t('spree.admin.orders.shipment.mark_as_shipped_message_html')
%div{class: "margin-bottom-30"}

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
class WebhookEndpointFormComponent < ViewComponent::Base
def initialize(webhooks:, webhook_type:)
@webhooks = webhooks
@webhook_type = webhook_type
end
private
attr_reader :webhooks, :webhook_type
def is_webhook_payment_status?
webhook_type == "payment_status_changed"
end
end

View File

@@ -0,0 +1,27 @@
-# Create new endpoints
- if webhooks.empty? # Only one allowed for now.
%tr
%td= t("components.webhook_endpoint_form.event_types.#{webhook_type}")
%td
= form_with(url: helpers.account_webhook_endpoints_path, id: "#{webhook_type}_webhook_endpoint") do |f|
= f.url_field :'webhook_endpoint[url]', id: "#{webhook_type}_webhook_endpoint_url", placeholder: t('components.webhook_endpoint_form.url.create_placeholder'), required: true, size: 64
= f.hidden_field :'webhook_endpoint[webhook_type]', id: "#{webhook_type}_webhook_endpoint_webhook_type", value: webhook_type
%td.actions
= button_tag t(:create), class: 'button primary tiny no-margin', form: "#{webhook_type}_webhook_endpoint"
-# Existing endpoints
- webhooks.each do |webhook_endpoint|
%tr
%td= t("components.webhook_endpoint_form.event_types.#{webhook_type}")
%td= webhook_endpoint.url
%td.actions.endpoints-actions
- if webhook_endpoint.persisted?
= button_to helpers.account_webhook_endpoint_path(webhook_endpoint), method: :delete,
class: "tiny alert no-margin",
data: { confirm: I18n.t(:are_you_sure) } do
= I18n.t(:delete)
- if is_webhook_payment_status?
= form_tag helpers.webhook_endpoint_test_account_path(webhook_endpoint), class: "button_to", 'data-turbo': true do
= button_tag type: "submit", class: "tiny alert no-margin", data: { confirm: I18n.t(:are_you_sure) } do
= I18n.t("components.webhook_endpoint_form.test_endpoint")

View File

@@ -162,6 +162,18 @@ module Admin
end
end
def destroy
if @object.destroy
flash.now[:success] = flash_message_for(@object, :successfully_removed)
else
flash.now[:error] = @object.errors.full_messages.to_sentence
end
respond_to do |format|
format.turbo_stream { render :destroy, status: :ok }
end
end
protected
def delete_custom_tab

View File

@@ -7,6 +7,7 @@ module Admin
before_action :init_filters_params
before_action :init_pagination_params
before_action :init_none_tag
def index
fetch_products
@@ -179,6 +180,8 @@ module Admin
product_query = OpenFoodNetwork::Permissions.new(spree_current_user)
.editable_products.merge(product_scope_with_includes).ransack(ransack_query).result
product_query = apply_tags_filter(product_query)
# Postgres requires ORDER BY expressions to appear in the SELECT list when using DISTINCT.
# When the current ransack sort uses the computed stock columns, include them in the select
# so the generated COUNT/DISTINCT query is valid.
@@ -225,12 +228,51 @@ module Admin
query.merge!(Spree::Variant::SEARCH_KEY => @search_term)
end
query.merge!(variants_primary_taxon_id_in: @category_id) if @category_id.present?
query.merge!(variants_tags_name_in: @tags) if @tags.present?
query.merge!(@q) if @q
query
end
# Apply tags filter with OR logic:
# - Products with variants having selected tags
# - OR products with variants having no tags (when "None" is selected)
#
# Note: This cannot be implemented using Ransack because Ransack applies
# AND semantics across associations and cannot express OR logic that combines
# the presence and absence of the same associated records.
def apply_tags_filter(base_query)
return base_query if @tags.blank?
tag_names = Array(@tags).dup
has_none_tag = (tag_names.delete(@none_tag_value) == @none_tag_value)
queries = []
if tag_names.any?
# Products with at least one variant having one of the selected tags
tagged_product_ids = Spree::Variant
.joins(taggings: :tag)
.where(tags: { name: tag_names })
.select(:product_id)
queries << base_query.where(id: tagged_product_ids)
end
if has_none_tag
# Products where no variants have any tags
tagged_product_ids = Spree::Variant
.joins(:taggings)
.select(:product_id)
queries << base_query.where.not(id: tagged_product_ids)
end
return base_query if queries.empty?
# Combine queries using ActiveRecord's or method
queries.reduce { |combined, query| combined.or(query) }
end
# Optimise by pre-loading required columns
def product_query_includes
[
@@ -289,6 +331,10 @@ module Admin
t('.error')
end
end
def init_none_tag
@none_tag_value = '""'
end
end
end
# rubocop:enable Metrics/ClassLength

View File

@@ -61,7 +61,7 @@ module Admin
def destroy
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }
@@ -76,7 +76,7 @@ module Admin
protected
def resource_not_found
flash[:error] = flash_message_for(model_class.new, :not_found)
flash[:error] = Spree.t(:not_found)
redirect_to collection_url
end

View File

@@ -6,7 +6,7 @@ module Admin
class StripeAccountsController < Spree::Admin::BaseController
def connect
payload = params.permit(:enterprise_id).to_h
key = Openfoodnetwork::Application.config.secret_token
key = Rails.application.secret_key_base
url_params = { state: JWT.encode(payload, key, 'HS256'), scope: "read_write" }
redirect_to Stripe::OAuth.authorize_url(url_params)
end

View File

@@ -30,7 +30,7 @@ module Admin
status = :ok
if @rule.destroy
flash[:success] = Spree.t(:successfully_removed, resource: "Tag Rule")
flash[:success] = Spree.t(:successfully_removed, resource: Spree.t(:tag_rule))
else
flash.now[:error] = t(".destroy_error")
status = :internal_server_error

View File

@@ -14,7 +14,7 @@ module Admin
)
if @voucher.save
flash[:success] = I18n.t(:successfully_created, resource: "Voucher")
flash[:success] = I18n.t(:successfully_created, resource: Spree.t(:voucher))
redirect_to edit_admin_enterprise_path(@enterprise, anchor: :vouchers_panel)
else
render_error

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module PaymentGateways
class TalerController < BaseController
include OrderCompletion
# The Taler merchant backend has taken the payment.
# Now we just need to confirm that and update our local database
# before finalising the order.
def confirm
payment = Spree::Payment.find(params[:payment_id])
@order = payment.order
process_payment_completion!
end
end
end

View File

@@ -68,7 +68,7 @@ module Spree
destroy_before
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
end
redirect_to location_after_save

View File

@@ -11,10 +11,11 @@ module Spree
respond_to :html
PAYMENT_METHODS = %w{
Spree::PaymentMethod::Check
Spree::Gateway::PayPalExpress
Spree::Gateway::StripeSCA
}.index_with(&:constantize).freeze
Spree::PaymentMethod::Check
Spree::PaymentMethod::Taler
}.freeze
def create
force_environment
@@ -95,7 +96,7 @@ module Spree
@payment_method = PaymentMethod.find(params[:pm_id])
end
else
@payment_method = PAYMENT_METHODS.fetch(params[:provider_type], PaymentMethod).new
@payment_method = PaymentMethod.new(type: params[:provider_type])
end
render partial: 'provider_settings'
@@ -117,7 +118,7 @@ module Spree
end
def validate_payment_method_provider
valid_payment_methods = Rails.application.config.spree.payment_methods.map(&:to_s)
valid_payment_methods = PAYMENT_METHODS
return if valid_payment_methods.include?(params[:payment_method][:type])
flash[:error] = Spree.t(:invalid_payment_provider)
@@ -133,13 +134,11 @@ module Spree
end
def load_providers
providers = Gateway.providers.sort_by(&:name)
providers = PAYMENT_METHODS.dup
unless show_stripe?
providers.reject! { |provider| stripe_provider?(provider) }
end
providers.delete("Spree::Gateway::StripeSCA") unless show_stripe?
providers
providers.map(&:constantize)
end
# Show Stripe as an option if enabled, or if the
@@ -164,10 +163,6 @@ module Spree
@payment_method.try(:type) == "Spree::Gateway::StripeSCA"
end
def stripe_provider?(provider)
provider.name.ends_with?("StripeSCA")
end
def base_params
@base_params ||= PermittedAttributes::PaymentMethod.new(params[:payment_method]).
call.to_h.with_indifferent_access

View File

@@ -16,7 +16,7 @@ module Spree
@url_filters = ::ProductFilters.new.extract(request.query_parameters)
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
end
# if destroy fails it won't show any errors to the user
redirect_to spree.admin_product_product_properties_url(params[:product_id], @url_filters)

View File

@@ -36,7 +36,7 @@ module Spree
end
@object.touch :deleted_at
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }

View File

@@ -5,7 +5,7 @@ module Spree
class TaxCategoriesController < ::Admin::ResourceController
def destroy
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }

View File

@@ -9,7 +9,6 @@ module Spree
include Spree::Core::ControllerHelpers::Auth
include Spree::Core::ControllerHelpers::Common
include Spree::Core::ControllerHelpers::Order
include CablecarResponses
helper 'spree/base'
@@ -24,14 +23,12 @@ module Spree
if spree_user_signed_in?
flash[:success] = t('devise.success.logged_in_succesfully')
render cable_ready: cable_car.redirect_to(
url: return_url_or_default(after_sign_in_path_for(spree_current_user))
)
redirect_to return_url_or_default(after_sign_in_path_for(spree_current_user))
else
render status: :unauthorized, cable_ready: cable_car.inner_html(
"#login-feedback",
partial("layouts/alert", locals: { type: "alert", message: t('devise.failure.invalid') })
)
message = t('devise.failure.invalid')
render turbo_stream: turbo_stream.update(
'login-feedback', partial: 'layouts/alert', locals: { message:, type: 'alert' }
), status: :unprocessable_entity
end
end
@@ -60,11 +57,13 @@ module Spree
end
def render_unconfirmed_response
render status: :unprocessable_entity, cable_ready: cable_car.inner_html(
"#login-feedback",
partial("layouts/alert", locals: { type: "alert", message: t(:email_unconfirmed),
unconfirmed: true, tab: "login" })
)
message = t(:email_unconfirmed)
render turbo_stream: turbo_stream.update(
'login-feedback',
partial: 'layouts/alert', locals: { type: "alert", message:, unconfirmed: true,
tab: "login", email: params.dig(:spree_user, :email) }
), status: :unprocessable_entity
end
def ensure_valid_locale_persisted

View File

@@ -3,7 +3,6 @@
module Spree
class UsersController < ::BaseController
include I18nHelper
include CablecarResponses
layout 'darkswarm'
@@ -25,34 +24,17 @@ module Spree
@unconfirmed_email = spree_current_user.unconfirmed_email
end
# Endpoint for queries to check if a user is already registered
def registered_email
registered = Spree::User.find_by(email: params[:email]).present?
if registered
render status: :ok, cable_ready: cable_car.
inner_html(
"#login-feedback",
partial("layouts/alert",
locals: { type: "alert", message: t('devise.failure.already_registered') })
).
dispatch_event(name: "login:modal:open")
else
head :not_found
end
end
def create
@user = Spree::User.new(user_params)
if @user.save
flash[:success] = t('devise.user_registrations.spree_user.signed_up_but_unconfirmed')
render cable_ready: cable_car.redirect_to(url: main_app.root_path)
redirect_to main_app.root_path
else
render status: :unprocessable_entity, cable_ready: cable_car.morph(
"#signup-tab",
partial("layouts/signup_tab", locals: { signup_form_user: @user })
)
render turbo_stream: turbo_stream.update(
'signup-tab',
partial: 'layouts/signup_tab', locals: { signup_form_user: @user }
), status: :unprocessable_entity
end
end
@@ -97,13 +79,10 @@ module Spree
end
def render_alert_timestamp_error_message
render cable_ready: cable_car.inner_html(
"#signup-feedback",
partial("layouts/alert",
locals: {
type: "alert",
message: InvisibleCaptcha.timestamp_error_message
})
render turbo_stream: turbo_stream.update(
'signup-feedback',
partial: 'layouts/alert',
locals: { type: "alert", message: InvisibleCaptcha.timestamp_error_message }
)
end
end

View File

@@ -3,7 +3,6 @@
class UserConfirmationsController < DeviseController
# Needed for access to current_ability, so we can authorize! actions
include Spree::Core::ControllerHelpers::Auth
include CablecarResponses
# GET /resource/confirmation?confirmation_token=abcdef
def show
@@ -29,12 +28,12 @@ class UserConfirmationsController < DeviseController
set_flash_message(:error, :confirmation_not_sent)
end
else
render cable_ready: cable_car.inner_html(
"##{params[:tab] || 'forgot'}-feedback",
partial("layouts/alert",
locals: { type: "success", message: t("devise.confirmations.send_instructions") })
flash.now[:sucess] = t("devise.confirmations.send_instructions")
return render turbo_stream: turbo_stream.update(
"#{params[:tab] || 'forgot'}-feedback",
partial: 'shared/flashes', locals: { flashes: flash }
)
return
end
respond_with_navigational(resource){ redirect_to login_path }

View File

@@ -1,37 +1,40 @@
# frozen_string_literal: true
class UserPasswordsController < Spree::UserPasswordsController
include CablecarResponses
layout 'darkswarm'
def create
return render_unconfirmed_response if user_unconfirmed?
self.resource = resource_class.send_reset_password_instructions(raw_params[resource_name])
status = :ok
if resource.errors.empty?
render cable_ready: cable_car.inner_html(
"#forgot-feedback",
partial("layouts/alert", locals: { type: "success", message: t(:password_reset_sent) })
)
message, type = [t(:password_reset_sent), :success]
else
render status: :not_found, cable_ready: cable_car.inner_html(
"#forgot-feedback",
partial("layouts/alert", locals: { type: "alert", message: t(:email_not_found) })
)
message, type = [t(:email_not_found), :alert]
status = :not_found
end
render turbo_stream: turbo_stream.update(
'forgot-feedback',
partial: 'layouts/alert',
locals: { type:, message:, tab: 'forgot',
unconfirmed: false, email: params.dig(:spree_user, :email) }
), status:
end
private
def render_unconfirmed_response
render status: :unprocessable_entity, cable_ready: cable_car.inner_html(
"#forgot-feedback",
partial("layouts/alert",
locals: { type: "alert", message: t(:email_unconfirmed),
unconfirmed: true, tab: "forgot" })
)
message, type, unconfirmed, tab = [t(:email_unconfirmed), :alert, true, 'forgot']
render turbo_stream: turbo_stream.update(
'forgot-feedback',
partial: 'layouts/alert',
locals: { type:, message:, tab:,
unconfirmed:, email: params.dig(:spree_user, :email) }
), status: :unprocessable_entity
end
def user_unconfirmed?

View File

@@ -90,11 +90,13 @@ class VoucherAdjustmentsController < BaseController
voucher_code: voucher_params[:voucher_code], enterprise: @order.distributor
)
voucher = vine_voucher_validator.validate
errors = vine_voucher_validator.errors
return nil if vine_voucher_validator.errors[:not_found_voucher].present?
return nil if errors[:not_found_voucher].present?
if vine_voucher_validator.errors.present?
@order.errors.add(:voucher_code, I18n.t('checkout.errors.add_voucher_error'))
if errors.present?
message = errors[:invalid_voucher] || I18n.t('checkout.errors.add_voucher_error')
@order.errors.add(:voucher_code, message)
return nil
end

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
class WebhookEndpointsController < BaseController
before_action :load_resource, only: :destroy
before_action :load_resource, only: [:destroy, :test]
def create
webhook_endpoint = spree_current_user.webhook_endpoints.new(webhook_endpoint_params)
@@ -25,12 +25,30 @@ class WebhookEndpointsController < BaseController
redirect_to redirect_path
end
def test
at = Time.zone.now
test_payload = Payments::WebhookPayload.test_data.to_hash
WebhookDeliveryJob.perform_later(@webhook_endpoint.url, "payment.completed", test_payload, at:)
flash[:success] = t(".success")
respond_with do |format|
format.turbo_stream do
render turbo_stream: turbo_stream.update(
:flashes, partial: "shared/flashes", locals: { flashes: flash }
)
end
end
end
private
def load_resource
@webhook_endpoint = spree_current_user.webhook_endpoints.find(params[:id])
end
def webhook_endpoint_params
params.require(:webhook_endpoint).permit(:url)
params.require(:webhook_endpoint).permit(:url, :webhook_type)
end
def redirect_path

View File

@@ -72,7 +72,23 @@ module ApplicationHelper
end
end
# Update "v1" to invalidate existing cache key
def cache_key_with_locale(key, locale)
Array.wrap(key) + [locale.to_s, I18nDigests.for_locale(locale)]
Array.wrap(key) + ["v3", locale.to_s, I18nDigests.for_locale(locale)]
end
def pdf_stylesheet_pack_tag(source)
# With shakapacker dev server running, the wicked_pdf_stylesheet_pack_tag will produce a
# relative path, because we don't have `config.action_controller.asset_host`. Relative path
# can't be resolved by `wkhtmltopdf`. So we pass the wepacker dev server host and port to
# the shakapacker helper, so it generates the correct url.
# For more info: https://stackoverflow.com/questions/58490299/how-to-include-css-stylesheet-into-wicked-pdf/60541688#60541688
if running_in_development?
options = { media: "all",
host: "#{Shakapacker.dev_server.host}:#{Shakapacker.dev_server.port}" }
stylesheet_pack_tag(source, **options)
else
wicked_pdf_stylesheet_pack_tag(source)
end
end
end

View File

@@ -63,8 +63,11 @@ module EnterprisesHelper
url = object_url(enterprise)
name = t(:delete)
options = {}
options[:class] = "delete-resource"
options[:data] = { action: 'remove', confirm: enterprise_confirm_delete_message(enterprise) }
options[:data] = {
turbo: true,
'turbo-method': 'delete',
'turbo-confirm': enterprise_confirm_delete_message(enterprise)
}
link_to_with_icon 'icon-trash', name, url, options
end

View File

@@ -12,7 +12,10 @@ class ApplicationRecord < ActiveRecord::Base
self.include_root_in_json = true
def self.image_service
ENV["S3_BUCKET"].present? ? :amazon_public : :local
return :local if ENV["S3_BUCKET"].blank?
return :amazon_public if ENV["S3_ENDPOINT"].blank?
:s3_compatible_storage_public
end
# We might have a development environment without S3 but with a database

View File

@@ -50,11 +50,11 @@ class Enterprise < ApplicationRecord
has_many :distributed_orders, class_name: 'Spree::Order',
foreign_key: 'distributor_id',
inverse_of: :distributor,
dependent: :restrict_with_exception
dependent: :restrict_with_error
belongs_to :address, class_name: 'Spree::Address'
belongs_to :business_address, optional: true, class_name: 'Spree::Address', dependent: :destroy
has_many :enterprise_fees, dependent: :restrict_with_exception
has_many :enterprise_fees, dependent: :restrict_with_error
has_many :enterprise_roles, dependent: :destroy
has_many :users, through: :enterprise_roles
belongs_to :owner, class_name: 'Spree::User',
@@ -62,18 +62,18 @@ class Enterprise < ApplicationRecord
has_many :distributor_payment_methods,
inverse_of: :distributor,
foreign_key: :distributor_id,
dependent: :restrict_with_exception
dependent: :restrict_with_error
has_many :distributor_shipping_methods,
inverse_of: :distributor,
foreign_key: :distributor_id,
dependent: :restrict_with_exception
dependent: :restrict_with_error
has_many :payment_methods, through: :distributor_payment_methods
has_many :shipping_methods, through: :distributor_shipping_methods
has_many :customers, dependent: :destroy
has_many :inventory_items, dependent: :destroy
has_many :tag_rules, dependent: :destroy
has_one :stripe_account, dependent: :destroy
has_many :vouchers, dependent: :restrict_with_exception
has_many :vouchers, dependent: :restrict_with_error
has_many :connected_apps, dependent: :destroy
has_many :dfc_permissions, dependent: :destroy
has_one :custom_tab, dependent: :destroy
@@ -111,14 +111,14 @@ class Enterprise < ApplicationRecord
end
validates :logo,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ::Spree::Image::ACCEPTED_CONTENT_TYPES
validates :promo_image,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ::Spree::Image::ACCEPTED_CONTENT_TYPES
validates :white_label_logo,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ::Spree::Image::ACCEPTED_CONTENT_TYPES
validates :terms_and_conditions, content_type: {
in: "application/pdf",
message: I18n.t(:enterprise_terms_and_conditions_type_error),

View File

@@ -29,11 +29,11 @@ class EnterpriseGroup < ApplicationRecord
has_one_attached :promo_image, service: image_service
validates :logo,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ::Spree::Image::ACCEPTED_CONTENT_TYPES
validates :promo_image,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ::Spree::Image::ACCEPTED_CONTENT_TYPES
scope :by_position, -> { order('position ASC') }
scope :on_front_page, -> { where(on_front_page: true) }

View File

@@ -95,8 +95,8 @@ class Invoice
def display_line_item_tax_rate(item)
all_tax_adjustments.select { |a|
a.adjustable.type == 'Spree::LineItem' && a.adjustable.id == item.id
}.map(&:originator).map { |tr|
number_to_percentage(tr.amount * 100, precision: 1)
}.map(&:originator).map(&:amount).sort.map { |amount|
number_to_percentage(amount * 100, precision: 1)
}.join(", ")
end

View File

@@ -31,7 +31,6 @@ module Spree
preference :admin_products_per_page, :integer, default: 10
# Should only be true if you don't need to track inventory
preference :allow_backorder_shipping, :boolean, default: false
preference :allow_checkout_on_gateway_error, :boolean, default: false
preference :allow_guest_checkout, :boolean, default: true
preference :currency_decimal_mark, :string, default: "."
preference :currency_symbol_position, :string, default: "before"

View File

@@ -2,6 +2,8 @@
module Spree
class Image < Asset
ACCEPTED_CONTENT_TYPES = %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
has_one_attached :attachment, service: image_service do |attachment|
attachment.variant :mini, resize_to_fill: [48, 48]
attachment.variant :small, resize_to_fill: [227, 227]
@@ -11,8 +13,8 @@ module Spree
validates :attachment,
attached: true,
processable_image: true,
content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
processable_file: true,
content_type: ACCEPTED_CONTENT_TYPES
validate :no_attachment_errors
def self.default_image_url(size)

View File

@@ -24,6 +24,8 @@ module Spree
before_validation :copy_price
before_validation :copy_tax_category
before_validation :copy_dimensions
before_validation :copy_product_name, on: :create
before_validation :copy_variant_name, on: :create
validates :quantity, numericality: {
only_integer: true,
@@ -250,6 +252,18 @@ module Spree
adjustments.enterprise_fee
end
def full_variant_name
return variant_name if variant_name.present?
variant.full_name
end
def full_product_name
return product_name if product_name.present?
variant.product.name
end
private
def computed_weight_from_variant
@@ -274,6 +288,18 @@ module Spree
order.create_tax_charge!
end
def copy_product_name
return if variant.nil? || variant.product.nil?
self.product_name = variant.product.name
end
def copy_variant_name
return if variant.nil?
self.variant_name = variant.full_name
end
def update_inventory_before_destroy
# This is necessary before destroying the line item
# so that update_inventory will restore stock to the variant

View File

@@ -437,18 +437,13 @@ module Spree
#
# Returns:
# - true if all pending_payments processed successfully
# - true if a payment failed, ie. raised a GatewayError
# which gets rescued and converted to TRUE when
# :allow_checkout_gateway_error is set to true
# - false if a payment failed, ie. raised a GatewayError
# which gets rescued and converted to FALSE when
# :allow_checkout_on_gateway_error is set to false
# which gets rescued and converted to FALSE
#
def process_payments!
process_each_payment(&:process!)
rescue Core::GatewayError => e
result = !!Spree::Config[:allow_checkout_on_gateway_error]
errors.add(:base, e.message) && (return result)
errors.add(:base, e.message) && (return false)
end
def process_payments_offline!

View File

@@ -101,6 +101,24 @@ module Spree
end
after_transition to: :completed, do: :set_captured_at
after_transition do |payment, transition|
# Catch any exceptions to prevent any rollback potentially
# preventing payment from going through
ActiveSupport::Notifications.instrument(
"ofn.payment_transition", payment: payment, event: transition.to
)
rescue StandardError => e
Rails.logger.fatal "ActiveSupport::Notification.instrument failed params: " \
"<event_type:ofn.payment_transition> " \
"<payment_id:#{payment.id}> " \
"<event:#{transition.to}>"
Alert.raise(
e,
metadata: {
event_tye: "ofn.payment_transition", payment_id: payment.id, event: transition.to
}
)
end
end
def money

View File

@@ -183,6 +183,7 @@ module Spree
options.merge!({ billing_address: order.bill_address.try(:active_merchant_hash),
shipping_address: order.ship_address.try(:active_merchant_hash) })
options.merge!(payment: self)
options
end

View File

@@ -52,10 +52,6 @@ module Spree
.where(environment: [Rails.env, "", nil])
}
def self.providers
Rails.application.config.spree.payment_methods
end
def configured?
!stripe? || stripe_configured?
end
@@ -93,8 +89,8 @@ module Spree
type.demodulize.downcase
end
def self.find_with_destroyed(*args)
unscoped { find(*args) }
def self.find_with_destroyed(*)
unscoped { find(*) }
end
def payment_profiles_supported?
@@ -118,8 +114,8 @@ module Spree
end
def self.clean_name
i18n_key = "spree.admin.payment_methods.providers.#{name.demodulize.downcase}"
I18n.t(i18n_key)
scope = "spree.admin.payment_methods.providers"
I18n.t(name.demodulize.downcase, scope:)
end
private

View File

@@ -0,0 +1,94 @@
# frozen_string_literal: true
require "taler"
module Spree
class PaymentMethod
# GNU Taler is a distributed, open source payment system.
# You need a hosted Taler backend server to process payments.
#
# For testing, you can use the official demo backend:
#
# - Merchant UX: https://backend.demo.taler.net
# - Username: sandbox
# - Password: sandbox
#
# Configure this payment method for testing with:
#
# - backend_url: https://backend.demo.taler.net/instances/sandbox
# - api_key: sandbox
class Taler < PaymentMethod
preference :backend_url, :string
preference :api_key, :password
# Name of the view to display during checkout
def method_type
"check" # empty view
end
def external_gateway?
true
end
# The backend provides this URL. It can look like this:
# https://backend.demo.taler.net/instances/blog/orders/2026..?token=S8Y..&session_id=b0b..
def external_payment_url(options)
order = options.fetch(:order)
payment = load_payment(order)
payment.source ||= self
payment.response_code ||= create_taler_order(payment)
payment.redirect_auth_url ||= fetch_order_url(payment)
payment.save! if payment.changed?
payment.redirect_auth_url
end
# Main method called by Spree::Payment::Processing during checkout
# when the user is redirected back to the app.
#
# The payment has already been made and we need to verify the success.
def purchase(_money, _source, gateway_options)
payment = gateway_options[:payment]
return unless payment.response_code
taler_order = client.fetch_order(payment.response_code)
status = taler_order["order_status"]
success = (status == "paid")
message = I18n.t(status, default: status, scope: "taler.order_status")
ActiveMerchant::Billing::Response.new(success, message)
end
private
def load_payment(order)
order.payments.checkout.where(payment_method: self).last
end
def create_taler_order(payment)
# We are ignoring currency for now so that we can test with the
# current demo backend only working with the KUDOS currency.
taler_amount = "KUDOS:#{payment.amount}"
urls = Rails.application.routes.url_helpers
new_order = client.create_order(
taler_amount,
I18n.t("payment_method_taler.order_summary"),
urls.payment_gateways_confirm_taler_url(payment_id: payment.id),
)
new_order["order_id"]
end
def fetch_order_url(payment)
order = client.fetch_order(payment.response_code)
order["order_status_url"]
end
def client
@client ||= ::Taler::Client.new(preferred_backend_url, preferred_api_key)
end
end
end
end

View File

@@ -2,5 +2,11 @@
# Records a webhook url to send notifications to
class WebhookEndpoint < ApplicationRecord
WEBHOOK_TYPES = %w(order_cycle_opened payment_status_changed).freeze
validates :url, presence: true
validates :webhook_type, presence: true, inclusion: { in: WEBHOOK_TYPES }
scope :order_cycle_opened, -> { where(webhook_type: "order_cycle_opened") }
scope :payment_status, -> { where(webhook_type: "payment_status_changed") }
end

View File

@@ -11,7 +11,9 @@ class ImageImporter
image = Spree::Image.create do |img|
PrivateAddressCheck.only_public_connections do
img.attachment.attach(io: valid_url.open, filename:, metadata:)
io = valid_url.open
content_type = Marcel::MimeType.for(io)
img.attachment.attach(io:, filename:, metadata:, content_type:)
end
end
product.image = image if image

View File

@@ -77,7 +77,7 @@ class LineItemSyncer
end
def add_order_update_issue(order, line_item)
issue_description = "#{line_item.product.name} - #{line_item.variant.full_name}"
issue_description = "#{line_item.product.name} - #{line_item.full_variant_name}"
issue_description << " - #{stock_issue_description(line_item)}" if line_item.insufficient_stock?
order_update_issues.add(order, issue_description)
end

View File

@@ -11,10 +11,12 @@ module OrderCycles
.merge(coordinator_name: order_cycle.coordinator.name)
# Endpoints for coordinator owner
webhook_endpoints = order_cycle.coordinator.owner.webhook_endpoints
webhook_endpoints = order_cycle.coordinator.owner.webhook_endpoints.order_cycle_opened
# Plus unique endpoints for distributor owners (ignore duplicates)
webhook_endpoints |= order_cycle.distributors.map(&:owner).flat_map(&:webhook_endpoints)
webhook_endpoints |= order_cycle.distributors.map(&:owner).flat_map { |owner|
owner.webhook_endpoints.order_cycle_opened
}
webhook_endpoints.each do |endpoint|
WebhookDeliveryJob.perform_later(endpoint.url, event, webhook_payload, at:)

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
# Called by "ActiveSupport::Notifications" when an "ofn.payment_transition" occurs
# Event originate from Spree::Payment event machine
#
module Payments
class StatusChangedListenerService
def call(_name, started, _finished, _unique_id, payload)
event = "payment.#{payload[:event]}"
Payments::WebhookService.create_webhook_job(payment: payload[:payment], event:, at: started)
end
end
end

View File

@@ -0,0 +1,84 @@
# frozen_string_literal: true
module Payments
class WebhookPayload
def initialize(payment:, order:, enterprise:)
@payment = payment
@order = order
@enterprise = enterprise
end
def to_hash
{
payment: @payment.slice(:updated_at, :amount, :state),
enterprise: @enterprise.slice(:abn, :acn, :name)
.merge(address: @enterprise.address.slice(:address1, :address2, :city, :zipcode)),
order: @order.slice(:total, :currency).merge(line_items: line_items)
}.with_indifferent_access
end
def self.test_data
new(payment: test_payment, order: test_order, enterprise: test_enterprise)
end
def self.test_payment
{
updated_at: Time.zone.now,
amount: 0.00,
state: "completed"
}
end
def self.test_order
order = Spree::Order.new(
total: 0.00,
currency: "AUD",
)
tax_category = Spree::TaxCategory.new(name: "VAT")
product = Spree::Product.new(name: "Test product")
Spree::Variant.new(product:, display_name: "")
order.line_items << Spree::LineItem.new(
quantity: 1,
price: 20.00,
tax_category:,
product:,
unit_presentation: "1kg"
)
order
end
def self.test_enterprise
enterprise = Enterprise.new(
abn: "65797115831",
acn: "",
name: "TEST Enterprise",
)
enterprise.address = Spree::Address.new(
address1: "1 testing street",
address2: "",
city: "TestCity",
zipcode: "1234"
)
enterprise
end
private_class_method :test_payment, :test_order, :test_enterprise
private
def line_items
@order.line_items.map do |li|
li.slice(:quantity, :price)
.merge(
tax_category_name: li.tax_category&.name,
product_name: li.product.name,
name_to_display: li.display_name,
unit_to_display: li.unit_presentation
)
end
end
end
end

View File

@@ -0,0 +1,30 @@
# frozen_string_literal: true
# Create a webhook payload for a payment status event.
# The payload will be delivered asynchronously.
module Payments
class WebhookService
def self.create_webhook_job(payment:, event:, at:)
order = payment.order
payload = WebhookPayload.new(payment:, order:, enterprise: order.distributor).to_hash
coordinator = payment.order.order_cycle.coordinator
webhook_urls(coordinator).each do |url|
WebhookDeliveryJob.perform_later(url, event, payload, at:)
end
end
def self.webhook_urls(coordinator)
# url for coordinator owner
webhook_urls = coordinator.owner.webhook_endpoints.payment_status.pluck(:url)
# plus url for coordinator manager (ignore duplicate)
users_webhook_urls = coordinator.users.flat_map do |user|
user.webhook_endpoints.payment_status.pluck(:url)
end
webhook_urls | users_webhook_urls
end
end
end

View File

@@ -11,7 +11,7 @@ module PermittedAttributes
[:name, :description, :type, :active,
:environment, :display_on, :tag_list,
:preferred_enterprise_id, :preferred_server, :preferred_login, :preferred_password,
:calculator_type, :preferred_api_key,
:calculator_type, :preferred_api_key, :preferred_backend_url,
:preferred_signature, :preferred_solution, :preferred_landing_page, :preferred_logourl,
:preferred_test_mode, :calculator_type, { distributor_ids: [] },
{ calculator_attributes: PermittedAttributes::Calculator.attributes }]

View File

@@ -2,6 +2,11 @@
module Vine
class VoucherValidatorService
VINE_ERRORS = {
# https://github.com/openfoodfoundation/vine/blob/main/app/Enums/ApiResponse.php
"This voucher has expired." => :expired,
}.freeze
attr_reader :voucher_code, :errors
def initialize(voucher_code:, enterprise:)
@@ -42,8 +47,10 @@ module Vine
end
def handle_errors(response)
if response[:status] == 400
errors[:invalid_voucher] = I18n.t("vine_voucher_validator_service.errors.invalid_voucher")
if [400, 409].include?(response[:status])
message = response[:body] && JSON.parse(response[:body]).dig("meta", "message")
key = VINE_ERRORS.fetch(message, :invalid_voucher)
errors[:invalid_voucher] = I18n.t("vine_voucher_validator_service.errors.#{key}")
elsif response[:status] == 404
errors[:not_found_voucher] =
I18n.t("vine_voucher_validator_service.errors.not_found_voucher")

View File

@@ -22,7 +22,7 @@
%tbody
= f.fields_for :collection do |enterprise_form|
- enterprise = enterprise_form.object
%tr{class: "enterprise-#{enterprise.id}"}
%tr{class: "enterprise-#{enterprise.id}", id: "resource-#{enterprise.id}"}
%td= link_to enterprise.name, main_app.edit_admin_enterprise_path(enterprise)
%td
= enterprise_form.check_box :is_primary_producer

View File

@@ -0,0 +1,4 @@
- unless flash[:error]
= turbo_stream.remove "resource-#{@object.id}"
= turbo_stream.append "flashes" do
= render(partial: 'admin/shared/flashes', locals: { flashes: flash })

View File

@@ -18,7 +18,7 @@
%span{ "ofn-with-tip": '{{ orderCycle.producerNames }}', "ng-show": 'orderCycle.producers.length > 3' }
{{ orderCycle.producers.length }}
= t('.suppliers')
%span{ "ng-hide": 'orderCycle.producers.length > 3', "ng-bind": 'orderCycle.producerNames' }
%span{ "ng-hide": 'orderCycle.producers.length > 3', "ng-bind-html": 'orderCycle.producerNames' }
%td.coordinator{ "ng-show": 'columns.coordinator.visible', "ng-bind-html": 'orderCycle.coordinator.name' }
%td.shops{ "ng-show": 'columns.shops.visible' }
%span{ "ofn-with-tip": '{{ orderCycle.shopNames }}', "ng-show": 'orderCycle.shops.length > 3' }

View File

@@ -23,7 +23,7 @@
- select_tag_options = { class: "fullwidth",
multiple: true ,
data: { controller: "tom-select", "tom-select-placeholder-value": t(".select_tag"), "tom-select-options-value": '{ "maxItems": 5 , "plugins": { "remove_button": {} , "no_active_items": {}, "checkbox_options": { "checkedClassNames": ["ts-checked"], "uncheckedClassNames": ["ts-unchecked"] } } }' } }
= select_tag :tags_name_in, options_for_select(available_tags, tags), select_tag_options
= select_tag :tags_name_in, options_for_select(available_tags.unshift([t('.tags.none'), @none_tag_value]), tags), select_tag_options
.submit
.search-button
= button_tag t(".search"), class: "secondary icon-search relaxed", name: nil

View File

@@ -7,5 +7,6 @@
#no-products-actions
%a{ href: "/admin/products/new", class: "button icon-plus", icon: "icon-plus" }
= t(:new_product)
%a{ href: "/admin/products/import", class: "button icon-upload secondary", icon: "icon-upload" }
%a{ href: admin_product_import_path, class: "button icon-upload secondary", icon: "icon-upload" }
= t(".import_products")

View File

@@ -9,7 +9,7 @@
%td.col-sku.field.naked_inputs
= f.text_field :sku, 'aria-label': t('admin.products_page.columns.sku')
= error_message_on variant, :sku
%td.col-unir_scale.field.naked_inputs{ 'data-controller': 'toggle-control', 'data-toggle-control-match-value': 'items' }
%td.col-unit_scale.field.naked_inputs{ 'data-controller': 'toggle-control', 'data-toggle-control-match-value': 'items' }
= f.hidden_field :variant_unit
= f.hidden_field :variant_unit_scale
= f.select :variant_unit_with_scale,

View File

@@ -1,5 +1,5 @@
.alert-box{ class: "#{type}" }
= message
- if local_assigns[:unconfirmed]
%a{ "data-action": "login-modal#resend_confirmation", "data-tab": local_assigns[:tab] }
= link_to spree_user_confirmation_path(spree_user: { email: }, tab: local_assigns[:tab]), data: { turbo_method: :post } do
= t('devise.confirmations.resend_confirmation_email')

View File

@@ -1,12 +1,12 @@
#forgot-tab
= form_with url: spree_user_password_path, scope: :spree_user, data: { remote: "true" } do |form|
= form_with url: spree_user_password_path, scope: :spree_user, data: { turbo: true } do |form|
.row
.large-12.columns#forgot-feedback
.row
.large-12.columns
= form.label :email, t(:signup_email)
= form.email_field :email, { tabindex: 1, inputmode: "email", "data-login-modal-target": "email", "data-action": "input->login-modal#emailOnInput" }
= form.email_field :email, { tabindex: 1, inputmode: "email" }
.row
.large-12.columns
= form.submit t(:reset_password), { class: "button primary", tabindex: 2 }

View File

@@ -1,5 +1,5 @@
#login-content
= form_with url: spree_user_session_path, scope: :spree_user, data: { remote: "true" } do |form|
= form_with url: spree_user_session_path, scope: :spree_user, data: { turbo: true } do |form|
.row
.large-12.columns#login-feedback
- confirmation_result = request.query_parameters[:validation]
@@ -10,7 +10,7 @@
.row
.large-12.columns
= form.label :email, t(:email)
= form.email_field :email, { tabindex: 1, inputmode: "email", autocomplete: "off", "data-login-modal-target": "email", "data-action": "input->login-modal#emailOnInput" }
= form.email_field :email, { tabindex: 1, inputmode: "email", autocomplete: "off" }
.row
.large-12.columns
= form.label :password, t(:password)

View File

@@ -1,14 +1,14 @@
- signup_form_user = Spree::User.new if local_assigns[:signup_form_user].nil?
#signup-tab
= form_with model: signup_form_user, url: spree.account_path, scope: :user, data: { remote: "true" } do |form|
= form_with model: signup_form_user, url: spree.account_path, scope: :user, data: { turbo: true } do |form|
.row
.large-12.columns#signup-feedback
.row
.large-12.columns
= form.label :email, t(:signup_email)
= form.email_field :email, { tabindex: 1, "data-login-modal-target": "email", "data-action": "input->login-modal#emailOnInput" }
= form.email_field :email, { tabindex: 1 }
= form.error_message_on :email
.row
.large-12.columns

View File

@@ -13,12 +13,12 @@
- else
= favicon_link_tag "/favicon-staging.ico"
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
%link{href: asset_pack_path("media/fonts/OFN-v2.woff"), rel: "preload", as: "font", crossorigin: "anonymous"}
%link{href: asset_pack_path("static/OFN-v2.woff"), rel: "preload", as: "font", crossorigin: "anonymous"}
= render "layouts/matomo_tag"
= language_meta_tags
= stylesheet_pack_tag "darkswarm", "data-turbo-track": "reload", media: "screen"
= javascript_pack_tag "application", "data-turbo-track": "reload"
= javascript_pack_tag "application", "data-turbo-track": "reload", defer: false # do not use defer because our javascript currently depend on order of execution of loaded script.
= render "layouts/shopfront_script" if @shopfront_layout
= render "layouts/bugsnag_js"

View File

@@ -5,7 +5,7 @@
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title
= Spree::Config[:site_name]
= stylesheet_link_tag 'mail', media: "screen"
= stylesheet_pack_tag "mail", media: "screen"
%body{:bgcolor => "#FFFFFF" }
- unless @hide_ofn_navigation
%table.head-wrap

View File

@@ -16,7 +16,7 @@
= stylesheet_pack_tag "darkswarm", media: "screen"
= javascript_include_tag "darkswarm/all"
= javascript_pack_tag "application"
= javascript_pack_tag "application", defer: false # do not use defer because our javascript currently depend on order of execution of loaded script.
= csrf_meta_tags

View File

@@ -1,4 +1,4 @@
= wicked_pdf_stylesheet_link_tag "mail"
= pdf_stylesheet_pack_tag "mail"
%table{:width => "100%"}
%tbody

View File

@@ -1,4 +1,4 @@
= wicked_pdf_stylesheet_link_tag "mail"
= pdf_stylesheet_pack_tag "mail"
%table{:width => "100%"}
%tbody

View File

@@ -1,4 +1,4 @@
= wicked_pdf_stylesheet_link_tag "mail"
= pdf_stylesheet_pack_tag "mail"
%table{:width => "100%"}
%tbody
@@ -102,4 +102,4 @@
= render partial: 'spree/admin/orders/_invoice/order_note'
.text-center
= link_to_platform_terms
= link_to_platform_terms

View File

@@ -25,7 +25,7 @@
= render "spree/admin/shared/translations"
= render "spree/admin/shared/routes"
= javascript_pack_tag "admin", "data-turbo-track": "reload"
= javascript_pack_tag "admin", "data-turbo-track": "reload", defer: false # do not use defer because our javascript currently depend on order of execution of loaded script.
%script
= raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";"

View File

@@ -10,24 +10,5 @@
%th= t('.url.header')
%th.actions
%tbody
-# Existing endpoints
- @user.webhook_endpoints.each do |webhook_endpoint|
%tr
%td= t('.event_types.order_cycle_opened') # For now, we only support one type.
%td= webhook_endpoint.url
%td.actions
- if webhook_endpoint.persisted?
= button_to account_webhook_endpoint_path(webhook_endpoint), method: :delete,
class: "tiny alert no-margin",
data: { confirm: I18n.t(:are_you_sure)} do
= I18n.t(:delete)
-# Create new
- if @user.webhook_endpoints.empty? # Only one allowed for now.
%tr
%td= t('.event_types.order_cycle_opened') # For now, we only support one type.
%td
= form_for(@user.webhook_endpoints.build, url: account_webhook_endpoints_path, id: 'new_webhook_endpoint') do |f|
= f.url_field :url, placeholder: t('.url.create_placeholder'), required: true, size: 64
%td.actions
= button_tag t(:create), class: 'button primary tiny no-margin', form: 'new_webhook_endpoint'
= render WebhookEndpointFormComponent.new(webhooks: @user.webhook_endpoints.order_cycle_opened, webhook_type: "order_cycle_opened")
= render WebhookEndpointFormComponent.new(webhooks: @user.webhook_endpoints.payment_status, webhook_type: "payment_status_changed")

View File

@@ -1,8 +1,7 @@
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["background", "modal", "email"];
static values = { email: String };
static targets = ["background", "modal"];
connect() {
if (this.hasModalTarget) {
@@ -19,13 +18,6 @@ export default class extends Controller {
window.dispatchEvent(new Event("login:modal:open"));
}
emailOnInput(event) {
this.emailValue = event.currentTarget.value;
this.emailTargets.forEach((element) => {
element.value = this.emailValue;
});
}
open = () => {
if (!location.hash.substr(1).includes("/login")) {
history.pushState({}, "", "#/login");
@@ -57,19 +49,6 @@ export default class extends Controller {
}, 200);
}
resend_confirmation(event) {
fetch("/user/spree_user/confirmation", {
method: "POST",
body: JSON.stringify({
spree_user: { email: this.emailValue },
tab: event.currentTarget.dataset.tab,
}),
headers: { "Content-type": "application/json; charset=UTF-8" },
})
.then((data) => data.json())
.then(CableReady.perform);
}
returnHome() {
window.location = "/";
}

View File

@@ -2,19 +2,19 @@
// While in feature-toggle, we inherit all files from old admin design.
// Individual files may be copied in order to replace the old files.
@import "vendor/assets/stylesheets/normalize";
@import "vendor/assets/stylesheets/responsive-tables";
@import "vendor/assets/stylesheets/jquery.powertip";
@import "~jquery-ui/themes/base/core";
@import "~jquery-ui/themes/base/button";
@import "~jquery-ui/themes/base/resizable";
@import "vendor/assets/stylesheets/jquery-ui-theme";
@import "~jquery-ui/themes/base/dialog";
@import "assets/stylesheets/normalize";
@import "assets/stylesheets/responsive-tables";
@import "assets/stylesheets/jquery.powertip";
@import "jquery-ui/themes/base/core";
@import "jquery-ui/themes/base/button";
@import "jquery-ui/themes/base/resizable";
@import "assets/stylesheets/jquery-ui-theme";
@import "jquery-ui/themes/base/dialog";
@import "../shared/ng-tags-input.min";
@import "vendor/assets/stylesheets/select2.css.scss";
@import "~flatpickr/dist/flatpickr";
@import "~flatpickr/dist/themes/material_blue";
@import "~shortcut-buttons-flatpickr/dist/themes/light";
@import "assets/stylesheets/select2";
@import "flatpickr/dist/flatpickr";
@import "flatpickr/dist/themes/material_blue";
@import "shortcut-buttons-flatpickr/dist/themes/light";
@import "../admin/globals/functions";
@import "globals/palette"; // admin_v3
@@ -123,13 +123,13 @@
@import "shared/question-mark-icon";
@import "../admin/question-mark-tooltip";
@import "~tom-select/src/scss/tom-select.default";
@import "tom-select/src/scss/tom-select.default";
@import "components/tom_select"; // admin_v3
@import "app/components/modal_component/modal_component";
@import "app/components/vertical_ellipsis_menu_component/vertical_ellipsis_menu_component"; // admin_v3 and only V3
@import "app/components/tag_list_input_component/tag_list_input_component";
@import "app/webpacker/css/admin/trix.scss";
@import "modal_component/modal_component";
@import "vertical_ellipsis_menu_component/vertical_ellipsis_menu_component"; // admin_v3 and only V3
@import "tag_list_input_component/tag_list_input_component";
@import "admin/trix";
@import "terms_of_service_banner"; // admin_v3

View File

@@ -9,7 +9,8 @@
}
}
.saved_cards, .no_cards {
.saved_cards,
.no_cards {
margin-bottom: 1em;
}
@@ -26,7 +27,7 @@
}
}
.authorised_shops{
.authorised_shops {
table {
width: 100%;
}
@@ -39,7 +40,9 @@
a {
color: $clr-brick;
&:hover, &:active, &:focus {
&:hover,
&:active,
&:focus {
color: $clr-brick-med-bright;
}
}
@@ -60,7 +63,8 @@
}
}
i.ofn-i_059-producer, i.ofn-i_060-producer-reversed {
i.ofn-i_059-producer,
i.ofn-i_060-producer-reversed {
font-size: 3rem;
display: inline-block;
margin-right: 0.25rem;
@@ -92,7 +96,8 @@
visibility: hidden;
}
.transaction-group {}
.transaction-group {
}
table {
border-radius: $radius-medium $radius-medium 0 0;
@@ -161,6 +166,15 @@ table {
//
// Unfortunately we can't use Scss's interpolation
// https://sass-lang.com/documentation/interpolation. We're using a too old version perhaps?
right: calc(12px + 2*2px + 2*1px);
right: calc(12px + 2 * 2px + 2 * 1px);
}
}
// Webhook Endpoints
td.endpoints-actions {
display: flex;
form {
padding-right: $padding-small;
}
}

View File

@@ -1,10 +1,10 @@
@import 'vendor/assets/stylesheets/autocomplete';
@import 'vendor/assets/stylesheets/leaflet';
@import 'assets/stylesheets/autocomplete';
@import 'assets/stylesheets/leaflet';
@import 'variables';
@import '../shared/variables/layout';
@import '../shared/utilities';
@import '~foundation-sites/scss/foundation';
@import 'foundation-sites/scss/foundation';
@import 'big-input';
@import 'branding';
@@ -77,4 +77,4 @@ ofn-modal {
@import "../shared/question-mark-icon";
@import '../admin/shared/scroll_bar';
@import 'app/components/modal_component/modal_component';
@import 'modal_component/modal_component';

View File

@@ -1,4 +1,4 @@
@import "~foundation-sites/scss/foundation/components/global";
@import "foundation-sites/scss/foundation/components/global";
// Brand guide colours:
// International: #81c26e

View File

@@ -0,0 +1,3 @@
@import '../admin/globals/palette.scss';
@import 'email';
@import 'payments_list';

View File

@@ -9,7 +9,7 @@ document.addEventListener("turbo:frame-missing", (event) => {
event.preventDefault();
// show error message instead
showError(event.detail.response?.status);
showHttpError(event.detail.response?.status);
});
document.addEventListener("turbo:submit-end", (event) => {

View File

@@ -0,0 +1 @@
@import "../css/mail/all.scss";

View File

@@ -1,72 +1,6 @@
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')
module.exports = function (api) {
const defaultConfigFunc = require("shakapacker/package/babel/preset.js");
const resultConfig = defaultConfigFunc(api);
if (!validEnv.includes(currentEnv)) {
throw new Error(
'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
}
return {
presets: [
isTestEnv && [
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
(isProductionEnv || isDevelopmentEnv) && [
'@babel/preset-env',
{
forceAllTransforms: true,
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
].filter(Boolean),
plugins: [
'babel-plugin-macros',
'@babel/plugin-syntax-dynamic-import',
isTestEnv && 'babel-plugin-dynamic-import-node',
'@babel/plugin-transform-destructuring',
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
],
[
'@babel/plugin-proposal-object-rest-spread',
{
useBuiltIns: true
}
],
[
'@babel/plugin-transform-runtime',
{
helpers: false
}
],
[
'@babel/plugin-transform-regenerator',
{
async: false
}
],
["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
["@babel/plugin-proposal-private-methods", { "loose": true }]
].filter(Boolean)
}
}
return resultConfig;
};

View File

@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
#
# Install dependencies and migrate data during production deployments or
# when updating your development environment.
#
# Take care when changing it and consider the ofn-install repository for
# the context of deployments.
require "fileutils"
# path to your application root.
@@ -16,13 +22,13 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.
puts "== Installing dependencies =="
system! "script/install-bundler"
# Check first (it's quicker), then install new gems if necessary
system("bundle check 2> /dev/null") || system!(BUNDLE_ENV, "bundle install")
# Install JavaScript dependencies
system("script/nodenv-install.sh")
system("bin/yarn")
system!("script/nodenv-install.sh")
system!("bin/yarn")
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
@@ -31,6 +37,16 @@ FileUtils.chdir APP_ROOT do
puts "\n== Preparing database, removing old logs and tempfiles =="
system! "bin/rails db:prepare log:clear tmp:clear"
system! "rm -f tmp/capybara/screenshots/*.png"
system! "rm -f tmp/invoices/*.pdf"
system! "rm -f tmp/javascripts/*.js"
system! "rm -f tmp/karma_unit.js*"
system! "rm -rf tmp/product_import-*"
puts "\n== Removing any precompiled assets that would be out of date now =="
system! "rm -rf public/assets/"
system! "rm -rf public/packs/"
system! "rm -rf public/packs-test/"
puts "\n== Restarting application server =="
# system! "bin/rails restart"

13
bin/shakapacker Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= "development"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
require "bundler/setup"
require "shakapacker"
require "shakapacker/webpack_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Shakapacker::WebpackRunner.run(ARGV)
end

13
bin/shakapacker-dev-server Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= "development"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
require "bundler/setup"
require "shakapacker"
require "shakapacker/dev_server_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Shakapacker::DevServerRunner.run(ARGV)
end

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
ENV["NODE_OPTIONS"] ||= "--openssl-legacy-provider"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
ENV["NODE_OPTIONS"] ||= "--openssl-legacy-provider"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::DevServerRunner.run(ARGV)
end

View File

@@ -1,9 +1,16 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
begin
exec "yarnpkg", *ARGV
rescue Errno::ENOENT
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
select { |dir| File.expand_path(dir) != __dir__ }.
product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"]).
map { |dir, file| File.expand_path(file, dir) }.
find { |file| File.executable?(file) }
if yarn
exec yarn, *ARGV
else
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1

View File

@@ -53,9 +53,9 @@ services:
OFN_REDIS_URL: redis://redis/
OFN_REDIS_JOBS_URL: redis://redis
OFN_REDIS_TEST_URL: redis://redis/3
WEBPACKER_DEV_SERVER_HOST: webpack
WEBPACKER_DEV_SERVER_PORT: 3035
WEBPACKER_DEV_SERVER_PUBLIC: localhost:3035
SHAKAPACKER_DEV_SERVER_HOST: webpack
SHAKAPACKER_DEV_SERVER_PORT: 3035
SHAKAPACKER_DEV_SERVER_PUBLIC: localhost:3035
command: >
sh -lc 'rm -f tmp/pids/server.pid;
@@ -89,7 +89,7 @@ services:
build: .
command: >
sh -lc 'until [ -f /bundles/.Gemfile.lock.sha ] && sha256sum -c /bundles/.Gemfile.lock.sha >/dev/null 2>&1; do sleep 0.5; done;
exec ./bin/webpack-dev-server'
exec ./bin/shakapacker-dev-server'
ports:
- "3035:3035"
volumes:
@@ -102,7 +102,7 @@ services:
retries: 30
environment:
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
SHAKAPACKER_DEV_SERVER_HOST: 0.0.0.0
volumes:
gems:
postgres:

View File

@@ -58,10 +58,15 @@ module Openfoodnetwork
Spree::Core::Engine.routes.default_url_options[:host] = ENV["SITE_URL"] if Rails.env == 'test'
end
# We reload the routes here
# so that the appended/prepended routes are available to the application.
config.after_initialize do
# We reload the routes here
# so that the appended/prepended routes are available to the application.
Rails.application.routes_reloader.reload!
# Subscribe to payment transition events
ActiveSupport::Notifications.subscribe(
"ofn.payment_transition", Payments::StatusChangedListenerService.new
)
end
initializer "spree.environment", before: :load_config_initializers do |app|
@@ -71,14 +76,6 @@ module Openfoodnetwork
end
end
initializer "spree.register.payment_methods" do |app|
Rails.application.reloader.to_prepare do
app.config.spree.payment_methods = [
Spree::PaymentMethod::Check
]
end
end
initializer "spree.mail.settings" do |_app|
Rails.application.reloader.to_prepare do
Spree::Core::MailSettings.init
@@ -126,14 +123,6 @@ module Openfoodnetwork
end
end
# Register Spree payment methods
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
Rails.application.reloader.to_prepare do
app.config.spree.payment_methods << Spree::Gateway::StripeSCA
app.config.spree.payment_methods << Spree::Gateway::PayPalExpress
end
end
initializer "ofn.reports" do |app|
module ::Reporting; end
Rails.application.reloader.to_prepare do
@@ -206,7 +195,16 @@ module Openfoodnetwork
Rails.autoloaders.main.ignore(Rails.root.join('app/webpacker'))
config.active_storage.service = ENV["S3_BUCKET"].present? ? :amazon : :local
config.active_storage.service =
if ENV["S3_BUCKET"].present?
if ENV["S3_ENDPOINT"].present?
:s3_compatible_storage
else
:amazon
end
else
:local
end
config.active_storage.content_types_to_serve_as_binary -= ["image/svg+xml"]
config.active_storage.variable_content_types += ["image/svg+xml"]
config.active_storage.url_options = config.action_controller.default_url_options

View File

@@ -74,9 +74,6 @@ Rails.application.configure do
allowed_warnings = [
# List strings here to allow matching deprecations.
#
# `Rails.application.secrets` is deprecated in favor of `Rails.application.credentials` and will be removed in Rails 7.2
"Rails.application.secrets",
"Passing the class as positional argument",
# Spree::CreditCard model aliases `cc_type` and has a method called `cc_type=` defined. Starting in Rails 7.2 `brand=` will not be calling `cc_type=` anymore. You may want to additionally define `brand=` to preserve the current behavior.

View File

@@ -19,6 +19,5 @@ Rails.application.config.assets.precompile += [
'web/all.js',
'darkswarm/all.js',
'shared/*',
'mail.scss',
'*.jpg', '*.jpeg', '*.png', '*.gif' '*.svg',
]

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