Commit Graph

31166 Commits

Author SHA1 Message Date
filipefurtad0
57f148564c Update all locales with the latest Transifex translations v4.4.41 2024-04-25 16:32:56 +01:00
Filipe
e99b072442 Merge pull request #12313 from anthonyms/11482-fix-rubocop-rails-issue-has_many
Fix Rubocop Rails: Rails/HasManyOrHasOneDependent
2024-04-25 16:24:47 +01:00
Filipe
f269584b8e Merge pull request #12392 from sergioosouzaa/fix/duplicate-language-display-new-user-11513
Fix Duplicate Language Display on New User Creation
2024-04-25 16:01:09 +01:00
Filipe
4ff832693c Merge pull request #12412 from dacook/buu/fix-non-admin-saving-12403
[BUU] Fix non-admin saving
2024-04-25 12:37:11 +01:00
Rachel Arnould
09354dc80e Merge pull request #12219 from abdellani/prevent-generate-invoices-when-distributor-cannot-invoice
prevent generating invoices when order's distributor can't generate invoices
2024-04-25 12:18:49 +02:00
David Cook
b846d0f517 Add ability to bulk update products for product managers
I forgot to do this in #12328 [BUU] Remove Stimulus Reflex from Products screen
2024-04-24 10:56:30 +10:00
Maikel
f083e851c0 Merge pull request #12408 from filipefurtad0/stripe_registered_customer
[VCR/Stripe] Tests payment intents for offline payments
2024-04-24 10:14:28 +10:00
filipefurtad0
85e3d5d858 Tests payment intents for offline payments
Moves let variables outside shared examples block

Re-records cassettes
2024-04-23 12:24:00 +01:00
Anthony Musyoki
0d03cdf815 Fix Rubocop: Delete dependent stock_movements 2024-04-23 13:13:26 +03:00
Anthony Musyoki
434afb73cd Fix Rubocop: Update handling of enterprise associations 2024-04-23 12:40:58 +03:00
Anthony Musyoki
c2cbe4f0bf Fix Rubocop: Hard delete paranoid associations
As much as the associated models act_as_paranoid, it
doesnt make sense to keep them around after deleting the enterprise
2024-04-23 12:31:43 +03:00
Anthony Musyoki
645cb10864 Fix Rubocop: Do not delete Spree::Variant associations
Spree::Variant acts_as_paranoid and is thus not hard deleted
2024-04-23 12:31:43 +03:00
Anthony Musyoki
4140257fa1 Fix Rubocop: Do not delete dependent adjustments
TaxRate acts_as_paranoid iand is thus not hard_deleted
2024-04-23 12:31:43 +03:00
Anthony Musyoki
4f851bbe1f Fix Rubocop: Do not delete dependent stock_movements 2024-04-23 12:31:43 +03:00
Anthony Musyoki
1ec453df4d Fix Rubocop issue: Do not delete addresses having shipments
The reasoning is that we should not delete an address that has
ever received a shipment
2024-04-23 12:31:43 +03:00
Anthony Musyoki
5559816e12 Fix Rubocop Rails issue: Rails/HasManyOrHasOneDependent 2024-04-23 12:31:41 +03:00
David Cook
574e8f0135 Show error message when turbo:frame-missing
Instead of replacing frame contents with unhelpful text 'Content missing'.
2024-04-23 16:48:52 +10:00
David Cook
b5cdee3d65 Rename translation key
So that it can be used for more general purposes.
2024-04-23 16:48:52 +10:00
David Cook
d0f683d279 Spec for bug 2024-04-23 16:48:52 +10:00
Gaetan Craig-Riou
8d166ed3e1 Merge pull request #12407 from cyrillefr/RedundantPresenceValidationOnBelongs_part_I
Fix RedundantPresenceValidationOnBelongs on some files
2024-04-23 10:29:48 +10:00
cyrillefr
9ae064a24f Fix RedundantPresenceValidationOnBelongs on some files
- presence: true is redundant since Rails 5.0 BUT applies
   with new default config of
   belongs_to_required_by_default to true
   Lots of files with belongs_to_required_by_default = false
   (backward compatibility)
   So: deleting this setting implies to adding optional: true
 - added 'NOT NULL' constraints so model constraints match
   with contraints on DB tables.
 - updated the todo
2024-04-22 17:36:47 +02:00
Mohamed ABDELLANI
7aad4ad652 Merge branch 'master' into prevent-generate-invoices-when-distributor-cannot-invoice 2024-04-22 10:55:39 +01:00
David Cook
4a3f4136df Merge pull request #12393 from mkllnk/lint-rubocop
Test all files with Rubocop, not just added code in the diff
2024-04-22 15:07:54 +10:00
Konrad
8e7f4ff908 Merge pull request #12333 from chahmedejaz/bugfix/12294-wrong-tax-category-display
[BUU] Fix Wrong Tax Category Display
2024-04-20 11:42:05 +02:00
Rachel Arnould
2090bc1b47 Merge pull request #12361 from dacook/buu/add-turbo
[BUU] Add Turbo for dynamic page loading
2024-04-19 11:44:17 +02:00
David Cook
38a4bfe98b Update all locales with the latest Transifex translations v4.4.40 2024-04-18 16:54:16 +10:00
David Cook
5b043574a2 Merge pull request #12384 from mkllnk/mail-config
Don't pass invalid auth method "None" to net-smtp
2024-04-18 16:51:51 +10:00
David Cook
e59237ef19 Merge pull request #12382 from mkllnk/dependabot-config
Allow Dependabot to open as many PRs as it likes
2024-04-18 11:06:05 +10:00
David Cook
053a88d252 Merge pull request #12363 from cyrillefr/FixRailsWhereExistsOffenses
Fix Rails/WhereExists rubocop offenses
2024-04-18 10:55:04 +10:00
Maikel
e7856d86f4 Merge pull request #12397 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.147.0
chore(deps): bump aws-sdk-s3 from 1.146.1 to 1.147.0
2024-04-18 09:08:24 +10:00
Maikel
09ece4b35e Merge pull request #12396 from openfoodfoundation/dependabot/bundler/stripe-11.1.0
chore(deps): bump stripe from 11.0.0 to 11.1.0
2024-04-18 08:56:59 +10:00
Sergio Souza
9477725997 update tests for avaliable_locales 2024-04-18 08:55:34 +10:00
Sergio Souza
51d90e782b remove the source_locale from the avaliable_locales method 2024-04-18 08:55:34 +10:00
Maikel Linke
c4e92e7d8f Update Stripe API recordings for new version 2024-04-18 08:42:18 +10:00
Maikel
142fe542c0 Merge pull request #12370 from filipefurtad0/regression_spec_ship_order_button
Adds regression spec as shared example, for order edit subsections
2024-04-18 08:31:37 +10:00
filipefurtad0
574297343f Sets pending examples for order edit page subsections 2024-04-17 14:27:56 +01:00
dependabot[bot]
302cde6f4e chore(deps): bump aws-sdk-s3 from 1.146.1 to 1.147.0
---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-17 09:43:41 +00:00
dependabot[bot]
5a2f791d58 chore(deps): bump stripe from 11.0.0 to 11.1.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v11.0.0...v11.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-17 09:43:21 +00:00
cyrillefr
456905e69f Fix Rails/WhereExists rubocop offenses
- after discussion, dev team decided not to follow
- this particular rule, but rather to enforce the where().exists? rule
  instead.
- cf. https://github.com/openfoodfoundation/openfoodnetwork/pull/12363
2024-04-17 10:37:18 +02:00
David Cook
a2255e62d4 Revert "Use POST for action that creates data,"
I'm not happy about it, but we need it to be a standard link to make it work. I assume it's because BulkFormController.preventLeavingChangedForm() isn't smart enough.

This reverts commit 91f0a80189.
2024-04-17 17:36:05 +10:00
David Cook
11541c9270 Disable turbo for those links
Now we can warn that "Changes that you made might not be saved"
2024-04-17 17:35:17 +10:00
David Cook
8f9d8b5fb8 Revert "Prevent frame navigations when form is changed"
It was too hacky and had issues. Let's just disable Turbo for those links for now.

This reverts commit 1d1169b478.
2024-04-17 17:26:49 +10:00
David Cook
91f0a80189 Use POST for action that creates data,
duh.

Turbo cleverly pre-fetches GET requests to save loading time. But that resulted in dozens of unwanted clones.
Attack of the clones!!!

I checked: even though this route predates the new products screen, it wasn't being used anywhere else. The old products screen uses the API instead.
2024-04-17 15:18:13 +10:00
David Cook
1d1169b478 Prevent frame navigations when form is changed
This is a hacky hack, filling a gap in Turbo.
2024-04-17 15:17:59 +10:00
David Cook
06f67488a9 Open links outside of frame by default
This page is big enough and it's hard to see how everything works. So links work like links by default (eg edit and clone). Other links and forms are special, and will reload only the frame: this is now explicit in the code.
2024-04-17 15:17:59 +10:00
David Cook
acc72514de Fix spec 2024-04-17 15:17:59 +10:00
David Cook
1abb068a00 Enable morphing?
I can't really prove if this is working, but it seems to be rendering slightly faster.
2024-04-17 15:17:59 +10:00
David Cook
508ebab75b Add loading spinner to turbo frame
That was surprisingly easy. Note that it's still shared with SR.

It hides a bit early though: when the web response returns, but before the DOM has been rendered. Something to optimise in the future.
2024-04-17 15:17:59 +10:00
David Cook
6c9a47854a Submit forms with Turbo Frame
Now the filters, pagination and product forms submit and load within the frame, and work perfectly, yay!

It's still building the whole page on the server.. I think we need Turbo Streams if we want to send back just a partial.
2024-04-17 15:17:59 +10:00
David Cook
9d6ef2f730 Avoid style issues with Turbo
But the filter dropdowns still get duplicated. So weird..
2024-04-17 15:17:59 +10:00