17628 Commits

Author SHA1 Message Date
David-OFN-CA
7922bf7b65 Revert "Fix 9 Rubocop violations (Rails/Presence and Rails/RedirectBackOrTo)Fix rubocop violations" 2026-02-26 17:04:21 -05:00
David-OFN-CA
2d46676bb4 Merge pull request #13973 from David-OFN-CA/fix-rubocop-violations
Fix 9 Rubocop violations (Rails/Presence and Rails/RedirectBackOrTo)Fix rubocop violations
2026-02-26 16:01:15 -05:00
David Thomas
2808a41f0d Safely autocorrect Rails/RedirectBackOrTo
Inspecting 1721 files
........................................W...................................................................W................W..W.......W................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/controllers/admin/order_cycles_controller.rb:212:9: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
        redirect_back(fallback_location: root_path)
        ^^^^^^^^^^^^^
app/controllers/locales_controller.rb:6:5: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
    redirect_back fallback_location: main_app.root_url
    ^^^^^^^^^^^^^
app/controllers/spree/admin/invoices_controller.rb:31:9: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
        redirect_back(fallback_location: spree.admin_dashboard_path)
        ^^^^^^^^^^^^^
app/controllers/spree/admin/orders_controller.rb:83:9: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
        redirect_back fallback_location: spree.admin_dashboard_path
        ^^^^^^^^^^^^^
app/controllers/spree/admin/orders_controller.rb:91:25: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
          format.html { redirect_back(fallback_location: spree.admin_dashboard_path) }
                        ^^^^^^^^^^^^^
app/controllers/spree/admin/return_authorizations_controller.rb:13:9: W: [Corrected] Rails/RedirectBackOrTo: Use redirect_back_or_to instead of redirect_back with :fallback_location keyword argument.
        redirect_back fallback_location: spree.admin_dashboard_path
        ^^^^^^^^^^^^^

1721 files inspected, 6 offenses detected, 6 offenses corrected
2026-02-26 15:35:55 -05:00
David Thomas
18869979db Safely autocorrect Rails/Presence
Inspecting 1721 files
...................................C.................................................................................................................................................................................................................................................................................................................................................C...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/controllers/admin/enterprises_controller.rb:180:7: C: [Corrected] Rails/Presence: Use @object.custom_tab.presence&.destroy instead of @object.custom_tab.destroy if @object.custom_tab.present?.
      @object.custom_tab.destroy if @object.custom_tab.present?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:243:9: C: [Corrected] Rails/Presence: Use (enterprises.presence&.includes(supplied_products: [:variants, :image])) instead of if enterprises.present? ... end.
        if enterprises.present? ...
        ^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:243:9: C: [Corrected] Style/RedundantParentheses: Don't use parentheses around a method call.
        (enterprises.presence&.includes(supplied_products: [:variants, :image]))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/product.rb:298:7: C: [Corrected] Rails/Presence: Use (first_variant.supplier.presence&.touch) instead of first_variant.supplier.touch if first_variant.supplier.present?.
      first_variant.supplier.touch if first_variant.supplier.present?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/product.rb:298:7: C: [Corrected] Style/RedundantParentheses: Don't use parentheses around a method call.
      (first_variant.supplier.presence&.touch)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1721 files inspected, 5 offenses detected, 5 offenses corrected
2026-02-26 15:34:45 -05:00
Rachel Arnould
83ec97e720 Merge pull request #13944 from pavelk-lab/fix/rails-7-serialize-deprecation
Fix Rails 7.2 serialize deprecation warnings
2026-02-26 11:29:27 +01:00
Rachel Arnould
81aac877a5 Merge pull request #13945 from mkllnk/taler-refund
Add "void" action to Taler payment admin page
2026-02-24 11:23:07 +01:00
Rachel Arnould
68c7d8f9f5 Merge pull request #13934 from chahmedejaz/bugfix/13827-tag-filters-reset-upon-product-update
Tag filters are reset after updating a product
2026-02-24 10:20:11 +01:00
Maikel Linke
702db32595 Connect unit label to input
And replace redundant spec helper method.
2026-02-23 13:08:55 +11:00
Maikel Linke
9d79119eb0 Link to payment action with title
The custom helper was adding a PowerTip which replaced the title
attribute with its own display. I removed the PowerTip and use a simple
title attribute. This should have several benefits:

- Capybara can find the link by the title.
- Screenreaders should be able read the title.
- Browser can show the title in the best position.
- Using the browser feature is more consistent and efficient.
2026-02-23 13:00:02 +11:00
Maikel Linke
f2eec5685e Include amount in refund email 2026-02-23 13:00:02 +11:00
Gaetan Craig-Riou
cd68ddc34f Merge pull request #13946 from mkllnk/erb
Remove unnecessary erb compilation on JS file
2026-02-23 09:43:11 +11:00
pavelk-lab
47ef21deb3 Merge branch 'master' into fix/rails-7-serialize-deprecation 2026-02-21 23:19:58 +00:00
Maikel Linke
69108df206 Use Rails to translate email subject
And translate the subject with the user's locale.
If the subject doesn't need parameters, you don't need to supply it.
Rails finds the translation automatically.
2026-02-20 13:43:09 +11:00
Maikel Linke
c66b9611b6 Move PaymentMailer translations out of Spree namespace
The mailer is not in the Spree namespace and we don't need to keep the
clutter.
2026-02-20 13:43:09 +11:00
Maikel Linke
de873ae42c Add void action to Taler for refunds 2026-02-20 13:43:09 +11:00
Maikel Linke
ed701b00dc Stop storing now redundant redirect URL
The Taler gem now computes it from the order id. No need to store it.
2026-02-20 13:43:04 +11:00
Maikel Linke
52e2fb923e Update Taler calls for new v0.2.0 2026-02-20 13:37:46 +11:00
Gaetan Craig-Riou
e276fb0386 Merge pull request #13930 from openfoodfoundation/dependabot/bundler/rubocop-1.84.1
Bump rubocop from 1.81.7 to 1.84.2
2026-02-20 09:05:41 +11:00
Pavel
e98244fe63 Fix Rails 7.2 serialize deprecation warnings
Pass type as keyword argument in serialize calls, as required from Rails 7.2 onwards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 21:55:13 +00:00
Rachel Arnould
f86eb3fb82 Merge pull request #13920 from mkllnk/clean-name
Stop pre-selecting Paypal when creating a payment method
2026-02-19 11:38:56 +01:00
Rachel Arnould
0d46a3bc2e Merge pull request #13902 from mkllnk/refund-simple
Simplify refund logic
2026-02-19 11:06:00 +01:00
Rachel Arnould
fb0f379c43 Merge pull request #13823 from chahmedejaz/bugfix/13625-enterprise-fee-reports-throws-504
Some Enterprise Fee reports are unusable when managing big shops
2026-02-18 15:22:21 +01:00
Maikel Linke
16b3da66c2 Style/HashAsLastArrayItem 2026-02-18 12:45:37 +11:00
Maikel Linke
167099badf Lint/NoReturnInBeginEndBlocks 2026-02-18 09:44:19 +11:00
Maikel Linke
da1e1a9859 Style indentation 2026-02-18 09:42:07 +11:00
Ahmed Ejaz
1d4bbfa506 Supports tag filters persistence during product updates
Adds functionality to retain tag filters applied in the admin product interface after bulk updates. Updates controller parameters to include tags_name_in, adds hidden fields for tag persistence in the view, and includes specs to verify filter state retention across update operations.
2026-02-18 01:37:41 +05:00
Maikel Linke
4b689d00a4 Remove unnecessary erb compilation on JS file 2026-02-17 13:56:30 +11:00
Maikel Linke
482c2a4a6e Delete now unused method clean_name 2026-02-13 12:36:26 +11:00
Maikel Linke
9da3b0ea01 User must choose payment method type on creation 2026-02-12 15:15:27 +11:00
Maikel Linke
3be0cca230 Move options code into helper 2026-02-12 11:47:01 +11:00
Maikel Linke
283d13eb35 Move payment method display logic to helper
So we don't need to convert strings into classes to then only convert it
into the same string again.
2026-02-12 11:25:13 +11:00
Ahmed Ejaz
7c0586db7b Enhance comment for shouldLoad function 2026-02-08 18:29:55 +05: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
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
Maikel Linke
162c58ac39 Check which methods we need to delegate
This implicit delegation makes it impossible to know which code is used
and which code is dead. The refund method is very rarely used though. So
we'll need to wait for a while.
2026-02-04 12:24:50 +11:00
Maikel Linke
02d47d0a0d Remove unused method #payment_profiles_supported?
And useless specs.
2026-02-04 11:37:53 +11:00
Maikel Linke
e86bf441ab Remove last use of #payment_profiles_supported? 2026-02-04 11:30:36 +11:00
Maikel Linke
f9617b8156 Remove broken dead code branch
The StripeSCA method is forwarding all missing methods to the provider
gateway. The ActiveMerchant gateway used to be decorated by our code and
that's how this code may have worked one day. But we removed the
decorator years ago:

- 549610bc35

A bit later we found that refunds are broken with Stripe:

- https://github.com/openfoodfoundation/openfoodnetwork/issues/12843

This commit could potentiall fix that, I guess? I haven't tested that.
It's a rare use case and not the aim of this work.
2026-02-04 11:30:36 +11:00
Maikel Linke
4650e30c09 Remove useless branch on credit method 2026-02-04 11:30:36 +11:00
Maikel Linke
2749965e73 Remove useless branch calling #void
StripeSCA is the only method with a different method signature for
`#void` but the additional parameter wasn't used. So this special case
can just be removed.
2026-02-04 11:30:36 +11:00
Maikel Linke
e87965bda0 Simplify storing of payment profiles
StripeSCA is the only payment method storing profiles following this
logic. This is the first step to remove indirection and let the payment
method handle this instead of the payment decided for the payment
method.
2026-02-04 11:30:36 +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
Ahmed Ejaz
9dcb3ec748 Refactor report routes to use scoped routes for better organization and readability 2026-02-04 03:55:07 +05:00
Ahmed Ejaz
99e238d92d Improve reports AJAX search safety, permissions, and TomSelect UX
- Sanitize AJAX search queries to safely support wildcard searches (ILIKE)
- Centralize reports search actions in Spree::Ability and reuse across roles
- Fix TomSelect remote loading to fetch on dropdown open and typing
- Surface HTTP errors in TomSelect via showHttpError and improve error handling
- Update dropdown behavior to show proper “no results” feedback
- Move reports AJAX specs to request specs and expand pagination coverage
- Simplify searchable dropdown component attribute passing
2026-02-04 02:25:41 +05: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
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
Ahmed Ejaz
8eb9709a04 Fix specs:
Fix tom_select_options_value to conditionally include 'virtual_scroll' plugin based on remote URL presence
2026-02-01 19:45:39 +05:00