Commit Graph

1006 Commits

Author SHA1 Message Date
David Rodríguez
4c6d894bc0 Bump RuboCop to 1.86.6
There were a few changes needed:

* Plugins are now specified through `plugin:` config keyword.
* All plugin gems need to be specified explicitly in Gemfile since they
  are no longer dependencies of plugins already specified explicitly.
* All plugin gems need to be updated in other to use the new APIs.
* One cop was renamed.
* New offenses safe to correct were corrected directly with `bundle exec
  rubocop -a`.
* New offenses unsafe to correct were added to the TODO configuration
  with `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude
  --exclude-limit 1400 --no-auto-gen-timestamp`.
2025-10-27 11:30:33 +01:00
Rachel Arnould
c4c266246c Merge pull request #13507 from rioug/tag-rules-remove-angular
[Variant Tags] Remove angular from tag rule admin page
2025-10-15 23:16:05 +02:00
Maikel Linke
7a12e7426f Pass actors instead of AR associations to Flipper
Apparently they removed support for checking collections of actors.
2025-10-14 13:32:51 +11:00
Gareth Rogers
0a9eb173ea Add report name and details to CSV files 2025-10-01 13:59:43 +10:00
Gaetan Craig-Riou
ab65b2d745 Per review, fix various syntax/misspell 2025-09-24 10:46:37 +10:00
Gaetan Craig-Riou
646ba18b8a Fix bug, load tag rule types when update errors 2025-09-24 10:40:43 +10:00
Gaetan Craig-Riou
8bd631fbb7 Clean up tag rule form component template
Consolidate everything in one template and move visibility options to
the component.
2025-09-24 10:40:43 +10:00
Gaetan Craig-Riou
75325e2935 Consolidate modal to add rule into a component 2025-09-24 10:40:43 +10:00
Gaetan Craig-Riou
7e48007d09 Add new tag group and add rule to tag group 2025-09-24 10:40:43 +10:00
Gaetan Craig-Riou
6790cad089 Add deleting tag rule
TagRuleController is now a subclass of Spree::Admin::BaseController
because Admin::ResourceController did not play well with turbo_stream.
And to be honest we did not need all the functionality provided by the
ResourceController
2025-09-24 10:38:53 +10:00
Gaetan Craig-Riou
7087d1b290 Add default tag rule
I tried to leverage turbo as much as possible
2025-09-24 10:38:53 +10:00
Ahmed Ejaz
49dbe1d039 Refactor comments for clarity in product sorting concerns 2025-09-15 02:15:03 +05:00
Ahmed Ejaz
c326aa6b23 Add comprehensive specs for sorting functionality 2025-09-15 01:59:40 +05:00
Ahmed Ejaz
da843d1ba1 Add sorting by stock levels using ransacker and update locale for 'on_hand' header 2025-09-13 01:11:21 +05:00
Filipe
a8114e42a7 Merge pull request #13381 from rioug/add-feature-flag-inventory
Add feature flag to enable inventory
2025-07-21 17:59:54 +01:00
Ahmed Ejaz
e6b9373570 Refactor line items search to improve security and maintainability
Moves search field configuration from frontend to backend to prevent potential security issues with exposing internal field names. The change also improves maintainability by centralizing search logic in the controller.

Adds conditional logic to use name_alias for non-admin users when searching distributor names, enhancing data access control.
2025-07-13 18:07:14 +05:00
Gaetan Craig-Riou
b7f969eed9 Move the inventory feature check to ScopeVariantToHub
Per review, the check is done on the same enterprise as the one use to
initialize ScopeVariantToHub. So it makes sense to move the actual
feature check to ScopeVariantToHub#scope
2025-07-09 13:43:12 +10:00
Gaetan Craig-Riou
6937a133ae Move inventory enabled check to OpenFoodNetwork::ScopeVariantToHub 2025-07-09 11:35:26 +10:00
Gaetan Craig-Riou
29a24b7305 Scope variant to hub only when inventory enabled 2025-07-09 11:35:26 +10:00
Gaetan Craig-Riou
b19b987ed0 Remove variant rule type when inventory disabled 2025-07-09 11:35:26 +10:00
Gaetan Craig-Riou
f30b899569 Disable inventory option for product import 2025-07-09 11:35:26 +10:00
Filipe
93ac10bb75 Merge pull request #13262 from cillian/remove-angular-on-enterprise-images-and-white-label-sections
Remove Angular from the Settings > Images section
2025-05-16 20:03:55 +01:00
Konrad
c657e31d07 Merge pull request #13318 from dacook/fix-13315
Prevent error on inventory page when logged out
2025-05-16 20:23:17 +02:00
David Cook
82f94e3969 Ensure user is loaded before loading data 2025-05-13 15:12:16 +10:00
Gaetan Craig-Riou
0ca3dca675 Per review, extract tags options from template
Now it also scope the tags to the available variant, ie the logged in
user will only see only tag that was used by them.
2025-05-05 14:56:50 +10:00
Gaetan Craig-Riou
e7aae5a03c Add tag search
First minimal implementation with a basic filter UI. Only support search
by any of the selected tags
2025-05-05 14:54:55 +10:00
Cillian O'Ruanaidh
65efd3b66c Render confirm remove image modal outside of form so a simple :button_to can be used instead of submitting via Stimulus controller. 2025-05-02 13:07:31 +01:00
Cillian O'Ruanaidh
a9a4156251 Remove Angular and Stimulus Reflex from the Settings > Images section 2025-05-02 13:07:31 +01:00
Carlos Chitty
d0c687650e Autocorrect Style/HashEachMethods offenses 2025-04-29 15:16:34 -04:00
Carlos Chitty
63168086e7 Autocorrect Style/HashConversion offenses 2025-04-29 14:27:31 -04:00
piyush828-design
5e890bb361 Merge branch 'master' into pagy_upgrade 2025-04-24 17:46:39 +05:30
David Cook
e1c6709472 Merge pull request #13251 from cyrillefr/FixRailsLexicallyScopedActionFilterPartI
Adresses Rails/LexicallyScoped offenses
2025-04-22 11:26:11 +10:00
Filipe
3236cbb0b8 Merge pull request #13191 from mkllnk/dfc-reset
Reset stock for absent products in DFC catalog
2025-04-20 21:34:49 +01:00
piyush828-design
3202d0ea81 fixed test failure 2025-04-16 18:24:32 +05:30
cyrillefr
5c3db6cab8 Removes unused action from filter in controller 2025-04-08 14:04:37 +02:00
Trésor Bireke
5e7f0f8a1a Merge branch 'master' into tb-rescue-not-found-error-for-enterprise 2025-04-01 01:10:17 +02:00
Tresor11
507705a4eb Update method name to require
This commit updates the method name to be called required_enterprise
since we only expect it to raise an error when the enterprise is not found.
2025-03-31 22:28:38 +03:00
Maikel Linke
9e3ff412f9 Simplify controller 2025-03-27 13:36:48 +11:00
Maikel Linke
48e3b5b05e Move more reset variant code for re-use 2025-03-27 13:36:48 +11:00
Maikel Linke
c43bd0c24b Move variant reset code to shared service 2025-03-27 13:36:48 +11:00
Maikel Linke
e35a29cc29 Remember local stock of backordered products
When retail variants are mapped to wholesale variants, we usually have a
some leftover stock at the end of an order cycle. For example, we
backordered a slab of 12 cans of tomatoes but our customers bought only
9 of those. Then we have 3 left for the next order cycle.

Even when the product is not available for backorder with the supplier,
we still want to sell off our leftover stock, the three cans of tomatoes
in our example.

And it might be that the product will come back in the future.
2025-03-27 13:36:48 +11:00
Maikel Linke
2a81d26ef1 Simplify complex method 2025-03-27 13:36:48 +11:00
Maikel Linke
c60718feea List absent products in import preview 2025-03-27 13:36:48 +11:00
Maikel
a2e68e1f3c Explain stock reset further
Co-authored-by: David Cook <david@redcliffs.net>
2025-03-27 13:36:48 +11:00
Maikel Linke
a6c08fe2ad Reset stock for absent products in DFC catalog 2025-03-27 13:36:47 +11:00
Tresor11
5b3bae85ca Rescue Not Found Error for Enterprise for admin
Currently when an admin tries to edit an no-existing enterprise, a
NoMethodError is raised.

This commit adds a set_enterprise setter method to the
enterprises controller that sets the @enterprise instance variable to
have the same value as the enterprise object defined in the the edit
method; this method also rescues the NotFound error  in case
the enterprise is not found and redirects the user to the enterprises
index page with a error message.
2025-03-22 00:35:27 +03:00
Maikel Linke
f9322ac71b Style: simplify controller method 2025-03-03 12:23:58 +11:00
Maikel Linke
7f8581fd9f DRY controller methods which became too long 2025-03-03 12:23:58 +11:00
Maikel Linke
9d5ce0ede5 Remove surrounding whitespace from pasted DFC URL 2025-03-03 12:23:58 +11:00
Maikel Linke
b6153fc155 Rescue from invalid DFC catalog URLs
This mistake should be dealt with differently but I wanted to make sure
that a really invalid URL is handled well, too.
2025-03-03 12:23:58 +11:00