Compare commits

...

1592 Commits

Author SHA1 Message Date
David Cook
a9d586952d Update all locales with the latest Transifex translations 2024-02-29 14:35:08 +11:00
Maikel
8e29bc1a03 Merge pull request #12213 from openfoodfoundation/dependabot/bundler/dotenv-3.1.0
chore(deps): bump dotenv from 3.0.3 to 3.1.0
2024-02-29 09:01:43 +11:00
Maikel
9ba43c64d7 Merge pull request #12210 from abdellani/11673-redirect-will-no-longer-have-body
on redirect, the body will no longer include the target link
2024-02-29 08:50:52 +11:00
Filipe
ce2712f780 Merge pull request #12168 from rioug/11670-refund-stripe-payment-complete-order
Refund stripe payment when an order is complete
2024-02-28 18:08:50 +00:00
dependabot[bot]
7652c72bd6 chore(deps): bump dotenv from 3.0.3 to 3.1.0
Bumps [dotenv](https://github.com/bkeepers/dotenv) from 3.0.3 to 3.1.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.0.3...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 09:58:26 +00:00
David Cook
f4e6095466 Merge pull request #12204 from dacook/rubocop-autocorrect-more
Disable RSpec cops by default
2024-02-28 17:30:22 +11:00
David Cook
2d09c23456 Disable Rails cops by default
There was just too much. Some of them seem over the top, while others look like they could be really helpful.
But we don't have time to evaluate them all right now.
2024-02-28 16:25:32 +11:00
David Cook
6f2b29eeec Move rspec styleguide to separate file 2024-02-28 16:17:49 +11:00
Gaetan Craig-Riou
8e56e076a3 Re record VCR cassettes after rebase 2024-02-28 15:26:51 +11:00
Gaetan Craig-Riou
48ba23af1c Notify BugSnag when something unexpected happens 2024-02-28 15:16:09 +11:00
Gaetan Craig-Riou
b5beeead74 Remove stripe stub for refund scenario 2024-02-28 15:13:40 +11:00
Gaetan Craig-Riou
e5cd8e5216 Log error when something goes wrong
Plus spec.
The old implementation would swallow the error, all we had was a flash
message feedback
2024-02-28 15:13:40 +11:00
Gaetan Craig-Riou
f634855826 Add request spec for Spree::Admin::PaymentsController 2024-02-28 15:13:40 +11:00
Gaetan Craig-Riou
8fb3f9a8b8 Remove "ujs-navigate": "false" from link
It somehow was causing a double loading of the page meaning flash
messages were lost. I suspect it's related to turbo/turbo link, but
I am not sure.
2024-02-28 15:13:40 +11:00
Gaetan Craig-Riou
e0e89e6452 Finally remove StripePaymentIntentsGateway decorator
Add spec for Spree::Gateway::StripeSCA#void
It also partially fix 11670, refund of Stripe payment should now work
for complete order
2024-02-28 15:13:40 +11:00
David Cook
7f77de89fc Explicitly load required file
This will be required if fixing FactoryBot/FactoryClassName
I'm not 100% sure about that rule yet, but figured this fix was worth keeping.
2024-02-28 09:37:34 +11:00
Gaetan Craig-Riou
7b5bc45d6c Merge pull request #12205 from openfoodfoundation/dependabot/bundler/dotenv-3.0.3
chore(deps): bump dotenv from 3.0.2 to 3.0.3
2024-02-28 09:20:36 +11:00
Mohamed ABDELLANI
091023baf7 on redirect, the body will no longer include the target link
for more details:
c2e756a944
2024-02-27 19:18:49 +01:00
dependabot[bot]
29f9d1e374 chore(deps): bump dotenv from 3.0.2 to 3.0.3
Bumps [dotenv](https://github.com/bkeepers/dotenv) from 3.0.2 to 3.0.3.
- [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.0.2...v3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-27 09:36:15 +00:00
Gaetan Craig-Riou
0b93c1b92b Merge pull request #12190 from openfoodfoundation/dependabot/bundler/stripe-10.10.0
chore(deps): bump stripe from 10.9.0 to 10.10.0
2024-02-27 10:27:42 +11:00
Gaetan Craig-Riou
cabf9a6502 Update Stripe API recordings for new version 2024-02-27 10:18:40 +11:00
Gaetan Craig-Riou
6d6f79ffae Merge pull request #12200 from openfoodfoundation/dependabot/bundler/rubocop-rspec-2.26.1
chore(deps-dev): bump rubocop-rspec from 2.23.2 to 2.26.1
2024-02-27 10:13:29 +11:00
Gaetan Craig-Riou
a90d944404 Merge pull request #12199 from openfoodfoundation/dependabot/bundler/webmock-3.23.0
chore(deps-dev): bump webmock from 3.21.2 to 3.23.0
2024-02-27 10:09:00 +11:00
Gaetan Craig-Riou
d2af6279f4 Merge pull request #12197 from openfoodfoundation/dependabot/bundler/listen-3.9.0
chore(deps-dev): bump listen from 3.8.0 to 3.9.0
2024-02-27 10:07:36 +11:00
Gaetan Craig-Riou
a8a1f45f1a Merge pull request #12196 from openfoodfoundation/dependabot/npm_and_yarn/karma-6.4.3
chore(deps-dev): bump karma from 6.4.2 to 6.4.3
2024-02-27 10:06:44 +11:00
Gaetan Craig-Riou
8e5adcd3a6 Merge pull request #12186 from openfoodfoundation/dependabot/bundler/view_component-3.11.0
chore(deps): bump view_component from 3.10.0 to 3.11.0
2024-02-27 09:54:30 +11:00
Gaetan Craig-Riou
a786d08df4 Merge pull request #12182 from openfoodfoundation/dependabot/npm_and_yarn/ip-1.1.9
chore(deps): bump ip from 1.1.8 to 1.1.9
2024-02-27 09:53:09 +11:00
Gaetan Craig-Riou
e1a6cb1d28 Merge pull request #12187 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-8.0.3
chore(deps): bump @hotwired/turbo from 8.0.2 to 8.0.3
2024-02-27 09:52:23 +11:00
David Cook
cb1f877117 Layout/LineLength
Manual fix, for some reason rubocop couldn't fix these automatically
2024-02-27 09:51:58 +11:00
dependabot[bot]
b3d9aafcde chore(deps-dev): bump rubocop-rspec from 2.23.2 to 2.26.1
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.23.2 to 2.26.1.
- [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/v2.23.2...v2.26.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 09:48:06 +00:00
dependabot[bot]
116c5d41d3 chore(deps-dev): bump webmock from 3.21.2 to 3.23.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.21.2 to 3.23.0.
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.21.2...v3.23.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 09:47:00 +00:00
dependabot[bot]
2c7d8745d9 chore(deps-dev): bump listen from 3.8.0 to 3.9.0
Bumps [listen](https://github.com/guard/listen) from 3.8.0 to 3.9.0.
- [Release notes](https://github.com/guard/listen/releases)
- [Commits](https://github.com/guard/listen/compare/v3.8.0...v3.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 09:44:48 +00:00
dependabot[bot]
6649039881 chore(deps-dev): bump karma from 6.4.2 to 6.4.3
Bumps [karma](https://github.com/karma-runner/karma) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.4.2...v6.4.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 09:38:36 +00:00
Gaetan Craig-Riou
965d8d20a6 Merge pull request #12195 from rioug/fix-github-action-linter
Fix github action linter
2024-02-26 20:37:54 +11:00
Gaetan Craig-Riou
927acf01f6 Fix reviewdog extension config
We need to use a string list of extensions as shown in the doc:
https://github.com/reviewdog/action-rubocop?tab=readme-ov-file#example-usage
2024-02-26 20:25:49 +11:00
Gaetan Craig-Riou
e749c614a0 Merge pull request #11500 from dacook/rubocop-rspec
Add RSpec cops
2024-02-26 11:56:57 +11:00
dependabot[bot]
31d8f49c26 chore(deps): bump stripe from 10.9.0 to 10.10.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.9.0 to 10.10.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/v10.9.0...v10.10.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-02-23 09:28:10 +00:00
David Cook
250f7be8a0 Re-organise spec 2024-02-23 12:36:42 +11:00
David Cook
b758bf0735 Fix spec 2024-02-23 12:36:10 +11:00
David Cook
2107aeded1 Un-safely autocorrect RSpec/ExpectChange 2024-02-23 12:17:09 +11:00
David Cook
eaacaf42aa Enforce block style for rspec .change
As discussed in https://github.com/openfoodfoundation/openfoodnetwork/pull/11208#discussion_r1280049281
2024-02-23 12:09:50 +11:00
David Cook
800bab5303 Regenerate Rubocop's TODO file: with new RSpec rules
Wow, so much offences
2024-02-23 12:05:46 +11:00
David Cook
0091a60a6e Install rubocop-rspec
Why not enforce more consistency in our specs also?

Some of them generated way too many violations, so I relaxed them a bit.
2024-02-23 12:03:55 +11:00
David Cook
715e8253ff Disable buggy cop
Although it says it supports safe autocorrection, it requires a manual fix. I was going to manually fix the violation, but found it didn't really make the code more readable. So i'm making the call to get rid of it 🔥
2024-02-23 11:28:23 +11:00
David Cook
6bb48f2c74 Sort/format yaml
I found a plugin that promised to retain comments while sorting, so gave it a try: https://marketplace.visualstudio.com/items?itemName=PascalReitermann93.vscode-yaml-sort

It didn't really save any time, because some comments were still stripped so I had to manually fix it up. Also it reprocesses the yaml and removed other formatting like extra line breaks. So I wouldn't recommend it for this case.

Still, it could be useful for maintaining formatting of a large yaml file like our I18n file.
2024-02-23 11:21:46 +11:00
David Cook
6a2d2c581b Cleanup comments
(to make sorting with a plugin easier)

These settings have been here long enough that I think we can safely say they're accepted. There's no need to have a separate category of contested settings anyway in my opinion.
2024-02-23 11:13:50 +11:00
Maikel Linke
676f64cc4b Update all locales with the latest Transifex translations 2024-02-23 11:11:16 +11:00
Maikel
55aa324028 Link to new Ready to Go column
Instead of Zenhub.
2024-02-23 11:09:33 +11:00
David Cook
68cc9ed2fe Safely autocorrect Layout/EmptyLinesAroundBlockBody
Inspecting 1540 files
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.............................................................................................................................................................................................................................................................................................................................................................C............................................................................

Offenses:

spec/lib/stripe/payment_intent_validator_spec.rb:7:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
spec/system/admin/products_v3/products_spec.rb:219:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.

1540 files inspected, 2 offenses detected, 2 offenses corrected
2024-02-23 10:02:23 +11:00
David Cook
5a7258c58e Regenerate Rubocop's TODO file 2024-02-23 10:00:18 +11:00
dependabot[bot]
277d185918 chore(deps): bump @hotwired/turbo from 8.0.2 to 8.0.3
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 8.0.2 to 8.0.3.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v8.0.2...v8.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-22 09:51:00 +00:00
dependabot[bot]
655fb77ce3 chore(deps): bump view_component from 3.10.0 to 3.11.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.10.0...v3.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-22 09:39:08 +00:00
Maikel
d2b1511397 Merge pull request #12160 from mkllnk/oidc-tokens
Store OIDC tokens to call DFC APIs
2024-02-22 10:34:32 +11:00
Maikel Linke
008e384f14 Simplify oidc_user factory
Now you can build in memory only as well.
2024-02-22 10:22:00 +11:00
Maikel Linke
4d8bb25f86 Allow enterprise users to disconnect their OIDC account 2024-02-22 10:21:58 +11:00
Maikel Linke
0813f43b49 Better wording for OIDC connection 2024-02-22 10:15:07 +11:00
Maikel Linke
a9b72c8095 Comment on rare upsert usage 2024-02-22 10:15:07 +11:00
Maikel Linke
6d9c5a9c66 Allow user to get new OIDC refresh token
The refresh token is usually valid for a year but it can be revoked at
any time. When we try to use it and it's expired, we should remove it
from the account record and notify the user. They can then refresh the
authorisation.
2024-02-22 10:15:07 +11:00
Maikel Linke
a89b22e397 Allow user to disconnect OIDC account
This makes testing much easier. But probably also good for users to
revoke any access via OIDC apps. It also enables users to then connect
to a different account, or just renew the current connection.
2024-02-22 10:15:07 +11:00
Maikel Linke
4f3ae4f2a4 Spec OIDC setup flow 2024-02-22 10:15:07 +11:00
Maikel Linke
07a8617143 Store OIDC account data in new model 2024-02-22 10:15:07 +11:00
Maikel Linke
6c0d15b6f9 Migrate existing OIDC account data 2024-02-22 10:15:07 +11:00
Maikel Linke
b4ee24368c Add model for OIDC accounts
The provider name and uid are currently stored on the user model but
it's better to move them to their own table. They are only needed in
certain situations, only some users have an account and we are now
storing a lot more.
2024-02-22 10:15:07 +11:00
Maikel Linke
4d680e5fd1 Use recorded auth hash including all tokens
We want to store the access and refresh token as well.
2024-02-22 10:15:07 +11:00
Maikel Linke
60dc710760 Refactor OIDC callback spec
* Clarify that it's a request spec, not testing a controller directly.
* Use `before` block to avoid side effects changing config at load time.
* Better name the test action as request instead of plain "subject".
* Move assignments into `before` block instead of variable.
2024-02-22 10:15:07 +11:00
Maikel Linke
26f4ebc8f9 Remove unnecessary test code 2024-02-22 10:15:07 +11:00
David Cook
0be0e88646 Merge pull request #12175 from mkllnk/spring-rubocop
Add rubocop binstub for spring support
2024-02-22 10:13:16 +11:00
David Cook
cbb1e41bbc Merge pull request #12174 from mkllnk/user-factory
Simplify user factory around admin role
2024-02-22 10:08:28 +11:00
David Cook
59c3bd02c7 Merge pull request #12173 from filipefurtad0/vcr_stripe_profile_storer_spec
[Stripe testing] Replaces stubs for VCR calls on profile_storer_spec.rb
2024-02-22 10:06:52 +11:00
filipefurtad0
89848efd23 Replaces stubs for VCR calls
Remove calling StripeStubs helper
2024-02-21 10:48:53 +00:00
dependabot[bot]
f564d22941 chore(deps): bump ip from 1.1.8 to 1.1.9
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-20 22:43:09 +00:00
Gaetan Craig-Riou
4ac2830ce6 Merge pull request #12177 from openfoodfoundation/dependabot/bundler/webmock-3.21.2
chore(deps-dev): bump webmock from 3.20.0 to 3.21.2
2024-02-21 09:42:28 +11:00
filipefurtad0
b91719d63c Removes reference to STRIPE_ACCOUNT
THe connected account is created a few lines below, and this env variable is not needed
2024-02-20 15:15:54 +00:00
dependabot[bot]
ccda70723d chore(deps-dev): bump webmock from 3.20.0 to 3.21.2
Bumps [webmock](https://github.com/bblimke/webmock) from 3.20.0 to 3.21.2.
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.20.0...v3.21.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-20 09:37:03 +00:00
Maikel Linke
0ce75ec6e9 Add rubocop binstub for spring support
I observed a significant speed-up on the second run. The first run seems
to be a lot slower though. Additional output suggests that it's now
loading the Rails environment which it doesn't do without spring.

```
time bundle exec rubocop Gemfile
0m2.496s

time rubocop Gemfile # not always right version
0m1.999s

time ./bin/rubocop Gemfile
0m7.543s

time ./bin/rubocop Gemfile
0m0.670s
```
2024-02-20 14:44:56 +11:00
Maikel Linke
e423015f0a Treat enterprises as normal user attribute in factory 2024-02-20 14:00:19 +11:00
Maikel Linke
af085c223d Simplify user factory around admin role
The original Spree user factory was adding the admin role by default.
Since we don't do that anymore, we don't need to remove it for normal
users. We also need to add it only once to admin users.
2024-02-20 12:58:04 +11:00
Maikel
87daf4eb79 Merge pull request #12171 from openfoodfoundation/dependabot/bundler/sidekiq-7.2.2
chore(deps): bump sidekiq from 7.2.1 to 7.2.2
2024-02-20 09:53:54 +11:00
Maikel
741f5dfc83 Merge pull request #12170 from openfoodfoundation/dependabot/bundler/jwt-2.8.0
chore(deps): bump jwt from 2.7.1 to 2.8.0
2024-02-20 09:53:09 +11:00
Konrad
2477a63f36 Merge pull request #12103 from basilawwad/selecting-OC-should-redirect-to-shop
Modify default hash tabs controller to redirect users to shopping panel when an OC is selected.
2024-02-19 21:51:19 +01:00
Filipe
7926ce0c79 Merge pull request #12122 from rioug/remove-stripe-decorator
Remove stripe decorator
2024-02-19 11:28:55 +00:00
dependabot[bot]
f8908d0cf3 chore(deps): bump sidekiq from 7.2.1 to 7.2.2
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.2.1 to 7.2.2.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/sidekiq/sidekiq/compare/v7.2.1...v7.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 09:49:49 +00:00
dependabot[bot]
f961e2c38e chore(deps): bump jwt from 2.7.1 to 2.8.0
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.7.1...v2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 09:48:44 +00:00
Gaetan Craig-Riou
cb83ad688e Remove old vcr stripe cassettes 2024-02-19 15:44:20 +11:00
Gaetan Craig-Riou
02019f7cae Re recorde vcr cassette after rebase 2024-02-19 11:01:20 +11:00
Gaetan Craig-Riou
848767d50f Per review, clean up test set up 2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
89236f4c2f Per review, create a Stripe account
It's better to avoid hard coded stripe entities
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
ef1d2fdb4d Clean up cassettes
* remove old cassettes left over from a rebase
* re recorded cassettes with the lastest Stripe version
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
657f71c357 Further refactor payment specs
- remove any stub_request
- use intance_double of ActiveMerchant::Billing::Response
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
8832f2fef6 Refactor #credit spec
Model spec shouldn't know about the undelying call to stripe. Replaced
request stubs by payment method stubs.
Consolidate #credit spec in one `describe` block
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
edc40c9ea9 Refactor Spree::Gateway::StripeSCA
- fix confusing comment
- rename parameter to better reflect usage
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
0af9ccd17a Add test for #credit
it uses ActiveMerchant::Billing::StripePaymentIntentsGateway#refund,
we covering the last scenario that previously used the decorator.
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
549610bc35 Finally remove StripePaymentIntentsGateway decorator
Add spec for Spree::Gateway::StripeSCA#void
It also partially fix 11670, refund of Stripe payment should now work
for complete order
2024-02-19 10:58:31 +11:00
Gaetan Craig-Riou
214e8b85ea StripePaymentIntentsGateway decorator, remove create_intent 2024-02-19 10:53:53 +11:00
Gaetan Craig-Riou
765ec81725 StripePaymentIntentsGateway decorator, remove capture 2024-02-19 10:53:53 +11:00
Gaetan Craig-Riou
84f53abdfe StripePaymentIntentsGateway decorator, remove store 2024-02-19 10:53:53 +11:00
Gaetan Craig-Riou
8a0c32eec0 Improve Stripe::ProfileStorer specs
* Use `with_stripe_setup` helper
* add the request failing scenario
2024-02-19 10:53:53 +11:00
Gaetan Craig-Riou
62fbaa8a6e Update Stripe payment intents decorator
- copied the relevant code from the new Active Merchant version
- Add spec to cover the scenario of saving a card when paying by card
- Fix Stripe stub.

I used stripe stubs for the new scenario because storing a card on
stripe depends on some client side interaction with Stripe. We can't
capture that with VCR.
2024-02-19 10:53:53 +11:00
dependabot[bot]
fad37318b3 chore(deps): bump activemerchant from 1.123.0 to 1.133.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.123.0 to 1.133.0.
- [Release notes](https://github.com/activemerchant/active_merchant/releases)
- [Changelog](https://github.com/activemerchant/active_merchant/blob/master/CHANGELOG)
- [Commits](https://github.com/activemerchant/active_merchant/compare/v1.123.0...v1.133.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 10:53:53 +11:00
Maikel
4bb1afcc8f Merge pull request #12166 from openfoodfoundation/dependabot/bundler/stripe-10.9.0
chore(deps): bump stripe from 10.8.0 to 10.9.0
2024-02-19 10:22:53 +11:00
Maikel Linke
7eccce138b Update Stripe API recordings for new version 2024-02-19 10:02:05 +11:00
Maikel
17186a5974 Merge pull request #12165 from openfoodfoundation/dependabot/bundler/dotenv-3.0.2
chore(deps): bump dotenv from 3.0.1 to 3.0.2
2024-02-19 09:57:32 +11:00
Rachel Arnould
39b83eae19 Merge pull request #12133 from dacook/buu/new-variant-11066
[BUU] Create a new variant inline
2024-02-16 14:32:17 +01:00
Rachel Arnould
a3af15dbae Merge pull request #12162 from isidzukuri/12003_improve_error_messageg_when_no_products_are_changed
Improve error message by not displaying the first part of the second …
2024-02-16 11:24:52 +01:00
Filipe
49ebcc23b3 Merge pull request #12159 from mkllnk/capybara-wait-time
Reduce Capybara wait time during development
2024-02-16 09:37:28 +00:00
dependabot[bot]
ba9f79c684 chore(deps): bump stripe from 10.8.0 to 10.9.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.8.0 to 10.9.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/v10.8.0...v10.9.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-02-16 09:17:53 +00:00
dependabot[bot]
f0ecef193d chore(deps): bump dotenv from 3.0.1 to 3.0.2
Bumps [dotenv](https://github.com/bkeepers/dotenv) from 3.0.1 to 3.0.2.
- [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.0.1...v3.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-16 09:11:42 +00:00
basilawwad
08111f9a2c added shop target and activateshoppanel function
Remove Pending Message

Update shopping_spec.rb

Update shopping_spec.rb
2024-02-16 09:27:21 +03:00
David Cook
52dbe408dc Merge pull request #12161 from mkllnk/reset
Add rake task to reset queued jobs
2024-02-16 12:17:19 +11:00
David Cook
fbbc47a8d8 Merge pull request #12153 from rioug/12150-dfc-add-state-to-address
[DFC] Add state to address
2024-02-16 10:30:28 +11:00
David Cook
c8af09e0a9 Merge pull request #12152 from mkllnk/record-stripe-commit
(Semi-)automatically commit new Stripe recordings
2024-02-16 10:17:52 +11:00
David Cook
7164cbd0bd Don't validate numericality if blank
This avoids unnecessary second message when left blank:
> can't be blank
> is not a number

Ok this is a little confusing. Why is there a  separate presence check above, and why is it only for measurable units, when we still require a number for _all_ units? Because, for 'items', we allow a blank value then auto-set it to 1.
I don't know if it's really necessary, but that's how it currently works...
2024-02-16 08:51:53 +11:00
David Cook
915a5ce66b Listen for changes on added fields
Finally, we can add new variants!

Requires updated stimulus-rails-nested-form
2024-02-16 08:51:49 +11:00
Maikel
5a0694acbb Merge pull request #12163 from openfoodfoundation/dependabot/bundler/dotenv-3.0.1
chore(deps): bump dotenv from 3.0.0 to 3.0.1
2024-02-16 08:03:54 +11:00
dependabot[bot]
afef8b0a82 chore(deps): bump dotenv from 3.0.0 to 3.0.1
Bumps [dotenv](https://github.com/bkeepers/dotenv) from 3.0.0 to 3.0.1.
- [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.0.0...v3.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 09:54:10 +00:00
isidzukuri
ae9229ec7a Merge branch 'master' into 12003_improve_error_messageg_when_no_products_are_changed 2024-02-15 09:36:53 +02:00
isidzukuri
0c02b5d9bd fix spec 2024-02-15 09:24:02 +02:00
isidzukuri
b9eea88f5c more precise spec for error message wording 2024-02-15 09:20:32 +02:00
isidzukuri
c0e820e447 Improve error message by not displaying the first part of the second sentence if no changes were counted 2024-02-15 09:14:52 +02:00
David Cook
0662708247 Use forked gem until contributions are made upstream 2024-02-15 17:32:08 +11:00
David Cook
3706b6d1da Make actions target optional
This is to make testing simpler, but it is strictly optional anyway.
2024-02-15 17:32:08 +11:00
David Cook
765ee0ed78 refactor js 2024-02-15 17:32:08 +11:00
David Cook
1df0eca4d1 Click button to add form
Now we can fill out the form, but in most cases we can't submit it because it's not marked as 'changed'.
2024-02-15 17:32:08 +11:00
David Cook
6cca7a4a3a Refactor HAML
Making use of nested hash to DRY it up
2024-02-15 17:32:08 +11:00
David Cook
6e5154b922 add stimulus-rails-nested-form
The official instructions (https://www.stimulus-components.com/docs/stimulus-rails-nested-form) don't quite work, because of an issue with this component (https://stackoverflow.com/a/76715129). So we work around for now by using the umd file instead.
2024-02-15 17:32:08 +11:00
David Cook
977ea47487 move new variant form to template
it can be activated with JS, once I can get that compoent working..

◉ Best viewed with whitespace ignored
2024-02-15 17:32:08 +11:00
David Cook
5253aeab17 Add unit_value so we can create new variants for producuts by weight/volume 2024-02-15 17:31:50 +11:00
David Cook
eff92b076f Add new variant form
And with the benefit of time travel, a feature spec from the future which will show us where we're heading.
2024-02-15 17:20:38 +11:00
David Cook
831d786d44 Fix existing specs
Gotta wait for server response before making expectations. This reveals that one test was incomplete, oops.
2024-02-15 17:04:14 +11:00
Maikel Linke
78bfd47ad3 Add rake task to reset queued jobs
Please note that the spec is using Redis as Sidekiq does. This revealed
that Sidekiq wasn't set up for jobs in the test environment properly.
2024-02-15 16:51:10 +11:00
Maikel
c15bf61099 Merge pull request #12156 from isidzukuri/issue_12062_fix_flacky_tax_rate_finder_spec
Improve random name generation in factories related to tax_rate_factory
2024-02-15 15:43:05 +11:00
Maikel
0e92bf33dc Merge pull request #12154 from openfoodfoundation/dependabot/bundler/letter_opener-1.9.0
chore(deps-dev): bump letter_opener from 1.8.1 to 1.9.0
2024-02-15 15:41:12 +11:00
David Cook
ec0e8b80eb Add specs for creating variants
This already works, but we want to make sure it stays that way!
2024-02-15 14:57:13 +11:00
Maikel Linke
3f98e2e559 Reduce Capybara wait time during development
In test-driven development, you run tests and expect them to fail.
Waiting for the results unnecessarily long just slows down development.

And even though CI can be slow, we should aim for good performance of
our code. Long wait times can hide performance bottle necks.

If anyone struggles with the default value, we can add an environment
variable to adjust the wait time to your machine in .env.test.local. But
this may just work for everyone.
2024-02-15 13:11:51 +11:00
David Cook
d812815913 Fix: use correct parameter name
Before, the index was defaulting to the record id, but we want to have a sequential index to guarantee the order always stays the same.
And more importantly, we'll need it for new records that don't have an ID yet.
2024-02-15 11:00:59 +11:00
David Cook
7e186091ff Ensure un-changed field error state shows
When there is a required field that can't be empty. I knew these complex styles would come back to bite me.

◉ Best viewed with whitespace ignored
2024-02-15 10:36:45 +11:00
David Cook
c65771eac6 Add new 'naked' button
I couldn't think of a better name.
2024-02-15 10:36:45 +11:00
David Cook
50b325c944 Annotate and arrange scss 2024-02-15 10:36:45 +11:00
David Cook
024f324027 Refactor: move rows to partials
This file was too big and it's about to get bigger.
2024-02-15 10:36:45 +11:00
Konrad
8751cc37f3 Merge pull request #12126 from cyrillefr/Replace-remote_toggle_controller-with-generic-toggle_control_controller
Replace remote_toggle with method inside generic controller
2024-02-15 00:32:05 +01:00
Konrad
6e54b1e726 Merge pull request #12116 from cillian/apply-fees-on-shipments-create
Make sure fees are applied when adding the first item to a back office order
2024-02-14 23:53:54 +01:00
Konrad
7cd7d2e8ea Merge pull request #12132 from rioug/9290-capture-payment-ignore-order-change
Fix capturing order payment ignore order changes
2024-02-14 23:00:49 +01:00
isidzukuri
cffe573203 improve random name generation in factories related to tax_rate_factory 2024-02-14 18:41:28 +02:00
Rachel Arnould
164bac63e0 Merge pull request #12130 from dacook/buu/modal-styles-11065
[BUU] Image modal styles
2024-02-14 16:12:32 +01:00
dependabot[bot]
0af3e8afcb chore(deps-dev): bump letter_opener from 1.8.1 to 1.9.0
Bumps [letter_opener](https://github.com/ryanb/letter_opener) from 1.8.1 to 1.9.0.
- [Changelog](https://github.com/ryanb/letter_opener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ryanb/letter_opener/compare/v1.8.1...v1.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-14 09:17:52 +00:00
Gaetan Craig-Riou
a5bc1d5c48 Add region to address via DfcProvider::Address
Plus spec and documentation
2024-02-14 16:05:57 +11:00
Gaetan Craig-Riou
17b13e75a8 Add DfcProvider::Address
Add our own address to include `region`, currently not supported
by the DFC connector.
`region` is already included in the next branch of data-model-uml:
729eba31a5
To me removed once the DFC connector is updated
2024-02-14 16:05:48 +11:00
David Cook
6f4e071a28 Update template: Ensure we confirm with next release manager 2024-02-14 14:35:04 +11:00
David Cook
1d9364ade6 Merge pull request #12148 from openfoodfoundation/dependabot/bundler/dotenv-rails-3.0.0
chore(deps): bump dotenv-rails from 2.8.1 to 3.0.0
2024-02-14 14:21:11 +11:00
Maikel Linke
28309c1910 (Semi-)automatically commit new Stripe recordings
This script is used by a developer whenever the Stripe gem is bumped by
Dependabot. I found myself always doing the same commands and thought
that they could be automated.

I'm not going as far as pushing back to the branch but we might do that
in the future?
2024-02-14 13:54:38 +11:00
Gaetan Craig-Riou
affadbc05c Update all locales with the latest Transifex translations 2024-02-14 13:33:28 +11:00
Maikel
4197611ad2 Merge pull request #12141 from openfoodfoundation/dependabot/bundler/stripe-10.8.0
chore(deps): bump stripe from 10.6.0 to 10.8.0
2024-02-14 11:40:16 +11:00
Maikel Linke
96469cb58a Update stripe cassettes 2024-02-14 11:16:59 +11:00
Gaetan Craig-Riou
930aac97eb Replacing dotenv-rails by dotenv
From dotenv V3 changelog:
> The dotenv-rails gem is now superfluous. It's not technically
  deprecated yet and will continue to work, but the dotenv gem does the
  same thing. bkeepers/dotenv#468
2024-02-14 09:25:52 +11:00
Gaetan Craig-Riou
2213487b99 Merge pull request #12147 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.6.3
chore(deps): bump @floating-ui/dom from 1.6.2 to 1.6.3
2024-02-14 09:04:53 +11:00
dependabot[bot]
e19d3d09dc chore(deps): bump dotenv-rails from 2.8.1 to 3.0.0
Bumps [dotenv-rails](https://github.com/bkeepers/dotenv) from 2.8.1 to 3.0.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/v2.8.1...v3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 09:22:42 +00:00
dependabot[bot]
1260ee281e chore(deps): bump @floating-ui/dom from 1.6.2 to 1.6.3
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.2 to 1.6.3.
- [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/@floating-ui/dom@1.6.3/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 09:11:30 +00:00
Maikel
41ebdc0c29 Merge pull request #12144 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.6.2
chore(deps): bump @floating-ui/dom from 1.6.1 to 1.6.2
2024-02-13 11:48:11 +11:00
Maikel
13b6296764 Merge pull request #12143 from openfoodfoundation/dependabot/npm_and_yarn/jasmine-core-5.1.2
chore(deps-dev): bump jasmine-core from 5.1.1 to 5.1.2
2024-02-13 11:46:12 +11:00
Filipe
850918dac5 Merge pull request #12112 from chahmedejaz/bugfix/12085-fix-customer-search-autofill-issue
Fix Customer Search Autofill Issue
2024-02-12 12:29:28 +00:00
dependabot[bot]
942b4eea30 chore(deps): bump @floating-ui/dom from 1.6.1 to 1.6.2
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.1 to 1.6.2.
- [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/@floating-ui/dom@1.6.2/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 09:41:12 +00:00
Gaetan Craig-Riou
78a1726bdc Merge pull request #12142 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-8.0.2
chore(deps): bump @hotwired/turbo from 7.3.0 to 8.0.2
2024-02-12 11:29:57 +11:00
Gaetan Craig-Riou
dc2fe0471d Merge pull request #12140 from openfoodfoundation/dependabot/bundler/redis-5.1.0
chore(deps): bump redis from 5.0.8 to 5.1.0
2024-02-12 11:19:33 +11:00
dependabot[bot]
2c0f8f2610 chore(deps-dev): bump jasmine-core from 5.1.1 to 5.1.2
Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine/compare/v5.1.1...v5.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 09:47:15 +00:00
dependabot[bot]
527246ab98 chore(deps): bump @hotwired/turbo from 7.3.0 to 8.0.2
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.3.0 to 8.0.2.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.3.0...v8.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 09:46:46 +00:00
dependabot[bot]
8a9c4f83c5 chore(deps): bump stripe from 10.6.0 to 10.8.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.6.0 to 10.8.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/v10.6.0...v10.8.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-02-09 09:30:05 +00:00
dependabot[bot]
c614123339 chore(deps): bump redis from 5.0.8 to 5.1.0
Bumps [redis](https://github.com/redis/redis-rb) from 5.0.8 to 5.1.0.
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v5.0.8...v5.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 09:28:19 +00:00
David Cook
c0adf94712 Update all locales with the latest Transifex translations 2024-02-09 10:29:47 +11:00
David Cook
4012eb52e2 Merge pull request #12136 from openfoodfoundation/dependabot/npm_and_yarn/hotkeys-js-3.13.7
chore(deps): bump hotkeys-js from 3.13.6 to 3.13.7
2024-02-09 10:19:05 +11:00
David Cook
458d5de426 Merge pull request #12134 from openfoodfoundation/dependabot/bundler/webmock-3.20.0
chore(deps-dev): bump webmock from 3.19.1 to 3.20.0
2024-02-09 10:17:48 +11:00
David Cook
7992d912b7 Merge pull request #12128 from mkllnk/bin-update
Remove update script, use bin/setup instead
2024-02-09 10:17:00 +11:00
David Cook
9d340af680 Merge pull request #12123 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.0.10
chore(deps): bump trix from 2.0.9 to 2.0.10
2024-02-09 10:08:44 +11:00
David Cook
5d630c27b0 Merge pull request #12104 from filipefurtad0/vcr_credit_card_remover_spec
[Stripe, VCR] Updates credit_card_remover_spec.rb
2024-02-09 09:06:43 +11:00
filipefurtad0
60c03f6161 Re-records VCR tapes 2024-02-08 15:08:59 +00:00
David Cook
c2f8786ffa Filter out STRIPE_INSTANCE_SECRET_KEY from cassettes
And also STRIPE_ENDPOINT_SECRET just in case it's ever used in tests.

Re-records Stripe tests. But some failed... :'(

Failed examples:

rspec ./spec/lib/stripe/credit_card_cloner_spec.rb:71 # Stripe::CreditCardCloner#find_or_clone when called with a valid customer and payment_method clones both the payment method and the customer
rspec ./spec/lib/stripe/payment_intent_validator_spec.rb[1:1:1:1:17:1:2] # Stripe::PaymentIntentValidator#call when payment intent is valid valid non-3D credit cards are correctly handled behaves like payments intents from UnionPay (debit) captures the payment
2024-02-08 14:58:24 +00:00
David Cook
e228ad0326 Exit if any command fails
If the working directory is dirty, git rm might fail.
2024-02-08 14:53:51 +00:00
filipefurtad0
aff8df1957 Undoes changes to stripe initializer
Sets instance key in .env.test file
2024-02-08 14:53:51 +00:00
filipefurtad0
edae56345b Removes unnecessary Stripe api key / secret declaration 2024-02-08 14:53:48 +00:00
filipefurtad0
5b738476e4 Replaces double with instance_double 2024-02-08 14:50:42 +00:00
filipefurtad0
dfb18af971 Improves Stripe api.key declaration 2024-02-08 14:50:42 +00:00
filipefurtad0
ecc5bbd0ed Adds condition to set Stripe.api key
Updates spec accordingly
2024-02-08 14:50:42 +00:00
filipefurtad0
949f7ef4d4 Removes unecessary braces - Ruby magic ;-) 2024-02-08 14:50:42 +00:00
filipefurtad0
9cad866fb6 Renames test case and VCR cassette
deletes previous cassette
2024-02-08 14:50:42 +00:00
filipefurtad0
949b515bfb Replaces stubs for non-existing customer test case 2024-02-08 14:50:42 +00:00
filipefurtad0
57f55d7585 Replaces stubs for existing customer test case 2024-02-08 14:50:42 +00:00
filipefurtad0
94168a3586 Encompasses test cases in describe block
Maybe not needed but, brings perhaps some structure to the spec, an creates a place holder for the required setup
2024-02-08 14:50:42 +00:00
dependabot[bot]
a26ecc0aa1 chore(deps): bump hotkeys-js from 3.13.6 to 3.13.7
Bumps [hotkeys-js](https://github.com/jaywcjlove/hotkeys-js) from 3.13.6 to 3.13.7.
- [Release notes](https://github.com/jaywcjlove/hotkeys-js/releases)
- [Commits](https://github.com/jaywcjlove/hotkeys-js/compare/v3.13.6...v3.13.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 09:22:40 +00:00
David Cook
c4ea343a47 Merge pull request #12127 from filipefurtad0/corrects_setup_in_credit_card_cloner_spec
Corrects setup for setup in credit card cloner spec
2024-02-08 09:14:35 +11:00
Maikel
b20bfae714 Merge pull request #12135 from filipefurtad0/stripe_payment_state_spec_failure
Removes UnionPay (debit) from non-3DS card list
2024-02-08 08:41:12 +11:00
Maikel
04320bcf27 Merge pull request #12124 from openfoodfoundation/dependabot/bundler/invisible_captcha-2.2.0
chore(deps): bump invisible_captcha from 2.1.0 to 2.2.0
2024-02-08 08:38:45 +11:00
Maikel
2f90adcaf3 Merge pull request #12121 from openfoodfoundation/dependabot/bundler/nokogiri-1.16.2
chore(deps): bump nokogiri from 1.16.0 to 1.16.2
2024-02-08 08:37:09 +11:00
Maikel
75896c0bc1 Merge pull request #12117 from openfoodfoundation/dependabot/bundler/valid_email2-5.2.1
chore(deps): bump valid_email2 from 5.1.1 to 5.2.1
2024-02-08 08:11:20 +11:00
filipefurtad0
6c9556f2db Removes UnionPay (debit) from non-3DS card list
Rubocop fixes
2024-02-07 16:32:34 +00:00
filipefurtad0
769ccfd6ef Corrects setup for setup in credit card cloner spec
We should not need additional hard coded keys other than the API key and the CLIENT_ID; this PR removes hard coded customer ID - creates one instead

Undoes Stripe.api_key deletion

This was a mixup with an ongoing PR in which we remove the need to call api_key in each individual spec.
2024-02-07 12:20:43 +00:00
dependabot[bot]
1d7cf8fdb8 chore(deps-dev): bump webmock from 3.19.1 to 3.20.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.19.1 to 3.20.0.
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.19.1...v3.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 10:08:57 +00:00
dependabot[bot]
49f64b6d2e chore(deps): bump valid_email2 from 5.1.1 to 5.2.1
Bumps [valid_email2](https://github.com/micke/valid_email2) from 5.1.1 to 5.2.1.
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v5.1.1...v5.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 08:02:14 +00:00
dependabot[bot]
5c14bb6dbf chore(deps): bump invisible_captcha from 2.1.0 to 2.2.0
Bumps [invisible_captcha](https://github.com/markets/invisible_captcha) from 2.1.0 to 2.2.0.
- [Changelog](https://github.com/markets/invisible_captcha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/markets/invisible_captcha/compare/v2.1.0...v2.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 04:28:31 +00:00
Gaetan Craig-Riou
5fd36e7eed Fix SubscriptionConfirmJob spec
Fix the payment stubbing, payment `process_offline!` was stubbed to
return true and payment `completed?` was also stubbed to return true.
`process_offline!` did not change the payment status in the database,
meaning that any call to 'order.pending_payments' after that would
return the payment which should have been processed offline, and
therefore completed. This created some unwanted side effect, resulting
in the test breaking.
2024-02-07 15:27:51 +11:00
Gaetan Craig-Riou
c11d30eb13 Refactor order updater spec
Re organise the specs based on the method we are testing, it makes
the spec file more readable.

Best viewed with whitespace hidden
2024-02-07 14:46:26 +11:00
Gaetan Craig-Riou
7da516b637 Update pending payment for completed order
Update pending payment for cash order, so we can take into account any
changes affecting order toral (shipments, line item quantity etc...).
This is to allow payment capture to cover the order total, not just
the amount due at checkout.
2024-02-07 14:46:19 +11:00
Gaetan Craig-Riou
e6fba74a87 Make update_pending_payment private
It's not used anywhere in the code, there is no reason for it to be
public
2024-02-07 14:44:59 +11:00
Gaetan Craig-Riou
a2ce718091 Merge pull request #12131 from mkllnk/openid_connect
Fix gem dependency declaration
2024-02-07 14:15:58 +11:00
Maikel Linke
d92263456d Fix gem dependency declaration
Dependabot updated openid_connect despite this being restricted in our
Gemfile. Now, all future updates downgrade openid_connect again to
satisfy our requested version.

I couldn't find any good reason not to upgrade openid_connect though and
since that's the version we already have, let's keep it and just remove
the restriction. Then bundler doesn't downgrade any more and updates are
performed well.
2024-02-07 13:50:19 +11:00
David Cook
5e4dd3864f Update image and modal size
Using a new 'fit' modal size.

On smaller screens, we need to allow the image to shrink. That's a good general rule, but I was hesitant to make it a global rule..
2024-02-07 12:48:44 +11:00
David Cook
98cfc68c3a Add option for modal class 2024-02-07 12:28:43 +11:00
David Cook
d24348d0f2 Increase button size
And fix alignment for smaller screens.
2024-02-07 10:13:17 +11:00
Maikel Linke
b524e0f1cc Remove update script, use bin/setup instead 2024-02-07 08:24:10 +11:00
cyrillefr
f8cb98f43e Replace remote_toggle with method inside generic controller
- put former remote toggle ctrller toggle method
   in new toggleAdvancedSettings in more generic toggle ctrller
 - modified acordingly the 2 associated views
 - put former test code in more generic ctrller test file
 - deleted now useless ctrller + test files
2024-02-06 17:02:23 +01:00
dependabot[bot]
7c8a149d49 chore(deps): bump trix from 2.0.9 to 2.0.10
Bumps [trix](https://github.com/basecamp/trix) from 2.0.9 to 2.0.10.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.0.9...v2.0.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 09:10:24 +00:00
Gaetan Craig-Riou
75355b0359 Add test to cover updating pending payments 2024-02-06 16:47:18 +11:00
David Cook
b3692d7468 Remove min-height for ModalComponent 2024-02-06 15:00:29 +11:00
David Cook
6189feadaa Prevent modal covered by scrollbar
Using units relative to the document, rather than the screen.

I don't think that remaining min-height should be there at all, but reveal-modal is used a lot so I don't know for sure.
2024-02-06 14:56:39 +11:00
David Cook
784f74f466 Align buttons to the right 2024-02-06 14:51:13 +11:00
dependabot[bot]
e77bad2dfa chore(deps): bump nokogiri from 1.16.0 to 1.16.2
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.0 to 1.16.2.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.0...v1.16.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 14:40:42 +11:00
Maikel
d772c590da Merge pull request #12118 from openfoodfoundation/dependabot/npm_and_yarn/hotkeys-js-3.13.6
chore(deps): bump hotkeys-js from 3.13.5 to 3.13.6
2024-02-06 14:37:26 +11:00
David Cook
8c6d3a27ec Move modal action styles to parent component
They were already being shared with a HelpModalComponent in fact.
2024-02-06 14:34:36 +11:00
Maikel
4dda4e2385 Merge pull request #12101 from openfoodfoundation/dependabot/bundler/datafoodconsortium-connector-1.0.0.pre.alpha.10
chore(deps): bump datafoodconsortium-connector from 1.0.0.pre.alpha.9 to 1.0.0.pre.alpha.10
2024-02-06 11:20:41 +11:00
filipefurtad0
6c2f958b3f Update all locales with the latest Transifex translations 2024-02-05 11:11:29 +00:00
Rachel Arnould
d4d5449fba Merge pull request #12107 from dacook/buu/fixes
[BUU] Style and behaviour updates
2024-02-05 11:33:06 +01:00
Rachel Arnould
11bdba3c4e Merge pull request #12073 from rioug/12045-add-invisible-captcha
Add invisible captcha to registration screen
2024-02-05 10:44:41 +01:00
dependabot[bot]
5b719fcb9b chore(deps): bump hotkeys-js from 3.13.5 to 3.13.6
Bumps [hotkeys-js](https://github.com/jaywcjlove/hotkeys-js) from 3.13.5 to 3.13.6.
- [Release notes](https://github.com/jaywcjlove/hotkeys-js/releases)
- [Commits](https://github.com/jaywcjlove/hotkeys-js/compare/v3.13.5...v3.13.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 09:25:21 +00:00
Maikel Linke
939687a592 Bump DFC taxonomies from v1.0.2 to v1.2.0 2024-02-05 14:19:29 +11:00
Maikel Linke
e3c6629f62 Remove DFC importer monkey patches
The Connector gem contains our code now.
2024-02-05 14:19:29 +11:00
dependabot[bot]
a65c7fc65a chore(deps): bump datafoodconsortium-connector
Bumps datafoodconsortium-connector from 1.0.0.pre.alpha.9 to 1.0.0.pre.alpha.10.

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 14:19:29 +11:00
Gaetan Craig-Riou
67aead6981 Merge pull request #12114 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.0.9
chore(deps): bump trix from 2.0.8 to 2.0.9
2024-02-05 11:58:08 +11:00
Gaetan Craig-Riou
6d3af4801e Merge pull request #12100 from mkllnk/remove-background-reports-toggle
Remove background_reports feature toggle
2024-02-05 11:47:43 +11:00
Cillian O'Ruanaidh
da71f711c0 Make sure fees are applied when adding the first item to a back office order 2024-02-02 13:11:15 +00:00
dependabot[bot]
4a0a6c6827 chore(deps): bump trix from 2.0.8 to 2.0.9
Bumps [trix](https://github.com/basecamp/trix) from 2.0.8 to 2.0.9.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.0.8...v2.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-02 09:53:24 +00:00
Maikel
df769192af Merge pull request #12109 from openfoodfoundation/dependabot/bundler/omniauth_openid_connect-and-openid_connect-0.7.1
chore(deps): bump omniauth_openid_connect and openid_connect
2024-02-02 15:11:40 +11:00
Maikel
ed62e5f371 Merge pull request #12110 from openfoodfoundation/dependabot/bundler/bootsnap-1.18.3
chore(deps): bump bootsnap from 1.18.2 to 1.18.3
2024-02-02 15:10:02 +11:00
Ahmed Ejaz
a6431bdec6 12085: fix customer search autofill issue 2024-02-02 01:58:35 +05:00
dependabot[bot]
2c497195b4 chore(deps): bump bootsnap from 1.18.2 to 1.18.3
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.18.2 to 1.18.3.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.18.2...v1.18.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 09:50:57 +00:00
dependabot[bot]
4d6500fe39 chore(deps): bump omniauth_openid_connect and openid_connect
Bumps [omniauth_openid_connect](https://github.com/m0n9oose/omniauth_openid_connect) and [openid_connect](https://github.com/nov/openid_connect). These dependencies needed to be updated together.

Updates `omniauth_openid_connect` from 0.6.1 to 0.7.1
- [Changelog](https://github.com/omniauth/omniauth_openid_connect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/m0n9oose/omniauth_openid_connect/compare/v0.6.1...v0.7.1)

Updates `openid_connect` from 1.4.2 to 2.3.0
- [Release notes](https://github.com/nov/openid_connect/releases)
- [Changelog](https://github.com/nov/openid_connect/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nov/openid_connect/compare/v1.4.2...v2.3.0)

---
updated-dependencies:
- dependency-name: omniauth_openid_connect
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: openid_connect
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 09:50:18 +00:00
David Cook
d0724bab85 Fix column header alignmnt 2024-02-01 12:09:49 +11:00
David Cook
36722bfa20 Add more room for the On Hand column 2024-02-01 12:02:42 +11:00
David Cook
262823bddd Ensure On Demand field doesn't overflow following cell 2024-02-01 11:56:40 +11:00
Maikel
1550f1356d Merge pull request #12105 from openfoodfoundation/dependabot/bundler/bootsnap-1.18.2
chore(deps): bump bootsnap from 1.17.1 to 1.18.2
2024-02-01 11:31:34 +11:00
David Cook
079925bc9a Fix for styling with a blank value
It's not usually valid, but can still be entered. I wasn't able to fix the positioning of the :after psuedo element without having a child text node. Maybe it's possible to add an empty child text node, but I didn't think it worth getting down to that level..
2024-02-01 11:31:14 +11:00
David Cook
133a9e6c7f Show popout when press printable character 2024-02-01 11:18:15 +11:00
David Cook
da82b12ca7 Prevent negative values for stock on hand
Using browser validation. I didn't use model validation because the on_hand pseudo-attribute doesn't support it.

But.. it turned out to  not be so simple. Browser validation can't work if the field is hidden, and breaks the javascript. So now I made the javascript smarter, and the end result is more helpful I think.
2024-02-01 11:18:15 +11:00
David Cook
3d941dcc1f Adjust popout position
Now it's lined up perfectly with the number input.
2024-02-01 11:18:15 +11:00
David Cook
ae1fabae38 Tweak padding according to design 2024-02-01 11:18:15 +11:00
Konrad
a30da1f656 Merge pull request #12093 from cillian/generate-invoice-button-warning
Display a warning when clicking the generate invoice button if an ABN is required but not present
2024-01-31 21:52:15 +01:00
Konrad
60c18ffa85 Merge pull request #12084 from cyrillefr/Replace-toggle_controller-with-generic-toggle_control_controller
Replace toggle_controller with method inside generic controller
2024-01-31 21:17:47 +01:00
Konrad
d24924b8f4 Merge pull request #12075 from cyrillefr/Actions-dropdown-should-not-open-automatically-after-shipping-the-order
Actions dropdown should stay closed after shipping order
2024-01-31 20:49:49 +01:00
Konrad
9e6b8e0624 Merge pull request #12047 from rioug/12021-enterprise-fee-tax-on-invoice
Include Tax on enterprise fees on the invoice
2024-01-31 15:32:54 +01:00
dependabot[bot]
3773946d0d chore(deps): bump bootsnap from 1.17.1 to 1.18.2
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.17.1 to 1.18.2.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.17.1...v1.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 10:00:46 +00:00
David Cook
52e2e37c4e Merge pull request #12078 from mkllnk/yarn
Prompt for nodenv when missing
2024-01-31 14:01:10 +11:00
David Cook
97ab41b47e Merge pull request #12068 from mkllnk/dfc-enterprise-promo-image
Add promo image to DFC Enterprise API
2024-01-31 13:35:47 +11:00
Maikel
46a5f13cd8 Merge pull request #12102 from openfoodfoundation/dependabot/bundler/monetize-1.13.0
chore(deps): bump monetize from 1.12.0 to 1.13.0
2024-01-31 11:36:34 +11:00
dependabot[bot]
8cd64f45b9 chore(deps): bump monetize from 1.12.0 to 1.13.0
Bumps [monetize](https://github.com/RubyMoney/monetize) from 1.12.0 to 1.13.0.
- [Changelog](https://github.com/RubyMoney/monetize/blob/main/CHANGELOG.md)
- [Commits](https://github.com/RubyMoney/monetize/compare/v1.12.0...v1.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 09:15:07 +00:00
Maikel Linke
a7571b152d Simplify report rendering
* DRY rendering_options calls.
* Remove unneeded parameter from method.
* Choose better name for background rendering method.
2024-01-30 12:46:32 +11:00
Maikel Linke
d2736002dc Remove dead code from ReportsController
That code was rendering the report in the request but we only do it in
the background now.
2024-01-30 12:34:57 +11:00
Maikel Linke
29bcbc58de Simplify reports form options 2024-01-30 12:18:59 +11:00
Maikel Linke
27353fbd7d Style FeatureToggle option for easier change
When the list of active features is empty, Rubocop wants the hash braces
to be collapsed to `{}`. While that's easier to read, we would need to
change that every time we add an entry or remove it. Instead I moved the
comment into the hash which satisfies Rubocop and is apt in that place.

This could also ease merge conflict resolution when we work on several
features in parallel.
2024-01-30 12:12:55 +11:00
Maikel Linke
bcfaed852b Remove background_reports feature toggle 2024-01-30 12:11:04 +11:00
Maikel
865394913b Merge pull request #12098 from filipefurtad0/shopfront_message_redirect_pending_test_for_12076
[Pending spec] Updates distributor to have a shopfront message (reproduces #12076)
2024-01-30 11:56:40 +11:00
Maikel
fff1a21688 Merge pull request #12074 from filipefurtad0/vcr_credit_card_clone_destroyer_spec
[Stripe, VCR] Updates credit_card_cloner_spec.rb
2024-01-30 11:24:04 +11:00
Maikel Linke
59e3592c6e Remove duplicate code from spec 2024-01-30 11:08:20 +11:00
Gaetan Craig-Riou
66fcbe3fa0 Merge pull request #12097 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.143.0
chore(deps): bump aws-sdk-s3 from 1.142.0 to 1.143.0
2024-01-30 09:42:53 +11:00
Gaetan Craig-Riou
239f4fcb73 Merge pull request #12096 from openfoodfoundation/dependabot/bundler/capybara-3.40.0
chore(deps-dev): bump capybara from 3.39.2 to 3.40.0
2024-01-30 09:40:41 +11:00
Gaetan Craig-Riou
881c54f4a2 Merge pull request #12095 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.6.1
chore(deps): bump @floating-ui/dom from 1.6.0 to 1.6.1
2024-01-30 09:39:44 +11:00
filipefurtad0
d2bb53da5b Removes assertion on bogus_customer
When running the CI we actually assert on the bogus credentials, which breaks the spec

Removes unecessary StripeStubs inclusion
2024-01-29 20:04:38 +00:00
filipefurtad0
318a8113ed Updates distributor to have a shopfront message
Doing so, enables a homepage for that enterprise, which surfaces issue #12076. The test as been set as pending, which needs to be changed when the issue is fixed
2024-01-29 15:52:31 +00:00
dependabot[bot]
65395d7c90 chore(deps): bump aws-sdk-s3 from 1.142.0 to 1.143.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.142.0 to 1.143.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 09:58:09 +00:00
dependabot[bot]
b41944396f chore(deps-dev): bump capybara from 3.39.2 to 3.40.0
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.39.2 to 3.40.0.
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.39.2...3.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 09:55:37 +00:00
dependabot[bot]
183cac4a0c chore(deps): bump @floating-ui/dom from 1.6.0 to 1.6.1
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.0 to 1.6.1.
- [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/@floating-ui/dom@1.6.1/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 09:24:52 +00:00
Gaetan Craig-Riou
e129ef38c2 Refactor total method to use sum instead of reduce
Plus some extra specs to cover missing scenarios
2024-01-29 14:12:28 +11:00
Gaetan Craig-Riou
04db8dbd37 Remove unused method 2024-01-29 13:21:13 +11:00
Gaetan Craig-Riou
aceb96e2af Merge pull request #12092 from openfoodfoundation/dependabot/bundler/rspec-rails-6.1.1
chore(deps-dev): bump rspec-rails from 6.1.0 to 6.1.1
2024-01-29 11:26:49 +11:00
Gaetan Craig-Riou
fb91e79ff2 Merge pull request #12091 from openfoodfoundation/dependabot/bundler/newrelic_rpm-9.7.1
chore(deps): bump newrelic_rpm from 9.7.0 to 9.7.1
2024-01-29 11:25:35 +11:00
Gaetan Craig-Riou
30489b8fb3 Merge pull request #12090 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.6.0
chore(deps): bump @floating-ui/dom from 1.5.4 to 1.6.0
2024-01-29 11:24:17 +11:00
Gaetan Craig-Riou
d892e00cdd Merge pull request #12083 from openfoodfoundation/dependabot/bundler/rubocop-1.60.2
chore(deps-dev): bump rubocop from 1.59.0 to 1.60.2
2024-01-29 11:15:19 +11:00
Gaetan Craig-Riou
8bb1e03808 Merge pull request #12081 from openfoodfoundation/dependabot/bundler/bugsnag-6.26.3
chore(deps): bump bugsnag from 6.26.2 to 6.26.3
2024-01-29 11:12:07 +11:00
Gaetan Craig-Riou
d39fecccb1 Merge pull request #12079 from mkllnk/pretty
Remove automatic pre-commit hook
2024-01-29 11:10:52 +11:00
Gaetan Craig-Riou
d5499245d0 Merge pull request #11698 from openfoodfoundation/dependabot/bundler/redis-5.0.8
chore(deps): bump redis from 4.8.1 to 5.0.8
2024-01-29 10:55:58 +11:00
Cillian O'Ruanaidh
f960dec0eb Display a warning when clicking the generate invoice button if an ABN is required but not present 2024-01-26 14:28:42 +00:00
dependabot[bot]
ea28282584 chore(deps-dev): bump rspec-rails from 6.1.0 to 6.1.1
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 6.1.0 to 6.1.1.
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v6.1.0...v6.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:52:30 +00:00
dependabot[bot]
b34127dc0d chore(deps): bump newrelic_rpm from 9.7.0 to 9.7.1
Bumps [newrelic_rpm](https://github.com/newrelic/newrelic-ruby-agent) from 9.7.0 to 9.7.1.
- [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.7.0...9.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:49:27 +00:00
dependabot[bot]
37fb72b9eb chore(deps): bump @floating-ui/dom from 1.5.4 to 1.6.0
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.5.4 to 1.6.0.
- [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/@floating-ui/dom@1.6.0/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:28:38 +00:00
filipefurtad0
3e734f1e6b Attaches customer to payment method and clones payment method
Improves naming of actors; improves assertions
2024-01-25 18:43:05 +00:00
filipefurtad0
baef7de663 Replaces stubs with real accounts and card ids
The second example on this sepec is commented out, and will be addressed on the following commit

Sets user email

We need to set an email for the user we're creating; if we don't, then each time we run the spec, a new user will be created with a random email - as per user factory. This will translate in a (slightly) different HTTP request each time the spec is ran, and will cause a VCR recording error as new cassettes cannot be recorded in under the CI.

Re-recordes cassette after rebase
2024-01-25 18:43:03 +00:00
Rachel Arnould
6fecd57c69 Merge pull request #12048 from dacook/buu/add-product-images-11065
[BUU] Add new product images
2024-01-25 16:44:02 +01:00
Rachel Arnould
96d2021b72 Merge branch 'master' into buu/add-product-images-11065 2024-01-25 16:32:45 +01:00
dependabot[bot]
a1120c6b06 chore(deps-dev): bump rubocop from 1.59.0 to 1.60.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.59.0 to 1.60.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.59.0...v1.60.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-25 09:32:15 +00:00
cyrillefr
e6c0afa477 Replace toggle_controller with method inside generic ctrller
- move toggle method from toggle_controller inside toggle_control
    ctrller
  - change corresponding html attributes in view
  - mode corresponding spec in toggle_controller ctrller spec
  - delete now unused toggle controller + spec
2024-01-25 10:16:02 +01:00
dependabot[bot]
3df5b0bcf9 chore(deps): bump bugsnag from 6.26.2 to 6.26.3
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.26.2 to 6.26.3.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.26.2...v6.26.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-25 09:14:57 +00:00
David Cook
a005069394 Merge pull request #12041 from mkllnk/migrations
Remove migrations with faulty ids
2024-01-25 17:29:23 +11:00
David Cook
6ffe125820 Override default messages
Just in case any bots have been trained to handle the gem's default messages.
2024-01-25 17:24:27 +11:00
David Cook
55ad1ede4e Add messages to ensure they get translated 2024-01-25 17:23:34 +11:00
David Cook
2535435b55 Test success with invisible_captcha 2024-01-25 17:09:18 +11:00
David Cook
0638b9eea4 Use unique email address for test
Using the existing user email is only needed for the 'already registered' test.
:
2024-01-25 17:06:25 +11:00
David Cook
c3914bc7ae Merge pull request #11759 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.3.1
chore(deps): bump tom-select from 2.2.3 to 2.3.1
2024-01-25 16:26:10 +11:00
David Cook
4634917597 Treat image integrity error as an input error
And thus give the user a useful message to try again.

Hmm, if this is a good idea, we should do it everywhere we upload an image. Can we build that in somehow, or at least make a shared helper that accepts a block and catches the error?

I replicated this in dev a couple of times, I think with a text file labelled as an image file. Unfortunately, I can no longer replicate in dev or with a spec.
2024-01-25 14:14:58 +11:00
David Cook
a915182bf8 Add tests for image controller 2024-01-25 14:14:58 +11:00
David Cook
c462ac919f Use image url helper
Without it, I think the correct S3 url isn't generated.
2024-01-25 14:14:58 +11:00
David Cook
f72154e40c Add image create form
Re-using the edit image form, because they're basically the same.
2024-01-25 14:14:58 +11:00
David Cook
07bef860b2 Add spec for updating image 2024-01-25 14:14:58 +11:00
David Cook
25f4954795 Combine spec 2024-01-25 14:14:58 +11:00
David Cook
e92f4a120a Refactor: re-organise spec file
No code changes, just moving it around and renaming blocks. Best viewed with white-space ignored.
2024-01-25 14:14:58 +11:00
Maikel Linke
687176cf49 Remove trouble-some hiredis
The hiredis client was praised as being faster parsing bulk responses
but it seems to have multiple issues now:

- The redis release 5.0 moved hiredis support to another gem.
- I tried the hiredis-client gem and it raised errors.
- There are claims of worse performance of hiredis [1].
- Maintenance responsiveness has been questioned [2].

Using the default redis driver seems to work fine though.

[1]: https://discuss.rubyonrails.org/t/hiredis-does-not-support-ssl-action-cable/75945
[2]: https://github.com/redis/hiredis/issues/655
2024-01-25 13:28:44 +11:00
dependabot[bot]
9d710652d4 chore(deps): bump redis from 4.8.1 to 5.0.8
Bumps [redis](https://github.com/redis/redis-rb) from 4.8.1 to 5.0.8.
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.8.1...v5.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-25 11:33:37 +11:00
Maikel Linke
79863fa749 Remove automatic pre-commit hook
It slows down the `git commit` command even when you don't edit any CSS
or JS files. It also restricts you when committing work in progress.

In my opinion, the linting should happen in your IDE, not when
committing. But you can install your own pre-commit hook if you like.

We still have CI to check all contributions.
2024-01-25 11:01:55 +11:00
Maikel Linke
09a24b0f1f Prompt for nodenv when missing
The setup script would display several error messages and continue
running. Now the user is guided to the right solution.
2024-01-25 10:57:38 +11:00
Maikel Linke
1884bcf780 Update all locales with the latest Transifex translations 2024-01-25 10:10:20 +11:00
Konrad
773131741b Merge pull request #11817 from rioug/10809-match-taxons-to-DFC-product-types
[DFC] match taxons to dfc product types
2024-01-25 00:05:31 +01:00
Konrad
d15395a252 Merge pull request #12052 from dacook/hotkeys
Hotkey fix
2024-01-24 23:34:50 +01:00
Konrad
ca12eab4bb Merge pull request #11985 from chahmedejaz/task/11768-add-voucher-in-enterprise-fees-with-tax-by-order-report
Include vouchers in report: Enterprise Fees With Tax Report By Order
2024-01-24 22:57:48 +01:00
Konrad
5377304190 Merge pull request #12050 from cyrillefr/Replace-toggle_button_disabled_controller-with-generic-toggle_control_controller
Replace toggle_button_disable controller with generic toggle_control controller
2024-01-24 16:39:26 +01:00
Konrad
ec4bbe6241 Merge pull request #12038 from mkllnk/dfc-tax-category
Spec requiring tax category when creating products
2024-01-24 16:26:57 +01:00
cyrillefr
b8743d853f Actions dropdown should stay closed after shipping order
- added hidden css class for it to stay closed.
2024-01-24 08:35:55 +01:00
Gaetan Craig-Riou
048619d660 Move disabling timestamp check to the spec helper 2024-01-24 15:56:25 +11:00
Gaetan Craig-Riou
67dc79b074 Replace tomselect_search_and_select by tomselect_select
In these scenarios, searching for the option is not actually required,
we can directly click on the needed option. It prevent issue with
the dropdown option staying open and breaking specs.
2024-01-24 14:53:44 +11:00
Gaetan Craig-Riou
98545741e6 Add tomselect_select helper
When using `tomselect_search_and_select` and searching isn't really
required it leaves the dropdown option open. It can then cause problem
when trying to interact with other element in the page. This happens
because clicking on the chosen option happena before the searching
finishes.
We can now use `tomselect_select` when searching is not actually
required.
It should not be a problem when search is required, as capybara will
wait for the option to appear on the page before clicking.
2024-01-24 14:47:21 +11:00
Maikel
25a4e45171 Merge pull request #12070 from openfoodfoundation/dependabot/bundler/sidekiq-7.2.1
Bump sidekiq from 7.2.0 to 7.2.1
2024-01-24 14:21:59 +11:00
Maikel Linke
d12c0a7d9d Fixup: Remove unused method from spec 2024-01-24 12:09:02 +11:00
Gaetan Craig-Riou
f4ea71eb3c Fix check for locale cookie
For some reason the app set an `_ofn_session_id cookie`, which broke
the assertion expecting no cookie.
2024-01-24 10:04:49 +11:00
Gaetan Craig-Riou
0d474f6e29 Fix Rubocop warning 2024-01-23 17:00:19 +11:00
Gaetan Craig-Riou
910d0a91f7 Small style refactor.
- Replace `context` by `describe`, although they are equivalent, they
don't convey the same intent.
- Remove "should" in `it` descrption
2024-01-23 16:35:13 +11:00
Gaetan Craig-Riou
d8876c40b8 Add invisible_captcha on the user registration page
The default action when a user submit the form too quickly is to
redirect to :back with flash error message. As we are using CableReady
it's not working for us, so I render_alert_timestamp_error_message
to show the error message to the user.
2024-01-23 16:30:12 +11:00
Gaetan Craig-Riou
c68b03c0dd Add invisble_captcha gem 2024-01-23 13:26:18 +11:00
Gaetan Craig-Riou
270a310e0f Use send_keys to populate tom select input
Setting the value directly doesn't trigger the search, presumably
because it doesn't trigger any javascript event.
2024-01-23 11:52:01 +11:00
dependabot[bot]
cd9c505c6b chore(deps): bump tom-select from 2.2.3 to 2.3.1
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.2.3 to 2.3.1.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.2.3...v2.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 11:52:01 +11:00
dependabot[bot]
67d66bde06 Bump sidekiq from 7.2.0 to 7.2.1
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.2.0 to 7.2.1.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/sidekiq/sidekiq/compare/v7.2.0...v7.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:50:34 +00:00
Gaetan Craig-Riou
46b1fe713f Merge pull request #12072 from openfoodfoundation/dependabot/npm_and_yarn/js-big-decimal-2.0.7
Bump js-big-decimal from 2.0.4 to 2.0.7
2024-01-23 11:47:40 +11:00
Gaetan Craig-Riou
41c1b8da10 Merge pull request #12071 from openfoodfoundation/dependabot/bundler/shoulda-matchers-6.1.0
Bump shoulda-matchers from 6.0.0 to 6.1.0
2024-01-23 11:44:52 +11:00
Gaetan Craig-Riou
fab6a79dae Fix various method to remove or add enterprise fee tax 2024-01-23 10:36:58 +11:00
Gaetan Craig-Riou
8181f3b09a Add enterprise_fee_additional_tax and enterprise_fee_included_tax 2024-01-23 10:36:43 +11:00
Gaetan Craig-Riou
b28e63174d Update display_line_items_taxes
Make sure we add the correct enterprise fee tax amount based on tax
being included in the price or not.
2024-01-23 10:36:43 +11:00
Gaetan Craig-Riou
bfe8f08910 Refator, add total_additional_tax and total_included_tax
They are used to add/remove enterprise fee tax as needed
2024-01-23 10:35:09 +11:00
dependabot[bot]
41268153c0 Bump js-big-decimal from 2.0.4 to 2.0.7
Bumps [js-big-decimal](https://github.com/royNiladri/js-big-decimal) from 2.0.4 to 2.0.7.
- [Release notes](https://github.com/royNiladri/js-big-decimal/releases)
- [Commits](https://github.com/royNiladri/js-big-decimal/compare/v2.0.4...v2.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 09:36:14 +00:00
dependabot[bot]
36f32ddca2 Bump shoulda-matchers from 6.0.0 to 6.1.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 6.0.0 to 6.1.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v6.0.0...v6.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 09:21:27 +00:00
Maikel Linke
8bb6bef0fa Comment on ABC style 2024-01-22 16:32:45 +11:00
Maikel Linke
fc75ea97a2 Add promo image to DFC Enterprise API
We want to use this image in the Discover Regenerative portal in
Australia. The property is read-only and the API doesn't support the
upload of a new file.

The enterprise factory needed fixing as well. This trait hadn't been
used anywhere else.
2024-01-22 16:21:10 +11:00
Gaetan Craig-Riou
3cfa7e29d1 Add the enterprise fee tax to amount with taxes 2024-01-22 13:08:58 +11:00
Gaetan Craig-Riou
ba841d9fbc Add enterprise_fee_tax to Invoice::LineItemSerializer 2024-01-22 13:08:58 +11:00
Gaetan Craig-Riou
a77ba5b0b1 Include enterprise fee tax in the line item tax 2024-01-22 13:08:39 +11:00
Gaetan Craig-Riou
913da34228 Add EnterpriseFeeAdjustments
It represent a collection of enterprise fee adjustments. Currently
it only allows you to calculate the tax amount relating to enterprise
fees when tax is not included in price
2024-01-22 13:08:39 +11:00
Gaetan Craig-Riou
36b3b3c989 Switch to comparing product type semanticId
Currently it's not possibel to compare two
`DataFoodConsortium::Connector::SKOSConcept` or
two `VirtualAssembly::Semantizer::SemanticObject with` `==`.

Related to : https://github.com/assemblee-virtuelle/semantizer-ruby/pull/2/files
2024-01-22 11:40:50 +11:00
Maikel
a55587b765 Merge pull request #12059 from openfoodfoundation/dependabot/bundler/stripe-10.6.0
Bump stripe from 10.5.0 to 10.6.0
2024-01-22 10:29:31 +11:00
Maikel Linke
e25464b38a Re-record stripe API requests 2024-01-22 10:21:15 +11:00
Maikel
1f5541d2fb Merge pull request #12064 from dacook/bump-prettier-v4
Bump prettier and pretty-quick
2024-01-22 10:15:30 +11:00
Gaetan Craig-Riou
96a010033d Fix admin view to use dfc_id
This was missed in a previous refactor
2024-01-22 10:12:39 +11:00
Maikel Linke
28e17aff68 Fix DFC context in spec to resolve product types
The `dfc-b:hasType` value can only be parsed as object id if the context
contains:

```
    "dfc-b:hasType":{
      "@type":"@id"
    },
```

The standard context includes this and it's easier to use. Now that the
URIs of product types are correctly resolved, we don't need to
substitute the URI manually.

Also dropped an old unneeded spec for backwards compatibility.
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
35da321e15 Fix skos parser to not replace Product type URI by dfc-pt
The given productType.rdf file doesn't give us any context for `dfc-pt`,
so there was no reason to do that.
We still need to do some substitution in the importer, as some times
we are given `dfc-pt` as input data.
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
2aa0ab15b9 Simplify traversing of Product Types 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
9607739e16 Per review, store product type instead of path 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
c1e7aa6daa Small improvment for Importer
Doesn't try to load skos concept if we are not dealing with an object
that doesn't refers to a skos concept
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
c40ccb8e86 Refactor, move product type matching to DfcProductTypeFactory
It keeps SuppliedProductBuilder and move all the matching logic to its
own class
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
d8b56d5c16 Per review, match on the product type URI instead of name part 2
For import this time
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
8013fac5b8 Per review, match on the product type URI instead of name
Fox export only
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
162fd4bef5 update documentation 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
25a820fe12 Allow updating of product type 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
a35e896a98 Add taxon to request spec 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
47cea0af6b Add matching DFC product type to taxon when importing product 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
e917b26e91 Support non "underscore" name for dfc_name
Ie: you can now use "Soft drink" instead of "soft_drink", case is also
ignored
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
476f3b8a28 Fix DFC importer to support Product types 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
2be1aea64c SKOS parser, user shorten version for product types URI 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
a2cb1f4c37 Update swagger documentation 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
4d52e169e2 Update taxon to not be a top concept product type
This is to test the product type matching is working properly
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
42e2141d05 Match product taxon with DFC Product type
It relies on having dfc_name populated on the given taxon.
Matching is as follow:
 - parse the DFC product types and store in PRODUCT_TYPES if needed
 - match the dfc_name against PRODUCT_TYPES
 - call the method returned on the DFC connector
2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
8014aa4c2f Update test to check for Product Type 2024-01-22 10:12:39 +11:00
Gaetan Craig-Riou
403386ea09 Add basic match on the root level Product Types
Currently anything but the leaf level is modelled as a
DataFoodConsortium::Connector::SKOSInstance, which isn't supported
by the connector as "hasType" for a product. The lead level is modelled
by DataFoodConsortium::Connector::SKOSConcept which is supported by
connector. On top of is `#narrowers`, `#broaders`and `#prefLabels`
aren't set making it very difficult to travers the Product Type tree.
2024-01-22 10:12:32 +11:00
Gaetan Craig-Riou
652c7a563c Add dfc_name field on Spree::Taxons
This will let us map OFN product taxons to DFC product types
2024-01-22 10:02:10 +11:00
Gaetan Craig-Riou
83beafc564 Add missing translation on taxon admin form 2024-01-22 10:02:10 +11:00
dependabot[bot]
acb6a866db Bump stripe from 10.5.0 to 10.6.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.5.0 to 10.6.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/v10.5.0...v10.6.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-01-19 10:41:53 +00:00
Filipe
487a7b2257 Merge pull request #12058 from openfoodfoundation/dependabot/bundler/stripe-10.5.0
Filter out Stripe client_id
2024-01-19 10:36:34 +00:00
David Cook
40166bf3e8 Update spec/support/vcr_setup.rb
Co-authored-by: Maikel <maikel@email.org.au>
2024-01-19 09:55:39 +11:00
David Cook
df82db9a95 Fix Layout/LineLength 2024-01-19 09:24:30 +11:00
David Cook
bb19151705 Merge pull request #12035 from filipefurtad0/remove_default_selection_pr_template
Removes default selection for User facing changes
2024-01-19 09:21:15 +11:00
Maikel
0b8ac17354 Merge pull request #12060 from openfoodfoundation/dependabot/bundler/roo-2.10.1
Bump roo from 2.10.0 to 2.10.1
2024-01-19 09:06:56 +11:00
David Cook
efc4fce7de Bump pretty-quick to v4.0.0 2024-01-19 09:03:21 +11:00
David Cook
9a5e9817a8 Bump prettier to v3.2.4
It's supported by the latest version of pretty-quick now.
2024-01-19 09:02:41 +11:00
Ahmed Ejaz
ff48825241 11768: fix the amount with voucher 2024-01-19 01:52:24 +05:00
Ahmed Ejaz
3a8e4d203a 11768: replace order_id with order 2024-01-19 01:52:24 +05:00
Ahmed Ejaz
cb9c2963af 11768: add roundoff
- Fix lint issues
2024-01-19 01:52:24 +05:00
Ahmed Ejaz
a3592cb14a 11768: add specs
- For applied_voucher_rate method in order
2024-01-19 01:52:24 +05:00
Ahmed Ejaz
38b7616b1a 11768: apply voucher 2024-01-19 01:52:18 +05:00
Konrad
bed405794f Merge pull request #11762 from binarygit/send-shipment-email-optionally
send-shipment-email-optionally
2024-01-18 12:02:00 +01:00
dependabot[bot]
7983988fde Bump roo from 2.10.0 to 2.10.1
Bumps [roo](https://github.com/roo-rb/roo) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/roo-rb/roo/releases)
- [Changelog](https://github.com/roo-rb/roo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/roo-rb/roo/compare/v2.10.0...v2.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 09:44:22 +00:00
cyrillefr
ca4aa645f7 Delete now ununsed stimulus controller toggle_button_disabled
- also delete one comment about replacing this controller with another
2024-01-18 10:10:49 +01:00
David Cook
6e522cb055 Filter out Stripe client_id 2024-01-18 12:47:02 +11:00
Maikel
08ca85250a Merge pull request #12018 from openfoodfoundation/dependabot/bundler/stripe-10.5.0
Bump stripe from 10.3.0 to 10.5.0
2024-01-18 12:41:17 +11:00
Maikel
1458f81bf8 Merge pull request #12049 from openfoodfoundation/dependabot/bundler/bullet-7.1.6
Bump bullet from 7.1.5 to 7.1.6
2024-01-18 12:33:16 +11:00
Maikel
a0e538d2df Merge pull request #12053 from openfoodfoundation/dependabot/npm_and_yarn/pretty-quick-3.3.1
Bump pretty-quick from 3.1.3 to 3.3.1
2024-01-18 12:32:29 +11:00
David Cook
ccf0e78b91 Refactor
It's not as beautiful as I hoped, but it enforces the rule. Am I going too far? Probably.
2024-01-18 12:26:21 +11:00
dependabot[bot]
0e0ad26699 Bump bullet from 7.1.5 to 7.1.6
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.5 to 7.1.6.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.5...7.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 01:22:51 +00:00
Maikel
8be7935169 Merge pull request #12054 from openfoodfoundation/dependabot/bundler/bugsnag-6.26.2
Bump bugsnag from 6.26.1 to 6.26.2
2024-01-18 12:21:40 +11:00
David Cook
a2436e9a1a Rename hidden keys
If they follow a rule, it reduces indirection and makes it easier to manage, I reckon.
2024-01-18 12:14:07 +11:00
dependabot[bot]
18ab0312bb Bump bugsnag from 6.26.1 to 6.26.2
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.26.1 to 6.26.2.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.26.1...v6.26.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 01:03:40 +00:00
Maikel
60acd566e1 Merge pull request #12042 from openfoodfoundation/dependabot/bundler/bootsnap-1.17.1
Bump bootsnap from 1.17.0 to 1.17.1
2024-01-18 12:02:18 +11:00
dependabot[bot]
2d839d3238 Bump pretty-quick from 3.1.3 to 3.3.1
Bumps [pretty-quick](https://github.com/prettier/pretty-quick) from 3.1.3 to 3.3.1.
- [Release notes](https://github.com/prettier/pretty-quick/releases)
- [Changelog](https://github.com/prettier/pretty-quick/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/pretty-quick/compare/v3.1.3...v3.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-17 09:06:08 +00:00
David Cook
b4f1709dcd Remove console.log
Oops.
2024-01-17 17:25:24 +11:00
David Cook
6ed74b2bc1 Ensure keyboard shortcut fires event handlers correctly
A StimulusReflex form handler was being ignored, resulting in an error.

Note that this method can support angular forms, the submit buttons just need to be updated to type='submit' (why they are not already boggles me).
2024-01-17 17:24:24 +11:00
David Cook
bf649b2f96 Merge pull request #12044 from openfoodfoundation/dependabot/npm_and_yarn/hotkeys-js-3.13.5
Bump hotkeys-js from 3.13.3 to 3.13.5
2024-01-17 16:42:20 +11:00
Gaetan Craig-Riou
4b0e5ee7b6 Update all locales with the latest Transifex translations 2024-01-17 16:23:08 +11:00
Gaetan Craig-Riou
2a9731f886 Reverse commenting out git status --porcelain
It was wrongly commented out in this commit:
7c9d4f1342
2024-01-17 16:20:43 +11:00
David Cook
f348cbc10c Update Stripe cassettes
Note that stripe_account_spec.rb:51 requires a special client_id
2024-01-17 15:16:52 +11:00
David Cook
f14f325441 Record exception details
Why mask the actual exception with a made-up one? The name did convey a bit more context, but Bugsnag tracks the context anyway. It would be more helpful to record the details of the error.

Just in case, I checked if there were any recorded instances of StripeDeauthorizeFailure. I couldn't find any in Bugsnag (last 3 months) for AU, Germany, Katuma, NZ, Norway, UK, USA. Also no mention in GitHub issues.
2024-01-17 15:16:51 +11:00
David Cook
d7bb3b77a7 Add comment
We really need to update our documentation more, but this is better than nothing.
2024-01-17 15:14:44 +11:00
dependabot[bot]
2315c51221 Bump stripe from 10.3.0 to 10.5.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.3.0 to 10.5.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/v10.3.0...v10.5.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-01-17 15:14:44 +11:00
Maikel
12be3f9ff6 Merge pull request #12037 from mkllnk/dfc-import
Update variant name, price and stock through the DFC API
2024-01-17 11:47:29 +11:00
cyrillefr
8eb5ac990e Replace toggle_button_disable ctrller with generic toggle_control ctrller
- add enableIfPresent method in toggle_control_controller.js to handle enabling on toggle
- add testing in the corresponding spec
- replace in view previous ctrler with intended generic toggle-control
2024-01-16 20:35:21 +01:00
David Cook
dd502f0883 Merge pull request #12031 from dacook/buu/update-product-images-11065
[BUU] Update product images
2024-01-16 15:52:44 +11:00
Gaetan Craig-Riou
aa6392029c Add #enterprise_fee_adjustments
It returns adjustments associated to enterprise fee
2024-01-16 15:40:22 +11:00
David Cook
627863bdf7 Fix up button colour variables 2024-01-16 13:45:02 +11:00
David Cook
c67f0c52a2 Show edit button only when hover image
This required some branching in the haml, which would be nice to avoid. But we have more work to do here so we'll refactor at the end.
2024-01-16 13:45:02 +11:00
David Cook
fa9deeb948 Remove unused method 2024-01-16 13:45:02 +11:00
David Cook
471dadeaec Accept only image files
Leaving the more specific validation in the Rails model (rather than try to duplicate it).
2024-01-16 13:45:02 +11:00
David Cook
88c840b3ee Update styling for close button
I think we need a more general solution similar to ConfirmModalComponent's .modal-actions so that we can style all modals more consistently. But it's too late in the afternoon.
2024-01-16 13:45:00 +11:00
David Cook
6ed96bae85 Submit image when selected
This could have been done with a tiny amount of inline JS, but I went this way in case I needed any special logic for UJS. It turns out we don't.. but it still looks a bit cleaner this way.
2024-01-16 13:44:34 +11:00
David Cook
6479990f6d Show image update form in modal
It submits to the existing controller. I wanted to submit it with StimulusReflex, but it [doesn't support file uploads](https://docs.stimulusreflex.com/guide/working-with-forms.html#a-note-about-file-uploads). Perhaps we'll enhance this with javascript later.
2024-01-16 13:44:28 +11:00
David Cook
20ca33adbe Merge pull request #11942 from dacook/buu-product-images-11065
[BUU] See product images
2024-01-16 13:41:48 +11:00
David Cook
38661a67bc Add option to open modal instantly
Using pre-existing feature in ModalController
2024-01-16 12:53:07 +11:00
David Cook
137489f492 Refactor: move basic modal styles to generic parent component
The style was already being shared with a sibling component.

Now we can instantiate a plain old 'modal'.
2024-01-16 12:53:07 +11:00
David Cook
91abb856a6 DRY
Refactor to use the (previously unused) shared method.
2024-01-16 12:53:07 +11:00
David Cook
c584d639cc Show default image if none set 2024-01-16 12:53:07 +11:00
David Cook
ca73a9ab62 Reduce space used by image 2024-01-16 12:53:07 +11:00
David Cook
a6a3a02d79 Use padding to set button size
It's more flexible.
Also reduced the overall size to suit the desired table row sizes.
2024-01-16 12:53:06 +11:00
David Cook
1f61b03796 Add image with edit button
With a new 'mini' button style.

For now, it's just a shortcut to the image edit page.
2024-01-16 12:50:31 +11:00
dependabot[bot]
5cc0a235fd Bump hotkeys-js from 3.13.3 to 3.13.5
Bumps [hotkeys-js](https://github.com/jaywcjlove/hotkeys-js) from 3.13.3 to 3.13.5.
- [Release notes](https://github.com/jaywcjlove/hotkeys-js/releases)
- [Commits](https://github.com/jaywcjlove/hotkeys-js/compare/v3.13.3...v3.13.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 09:49:35 +00:00
dependabot[bot]
12ab460d1b Bump bootsnap from 1.17.0 to 1.17.1
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.17.0 to 1.17.1.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.17.0...v1.17.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 09:43:26 +00:00
Gaetan Craig-Riou
64043b820a Merge pull request #12030 from mkllnk/connected-apps-visibility
Show Connected Apps only to enterprise managers
2024-01-15 15:24:29 +11:00
Maikel Linke
dc411eb42b Remove migrations with bad ids
We could rename them later but we don't want them to be executed under
their new name. So we need to deploy the version rename in the database
first.
2024-01-15 14:36:23 +11:00
Maikel Linke
301add4992 Remove faulty migration generation
The long timestamps don't play well with Rails default timestamps for
migrations. They are always seen as the newest. Not using long
timestamps leads to duplicate timestamps though.

The better solution is to use `rails generate migration` and copy the
`change` method.
2024-01-15 14:36:23 +11:00
Maikel
3431f89ec3 Merge pull request #11470 from openfoodfoundation/dependabot/bundler/webmock-3.19.1
chore(deps-dev): bump webmock from 3.18.1 to 3.19.1
2024-01-15 10:57:08 +11:00
binarygit
e865f27158 Provide correct modal-link-target-value and write tests for orders#edit page 2024-01-14 15:33:31 +05:45
binarygit
746b521856 Associate each label with its checkbox 2024-01-14 15:06:02 +05:45
binarygit
bc570743a5 Bugfix: Link individual send shipment button to its corresponding form 2024-01-14 15:06:02 +05:45
binarygit
5b99c2666a Use cable_ready.replace instead of morphing after order is captured 2024-01-14 15:06:02 +05:45
binarygit
6e00a34494 Use transaltion with HTML in it by adding html suffix 2024-01-14 15:06:02 +05:45
binarygit
75ca1dddf1 Fix tests and rubocop warnings 2024-01-14 15:06:02 +05:45
binarygit
36c5d7c5ee Change displayed message 2024-01-14 15:06:02 +05:45
binarygit
267e749369 Show same dialog box when shipping order through the actions dropdown 2024-01-14 15:06:02 +05:45
binarygit
e83fd5bd83 Create ShipOrder component 2024-01-14 15:06:02 +05:45
binarygit
aa7a4fb5a2 Send shipment email by default 2024-01-14 15:06:02 +05:45
binarygit
5fe246e739 Add translations 2024-01-14 15:06:02 +05:45
binarygit
99f4c4705f Remove redundant function 2024-01-14 15:06:02 +05:45
binarygit
5e45d3b877 send shipment email optionally from orders#edit page 2024-01-14 15:06:02 +05:45
binarygit
95a51159d7 send-shipment-email-optionally 2024-01-14 15:05:59 +05:45
filipefurtad0
0a5982bb8f Update all locales with the latest Transifex translations 2024-01-12 12:12:17 +00:00
filipefurtad0
6eb56fa79b Update all locales with the latest Transifex translations 2024-01-12 11:59:48 +00:00
Filipe
4c96eb40df Merge pull request #11932 from dacook/buu-dropdown-tweaks-11518
[BUU] Dropdown UI tweaks (tom-select)
2024-01-12 11:41:07 +00:00
Filipe
2cd3545d1d Merge pull request #12015 from rioug/fix-select-customer-search
Backoffice, fix customer search when searching by first name
2024-01-12 11:22:13 +00:00
Rachel Arnould
877a145874 Merge branch 'master' into buu-dropdown-tweaks-11518 2024-01-12 10:40:19 +01:00
Maikel Linke
ad26a006e2 Remove unnecessary spec helper module
These shared examples were used in only one spec file. It's much easier
to read having all the related specs in one file instead of hiding some
in a helper module.

It's also one less file to load whenever we run specs.
2024-01-12 17:18:07 +11:00
Maikel Linke
c5b64e875f Remove unnecessary spec helper
Best viewed ignoring whitespaces.

Products don't require a tax category by default. And when you activate
it via Spree::Config then it's automatically reset at the end of the spec.
We don't need this helper to do it.
2024-01-12 17:12:40 +11:00
Maikel Linke
95c6a56e2e Simplify loading of default tax category
The logic doesn't change but I simplified it and added more detailed
specs.
2024-01-12 17:06:24 +11:00
Maikel Linke
9ad2cf78ce Spec requiring tax category when creating products
We observed an error when an instance requires a tax category and we
tried to create products via the DFC API:

* https://github.com/openfoodfoundation/openfoodnetwork/issues/11212

But I found that the error only appears after changing the instance
config without declaring a tax category as default. The right setup as
in the spec does work. The spec passes.

I don't think that this needs any fix. We shouldn't assign any tax
category just because it's required. The instance manager needs to
select a default.
2024-01-12 17:06:24 +11:00
Maikel Linke
aa5c6f34f2 Move product type definition to separate module 2024-01-12 14:58:03 +11:00
Maikel Linke
583ac65920 Move building of Offer to the right module
The DfcBuilder was doing everything to start with but we are moving its
parts to smaller modules now.
2024-01-12 14:57:58 +11:00
Maikel Linke
bdff8ffea3 Spec pending setting of on_demand via DFC API
The DFC Connector doesn't support importing null values. This has to
wait until it's solved in the Connector or we have an urgent use case.
2024-01-12 14:25:14 +11:00
Maikel Linke
af51177593 Update price and stock through the DFC API 2024-01-12 14:25:11 +11:00
Maikel Linke
8d6ae18fb6 Show Offers on the DFC API 2024-01-12 14:22:24 +11:00
Maikel Linke
4bac83dd83 Update variant name instead of product via DFC
A DFC SuppliedProduct relates to a Spree::Variant and when updating its
name we only want to change the name for that variant. Otherwise, when
we update the name of the product, it would update the name for all
variants and all the corresponding SuppliedProducts.
2024-01-12 14:22:24 +11:00
Maikel Linke
afb334c449 Add explicit label for user-facing changes 2024-01-12 09:09:58 +11:00
Maikel
2ff2cebb0d Merge pull request #12033 from openfoodfoundation/dependabot/bundler/newrelic_rpm-9.7.0
Bump newrelic_rpm from 9.6.0 to 9.7.0
2024-01-12 08:58:46 +11:00
Maikel
90fb0ed399 Merge pull request #12024 from rioug/11707-DFC-update-enterprise-group
[DFC] add/delete enterprise to enterprise group
2024-01-12 08:53:17 +11:00
Filipe
2493ee5e2a Merge pull request #11982 from drummer83/logo_size
Make hint for logo size translatable and adjust to 300 px
2024-01-11 19:27:11 +00:00
Rachel Arnould
6ff2be17c6 Merge pull request #12023 from dacook/buu/sticky_table_header_and_saving_banner-2
[BUU] Sticky table header and saving banner - alternate solution
2024-01-11 15:23:06 +01:00
filipefurtad0
a655ff099b Removes default selection for User facing changes 2024-01-11 14:06:27 +00:00
dependabot[bot]
f66cdba0da Bump newrelic_rpm from 9.6.0 to 9.7.0
Bumps [newrelic_rpm](https://github.com/newrelic/newrelic-ruby-agent) from 9.6.0 to 9.7.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.6.0...9.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-11 09:13:52 +00:00
David Cook
ef82925710 Merge pull request #12032 from mkllnk/swagger
Show DFC API first in documentation
2024-01-11 16:45:16 +11:00
Maikel Linke
3425be4ded Show DFC API first in documentation
The capabilities and documentation for the DFC API are bigger. And since
it's in active development, people want to check the DFC API more
frequently. They needed to find the switch to select the DFC API in the
top right corner but now it's displayed straight away.
2024-01-11 15:14:10 +11:00
Maikel Linke
30b5d065c1 Replace deprecated swagger syntax 2024-01-11 15:13:41 +11:00
Maikel Linke
78e42ec664 Show Connected Apps only to enterprise managers
Super-admins also saw that tab but connecting an app doesn't work unless
you are a manager of that enterprise.
2024-01-11 12:20:40 +11:00
Maikel Linke
f480997754 Spec admin enterprise menu helper
There was no spec despite lots of logic. And I want to add more logic.
2024-01-11 12:14:09 +11:00
Maikel
d197251262 Merge pull request #12026 from dacook/rubocop-autocorrect
Autocorrect Rubocop issues
2024-01-11 09:04:49 +11:00
Maikel
1f8fe7b8ed Merge pull request #12027 from openfoodfoundation/dependabot/bundler/view_component-3.10.0
Bump view_component from 3.9.0 to 3.10.0
2024-01-11 08:55:09 +11:00
Maikel
52baa96fa3 Merge pull request #12028 from openfoodfoundation/dependabot/bundler/knapsack_pro-6.0.4
Bump knapsack_pro from 6.0.3 to 6.0.4
2024-01-11 08:54:14 +11:00
Maikel
a3e7898194 Merge pull request #12029 from openfoodfoundation/dependabot/bundler/faraday-2.9.0
Bump faraday from 2.8.1 to 2.9.0
2024-01-11 08:53:28 +11:00
Konrad
1c01af5874 Merge pull request #11983 from bmd08a1/opt/fix-enterprise-roles
Improve `admin/enterprise_roles` page performance
2024-01-10 20:30:41 +01:00
Konrad
19dd5b110c Merge pull request #12009 from chahmedejaz/bugfix/11971-tos-position-issue
Fix ToS Position Issue
2024-01-10 19:36:57 +01:00
dependabot[bot]
bb031b6bf6 Bump faraday from 2.8.1 to 2.9.0
Bumps [faraday](https://github.com/lostisland/faraday) from 2.8.1 to 2.9.0.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.8.1...v2.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 09:09:23 +00:00
dependabot[bot]
286816700d Bump knapsack_pro from 6.0.3 to 6.0.4
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 6.0.3 to 6.0.4.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.3...v6.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 09:08:02 +00:00
dependabot[bot]
013ee6e9b7 Bump view_component from 3.9.0 to 3.10.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.9.0...v3.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 09:06:32 +00:00
Gaetan Craig-Riou
557e6e6a37 Return a duplicate empty string for css pack request 2024-01-10 16:46:13 +11:00
David Cook
0bb0e1674e Remove unused rule
I forgot to remove this before.
2024-01-10 16:41:47 +11:00
Gaetan Craig-Riou
a78042cee1 Remove save after adding an association with <<
`<<` operator already save the the association to the database
2024-01-10 15:48:36 +11:00
David Cook
443b3134df Tweak padding
I'm not sure why this requires extra padding here, but it looks good 🤷

Co-authored-by: Mario Carabotta <6696729+mariocarabotta@users.noreply.github.com>
2024-01-10 14:26:56 +11:00
David Cook
792dc2cb36 Add shadow 2024-01-10 14:15:10 +11:00
Gaetan Craig-Riou
92921c89d1 Add enpoint to delete enterprise from group
Plus documentation
2024-01-10 12:44:02 +11:00
David Cook
c3e513e457 Move .form-actions into table, to allow sticky stacking
Unfortunately, it's not possible to stack two sticky elements that are inside different containers:
https://stackoverflow.com/questions/54689034/pure-css-multiple-stacked-position-sticky

So instead I've moved them under the same container. The .form-actions needs to cover up some of the table border.
I don't like the deep nesting of markup or class naming.. pls suggest if you have better ideas!
2024-01-10 12:33:41 +11:00
Gaetan Craig-Riou
b90349e4c2 Add endpoint to add enterprise to a group
plus documentaion
2024-01-10 12:31:38 +11:00
David Cook
a2f3179510 Merge pull request #12025 from openfoodfoundation/dependabot/bundler/bugsnag-6.26.1
Bump bugsnag from 6.26.0 to 6.26.1
2024-01-10 11:38:02 +11:00
David Cook
c1486630e1 Merge pull request #12022 from openfoodfoundation/dependabot/npm_and_yarn/follow-redirects-1.15.4
Bump follow-redirects from 1.14.8 to 1.15.4
2024-01-10 11:36:17 +11:00
David Cook
c95d7523f6 Merge pull request #12013 from mkllnk/spec-file-helper
DRY specs with fixture_file_upload helper
2024-01-10 10:28:23 +11:00
David Cook
47418d9873 Merge pull request #12014 from mkllnk/voucher-on
Remove feature toggle for vouchers, they are always on
2024-01-10 09:58:35 +11:00
David Cook
2a3d498c13 Style/RedundantReturn 2024-01-10 09:38:35 +11:00
David Cook
7e00dbfd67 Style/RedundantParentheses 2024-01-10 09:38:21 +11:00
David Cook
18c2b2512b Safely autocorrect Style/RedundantLineContinuation
Inspecting 1530 files
.................................................................................................................................................................................C................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................

Offenses:

app/helpers/shop_helper.rb:48:43: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    no_open_order_cycles?(order_cycles) &&
                                          ^
app/helpers/shop_helper.rb:48:44: C: [Corrected] Style/RedundantLineContinuation: Redundant line continuation.
    no_open_order_cycles?(order_cycles) && \ ...
                                           ^
spec/system/admin/configuration/content_spec.rb:35:64: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    expect(page).to have_selector :link, "markdown link", href:
                                                               ^
spec/system/admin/configuration/content_spec.rb:35:65: C: [Corrected] Style/RedundantLineContinuation: Redundant line continuation.
    expect(page).to have_selector :link, "markdown link", href: \ ...
                                                                ^

1530 files inspected, 4 offenses detected, 4 offenses corrected
2024-01-10 09:29:37 +11:00
David Cook
fbbaf51522 Safely autocorrect Lint/SymbolConversion
Inspecting 1530 files
.....................................................................................................................................................................................................................................................................................................................................................W.................................................................................................................................................................................................................................................W..........................................................................................................................................................................................................................................................W.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/spree/preferences/preferable_class_methods.rb:73:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}" instead.
        "preferred_#{name}".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:77:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}=" instead.
        "preferred_#{name}=".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:81:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"prefers_#{name}?" instead.
        "prefers_#{name}?".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:85:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"prefers_#{name}=" instead.
        "prefers_#{name}=".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:89:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_default" instead.
        "preferred_#{name}_default".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:93:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_type" instead.
        "preferred_#{name}_type".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:97:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_description" instead.
        "preferred_#{name}_description".to_sym
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/sets/product_set.rb:121:28: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"variant_#{error.attribute}" instead.
        product.errors.add("variant_#{error.attribute}".to_sym, error.message)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/spree/core/environment_extension.rb:11:24: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"#{name}=" instead.
        create_method( "#{name}=".to_sym ) { |val|
                       ^^^^^^^^^^^^^^^^^

1530 files inspected, 9 offenses detected, 9 offenses corrected
2024-01-10 09:21:43 +11:00
Konrad
7c33c9749d Merge pull request #11999 from chahmedejaz/task/11923-add-vouchers-to-oc-customer-total-report
Add Vouchers to OC Customer Total Report
2024-01-09 20:56:50 +01:00
Konrad
591885610a Merge branch 'master' into task/11923-add-vouchers-to-oc-customer-total-report 2024-01-09 18:51:47 +01:00
Konrad
1e2985b3cb Merge pull request #11990 from dacook/form-hotkeys
Add keyboard shortcut to submit forms
2024-01-09 18:33:33 +01:00
dependabot[bot]
d847565bfb Bump bugsnag from 6.26.0 to 6.26.1
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.26.0 to 6.26.1.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.26.0...v6.26.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 10:00:06 +00:00
David Cook
4f27bea02f Make table header sticky
But it overlaps the .form-actions. how to make them sticky together..

todo: register the z-index in variables.scss
2024-01-09 17:07:37 +11:00
Gaetan Craig-Riou
626e903ab9 Add ability for controller to use CanCan 2024-01-09 14:44:12 +11:00
David Cook
e48d009668 Hide #sort section instead of covering it
Before, the .form-actions was overlaying it, to avoid making the table below jump. But if the .form-actions and #sort are the same height, it won't jump when we swap them.

It does make the table jump in the case of a multi-line .form-actions message, but that only happens after submit anyway.

This is needed for the next commit..
2024-01-09 13:11:49 +11:00
David Cook
2defc4afa7 Ensure form-actions content uses available space
Using pre-defined colunms was a hacky short term solution, this way is more flexible.
2024-01-09 12:34:05 +11:00
Gaetan Craig-Riou
a7fbff12dd Merge pull request #12019 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.5.4
Bump @floating-ui/dom from 1.5.3 to 1.5.4
2024-01-09 09:57:00 +11:00
Gaetan Craig-Riou
5ebc8be887 Merge pull request #12017 from openfoodfoundation/dependabot/bundler/bullet-7.1.5
Bump bullet from 7.1.4 to 7.1.5
2024-01-09 09:55:39 +11:00
dependabot[bot]
ee6fd0ffeb Bump follow-redirects from 1.14.8 to 1.15.4
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.8...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 22:54:20 +00:00
Gaetan Craig-Riou
c84e3d9018 Merge pull request #12016 from openfoodfoundation/dependabot/bundler/puma-6.4.2
Bump puma from 6.4.1 to 6.4.2
2024-01-09 09:53:47 +11:00
Rachel Arnould
16a091d95c Merge pull request #11921 from abdellani/11431-show_warning_when_a_new_invoice_can_be_generated
show warning when a new invoice can be generated
2024-01-08 16:45:11 +01:00
Rachel Arnould
f7aca7a9f1 Merge branch 'master' into 11431-show_warning_when_a_new_invoice_can_be_generated 2024-01-08 16:38:39 +01:00
Rachel Arnould
bd0a296100 Merge pull request #11846 from chahmedejaz/task/11068-delete-product-or-variant
[BUU] Add option to delete a product or variant
2024-01-08 13:17:29 +01:00
dependabot[bot]
c3e102aa0e Bump @floating-ui/dom from 1.5.3 to 1.5.4
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.5.3 to 1.5.4.
- [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/@floating-ui/dom@1.5.4/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 09:36:52 +00:00
dependabot[bot]
d8c6241398 Bump bullet from 7.1.4 to 7.1.5
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.4 to 7.1.5.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.4...7.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 09:09:30 +00:00
dependabot[bot]
da1ed8c118 Bump puma from 6.4.1 to 6.4.2
Bumps [puma](https://github.com/puma/puma) from 6.4.1 to 6.4.2.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.4.1...v6.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 09:07:26 +00:00
Jean-Baptiste Bellet
9ea6fc00cb Ignore test.host host to avoid error
```
Failed to open TCP connection to test.host:80
```
2024-01-08 16:54:53 +11:00
Jean-Baptiste Bellet
f500d1e7a8 Instead of stubbing CSS pack requests, ignore them with VCR 2024-01-08 16:54:53 +11:00
dependabot[bot]
ed5c750199 chore(deps-dev): bump webmock from 3.18.1 to 3.19.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.18.1 to 3.19.1.
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.18.1...v3.19.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 16:54:53 +11:00
Maikel Linke
4e510e9bd0 Avoid warning hiding main menu in report spec 2024-01-08 15:54:25 +11:00
Maikel Linke
38843c4d4d Remove use of feature vouchers 2024-01-08 15:53:50 +11:00
Maikel Linke
9aff9efa86 Remove feature vouchers 2024-01-08 15:53:50 +11:00
Maikel Linke
a8c83b670b Remove superfluous feature tag from specs 2024-01-08 15:53:50 +11:00
Maikel Linke
e2eead0f86 Scroll to reveal White Label tab
The Vouchers tab pushed the White Label tab further down and it was
hidden by the savebar. The CSS adjustment in this commit makes sure
that users can always see all menu items.

The automatic scrolling by Capybara fails because of the savebar but
scrolling to the bottom works.
2024-01-08 15:52:17 +11:00
Gaetan Craig-Riou
9d13549de4 Remove jquery usage
Also remove populating user_id as it's not on the page
2024-01-08 15:51:37 +11:00
Gaetan Craig-Riou
5f499a9d3f Add search on first name 2024-01-08 15:22:28 +11:00
Maikel Linke
b0b061f97d Activate vouchers for dev and test
CI can then tell me if some specs still rely on it being disabled.
2024-01-08 14:30:28 +11:00
Maikel Linke
2699ae6ca7 DRY terms of service PDF file use in specs 2024-01-08 13:01:21 +11:00
Maikel Linke
dd639435f1 Remove unnecessary image file helper 2024-01-08 13:01:21 +11:00
Maikel Linke
6327f46733 Use fixture_file_upload helper where possible
We can't use it in factories but in other places it's a nice shortcut.
2024-01-08 11:32:01 +11:00
Maikel Linke
41112c1462 DRY uploaded file use in specs 2024-01-08 11:32:01 +11:00
Maikel
e11d1582f2 Merge pull request #11994 from abdellani/11673-upgrade-paper_trail
upgrade paper-trail to 15.1
2024-01-08 09:34:51 +11:00
Konrad
1e9aaf17ba Merge pull request #11981 from bouaik/fix-flash-type-when-updating-entreprise-fees
Fix flash type when updating entreprise fees
2024-01-06 20:45:16 +01:00
Gaetan Craig-Riou
b0541b0a34 Merge pull request #12004 from mkllnk/default-country
Cache default country simply in memory
2024-01-05 14:10:35 +11:00
Maikel Linke
a1b02de11e Update all locales with the latest Transifex translations 2024-01-05 12:16:41 +11:00
Maikel
a35b42da2f Merge pull request #12008 from openfoodfoundation/dependabot/bundler/shoulda-matchers-6.0.0
Bump shoulda-matchers from 5.3.0 to 6.0.0
2024-01-05 12:10:09 +11:00
Maikel Linke
57a6d1ef06 Partial spec of error message for readability
This avoids Rubocop warnings. We don't need to test for the whole
message. The tested part is unique already and quicker to read.
2024-01-05 11:48:30 +11:00
Maikel
6bdbb270d3 Merge pull request #12010 from openfoodfoundation/dependabot/bundler/view_component-3.9.0
Bump view_component from 3.8.0 to 3.9.0
2024-01-05 11:42:23 +11:00
Maikel
def32bcab8 Merge pull request #12007 from openfoodfoundation/dependabot/bundler/mime-types-3.5.2
Bump mime-types from 3.5.1 to 3.5.2
2024-01-05 11:41:08 +11:00
Maikel
582ea2c1bb Merge pull request #12006 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.142.0
Bump aws-sdk-s3 from 1.141.0 to 1.142.0
2024-01-05 11:40:10 +11:00
dependabot[bot]
b5c413b9e7 Bump view_component from 3.8.0 to 3.9.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.8.0 to 3.9.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.8.0...v3.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-04 22:05:30 +00:00
Ahmed Ejaz
056907d195 11971: update z-index for ToS 2024-01-05 00:59:42 +05:00
dependabot[bot]
0e9ef61648 Bump shoulda-matchers from 5.3.0 to 6.0.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.3.0 to 6.0.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v5.3.0...v6.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-04 09:22:11 +00:00
dependabot[bot]
9a0685bec4 Bump mime-types from 3.5.1 to 3.5.2
Bumps [mime-types](https://github.com/mime-types/ruby-mime-types) from 3.5.1 to 3.5.2.
- [Changelog](https://github.com/mime-types/ruby-mime-types/blob/main/History.md)
- [Commits](https://github.com/mime-types/ruby-mime-types/compare/v3.5.1...v3.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-04 09:17:21 +00:00
dependabot[bot]
36c6d5fd2e Bump aws-sdk-s3 from 1.141.0 to 1.142.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.141.0 to 1.142.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-04 09:12:23 +00:00
Ahmed Ejaz
25c1f64876 Update lib/reporting/reports/orders_and_fulfillment/order_cycle_customer_totals.rb
Co-authored-by: Gaetan Craig-Riou <40413322+rioug@users.noreply.github.com>
2024-01-04 12:53:24 +05:00
Maikel Linke
883bfcdf0d Simplify column toggling in report spec
* This partly reverts 3a957fb988.
2024-01-04 16:53:36 +11:00
Maikel Linke
074e97c414 Remove paper_trail version restriction for Dependabot updates 2024-01-04 16:01:35 +11:00
Maikel
e2aeb18359 Merge pull request #11998 from abdellani/remove-unecessary-require-instructions
remove unnecessary require instructions
2024-01-04 15:30:33 +11:00
Maikel
f986825311 Merge pull request #11996 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.1.4
Bump active_storage_validations from 1.1.3 to 1.1.4
2024-01-04 13:59:51 +11:00
Maikel Linke
cb3cd3e7ea Cache default country simply in memory
This simplifies the code, avoids a method naming collision with Rails
and should be faster as well.
2024-01-04 13:45:36 +11:00
dependabot[bot]
9e9daa0239 Bump active_storage_validations from 1.1.3 to 1.1.4
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.1.3 to 1.1.4.
- [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)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-04 01:37:31 +00:00
Gaetan Craig-Riou
759aa684d6 Merge pull request #11997 from openfoodfoundation/dependabot/bundler/pdf-reader-2.12.0
Bump pdf-reader from 2.11.0 to 2.12.0
2024-01-04 12:37:25 +11:00
Gaetan Craig-Riou
eee4ef847d Merge pull request #11995 from openfoodfoundation/dependabot/bundler/puma-6.4.1
Bump puma from 6.4.0 to 6.4.1
2024-01-04 12:32:36 +11:00
Gaetan Craig-Riou
85f1c58e52 Merge pull request #11993 from abdellani/11673-upgrade-ransack
upgrade ransack to 4.1.0
2024-01-04 12:06:08 +11:00
Dung Bui
14d755d706 fix typo 2024-01-04 07:55:19 +07:00
Filipe
c2100bb607 Merge pull request #12002 from openfoodfoundation/RachL-patch-2
Update copyright year in README.md
2024-01-03 17:54:04 +00:00
Dung Bui
ab6a7e307b remove unused helpers 2024-01-04 00:19:15 +07:00
Dung Bui
f1da550912 remove unused structs 2024-01-04 00:19:15 +07:00
Dung Bui
b844b188ce fix enterprise roles page performance 2024-01-04 00:19:15 +07:00
Rachel Arnould
84aada4137 Update README.md
Changing the year in the readme - Happy New Year!
2024-01-03 15:32:45 +01:00
Mohamed ABDELLANI
1ffdca3fc2 require tag_rule_applicator as it's not loaded automatically on OrderAvailableShippingMethods & OrderAvailablePaymentMethods 2024-01-03 12:08:26 +01:00
Ahmed Ejaz
dcc962a8fd 11923: fix lint issues 2024-01-03 16:02:07 +05:00
Mohamed ABDELLANI
3fab2c350e require tag_rule_applicator on Shop::OrderCyclesList 2024-01-03 11:59:21 +01:00
Ahmed Ejaz
c06f251ff3 11923: update voucher_amount logic 2024-01-03 15:54:32 +05:00
Ahmed Ejaz
3a957fb988 11923: add specs 2024-01-03 15:46:16 +05:00
Mohamed ABDELLANI
ab1a0ba986 add ActiveSupport::TimeZone to yaml_column_permitted_classes 2024-01-03 11:41:37 +01:00
Mohamed ABDELLANI
d239beb226 remove unnecessary require instructions 2024-01-03 11:34:57 +01:00
Mohamed ABDELLANI
d591ce6977 add Time to yaml_column_permitted_classes 2024-01-03 11:24:50 +01:00
Mohamed ABDELLANI
0a474f9288 add "ActiveSupport::TimeWithZone" to yaml_column_permitted_classes 2024-01-03 11:12:06 +01:00
Rachel Arnould
edfd4277ac Merge pull request #11977 from drummer83/my_pr-11936
Fixes minor styling issues of admin and admin v3 in the dashboard
2024-01-03 10:47:56 +01:00
dependabot[bot]
f2e4343fad Bump pdf-reader from 2.11.0 to 2.12.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.11.0 to 2.12.0.
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.11.0...v2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-03 09:40:18 +00:00
dependabot[bot]
9f785cc7b9 Bump puma from 6.4.0 to 6.4.1
Bumps [puma](https://github.com/puma/puma) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v6.4.0...v6.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-03 09:37:32 +00:00
Mohamed ABDELLANI
ec439b4bf7 update paper-trail to 15.1 2024-01-03 10:28:17 +01:00
Mohamed ABDELLANI
81c2fdd62a upgrade ransack to 4.1.0 2024-01-03 10:19:27 +01:00
Maikel
1746ba5878 Merge pull request #11972 from filipefurtad0/fix_flaky_enterprise_navigation
Moves test introduced by #11799 to avoid non-explicit modal acceptance
2024-01-03 11:19:33 +11:00
Maikel
b9f117e643 Merge pull request #11959 from mkllnk/connect-app-id
Send semantic id when connecting enterprise to app
2024-01-03 11:18:01 +11:00
Maikel
990984108f Merge pull request #11956 from mkllnk/dfc-product-name
Use full product and variant name on DFC API
2024-01-03 11:17:44 +11:00
Maikel
63ce91d52a Merge pull request #11954 from mkllnk/delete-app
Enterprise user can remove Connected Apps
2024-01-03 11:17:26 +11:00
Maikel
1f0c5fc187 Merge pull request #11963 from filipefurtad0/stripe_payment_status_spec_vcr
Tests app/services/stripe_payment_status.rb
2024-01-03 10:57:46 +11:00
Maikel
5c4dcf371b Merge pull request #11979 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.23.1
Bump rubocop-rails from 2.23.0 to 2.23.1
2024-01-03 10:57:34 +11:00
Maikel
b5c145c15f Merge pull request #11989 from openfoodfoundation/dependabot/npm_and_yarn/moment-2.30.1
Bump moment from 2.29.4 to 2.30.1
2024-01-03 10:46:42 +11:00
Maikel
1d4e0ec779 Merge pull request #11980 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.26
Bump combine_pdf from 1.0.25 to 1.0.26
2024-01-03 10:44:54 +11:00
Maikel
6e26eda08a Merge pull request #11969 from openfoodfoundation/dependabot/bundler/debug-1.9.1
Bump debug from 1.9.0 to 1.9.1
2024-01-03 10:43:54 +11:00
Ahmed Ejaz
862edbe55b 11923: add voucher to OC customer total report 2023-12-30 14:35:37 +05:00
David Cook
aa3d4c3f6e Add keyboard shortcut to submit forms on frontend 2023-12-29 15:02:43 +11:00
David Cook
78e2311f59 Add keyboard shortcut to submit form in admin
Unfortunately it doesn't work for Angular forms. I'm not sure if there's a way to trigger an angular submit.
2023-12-29 14:57:59 +11:00
David Cook
50fb8466a9 [add package] hotkeys-js 2023-12-29 14:57:39 +11:00
David Cook
e62cd0eb89 Add reports readme [doc]
It doesn't say much yet, but could be a helpful starting point. Hopefully we will add to it next time we're working on it.

[skip ci]
2023-12-29 13:58:55 +11:00
Ahmed Ejaz
c2693d1a32 11068: add responsiveness to delete modal actions 2023-12-29 03:02:16 +05:00
Ahmed Ejaz
1d6a089754 11068: fix specs 2023-12-28 22:11:52 +05:00
Ahmed Ejaz
17bd3bb0cc 11068: update setModalDataset logic to generic logic 2023-12-28 21:34:37 +05:00
Ahmed Ejaz
f194b03882 11068: add sleep of 0.1s 2023-12-28 17:51:52 +05:00
Ahmed Ejaz
548ffc0222 11068: replace p tag with a tag 2023-12-28 17:28:26 +05:00
Ahmed Ejaz
813ebd9129 11068: add confirm_actions to close the modal 2023-12-28 17:07:18 +05:00
Ahmed Ejaz
047e63541c 11068: add black-text css class 2023-12-28 17:06:56 +05:00
Ahmed Ejaz
0fd868b669 11068: update variant_scope method to inline 2023-12-28 17:06:21 +05:00
dependabot[bot]
74214aba7e Bump moment from 2.29.4 to 2.30.1
Bumps [moment](https://github.com/moment/moment) from 2.29.4 to 2.30.1.
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.4...2.30.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-28 09:14:28 +00:00
David Cook
59ad2cf5ec Re-set vcr config after each test
I couldn't find a built-in way to do it, and couldn't even directly access the vcr config outside of VCR.configure. So this is the best way I could think of.
2023-12-28 17:47:09 +11:00
David Cook
263f68f927 Merge pull request #11915 from murjax/cleanse-stripe-js-errors-11886
Cleanse JS errors from DOM on Stripe failure
2023-12-28 13:11:36 +11:00
drummer83
da4dc637e4 Add empty line at end of file 2023-12-27 09:33:27 +01:00
drummer83
887a6d8e7a Make string translatable and adjust to 300 px 2023-12-26 16:00:00 +01:00
Ahmed Ejaz
86c2397f63 11068: update modal padding 2023-12-26 15:41:38 +05:00
bouaik
2e926e867c fix flash type when updating entreprise fees 2023-12-25 10:19:51 +01:00
dependabot[bot]
15e810b7f1 Bump combine_pdf from 1.0.25 to 1.0.26
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.25 to 1.0.26.
- [Release notes](https://github.com/boazsegev/combine_pdf/releases)
- [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.25...v1.0.26)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 09:09:26 +00:00
dependabot[bot]
13e71d5b8c Bump rubocop-rails from 2.23.0 to 2.23.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.23.0 to 2.23.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.23.0...v2.23.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 09:06:40 +00:00
drummer83
120b2c363d Fixing indentation error 2023-12-24 20:29:41 +01:00
drummer83
ad508c36e5 Avoid overflow of enterprise list when only few enterprises present 2023-12-24 19:07:14 +01:00
drummer83
2ab3efe5de Adjust outline when focusing the overflowing enterprisie list (was red in Firefox) 2023-12-24 19:02:58 +01:00
drummer83
4e6f43afab Add styles for hovering and warning 2023-12-24 17:59:27 +01:00
drummer83
ddd455a73e Use methodology from order_cycles for products 2023-12-24 17:58:21 +01:00
drummer83
dddebae56a Unify coding style 2023-12-24 17:52:21 +01:00
Ahmed Ejaz
c5a86341dc 11068: update sleep logic in specs 2023-12-24 02:00:26 +05:00
David Cook
3319f38e6c Rename class to signal intent
Because the HTML is changed, I had to also update the old stylesheet too.
2023-12-23 15:46:15 +01:00
David Cook
39d66c082b Remove unused green class 2023-12-23 15:46:15 +01:00
David Cook
e379ee761b Refactor
'positive' and 'zero' methods are preferred in this case.
2023-12-23 15:46:15 +01:00
David Cook
6ca98d497a Remove unnecessary 'blue' class
Buttons are already blue.

And we don't want the text to be blue. This resolves #11865
2023-12-23 15:46:15 +01:00
David Cook
e9fe66748a Replace 'orange' class with 'red'
It was the same colour anyway
2023-12-23 15:46:15 +01:00
Ahmed Ejaz
87d328d6d6 11068: fix specs 2023-12-23 16:08:26 +05:00
Ahmed Ejaz
6ed447b6ac 11068: code refactor
- Add single delete modal
  for product and variant each
2023-12-23 15:53:28 +05:00
Konrad
eb70eb4bc8 Merge pull request #11966 from bouaik/fix-menu-and-sub-menu-highlighting
Fix menu and sub menu highlighting
2023-12-22 22:35:47 +01:00
Konrad
398be49d43 Merge pull request #11914 from bmd08a1/ft/include-vouchers-in-revenues-by-hub-report
Include voucher tax adjustment in revenues by hub report
2023-12-22 20:59:00 +01:00
filipefurtad0
2e301a67b0 Moves test introduced by #11799 to a section in the spec where a modal does not need acceptance
Tests forward navigation
2023-12-22 14:24:37 +00:00
Konrad
72c824a412 Merge pull request #11795 from rioug/11720-enterprise-user-consent-to-ToS-changes
Add banner to allow user to accept ToS changes
2023-12-22 14:03:24 +01:00
Gaetan Craig-Riou
1bb4a667da Move banner to orignal postion at the bottom of page 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
772c641611 Move banner up to not cover existing button 2023-12-22 13:20:14 +01:00
David Cook
041d74b7c2 Fix CSS selector
These styles should only apply to the form-actions in the products form.
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
d0edf57e74 Fix tos system spec
Actually create a ToS file instead of using a fake one
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
a1d3b20e5b Remove the fact ToS file
Now that we check if there is a ToS file before displaying the banner
it's not needed anymore
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
9609ba4268 Don't show the banner if no ToS file uploaded 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
17fa6b6168 Per review, revert change 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
91e5227d80 Move to simple UserReflex 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
b28f40b125 Add system spec for ToS Banner 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
b3acdaf324 Remove user.id parameter
It's not needed, as the reflex get the curent user based on the user
session
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
f643ba5074 Update only User who are enterprise owner 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
56b75ad9fb Per review, stream line the css
Reuse existing css when possible, and use variable for z-index so its
easier to track usage of z-index
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
aaa8f3f572 Per review, move logic to display ToS banner to a helper
It easier to understand when we can see the logic to display the banner
in the view.
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
d0ba881aa2 Move acepting of ToS change to a reflex
Spree::Admin::UserController is for super admin user only. Moving to a
reflex simplifies the code by getting rid of a new route and a new stimulus
controller
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
91862c126b Remove now useless fix
Now that the banner isn't displayed if enterprise are not required to
sign ToS, the fix is useless
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
d2b210c818 Update migration to set terms_of_service_accepted_at to time of deployment 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
8371eada23 Don't show the banner if enterprises are not required to accepte ToS 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
6226067846 Update translation to be inline with design mockup 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
25d1511f0b Add Terms of Service banner styling for admin V3 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
5c9abfefee Per review, remove useless code pass
It shouldn't be possible for the update to fail, as we are not sending
any parameter. Any other failure should be handled by rails already, ie
missing csrf token.
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
44f22dc634 Per review, check terms_of_service_accepted_at has been updated 2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
8e3e9ad18a Fix terms and condition spec
Timecop intefere with the fake terms of service, so we need to manually
accept the terms of service to make the banner disappear
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
94fb1397f0 Set up data to hide ToS banner
The banner can in some case overlap element we are trying to interact
with. Add a fake ToS file and make sure user have accepted the ToS, so
that the banner is not shown
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
8e31e35d5d Add Tos banner on all admin pages
Plus spec, this is tested on the dashboard page.
The banner will show if the user accepted_at is before the tos file
updated at time.
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
ee79fd88d2 Add /admin/users/:id/accept_terms_or_service end point
Plus specs
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
a234f1ace6 Add stimulus controller to handle ToS banner
Plus spec
2023-12-22 13:20:14 +01:00
Gaetan Craig-Riou
16cb72adbc Add terms_of_service_accepted_at to spree_user
It will be used to track when a user has accepted changed to ToS
2023-12-22 13:20:14 +01:00
Konrad
5f7760c3cc Merge pull request #11803 from rioug/11801-remove-raw-from-email-template
Remove raw from various template
2023-12-22 13:10:33 +01:00
filipefurtad0
265de61e49 Resets VCR/Stripe library directory, after example run, on base spec helper 2023-12-22 12:09:50 +00:00
dependabot[bot]
f88d4a6da1 Bump debug from 1.9.0 to 1.9.1
Bumps [debug](https://github.com/ruby/debug) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.9.0...v1.9.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-22 09:48:10 +00:00
Gaetan Craig-Riou
ffbdb17b60 Merge pull request #11960 from mkllnk/rswag-deprecations
Update Swagger config to new naming
2023-12-22 11:30:18 +11:00
Ahmed Ejaz
985487c061 11068: update confirm_modal_component
- add new position alignment for the modal actions
- add 'justify-space-around' and 'justify-end' as new alignment classes
- use the above classes accordingly
2023-12-22 03:10:52 +05:00
Maikel
e3a838bc3f Merge pull request #11961 from openfoodfoundation/dependabot/bundler/faraday-2.8.1
Bump faraday from 2.7.12 to 2.8.1
2023-12-22 08:47:11 +11:00
Maikel
e15893e697 Merge pull request #11950 from filipefurtad0/stripe_accounts_vcr_spec
Replaces Stripe stubs with the real account IDs
2023-12-22 08:45:25 +11:00
Maikel
0b9a4386f2 Merge pull request #11965 from filipefurtad0/remove_comment
Removes forgotten comment line
2023-12-22 08:28:59 +11:00
Ahmed Ejaz
dc78fa843a Update app/reflexes/products_reflex.rb
11068: remove overdefensive auth check

Co-authored-by: Maikel <maikel@email.org.au>
2023-12-22 02:24:28 +05:00
Ahmed Ejaz
24fd75a85d Update app/reflexes/products_reflex.rb
11068: remove overdefensive auth check

Co-authored-by: Maikel <maikel@email.org.au>
2023-12-22 02:21:53 +05:00
bouaik
6fa3720d05 Merge branch 'master' into fix-menu-and-sub-menu-highlighting 2023-12-21 21:20:04 +01:00
bouaik
fde7c34287 fix highlighting 2023-12-21 21:16:39 +01:00
filipefurtad0
dc9774def6 Removes forgotten comment line 2023-12-21 18:56:11 +00:00
filipefurtad0
0517d1ce6b Replaces receive_message_chain rspec mocks with responses from real Stripe calls 2023-12-21 18:15:34 +00:00
filipefurtad0
d8d874f7ea Creates a connected account and tests OFN code for disconnecting it
Re-records cassettes

Creates a bogus publishable key

We need to feed some value to the ENV variables which are picked up from the local test environment, for the build to run. We could also store them all as environment secrets on our repo, but I don'r think this is necessary, as we only run recorderd API/VCR calls on our build, and never real API calls.
2023-12-21 11:09:18 +00:00
filipefurtad0
beb916d24d Improves assertions around disconnect-failure and -success test cases 2023-12-21 11:02:57 +00:00
filipefurtad0
87ba37dcfd Replaces Stripe stubs with the account and customer IDs
Adds STRIPE_ACCOUNT as sensitive data to VCR setup

Rubocop fixes and re-recording of cassettes

Adds bogus client_id to local test file - for CI to run
2023-12-21 11:02:55 +00:00
dependabot[bot]
f977a6f8d4 Bump faraday from 2.7.12 to 2.8.1
Bumps [faraday](https://github.com/lostisland/faraday) from 2.7.12 to 2.8.1.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.7.12...v2.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-21 09:37:20 +00:00
Maikel Linke
82d3199cf0 Update Swagger config to new naming
Avoids deprecation warnings:

```
DEPRECATION WARNING: swagger_root= is deprecated and will be removed from rswag-api 3.0 (use openapi_root= instead) (called from block in <main> at config/initializers/rswag_api.rb:8)
DEPRECATION WARNING: Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0 (called from block in <main> at config/initializers/rswag_ui.rb:12)
DEPRECATION WARNING: Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0 (called from block in <main> at config/initializers/rswag_ui.rb:13)
```
2023-12-21 16:23:27 +11:00
Maikel Linke
1903747c0a Send semantic id when connecting enterprise to app
It allows us to list enterprises from any OFN server, not just ofn-au.
The app could even accept any enterprise on any server providing its
data in the DFC format.
2023-12-21 15:09:09 +11:00
Maikel
589ae4db44 Merge pull request #11957 from duleorlovic/11855_add_ml_and_pa
Add Punjabi and Malayalam language for India instance #11855
2023-12-21 10:47:27 +11:00
Maikel
9ad60e891e Merge pull request #11906 from filipefurtad0/add_translation_checks
Adds build node to check for i18n exceptions
2023-12-21 09:31:28 +11:00
Dusan Orlovic
2585820bbb Add Punjabi and Malayalam language for India instance #11855 2023-12-20 12:55:51 +01:00
filipefurtad0
8891091ebb Uncomments preferences
Moves I18n exception handler within base spec helper
2023-12-20 11:16:25 +00:00
Ahmed Ejaz
0290697fb7 11068: add specs
- For delete_product
- For delete_variant
2023-12-20 12:54:54 +05:00
Ahmed Ejaz
78f5a8ad30 11068: add specs
- For system's product delete action
2023-12-20 12:54:54 +05:00
Ahmed Ejaz
d767529e11 11068: add divs to contain modals 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
9c321ef9c8 11068: update comment message 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
f44476b9af 11068: code refactoring
- Make use of reflexes when deleting the product and variant
- Add reflex dataset param to confirm_modal_component
2023-12-20 12:54:54 +05:00
Ahmed Ejaz
9cf51f3453 11068: add success and failure messages 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
1936adc82f 11068: fix lint issues 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
a321a962a5 11068: separate prompt_html into individual translation 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
26d102f66b 11068: update product/varaint delete actions 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
a71bb21789 11068: update confirm_button_color to confirm_button_class 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
d8eace8dff #11068: remove product_actions_controller.js 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
05e7674805 #11068: add delete variant and product reflexes 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
eca83eeec3 #11068, update delete links for uniq modal ids 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
5d90993f21 11068, apply delete_modals partial 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
c202324cb0 #11068: add product_v3 delete_modals partial 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
0efd78b979 #11068: update confirm_modal_component to accept controller values 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
d1224ea022 #11068, resolve conflicts 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
d7f2cbf882 11068, revert controller changes 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
2f0965aa62 #11068, add product_actions_controller 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
bf0943e655 #11068, add ProductDeleter 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
4f76478619 #11068, add delete modals 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
5d490ded15 #11068, update ConfirmModalComponent to take more options 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
0ff1067bc6 #11068, add delete option for product variant 2023-12-20 12:54:54 +05:00
Ahmed Ejaz
39de2f704f #11068, add delete dropdown option
# Conflicts:
#	app/views/admin/products_v3/components/_product_actions.html.haml
2023-12-20 12:54:54 +05:00
Maikel Linke
eb03235295 Use full product and variant name on DFC API 2023-12-20 16:43:29 +11:00
Maikel Linke
a9b206f74e Update Discover Regenerative description 2023-12-20 16:35:01 +11:00
Maikel Linke
67ffb5526e Display loading status in action button 2023-12-20 16:35:00 +11:00
Maikel Linke
b33910d5b4 Disconnect Connected App as enterprise user
The app has to provide a webhook URL to be notified when the app is
disconnected. Once we have better token management, we would have a
unique token per app and could revoke it. But for now it's just a
request to disconnect the app.
2023-12-20 15:29:28 +11:00
Maikel Linke
efee68007d Adjust header colour in new layout 2023-12-20 15:29:28 +11:00
Maikel Linke
fcb540a89f Improve readability by limiting text width 2023-12-20 15:29:28 +11:00
Maikel
6d5f07c6a0 Merge pull request #11945 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.23.0
Bump rubocop-rails from 2.22.2 to 2.23.0
2023-12-20 13:58:33 +11:00
Maikel
70a2a05a8d Merge pull request #11953 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.25
Bump combine_pdf from 1.0.24 to 1.0.25
2023-12-20 13:58:16 +11:00
Maikel Linke
89ef62d341 Update Rubocop config todo
[skip ci]
2023-12-20 13:57:06 +11:00
filipefurtad0
cdceefb6fb Moves test.rb I18n exception hanlder into base_spec_helper 2023-12-19 16:44:53 +00:00
Konrad
4973b5c07c Merge pull request #11789 from duleorlovic/11784_contact_tab
Fix open Contact tab from "customers only" message
2023-12-19 15:05:41 +01:00
dependabot[bot]
632291e8c7 Bump combine_pdf from 1.0.24 to 1.0.25
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/boazsegev/combine_pdf/releases)
- [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.24...v1.0.25)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 09:07:11 +00:00
Rachel Arnould
2b749714bd Merge pull request #11927 from drummer83/Dashboard
Show Dashboard header in the header area for multi-enterprise users
2023-12-18 17:49:49 +01:00
Dung Bui
248b9fb186 update order state 2023-12-18 19:26:00 +07:00
dependabot[bot]
4551a9b689 Bump rubocop-rails from 2.22.2 to 2.23.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.22.2 to 2.23.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.22.2...v2.23.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 09:18:45 +00:00
Maikel
080086aa38 Merge pull request #11943 from openfoodfoundation/dependabot/bundler/stripe-10.3.0
Bump stripe from 10.2.0 to 10.3.0
2023-12-18 14:46:40 +11:00
Gaetan Craig-Riou
502df3d78f Remove a bunch of non needed string interpolation 2023-12-18 14:42:04 +11:00
Gaetan Craig-Riou
eb4115ceed Per review, use existing TrixScrubber to sanitize content 2023-12-18 14:40:14 +11:00
Gaetan Craig-Riou
085629fae1 Remove raw 2023-12-18 14:40:14 +11:00
Gaetan Craig-Riou
28f3161bf8 Removing raw from invoice template 2023-12-18 14:40:14 +11:00
Gaetan Craig-Riou
031cc45992 Sanitize home_page_alert_html
It still allows some specific tag so we can have link and some
formatting.
2023-12-18 14:39:13 +11:00
Gaetan Craig-Riou
84a8c6b31a Remove raw from email template 2023-12-18 14:39:13 +11:00
Gaetan Craig-Riou
4a32df7ef5 Remove seemingly useless method
Left over from Spree, it looks like a weird way to cast somehing to a
string
2023-12-18 14:38:16 +11:00
Maikel Linke
317d492873 Test Stripe with real API 2023-12-18 14:06:38 +11:00
Maikel
b52b0c0413 Merge pull request #11937 from mkllnk/dfc-app
Add new enterprise settings tab Connected Apps
2023-12-18 13:37:26 +11:00
dung bui
738b338827 Merge branch 'master' into ft/include-vouchers-in-revenues-by-hub-report 2023-12-17 10:52:37 +07:00
Dung Bui
1867d7ef8e creat real records instead of mocking 2023-12-17 10:47:48 +07:00
Dusan Orlovic
120e299653 Use activate instead of changeActivePanel/ChangeActiveTab
Remove shop-tabs controllers since we can listen on `"data-action":
"orderCycleSelected@window->tabs-and-panels#activateDefaultPanel"`

Test for cases:
* activate by clicking on tab
* activateDefaultPanel on orderCycleSelected event
* activateFromWindowLocationOrDefaultPanelTarget to activate tab based
  on achor in URL
2023-12-16 10:00:17 +01:00
Dusan Orlovic
ba7ffc25fe Add data-action=tabs-and-panels 2023-12-15 23:00:13 +01:00
filipefurtad0
264b6e072e Adds missing translation key 2023-12-15 13:20:32 +00:00
filipefurtad0
57aa151ddd Comments out default values from superadmin fields to bring the build back to green 2023-12-15 12:48:21 +00:00
filipefurtad0
f8f85e7fbd Adds I18n exception handler as test initializer
As per code review, we follow this approach https://sikac.hu/missing-translations-keys-gotta-catch-em-all-3aa8d2ead8bd
2023-12-15 12:48:21 +00:00
dependabot[bot]
7f0a461385 Bump stripe from 10.2.0 to 10.3.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.2.0 to 10.3.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/v10.2.0...v10.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 09:11:11 +00:00
Maikel Linke
f758daadc0 Use common colours in old and new design 2023-12-15 16:21:43 +11:00
Maikel Linke
35ca66cbb7 Respond fast by rendering only partial 2023-12-15 12:34:40 +11:00
Maikel Linke
1d7f96e965 Broadcast connected app to all user tabs 2023-12-15 12:34:40 +11:00
Maikel Linke
e1730f25d6 Show app connection state and update link 2023-12-15 12:34:40 +11:00
Maikel Linke
12e5a0d1e1 Query webhook to connect app 2023-12-15 11:50:04 +11:00
Maikel Linke
4eb273b06e Create ConnectedApp with a reflex
I would have like to use a standard form to submit to the reflex but the
whole enterprise settings tab is in a form already and HTML doesn't
allow nested forms. While it does still work in browsers, it would have
added much more HTML to set up a form with a hidden input field instead
of just one additional data attribute.

The whole page is rendered by the controller again but the reflex root
attribute ensures that only parts of this tab are replaced. Otherwise
unsaved data on other tabs could be replaced and the page actually
becomes blank because AngularJS doesn't play well with the morph.
2023-12-15 11:50:04 +11:00
Maikel Linke
2346f03b6f Add ConnectedApp model 2023-12-15 11:50:04 +11:00
Maikel Linke
ca7b02d3ee Add basic description of Discover Regen app 2023-12-15 11:50:04 +11:00
Maikel Linke
d4ce3965b1 Connected apps can be enabled per user or enterprise 2023-12-15 11:22:15 +11:00
Maikel Linke
af2b65256f Add new enterprise settings tab Connected Apps 2023-12-15 11:22:15 +11:00
David Cook
aebc378aa8 [suggestion] Update translation key 2023-12-15 09:58:30 +11:00
David Cook
ad809facc6 [fixup] Fix translation key
The dot indicates lazy lookup
Also the name was missing a letter. It was hard to notice because the key name was so long, so I suggest reducing the key to something like 'order_has_changed'
2023-12-15 09:55:14 +11:00
Rachel Arnould
97985dbe8f Merge pull request #11805 from abdellani/fix-shipping-method-category-on-invoices-v3
[Invoices] Display the shipping category.
2023-12-14 17:09:39 +01:00
Mohamed ABDELLANI
2b1d7923da remove ':' after the shipping category on the invoice template 2023-12-14 16:42:24 +01:00
Mohamed ABDELLANI
82d50f58f3 remove raw from shipping method name 2023-12-14 16:36:36 +01:00
Mohamed ABDELLANI
db653fc945 render the shipping category in the invoice. 2023-12-14 16:36:36 +01:00
Rachel Arnould
9d87449730 Merge pull request #11704 from abdellani/add-reference-to-previous-invoices
a new invoice should refer the latest invoice.
2023-12-14 16:05:08 +01:00
Mohamed ABDELLANI
1038536c39 show warning when a new invoice can be generated 2023-12-14 15:34:19 +01:00
David Cook
37a1776c7e Prevent scrollbars on select2 item
This is unrelated to the rest of the PR, I just noticed this issue so decided to fix it. I can't find any explanation, or think of any good reason for this rule, so I'm burning it.
2023-12-14 15:23:41 +11:00
David Cook
2cbe9a4268 Style tom-select dropdown-input to appear over the main control
It's more compact, and we don't need to see the currently selected value because it's highlighted in the list already.
2023-12-14 15:23:40 +11:00
David Cook
b97890b537 Support custom placeholder value
Hmm, but this isn't useful until we get Tom-Select to work the way we want..

To do that, I think we'd ned to hook into TS to clear the current selection when focused, then set it back upon blur (if no selection was made). Hmm, but we still want it to show slected in the dropdown list.
Can we do it with css maybe?
2023-12-14 14:24:21 +11:00
David Cook
e8266ba3ae Refactor 2023-12-14 14:23:50 +11:00
David Cook
2756e37603 Placeholder style 2023-12-14 14:19:31 +11:00
David Cook
e578f697f5 Refactor: use data hash 2023-12-14 14:19:09 +11:00
David Cook
a5b2a24dc2 Refactor: Code cleanup 2023-12-14 14:13:01 +11:00
David Cook
ad797de1a6 Responsive sizing for elements
The query input can grow to fill the space.
2023-12-14 14:13:01 +11:00
David Cook
f29c1d5797 Use chevron for dropdown icon
We should be able to use @extend .icon-chevron-down, but I couldn't get it to work. I'd like to have a better method for this, but we should upgrade our ancient FontAwesome before worrying about that.
2023-12-14 14:13:01 +11:00
David Cook
1776420d4a Clip long content with ellipsis 2023-12-14 14:13:01 +11:00
David Cook
0efda02b9b Style list items as per design 2023-12-14 13:33:05 +11:00
David Cook
3fbd5f6357 Style single-select as per design 2023-12-14 13:33:03 +11:00
David Cook
05582b3d2d Fix display of single-select dropdowns 2023-12-14 13:28:41 +11:00
David Cook
53c49050a6 Use body font size on all form inputs 2023-12-14 13:28:41 +11:00
Gaetan Craig-Riou
b8e24918fc Merge pull request #11933 from openfoodfoundation/dependabot/bundler/rubocop-1.59.0
Bump rubocop from 1.58.0 to 1.59.0
2023-12-14 11:42:17 +11:00
Rachel Arnould
329ad1ddb2 Merge pull request #11874 from dacook/buu-success-message-11517
[BUU] Flash message redesign
2023-12-13 11:59:19 +01:00
David Cook
f99b0b19e7 Disable another OutputSafety warning
This one is a little more concerning: what if a model error message includes the user-submitted value? But this is for the admin interface only, and I'm not sure if we have model error messages that do that. So it's probably fine (it's certainly been like this a long time already).
2023-12-13 14:21:27 +11:00
David Cook
0e95b3211b Disable most OutputSafety warnings
These all seem to require html_safe/raw, so we'll permit it.
Some of the spree code is a bit strange and could probably be improved, but I think it's ok for now.
2023-12-13 14:19:19 +11:00
David Cook
dc9fd669a2 Remove unnecessary html_safe calls
The tag generator methods should already be returning html_safe strings.
2023-12-13 14:11:02 +11:00
Maikel
55ff376193 Merge pull request #11924 from filipefurtad0/stripe_sca_vcr_spec
Replaces Stripe Stubs with VCR calls
2023-12-13 11:53:15 +11:00
filipefurtad0
0f41d900df DRYes card and payment intent let groups
Fixes typo on capture_amount declaration
2023-12-12 13:18:17 +00:00
dependabot[bot]
321e6ef316 Bump rubocop from 1.58.0 to 1.59.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.58.0 to 1.59.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.58.0...v1.59.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-12 09:32:12 +00:00
David Cook
b340762366 Merge pull request #11931 from drummer83/Dashboard_v3_pointer
Fix colour of the arrow when hovering the change package area in dashboard
2023-12-12 14:19:23 +11:00
drummer83
dcba1dc5e9 Fix colour of the arrow when hovering the change package area in dashboard 2023-12-12 03:56:37 +01:00
David Cook
1f8a1cc376 Merge pull request #11929 from drummer83/Dashboard_translation
Fix missing translation of tooltip in dashboard
2023-12-12 13:47:53 +11:00
drummer83
43effb8197 Fix missing translation of tooltip 2023-12-12 02:00:59 +01:00
David Cook
638dbde1ba Merge pull request #11919 from openfoodfoundation/dependabot/bundler/debug-1.9.0
Bump debug from 1.8.0 to 1.9.0
2023-12-12 10:48:41 +11:00
drummer83
1afdbd92ea Show Dashboard header in the header area for multi-enterprise users
Use correct translation string
2023-12-12 00:11:15 +01:00
filipefurtad0
b45fc0b7ef Replaces Stripe Stubs with VCR calls
Adds new VCR cassettes

Keeps assertion on ActiverMerchant response

Re-records cassettes
2023-12-11 21:52:37 +00:00
Ryan Murphy
b84707edd9 Cleanse JS errors from DOM on Stripe failure 2023-12-11 07:46:42 -05:00
dependabot[bot]
ae04716391 Bump debug from 1.8.0 to 1.9.0
Bumps [debug](https://github.com/ruby/debug) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.8.0...v1.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 09:27:53 +00:00
Mohamed ABDELLANI
915afd8557 update the invoice v3 template 2023-12-11 08:26:32 +01:00
Mohamed ABDELLANI
615c001c28 implement Invoice#previous_invoice 2023-12-11 08:26:32 +01:00
Gaetan Craig-Riou
f6ba2dc70c Merge pull request #11917 from mkllnk/json-canonicalization
Bump json-canonicalization from 0.3.2 to 0.4.0
2023-12-11 10:04:02 +11:00
Maikel
3ceef60f6f Merge pull request #11913 from openfoodfoundation/dependabot/bundler/knapsack_pro-6.0.3
Bump knapsack_pro from 6.0.2 to 6.0.3
2023-12-11 09:58:29 +11:00
Maikel Linke
e8eeb0029c Bump json-canonicalization from 0.3.2 to 0.4.0
This is actually not changing anything. The author didn't realise the
bad implications of yanking 0.3.2 and restored it as 0.4.0.

https://github.com/dryruby/json-canonicalization/issues/2
2023-12-11 09:48:51 +11:00
Konrad
5aaaef63ac Merge pull request #11911 from arunguleria/11599-checkout-page-title-changes
Change page title on checkout pages
2023-12-10 20:53:56 +01:00
Konrad
cdb7312e95 Merge pull request #11798 from cillian/conditional-supplier-column-in-order-cycle-report
Only display Supplier column in Order Cycle Report email if there is more than one supplier
2023-12-10 16:49:23 +01:00
dung bui
c0ed579b44 Merge branch 'master' into ft/include-vouchers-in-revenues-by-hub-report 2023-12-09 13:04:52 +07:00
Dung Bui
d8024eb526 include voucher tax adjustment in revenues by hub report 2023-12-09 12:40:51 +07:00
Sigmund Petersen
7b7b4ceb81 Merge pull request #11696 from abdellani/sequential-invoice-numbers-per-distributor
Sequential invoice numbers per distributor
2023-12-08 13:56:23 +01:00
Mohamed ABDELLANI
4a22224c73 fix existing tests 2023-12-08 13:33:36 +01:00
Mohamed ABDELLANI
fea910f8b6 update the invoice number rendering 2023-12-08 13:33:36 +01:00
Mohamed ABDELLANI
41d5ca7861 update the invoice number calculation 2023-12-08 13:33:36 +01:00
Rachel Arnould
60656dedd4 Merge pull request #11901 from dacook/buu-bom-pagination-11608
Ensure pagination appears at bottom of table
2023-12-08 13:25:31 +01:00
dependabot[bot]
9f71f710ff Bump knapsack_pro from 6.0.2 to 6.0.3
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 6.0.2 to 6.0.3.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.2...v6.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 09:18:18 +00:00
Maikel Linke
29ef444f36 Consolidate system specs for efficiency
And test for literal strings. It's more readable and robust.
2023-12-08 09:05:00 +05:30
Maikel Linke
f88a3122ee Fix expectation of checkout title 2023-12-08 09:05:00 +05:30
Arun Guleria
d60216787b 11599 Remove whitespace trailing 2023-12-08 09:05:00 +05:30
Arun Guleria
4e408d404b 11599-Change page title on checkout pages 2023-12-08 09:05:00 +05:30
Maikel
029b8ce255 Merge pull request #11910 from openfoodfoundation/dependabot/bundler/knapsack_pro-6.0.2
Bump knapsack_pro from 6.0.1 to 6.0.2
2023-12-08 09:14:35 +11:00
Maikel
fe4380a84a Merge pull request #11900 from filipefurtad0/valid_cards_extend_payment_intents_tests
Adds payment intent creation/capture tests for valid credid card types (non-3D)
2023-12-08 09:04:56 +11:00
filipefurtad0
3802447bfe Removes credit card mock, pointing to real Stripe object
Re-records cassettes after source change
2023-12-07 18:30:23 +00:00
dependabot[bot]
4938d1a37c Bump knapsack_pro from 6.0.1 to 6.0.2
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 6.0.1 to 6.0.2.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.1...v6.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 09:53:12 +00:00
David Cook
1d3a588820 Update all locales with the latest Transifex translations 2023-12-07 16:53:26 +11:00
Maikel
f898572094 Merge pull request #11903 from openfoodfoundation/dependabot/bundler/json-2.7.1
Bump json from 2.7.0 to 2.7.1
2023-12-07 08:03:03 +11:00
Maikel
f8347ff836 Merge pull request #11904 from openfoodfoundation/dependabot/bundler/knapsack_pro-6.0.1
Bump knapsack_pro from 6.0.0 to 6.0.1
2023-12-07 08:02:42 +11:00
Maikel
7bc1442b5b Merge pull request #11899 from filipefurtad0/system_spec_zero_priced_variant
Adds test cases to account for priceless and 0.0 priced variant creation
2023-12-07 07:53:42 +11:00
dependabot[bot]
244d532268 Bump json from 2.7.0 to 2.7.1
Bumps [json](https://github.com/flori/json) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v2.7.0...v2.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 20:48:01 +00:00
Maikel
c34990bef4 Merge pull request #11895 from openfoodfoundation/dependabot/bundler/rubocop-1.58.0
Bump rubocop from 1.57.2 to 1.58.0
2023-12-07 07:46:54 +11:00
Konrad
7efc6f35b2 Merge pull request #11891 from bmd08a1/ft/search-by-customer-fullname-with-comma
Allow searching orders by customers' full name with comma and full name reversed
2023-12-06 21:08:28 +01:00
Konrad
7c892b2e9e Merge pull request #11889 from cillian/split-checkout-to-just-checkout
Replace references to 'split checkout' with just 'checkout'
2023-12-06 20:42:26 +01:00
Konrad
dc4b6519dd Merge pull request #11885 from dacook/flash-messages
Fix mapping of flash messages on order cycle pages
2023-12-06 18:03:57 +01:00
David Cook
979071736b Fix typo 2023-12-06 17:00:31 +11:00
David Cook
6280d4c1ea Merge pull request #11907 from dacook/buu-style-tweaks
[BUU] Link style tweaks
2023-12-06 16:10:52 +11:00
David Cook
0f3a952fd0 Add translation for product cloned message
A validation error shouldn't happen. If it does, it's an exception, not an error.
2023-12-06 15:13:20 +11:00
David Cook
0f46da07b2 Render flashes along with table
It doesn't matter where the flash messages appear in the HTML (thanks to fixed positioning), so why not keep it simple and send them with the main response.

preventDefault in case we are inside a form, so the button doesn't submit it.
2023-12-06 15:13:15 +11:00
David Cook
7fe2284d84 Refactor: Move ID out of partial
Because it can only be used once. But the classname can be used each time the partial is included.
2023-12-06 14:18:58 +11:00
David Cook
9fa521917e Allow nav menu items to wrap
And thus avoid wrapping inside the li.

This avoids the menu going off the edge of the screen.
2023-12-06 12:54:04 +11:00
David Cook
4de40e817f Left-align navigation menu
It looks really wierd when there's only a few items.
2023-12-06 12:54:04 +11:00
David Cook
3760cd93b9 Enable brower-default outlines on links
This code was from Spree. Unless you have good focus/active styles for all links, the outline is very helpful for accessibility.
Most websites these days add nice thick outlines, which might be worth considering in the future.
2023-12-06 12:54:01 +11:00
David Cook
32a4088386 Revert "#11067, remove messages to match with old UI UX"
Now we support flash messages, we can show it!

This reverts commit d8904099dd.
2023-12-06 10:12:18 +11:00
David Cook
fbf0afa15d Auto dismiss success flashes only 2023-12-06 10:12:18 +11:00
David Cook
0b4013dd11 Add dismiss button to flashes
And updating the secondary button style to ensure it's always white background
2023-12-06 10:12:17 +11:00
David Cook
20afe5b99c Update style of flash messages
They now hover near the bottom of the screen.

I've created new variables so as not to mess with the existing use of color-success etc.
2023-12-06 10:12:17 +11:00
David Cook
44187658be Copy messages styles for admin_v3 2023-12-06 10:12:17 +11:00
David Cook
f1a407c8a9 Remove unnecessary mixin,
and use generic variable for shadows.
2023-12-06 10:12:17 +11:00
David Cook
54d61cd24d Don't show flashes until everything else is done.
Mario reported that it was showing before the loading spinner had gone.
Technically the loading spinner doesn't hide until after the reflex is finished, but hopefully this is close enough.
2023-12-06 10:12:17 +11:00
David Cook
6dc04c458c Show saving success message in flash
I don't know if this is the best way to do it with SR, but it works..
2023-12-06 10:12:17 +11:00
David Cook
70f153b0f7 Refactor spec
Only the first example is testing the updated variant here.
2023-12-06 10:11:19 +11:00
David Cook
7d299affd3 Move hiding logic to stimulus controller
This ensures morphed flashes hide like other flashes (eg in bulk order actions). I wanted to write a spec to prove it, but Capybara doesn't support mocking setTimeout and I didn't want to use sleep.

I've made it optional because this controller is shared with the shop frontend ([supposedly](5ef34347a3), although angular seems to override it).
2023-12-06 10:11:19 +11:00
David Cook
127eaa44e5 Ensure loading message always shows
Before, it was affixed near the top of the page and wasn't visible after scrolling down.
2023-12-06 10:11:19 +11:00
filipefurtad0
e50baa9a18 Adds payment capture scenario 2023-12-05 15:27:46 +00:00
dependabot[bot]
e47cb0e961 Bump knapsack_pro from 6.0.0 to 6.0.1
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 6.0.0 to 6.0.1.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v6.0.0...v6.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-05 09:05:10 +00:00
David Cook
c4e8d4318c Ensure pagination appears at bottom of table
I'm not sure what the problem was. It's obviously a hacky fix, but it works for now. We intend to rebuild this screen without Angular anyway.
2023-12-05 14:46:51 +11:00
David Cook
300998acb6 Merge pull request #11811 from dacook/buu-stock-levels-11062
[BUU] Stock level popout
2023-12-05 13:56:01 +11:00
David Cook
685a1955bc Merge pull request #11872 from mkllnk/activate-background-reports
Activate background report processing by default
2023-12-05 12:04:19 +11:00
filipefurtad0
f3f59ed6ad Adds valid credid card types (non-3D) 2023-12-04 20:48:53 +00:00
filipefurtad0
7aeb6e4cd9 Adds test cases to account for priceless and 0.0 priced variant creation 2023-12-04 18:40:55 +00:00
dependabot[bot]
0281381e6e Bump rubocop from 1.57.2 to 1.58.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.2 to 1.58.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.57.2...v1.58.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 09:42:24 +00:00
Maikel
cb5164ac6e Merge pull request #11888 from openfoodfoundation/dependabot/bundler/stripe-10.2.0
bump stripe from 10.1.0 to 10.2.0
2023-12-04 14:54:38 +11:00
Maikel
89b6b183b9 Merge pull request #11893 from rioug/10809-patch-dfc-connector-parser
[DFC] Patch dfc connector parser to improve SKOS concept parsing
2023-12-04 14:32:02 +11:00
Gaetan Craig-Riou
021e292190 Add a quick patch description 2023-12-04 13:56:14 +11:00
Gaetan Craig-Riou
9628045e1c Fix indentation 2023-12-04 13:56:14 +11:00
Gaetan Craig-Riou
a06e7c1d9e Fix rubocop issue 2023-12-04 13:56:14 +11:00
Gaetan Craig-Riou
0392806018 Parser, populate SKOSConcept label 2023-12-04 13:56:14 +11:00
Gaetan Craig-Riou
9f209cac14 Fix rubocop warning 2023-12-04 13:56:14 +11:00
Gaetan Craig-Riou
633d0eadfe Parser element, add label 2023-12-04 13:56:14 +11:00
Dung Bui
8a3aababa1 group specs into one it block, added fullname with comma reversed ransacker 2023-12-04 08:45:19 +07:00
Gaetan Craig-Riou
c61e982a76 Fix rubocop warning 2023-12-04 12:00:18 +11:00
Maikel Linke
48c6d0144d Update stripe tests 2023-12-04 10:58:10 +11:00
Maikel
6b22227c5f Merge pull request #11887 from openfoodfoundation/dependabot/bundler/json-2.7.0
chore(deps): bump json from 2.6.3 to 2.7.0
2023-12-04 10:53:43 +11:00
Gaetan Craig-Riou
55d64e1768 Fix rubocop warning 2023-12-04 10:36:53 +11:00
Dung Bui
6206164c30 fix rubocop 2023-12-03 14:28:50 +07:00
Dung Bui
600226cb52 add fullname reversed search 2023-12-03 14:15:41 +07:00
Dung Bui
febda2ce12 add search by fullname with comma 2023-12-03 14:10:12 +07:00
Cillian O'Ruanaidh
2f972a5446 Remove more references to split checkout in test descriptions 2023-12-01 13:04:49 +00:00
Cillian O'Ruanaidh
a75ee3b207 Remove duplicate checkout translations which are now scoped under :step3 2023-12-01 12:56:21 +00:00
Cillian O'Ruanaidh
b78258c505 Replace references to :split_checkout translation keys with :checkout in views, controllers, etc. 2023-12-01 12:37:13 +00:00
Cillian O'Ruanaidh
3fee77136a Remove duplicate checkout.already_ordered translations 2023-12-01 12:31:42 +00:00
Cillian O'Ruanaidh
95a3e372ed Move translations in :split_checkout scope to :checkout. 2023-12-01 12:21:57 +00:00
Cillian O'Ruanaidh
def027efb2 Replace references to split_checkout directory in views and specs 2023-12-01 11:32:55 +00:00
Cillian O'Ruanaidh
931e42cf14 Rename split_checkout_controller_spec.rb to checkout_controller_spec.rb 2023-12-01 11:23:50 +00:00
Cillian O'Ruanaidh
a4b752e538 Rename SplitCheckoutHelper used in specs to CheckoutHelper 2023-12-01 11:22:44 +00:00
Cillian O'Ruanaidh
e014a991d8 Send /checkout routes to CheckoutController instead of SplitCheckoutController 2023-12-01 11:20:06 +00:00
Cillian O'Ruanaidh
a63b9c2690 Rename SplitCheckoutController to CheckoutController 2023-12-01 11:18:56 +00:00
Cillian O'Ruanaidh
7505f9504e Rename spec/views/split_checkout directory to spec/views/checkout 2023-12-01 11:16:57 +00:00
Cillian O'Ruanaidh
222c6d8ac5 Rename app/views/split_checkout directory to app/views/checkout 2023-12-01 11:12:00 +00:00
Filipe
f94d2c386c Merge pull request #11863 from abdellani/11862-fix-product-shoud-not-be-priceless
product should not be priceless
2023-12-01 10:43:30 +00:00
dependabot[bot]
cdf87436f9 bump stripe from 10.1.0 to 10.2.0
---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 10:08:51 +00:00
dependabot[bot]
ef58061cc0 chore(deps): bump json from 2.6.3 to 2.7.0
Bumps [json](https://github.com/flori/json) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v2.6.3...v2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 09:52:00 +00:00
David Cook
a2b8fb5105 Show success messages as.. success. 2023-12-01 16:59:23 +11:00
Maikel Linke
72755840c0 Update specs for background reports 2023-12-01 15:22:34 +11:00
Maikel Linke
75467a0c65 Update specs for background reports 2023-12-01 15:22:34 +11:00
Maikel Linke
d1c73f86c0 Update specs for background reports 2023-12-01 15:22:34 +11:00
Maikel Linke
049df77558 Update specs for background reports 2023-12-01 15:22:34 +11:00
Maikel Linke
0b7cf86b5b Update report spec for background reports 2023-12-01 15:22:34 +11:00
Maikel Linke
bbe37e1392 Update ReportsController for background reports
As it turns out, the background reports were missing a small feature to
store user preferences. Yay specs!
2023-12-01 15:21:42 +11:00
Maikel Linke
f28a8c87ab Activate background report processing by default
Many report specs are still testing the old behaviour. We need to
migrate them to background reports. Some tests may be better as unit
tests instead of system tests.
2023-12-01 14:44:33 +11:00
Gaetan Craig-Riou
e846761e54 WIP Patch DFC connector to fix SKOS Concept parsing
This is to let us use intermediary SKOS Concept.
Upstream PR for more details: https://github.com/datafoodconsortium/connector-codegen/pull/10/files
2023-12-01 14:26:09 +11:00
David Cook
1cd9d9aafd Organise controller translation keys with lazy loading 2023-12-01 14:20:30 +11:00
Gaetan Craig-Riou
7c9d4f1342 Update all locales with the latest Transifex translations 2023-12-01 11:22:35 +11:00
David Cook
dbb62c9820 Merge pull request #11881 from mkllnk/rswag
Help Dependabot to update rswag
2023-12-01 11:12:31 +11:00
David Cook
c35b82373e Merge pull request #11867 from mkllnk/tos-spec
DRY Terms of Service spec to save time
2023-12-01 11:10:48 +11:00
Gaetan Craig-Riou
082f78c772 Merge pull request #11873 from dacook/viewcomponent-sidecar
ViewComponent sidecar
2023-12-01 10:44:13 +11:00
David Cook
9658223700 Merge pull request #11792 from filipefurtad0/invoice_printing_legal_invoices_feature
Adds a pending spec for legal invoices feature issue #11791
2023-12-01 09:11:51 +11:00
Maikel Linke
2bf480732d Help Dependabot to update rswag
The rswag gem consists of three gem which are all maintained in the same
repository. So when one of the three gems is updated, the version of all
three gems is bumped. Dependabot was opening 3 independent pull requests
with the same release notes and linking to the same repository.

I hope that making the rswag gem a dependency will make Dependabot try
to update all gems together.

We are still listing two gems separately to be loaded in production.
They enable us to view the API documentation. But we don't need the
third gem rswag-specs in production. That one is only useful in tests.
2023-12-01 09:11:15 +11:00
Maikel
dd786312bf Merge pull request #11876 from openfoodfoundation/dependabot/bundler/rswag-ui-2.13.0
chore(deps): bump rswag-ui from 2.12.0 to 2.13.0
2023-12-01 09:08:11 +11:00
Maikel
5bfb72f65f Merge pull request #11875 from openfoodfoundation/dependabot/bundler/rswag-api-2.13.0
chore(deps): bump rswag-api from 2.12.0 to 2.13.0
2023-12-01 09:07:42 +11:00
Maikel
e54e9b2110 Merge pull request #11878 from openfoodfoundation/dependabot/bundler/rswag-specs-2.13.0
chore(deps-dev): bump rswag-specs from 2.12.0 to 2.13.0
2023-12-01 09:07:10 +11:00
Maikel
bc614c7b89 Merge pull request #11877 from openfoodfoundation/dependabot/bundler/knapsack_pro-6.0.0
chore(deps-dev): bump knapsack_pro from 5.7.0 to 6.0.0
2023-12-01 09:05:20 +11:00
Maikel Linke
08d0345967 Simplify feature selection in spec 2023-12-01 08:55:47 +11:00
Cillian O'Ruanaidh
b96110ec6c Don't display a supplier column if there is only one supplier in the orders grouped by customer part of the order cycle report 2023-11-30 20:32:23 +00:00
Cillian O'Ruanaidh
c3a62e53fc If not display supplier column in the order cycle report, reduce number of columns in totals row by one too to keep columns aligned 2023-11-30 20:32:23 +00:00
Cillian O'Ruanaidh
1d88510b7b Only display Supplier column in Order Cycle Report email if there is more than one supplier 2023-11-30 20:32:23 +00:00
filipefurtad0
3bf4e47d53 Sets shared example for invoice bulk printing
with legal invoices feature enabled and disabled
2023-11-30 12:44:49 +00:00
dependabot[bot]
22e9cf66e2 chore(deps-dev): bump rswag-specs from 2.12.0 to 2.13.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.12.0 to 2.13.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.12.0...2.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 09:37:20 +00:00
dependabot[bot]
235d17a2b8 chore(deps-dev): bump knapsack_pro from 5.7.0 to 6.0.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.7.0 to 6.0.0.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.7.0...v6.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 09:30:00 +00:00
dependabot[bot]
4d9137a2a6 chore(deps): bump rswag-ui from 2.12.0 to 2.13.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.12.0 to 2.13.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.12.0...2.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 09:28:58 +00:00
dependabot[bot]
58892b5a37 chore(deps): bump rswag-api from 2.12.0 to 2.13.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.12.0 to 2.13.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.12.0...2.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 09:19:25 +00:00
David Cook
58215727bc [fixup]
- Style/ClassAndModuleChildren: Use nested module/class definitions instead of compact style.
- fix spec
2023-11-30 13:47:39 +11:00
Maikel
ccc460a990 Merge pull request #11868 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.141.0
chore(deps): bump aws-sdk-s3 from 1.140.0 to 1.141.0
2023-11-30 13:03:53 +11:00
David Cook
2013750732 Rename files to match recommended naming scheme
This naming scheme removes some duplication which is nice, but it's a little strange and results in a longer name overall. I don't like it very much because:
- filenames don't include the component's actual name. This makes it slightly harder to find them in my text editor (but I'd probably get used to that)
- the namespace and class naming isn't exactly right. This is _the_ vertical_ellipsis_menu, not a subcomponent.
- the stimulus controller name is now longer, adding more cruft to the HTML.

Lots of discussion here: https://github.com/ViewComponent/view_component/discussions/67
People tried to come up with a better way (and I was tempted to try myself). It seems this approach won. I guess it's not so bad if your component names are shorter.
2023-11-30 12:25:18 +11:00
David Cook
f6d72127a7 Move controller to sidecar directory 2023-11-30 12:18:55 +11:00
David Cook
ed93c77578 Load Stimulus controllers from 'sidecar' directories
Javascript files can now be included in the component directory, alongside HTML and CSS.

As per https://viewcomponent.org/guide/javascript_and_css.html
2023-11-30 12:18:55 +11:00
dependabot[bot]
db652acf67 chore(deps): bump aws-sdk-s3 from 1.140.0 to 1.141.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.140.0 to 1.141.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 09:04:14 +00:00
Rachel Arnould
63bf574b02 Merge pull request #11807 from abdellani/fix-bulk-invoice-printing
[Invoices] fix bulk invoice printing
2023-11-29 08:17:38 +01:00
David Cook
6bf418c4eb Fixup 2023-11-29 15:36:00 +11:00
David Cook
ccc0c17e04 Hide value of disabled input in popout
I'm not sure if we want to do this on all fields, so just scoped it here for now.
2023-11-29 15:36:00 +11:00
David Cook
9ce511f69d Update disabled field style 2023-11-29 15:35:59 +11:00
David Cook
aa792346fc Refactor 2023-11-29 15:18:23 +11:00
Maikel
afdd68269c Merge pull request #11866 from openfoodfoundation/dependabot/bundler/view_component-3.8.0
chore(deps): bump view_component from 3.7.0 to 3.8.0
2023-11-29 13:59:52 +11:00
Maikel Linke
f6e9bfe15d Further simplify Terms of Service spec
Since system specs are expensive, the standard workflow can be tested in
one "smoke test", as one scenario.

Run time reduced from 5.8s to 4.9s.
2023-11-29 12:21:38 +11:00
Maikel Linke
d3f2c72730 DRY Terms of Service spec to save time
The test conditions were already checked in the normal file upload.

Run time reduced from 7.2s to 5.8s.
2023-11-29 12:21:37 +11:00
Mohamed ABDELLANI
da900321ca fix product controller tests 2023-11-28 16:15:20 +01:00
Mohamed ABDELLANI
c995f5dfbe set the price to 0 on the cloned product (Spree::Code::RroductDuplicator) 2023-11-28 16:15:12 +01:00
Mohamed ABDELLANI
9ce62cf6af replace link_to with contant_tag 2023-11-28 15:02:03 +01:00
Mohamed ABDELLANI
a13e087541 use render edit instead of redirect_to
with redirect_to, the validation errors will be lost at the rendering time.
2023-11-28 13:45:17 +01:00
Mohamed ABDELLANI
a0c2facca4 validate price numericality on product and variants 2023-11-28 13:45:08 +01:00
Konrad
d4cebfdb4f Merge pull request #11837 from binarygit/open-link-in-new-page
Open external link in product description inside new page
2023-11-28 11:09:35 +01:00
dependabot[bot]
794d964007 chore(deps): bump view_component from 3.7.0 to 3.8.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.7.0...v3.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-28 09:45:44 +00:00
David Cook
40742d6308 Merge pull request #11861 from openfoodfoundation/dependabot/bundler/rswag-ui-2.12.0
chore(deps): bump rswag-ui from 2.11.0 to 2.12.0
2023-11-28 13:57:05 +11:00
David Cook
77c55838fa Merge pull request #11860 from openfoodfoundation/dependabot/bundler/rswag-api-2.12.0
chore(deps): bump rswag-api from 2.11.0 to 2.12.0
2023-11-28 13:52:54 +11:00
David Cook
021d11c5dd Merge pull request #11859 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.140.0
chore(deps): bump aws-sdk-s3 from 1.139.0 to 1.140.0
2023-11-28 13:47:43 +11:00
dependabot[bot]
457b9e4010 chore(deps): bump rswag-ui from 2.11.0 to 2.12.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.11.0...2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-28 02:38:02 +00:00
dependabot[bot]
868b96fff0 chore(deps): bump rswag-api from 2.11.0 to 2.12.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.11.0...2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-28 02:38:00 +00:00
David Cook
e3ef791e10 Merge pull request #11858 from openfoodfoundation/dependabot/bundler/rswag-specs-2.12.0
chore(deps-dev): bump rswag-specs from 2.11.0 to 2.12.0
2023-11-28 13:36:37 +11:00
David Cook
bac023abf9 Merge pull request #11857 from mkllnk/default-host
Remove unnecessary host config in specs
2023-11-28 13:23:38 +11:00
David Cook
f034e46aed Fix label
Strangely, the spec passed when run locally, but not in CI. It's a curious case of the wrong letter case.
2023-11-28 10:44:34 +11:00
David Cook
994dd606b9 Refactor: remove dead code
I was mistakenly thinking that you can define variables in beforeEach, but it turns out these are not used.

Rather, Jest was automatically creating variables for the elements according to their IDs. How convenient!
2023-11-28 10:44:34 +11:00
David Cook
bc6a83017b Update spec
Ok that was an afterthought, but better late than never.
2023-11-28 10:44:34 +11:00
David Cook
373743f96d Simplify event handlers
The new 'input' event is for this exact use case.
2023-11-28 10:44:34 +11:00
David Cook
88fe8dcbe0 Show changes on popout button 2023-11-28 10:44:34 +11:00
David Cook
5e96368c85 Count changed checkboxes 2023-11-28 10:44:34 +11:00
David Cook
69f160ff95 Toggle input disabled when on demand checked
This introduces a new 'toggle' controller, and we already had three\! So I created a generic interface that could be extended to potentially support all of them. I propose we try to reduce them all into the one controller, but won't go down the rabbit-hole just yet..

I have an idea on how to re-arrange and make it more contained, by assigning the controller only to the checkbox, and defining targets with aria-controls="", but chose to stick with Stimulus conventions for now.
2023-11-28 10:44:34 +11:00
David Cook
9bc1e873d3 Display summary of the popout values
I couldn't think of a simpler way to hardcode it, so now we have a clever generic method :)

We can assume that hidden elements will stay hidden, but we need to check each time if an element is disabled or not.
2023-11-28 10:44:34 +11:00
David Cook
888e0b976b Refactor spec
Shoulda done this at the start.
2023-11-28 10:44:34 +11:00
David Cook
b6045655ee Hide popout when checkbox is checked 2023-11-28 10:44:34 +11:00
David Cook
78d2ddb9b7 Close popout when focus outside
I'm starting to think that these stimulus tests are worthless. The environment is not the same as a browser, which creates extra work to deal with the inconsistencies. And it means we're not testing real world behaviour.

So these are just unit tests, but they take extra effort to put together due to the inter-relatedness with the DOM. Hmm.
2023-11-28 10:44:34 +11:00
David Cook
4560e3728c Show popout on click or down key
It looks like a select drop-down, so it can behave like one too.
2023-11-28 10:44:34 +11:00
David Cook
735b5789cc [wip] Style on-hand button
Had to update the form controller a little bit to handle buttons.

But arrow not showwing on focus.
Getting some weird SCSS behaviour here.. maybe I'm trying to be too clever.
2023-11-28 10:44:34 +11:00
David Cook
d218565834 Style stock popout 2023-11-28 10:44:34 +11:00
David Cook
d9570cdf32 Update v3 checkbox style
This doesn't _quite_ match the design, but would require a big CSS hack to customise it further, so I thought let's start with this.
2023-11-28 10:44:34 +11:00
David Cook
b7ac1f2696 Move specific style rule to where it belongs
Also fixed it to line up properly. There's probably a better way to line it up but that's no my concern right now..
2023-11-28 10:44:34 +11:00
David Cook
eccfe96a5b Use form hash structure
The array format is generally fine, but to properly support checkboxes, we need this format with hash keys.
https://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions
2023-11-28 10:44:34 +11:00
David Cook
55cd8a6773 Add on_demand field
But 'Array parameters do not play well with the check_box helper.'

...
2023-11-28 10:43:10 +11:00
David Cook
7aefa834bf Add on_hand input 2023-11-28 10:43:10 +11:00
David Cook
4d22123e02 Remove stock level from product row
It creates the false impression we can handle agregated stock.
2023-11-28 10:43:10 +11:00
dependabot[bot]
a2b64f9ebb chore(deps): bump aws-sdk-s3 from 1.139.0 to 1.140.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.139.0 to 1.140.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 09:47:30 +00:00
dependabot[bot]
2f9375dcb2 chore(deps-dev): bump rswag-specs from 2.11.0 to 2.12.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.11.0...2.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 09:43:36 +00:00
Maikel Linke
4c5c39f23b Remove unnecessary host config in specs 2023-11-27 10:51:23 +11:00
Gaetan Craig-Riou
4b070f8447 Merge pull request #11848 from dacook/vertical_ellipsis_menu_component
Vertical ellipsis menu component
2023-11-27 10:21:09 +11:00
Maikel
d067f1329f Merge pull request #11856 from duleorlovic/add_hi_and_mr_locale
Add hi and mr locale using tx pull -l hi
2023-11-27 09:18:03 +11:00
Dusan Orlovic
fc42330383 Add hi and mr locale using tx pull -l hi 2023-11-26 08:35:50 +01:00
Filipe
92686c97d6 Merge pull request #11853 from dacook/check_pdf_file_bulk_invoice_print2
Spec refactor
2023-11-24 10:14:53 +00:00
David Cook
e53960bae7 Disable Rails/OutputSafety for specs
This cop is to protect against user input. There's no user input (or users) in specs.
2023-11-24 16:35:45 +11:00
David Cook
d989b8ad2f Remove unnecessary partial
Yay, now it's compact enough to fit in the table partial.

(Although we should probably try to reduce that one down one day..)
2023-11-24 16:28:00 +11:00
David Cook
968a224da6 Move vertical ellipsis menu to a ViewComponent
Javascript hasn't been moved in, as we don't seem to be set up for that yet.

We could make it smarter, and pass in an array of parameters to build the links (as in _order_links.html.haml). But why make it complicated if we don't need to?
2023-11-24 16:23:18 +11:00
David Cook
2bd2bea7b7 Remove need for class
Generally, I would say that style rules should have a BEM-style class name, but in this case it's terribly convenient to support a tags directly.
2023-11-24 16:14:28 +11:00
Maikel Linke
f2f63eb416 Update all locales with the latest Transifex translations 2023-11-24 14:23:46 +11:00
Maikel Linke
777060ea6b Remove old script
We use Github to draft releases these days.
2023-11-24 14:22:42 +11:00
David Cook
3bfe0f86f2 Merge pull request #11852 from filipefurtad0/fix_display_inventory_warning_spec
Fix display inventory warning spec
2023-11-24 13:46:41 +11:00
David Cook
358470f801 Merge pull request #11849 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.139.0
chore(deps): bump aws-sdk-s3 from 1.138.0 to 1.139.0
2023-11-24 13:29:41 +11:00
David Cook
eecca8ee96 Refactor: match url with regexp
And remove unnecessary button click.
2023-11-24 12:41:02 +11:00
Gaetan Craig-Riou
f10c35dc32 Merge pull request #11850 from openfoodfoundation/dependabot/bundler/spring-4.1.3
chore(deps-dev): bump spring from 4.1.2 to 4.1.3
2023-11-24 12:31:29 +11:00
Gaetan Craig-Riou
8b5e543ba5 Merge pull request #11836 from filipefurtad0/check_pdf_file_bulk_invoice_print
Extends bulk print invoice spec to assert on file contents
2023-11-24 11:42:49 +11:00
David Cook
907d559eef Merge pull request #11847 from mkllnk/spec-opt
Avoid precompiling assets unnecessarily
2023-11-24 09:16:50 +11:00
filipefurtad0
0390d52f18 Adds test to reproduce issue #11851 2023-11-23 19:49:34 +00:00
filipefurtad0
8b5d5b3626 Changes inventory setting for order cycle coordinator
...instead of supplier; Inventory is a feature which is relevant for shops/hubs.
2023-11-23 17:27:09 +00:00
dependabot[bot]
103f5d1dcb chore(deps-dev): bump spring from 4.1.2 to 4.1.3
Bumps [spring](https://github.com/rails/spring) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v4.1.2...v4.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-23 10:09:38 +00:00
dependabot[bot]
bafbcd1e1e chore(deps): bump aws-sdk-s3 from 1.138.0 to 1.139.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.138.0 to 1.139.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-23 10:01:00 +00:00
Maikel Linke
3586497c56 Precompile assets only when needed 2023-11-23 17:23:47 +11:00
David Cook
c6fc139f62 Always generate components in subfolders
Currently all our view components are in subfolders, so we probably want to keep it that way.
2023-11-23 17:04:09 +11:00
Maikel Linke
37feefce37 Avoid precompiling assets unnecessary
We had two calls to precompile assets, one for all specs and then a
second one just for system specs. The one for system specs is better
because it checks for the webpack dev server before compiling assets. So
let's use just that one.
2023-11-23 17:00:44 +11:00
Maikel Linke
6431b94aba Remove unnecessary condition in spec helper
This helper file is only loaded when system specs are loaded. So we
don't need to check for the absence of system specs because this file
wouldn't be loaded if there were not system specs to be run.
2023-11-23 16:59:30 +11:00
Maikel
bb0684bd23 Merge pull request #11818 from mkllnk/dfc-vocabularies 2023-11-23 10:06:38 +11:00
Maikel
ee4dd0666c Merge pull request #11840 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.1.3
chore(deps): bump active_storage_validations from 1.1.2 to 1.1.3
2023-11-23 09:29:50 +11:00
Maikel
f8fc44ea72 Merge pull request #11844 from filipefurtad0/fix_blacklist_whitelist_deprecation_warning
[System specs, CI] Fixes blacklist/whitelist deprecation warning
2023-11-23 08:48:48 +11:00
Maikel
1e635673c0 Merge pull request #11842 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.138.0
chore(deps): bump aws-sdk-s3 from 1.137.0 to 1.138.0
2023-11-23 08:47:49 +11:00
Maikel
bf95a655af Merge pull request #11841 from openfoodfoundation/dependabot/bundler/rspec-rails-6.1.0
chore(deps-dev): bump rspec-rails from 6.0.3 to 6.1.0
2023-11-23 08:47:13 +11:00
Maikel
3f76a4c68e Merge pull request #11839 from openfoodfoundation/dependabot/bundler/faraday-2.7.12
chore(deps): bump faraday from 2.7.11 to 2.7.12
2023-11-23 08:42:51 +11:00
Maikel Linke
22e96764ec Simplify spec 2023-11-23 08:39:20 +11:00
filipefurtad0
660db32c04 Converts whitelist URLs to regular expressions 2023-11-22 17:37:41 +00:00
filipefurtad0
674974f868 Moves block within test description
This way, we don't need to use it as a global method

Clarifies context naming
2023-11-22 17:01:43 +00:00
Rachel Arnould
1088b6b6dd Merge pull request #11785 from chahmedejaz/task/11067-admin_style_v3-product-clone
Implement product clone
2023-11-22 16:29:38 +01:00
dependabot[bot]
4b2def7831 chore(deps): bump aws-sdk-s3 from 1.137.0 to 1.138.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.137.0 to 1.138.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 09:32:36 +00:00
dependabot[bot]
55a2562061 chore(deps-dev): bump rspec-rails from 6.0.3 to 6.1.0
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 6.0.3 to 6.1.0.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v6.0.3...v6.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 09:28:41 +00:00
dependabot[bot]
fa3bfe7698 chore(deps): bump active_storage_validations from 1.1.2 to 1.1.3
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.1.2 to 1.1.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)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 09:16:42 +00:00
dependabot[bot]
0bed1e852f chore(deps): bump faraday from 2.7.11 to 2.7.12
Bumps [faraday](https://github.com/lostisland/faraday) from 2.7.11 to 2.7.12.
- [Release notes](https://github.com/lostisland/faraday/releases)
- [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lostisland/faraday/compare/v2.7.11...v2.7.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 09:12:53 +00:00
Maikel
599085b33f Merge pull request #11838 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.0.8
chore(deps): bump trix from 2.0.7 to 2.0.8
2023-11-22 16:46:26 +11:00
Maikel
19c4629ff9 Merge pull request #11835 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.137.0
chore(deps): bump aws-sdk-s3 from 1.136.0 to 1.137.0
2023-11-22 16:26:00 +11:00
Maikel
a286b15be5 Merge pull request #11834 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.22.2
chore(deps-dev): bump rubocop-rails from 2.22.1 to 2.22.2
2023-11-22 15:57:38 +11:00
Maikel
97d9ea4f7a Merge pull request #11833 from openfoodfoundation/dependabot/bundler/bullet-7.1.4
chore(deps-dev): bump bullet from 7.1.3 to 7.1.4
2023-11-22 15:54:41 +11:00
Maikel
e602174451 Merge pull request #11832 from openfoodfoundation/dependabot/bundler/activerecord-import-1.5.1
chore(deps): bump activerecord-import from 1.5.0 to 1.5.1
2023-11-22 15:53:46 +11:00
Maikel
e16429b166 Merge pull request #11821 from mkllnk/feature-toggled-specs
Feature toggled specs
2023-11-22 14:18:13 +11:00
Konrad
8ae9399a28 Merge pull request #11831 from chahmedejaz/task/11827-activate-vouchers-by-default
Fully Enable Vouchers Feature Toggle by Default
2023-11-21 14:45:13 +01:00
Konrad
40f5fadc9a Merge pull request #11732 from yasirazgar/11612_keep_data_range_reports
Maintain date range values in the report forms
2023-11-21 13:48:58 +01:00
Yasir Azgar
72089d8213 11612 - pass date args
fix typo
2023-11-21 11:15:52 +01:00
dependabot[bot]
8398e6facb chore(deps): bump trix from 2.0.7 to 2.0.8
Bumps [trix](https://github.com/basecamp/trix) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.0.7...v2.0.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-21 09:19:11 +00:00
binarygit
208cad959a Open external link in product description inside new page 2023-11-21 13:33:48 +05:45
filipefurtad0
a5e5b4a114 Extends bulk print invoice spec to assert on file contents 2023-11-20 19:31:10 +00:00
dependabot[bot]
e37acfc251 chore(deps): bump aws-sdk-s3 from 1.136.0 to 1.137.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.136.0 to 1.137.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:51:11 +00:00
dependabot[bot]
2ab4f7010d chore(deps-dev): bump rubocop-rails from 2.22.1 to 2.22.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.22.1 to 2.22.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.22.1...v2.22.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:49:30 +00:00
dependabot[bot]
7a88c9186a chore(deps-dev): bump bullet from 7.1.3 to 7.1.4
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.3 to 7.1.4.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.3...7.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:48:19 +00:00
dependabot[bot]
0b0d7f7610 chore(deps): bump activerecord-import from 1.5.0 to 1.5.1
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.5.0 to 1.5.1.
- [Changelog](https://github.com/zdennis/activerecord-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zdennis/activerecord-import/compare/v1.5.0...v1.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:47:53 +00:00
Maikel
7919329651 Update db/migrate/20231118125941_activate_voucher_by_default.rb 2023-11-20 09:31:50 +11:00
Ahmed Ejaz
e370693309 #11827, fully enable vouchers by default 2023-11-18 18:05:45 +05:00
filipefurtad0
a30c0008a1 Update all locales with the latest Transifex translations 2023-11-17 12:49:34 +00:00
Filipe
ebd1151054 Merge pull request #11730 from murjax/payment-save-flash-9048
Fix Stripe payment flash rendering issue
2023-11-17 11:51:42 +00:00
Filipe
e6e4e014dc Merge pull request #11731 from chahmedejaz/bugfix/11667-clone-tags-issue-for-OC
Fix Cloning Tags Issue for OrderCycle
2023-11-17 10:50:33 +00:00
Filipe
c9084db933 Merge pull request #11761 from binarygit/open-external-links-in-new-page
Open external links in product description in a new page
2023-11-17 10:30:03 +00:00
David Cook
84ea05ad5a Merge pull request #11822 from rioug/revert-prettier-to-2.8.8
Revert prettier to v 2.8.8
2023-11-17 16:01:20 +11:00
Maikel
a1dbb3353f Merge pull request #11820 from macanudo527/fix_autocorrect_rubocop2
Fix Style Rubocop Errors
2023-11-17 14:25:12 +11:00
Maikel
df44446291 Merge pull request #11819 from dacook/update-browserslist-db
Update browserslist caniuse db
2023-11-17 14:05:11 +11:00
Maikel Linke
6f3bee708c Check feature name in specs
There was one case where a typo meant that the desired feature wasn't
active and tests were not testing the right code path. Using this new
syntax should prevent that.

* https://github.com/openfoodfoundation/openfoodnetwork/pull/11705
2023-11-17 13:18:31 +11:00
Maikel Linke
d841b1dae2 DRY feature activation in specs
It's simple this way and we have one place to add logic to when needed
(see next commit).
2023-11-17 13:17:27 +11:00
Gaetan Craig-Riou
5117cd31e9 Pretty-quick breaks with Prettier v3
As explained here : https://github.com/azz/pretty-quick/issues/164
We most likely need to move away from pretty-quick
2023-11-17 13:04:32 +11:00
Maikel
f087aa07d0 Merge pull request #11705 from abdellani/fix-existing-tests
Fix invoice printing tests
2023-11-17 12:57:24 +11:00
Neal Chambers
c3c4486d0c Safely autocorrect Style/RedundantStringEscape
Inspecting 1513 files
..........................................................................................................................................................................................................................................................................................................................C...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C......................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...........................................................................................................

Offenses:

app/models/spree/calculator.rb:31:48: C: [Corrected] Style/RedundantStringEscape: Redundant escape of / inside string literal.
      self.class.name.titleize.gsub("Calculator\/", "")
                                               ^^
spec/controllers/spree/admin/shipping_methods_controller_spec.rb:40:78: C: [Corrected] Style/RedundantStringEscape: Redundant escape of ' inside string literal.
        params[:shipping_method][:calculator_attributes][shipping_amount] = "\'20.0'"
                                                                             ^^
spec/system/admin/enterprise_fees_spec.rb:82:78: C: [Corrected] Style/RedundantStringEscape: Redundant escape of ' inside string literal.
    fill_in("#{prefix}_calculator_attributes_preferred_flat_percent", with: "\'20.0'")
                                                                             ^^
spec/system/admin/enterprise_fees_spec.rb:140:42: C: [Corrected] Style/RedundantStringEscape: Redundant escape of ' inside string literal.
        'preferred_flat_percent', with: "\'20.0'"
                                         ^^

1513 files inspected, 4 offenses detected, 4 offenses corrected
2023-11-17 09:03:32 +09:00
Neal Chambers
edbf4c15a9 Safely autocorrect Style/RedundantReturn
Inspecting 1513 files
.........................................................................................................................................................................................................................................................................................................C......................................................C............................................................................................................................................................................................................................................................................................................................................................................................................................................C.........................................................C.......C.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/product_import/entry_validator.rb:200:7: C: [Corrected] Style/RedundantReturn: Redundant return detected.
      return true unless Float(value, exception: false).nil?
      ^^^^^^
app/models/spree/stock/availability_validator.rb:30:9: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
        return line_item.target_shipment if line_item.target_shipment
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/stock/availability_validator.rb:31:9: C: [Corrected] Style/RedundantReturn: Redundant return detected.
        return line_item.order.shipments.first if line_item.order&.shipments&.any?
        ^^^^^^
lib/reporting/reports/enterprise_fee_summary/summarizer.rb:41:11: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
          return DataRepresentations::IncomingExchangeLineItemFee if for_incoming_exchange?
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/reporting/reports/enterprise_fee_summary/summarizer.rb:42:11: C: [Corrected] Style/RedundantReturn: Redundant return detected.
          return DataRepresentations::OutgoingExchangeLineItemFee if for_outgoing_exchange?
          ^^^^^^
lib/stripe/authorize_response_patcher.rb:31:7: C: [Corrected] Style/RedundantReturn: Redundant return detected.
      return url if url.match(%r{https?://\S+}) && url.include?("stripe.com")
      ^^^^^^
lib/tasks/data.rake:99:7: C: [Corrected] Style/RedundantReturn: Redundant return detected.
      return true if Integer(value)
      ^^^^^^

1513 files inspected, 7 offenses detected, 7 offenses corrected
2023-11-17 09:00:50 +09:00
Neal Chambers
85fef7ac4b Safely autocorrect Style/RedundantRegexpArgument
Inspecting 1513 files
...........................................................................................................................................................................................................................................................................................................................................................C....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/spree/shipping_method.rb:69:25: C: [Corrected] Style/RedundantRegexpArgument: Use string ":tracking" as argument instead of regexp /:tracking/.
      tracking_url.gsub(/:tracking/, tracking) unless tracking.blank? || tracking_url.blank?
                        ^^^^^^^^^^^
lib/spree/i18n.rb:36:17: C: [Corrected] Style/RedundantRegexpArgument: Use string "spree" as argument instead of regexp /spree/.
      path.gsub(/spree/, '')
                ^^^^^^^

1513 files inspected, 2 offenses detected, 2 offenses corrected
2023-11-17 08:59:27 +09:00
David Cook
668b102efc Combine two specs for efficiency 2023-11-17 10:21:55 +11:00
Gaetan Craig-Riou
8347557bea Merge pull request #11814 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.1.2
chore(deps): bump active_storage_validations from 1.1.1 to 1.1.2
2023-11-17 10:12:29 +11:00
Gaetan Craig-Riou
ecb5ae47ff Merge pull request #11812 from openfoodfoundation/dependabot/bundler/angular_rails_csrf-6.0.0
chore(deps): bump angular_rails_csrf from 5.0.0 to 6.0.0
2023-11-17 10:08:15 +11:00
Ahmed Ejaz
b056c1495b Merge branch 'master' into task/11067-admin_style_v3-product-clone 2023-11-17 03:53:33 +05:00
Maikel
54f6b32231 Merge pull request #11810 from filipefurtad0/extend_payment_intents_tests
[VCR, automation] Adds payment intent tests with invalid cards
2023-11-17 09:50:25 +11:00
Ahmed Ejaz
29eadedc3a Merge branch 'master' into task/11067-admin_style_v3-product-clone 2023-11-17 03:45:54 +05:00
David Cook
de9fbea2b8 npx update-browserslist-db@latest
Compilation was sometimes failing with the following error. So I did what it said.

> Browserslist: caniuse-lite is outdated. Please run:
>   npx update-browserslist-db@latest
>   Why you should do it regularly: https://github.com/browserslist/update-db#readme
2023-11-17 09:45:11 +11:00
David Cook
2960f7570e Merge pull request #11741 from abdellani/fix-product-with-ml-unit-display-dl
Fix product with ml unit display dl
2023-11-17 09:41:44 +11:00
Konrad
0fae09f5a2 Merge pull request #11659 from chahmedejaz/bugfix/11606-localized-date-times
Fixes un-localized Order date and time format on edit order page
2023-11-16 21:27:13 +01:00
Ahmed Ejaz
fc59c9397d 11606, fix lint issues 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
4040dc0a52 #11606, add and fix specs for pretty_time method 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
edc827bdc8 #11606, adds long time formatting for en.yml 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
dddb777cea #11606, adds date locales for Português do Brasil 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
4639a002f2 #11606, adds date locales for Nederlands (Belgium) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
6a889d8084 #11606, adds date locales for Italiano (Switzerland) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
a35dcde0e3 #11606, adds date locales for Français (Cameroon) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
ec7c77af68 #11606, adds date locales for Français (Switzerland) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
6a0588e6a2 #11606, adds date locales for Français (Canada) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
c3bc2d1087 #11606, adds date locales for Français (Belgium) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
e0ed5ef9f0 #11606, adds date locales for Filipino (Philippines) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
295ad230c2 #11606, adds date locales for Espanol (United States) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
afa172bfa2 #11606, adds date locales for Espanol (Costa Rica) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
315dfe7d38 #11606, adds date locales for Espanol (Colombia) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
adcca684bf #11606, adds date locales for German (Germany) 2023-11-16 20:57:40 +01:00
Ahmed Ejaz
850a9c3738 #11606, adds langage locales for the German for Germany 2023-11-16 20:57:40 +01:00
Filipe
ed8fd41bec Merge pull request #11290 from cyrillefr/Orders_in_confirmation_state_cannot_be_completed_by_hub_or_shop
Fix Orders in confirmation state cannot be completed by hub or shop
2023-11-16 19:50:14 +00:00
Filipe
37436aab80 Merge pull request #11799 from murjax/enterprise-panel-navigation-6754
Fix navigation behavior on enterprise settings panel tabs
2023-11-16 17:56:49 +00:00
Filipe
8a3fbf92b9 Merge pull request #11776 from rioug/11775-fix-hidden-input
Fix hidden input showing on Producer registration
2023-11-16 17:26:28 +00:00
Konrad
dff8257255 Merge pull request #11661 from mkllnk/report-file-storage
Store report files on the local disk
2023-11-16 16:20:46 +01:00
filipefurtad0
beb47f03c0 Removes Stripe module
...and calls it within the describe block
2023-11-16 14:46:25 +00:00
Maikel
c8023b7c37 Merge pull request #11813 from openfoodfoundation/dependabot/bundler/spring-4.1.2
chore(deps-dev): bump spring from 4.1.1 to 4.1.2
2023-11-16 17:00:51 +11:00
Maikel
63721938c3 Merge pull request #11780 from filipefurtad0/fix_pending_examples_on_invoices_spec
Fixes pending tests cases on invoices spec
2023-11-16 17:00:02 +11:00
Maikel Linke
6e34c41f42 Bump DFC taxonomies to v1.0.2
Finally replacing the last of the old DFC context URLs that are not
valid any more.
2023-11-16 15:52:31 +11:00
Maikel
5f3e176b49 Merge pull request #11816 from mkllnk/dfc-enterprise-fields
Add logo and contact info to DFC Enterprise API
2023-11-16 10:15:01 +11:00
Maikel Linke
b055474918 DRY long method 2023-11-16 09:30:04 +11:00
Maikel Linke
e5f5f3922c Add contact name to DFC Enterprise API 2023-11-16 09:10:43 +11:00
filipefurtad0
9d00b7dc43 Re-records relevant cassettes 2023-11-15 13:05:15 +00:00
filipefurtad0
4c3f87f047 Adds payment intent tests with invalid cards 2023-11-15 13:05:15 +00:00
Maikel Linke
3e6db7fda4 Update spec of changed report link
The link now contains the local test server instead of some fake domain.
2023-11-15 10:29:05 +01:00
Maikel Linke
9f00817852 Use source of truth of url_options for report URLs
The ActionController options were not set in testing nor Sidekiq jobs.
The now used config is always set in config/application.rb.
2023-11-15 10:29:05 +01:00
Maikel Linke
a110ee0982 Simplify Active Storage config for test env 2023-11-15 10:29:05 +01:00
Maikel Linke
eaff1ed921 Store report files on the local disk 2023-11-15 10:29:05 +01:00
Maikel Linke
20af19c912 Simplify report file storage 2023-11-15 10:29:05 +01:00
Maikel Linke
ff6bcb113f Create report file where the content is generated
In the past, we needed the report blob to know when the report has been
finished and uploaded. But not we use cable_ready to notify when the
report is done and we don't need the blob in the controller.
2023-11-15 10:29:05 +01:00
dependabot[bot]
021e150421 chore(deps): bump active_storage_validations from 1.1.1 to 1.1.2
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.1.1 to 1.1.2.
- [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)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-15 09:17:25 +00:00
dependabot[bot]
b54794f3f6 chore(deps-dev): bump spring from 4.1.1 to 4.1.2
Bumps [spring](https://github.com/rails/spring) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/rails/spring/releases)
- [Changelog](https://github.com/rails/spring/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/spring/compare/v4.1.1...v4.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-15 09:16:50 +00:00
dependabot[bot]
9d2ca908cb chore(deps): bump angular_rails_csrf from 5.0.0 to 6.0.0
Bumps [angular_rails_csrf](https://github.com/jsanders/angular_rails_csrf) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/jsanders/angular_rails_csrf/releases)
- [Changelog](https://github.com/jsanders/angular_rails_csrf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsanders/angular_rails_csrf/compare/v5.0.0...v6.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-15 09:14:26 +00:00
Maikel Linke
fc8f0ec4f2 Add email address to DFC Enterprise API 2023-11-15 17:00:53 +11:00
Maikel Linke
057c1363b1 Add phone number to DFC Enterprise API 2023-11-15 16:57:38 +11:00
Maikel Linke
80c0df9d1e Add website to DFC Enterprise API 2023-11-15 16:48:44 +11:00
Maikel Linke
1fb87bc497 Add SocialMedia to DFC Enterprise API 2023-11-15 16:19:23 +11:00
Maikel Linke
9311a29c9f Add logo URL to DFC Enterprise API 2023-11-15 15:16:39 +11:00
Maikel Linke
6266df5c76 Add long description to DFC Enterprise API 2023-11-15 14:59:15 +11:00
David Cook
3f4ef3e48b Merge pull request #11806 from openfoodfoundation/dependabot/npm_and_yarn/prettier-3.1.0
chore(deps-dev): bump prettier from 2.8.8 to 3.1.0
2023-11-15 12:28:12 +11:00
David Cook
58cf3cfca8 Merge pull request #11802 from mkllnk/flaky-taxonomies
Stabilise spec with sleep
2023-11-15 11:55:25 +11:00
Maikel Linke
58d2e9d9aa Fix pending spec example and clarify displayed content 2023-11-15 10:28:45 +11:00
Maikel Linke
b626ec1cd7 Further reduce branching
This is much easier to read.
2023-11-15 10:13:24 +11:00
Maikel Linke
d0c07df0cf Avoid complexity of branch flags 2023-11-15 10:06:48 +11:00
filipefurtad0
a56f95d1e3 Uses more readable DB call
Also makes some other minor improvements, like removing the rest case around editing ajustment types, something which we don't really need a test for, as it should not occur in the app
2023-11-14 14:40:21 +00:00
filipefurtad0
612125b918 Updates create/delete adjustments tests
Creating and deleting adjustments will change associated attributes such as the payment state of the order which triggers a new invoice
2023-11-13 23:20:50 +00:00
filipefurtad0
eea15089d3 Updates state change tests
Cancelling orders will change associated attributes such as payment_state which is triggers a new invoice
2023-11-13 23:19:40 +00:00
filipefurtad0
e7c2b52f52 Updates pending example
..however: creating and deleting adjustments are still not passing when can_update_latest_invoice? is called over the order. @abdellani, I think I need your help on this one, I was not able to progress any further
2023-11-13 23:19:40 +00:00
filipefurtad0
9057ffd6c0 Fixes pending test case 2023-11-13 23:19:40 +00:00
binarygit
249c0029dd Improve tests 2023-11-13 21:31:41 +05:45
binarygit
f52c7e8a5d Rename richtext controller and write specs 2023-11-13 21:31:41 +05:45
binarygit
e78fe663d2 Open external links in product description in a new page 2023-11-13 21:31:41 +05:45
dependabot[bot]
40430a8fab chore(deps-dev): bump prettier from 2.8.8 to 3.1.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 09:58:03 +00:00
Mohamed ABDELLANI
847c3af4da update WeightsAndMeasures#scales_for_variant_unit to ignore available untis when needed 2023-11-13 09:59:14 +01:00
David Cook
b872d7c308 Re-arrange spec
Best viewed with white-space ignored
2023-11-13 09:29:31 +01:00
David Cook
91cb3df215 Use named config method
And mock the preference value, rather than setting it. Before, the set preference could have leaked to other tests.
(I noticed that it was already like this in product_import_spec.rb)
2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
72d854487a update VariantUnitManager#compatibleUnitScales to return units that are selected 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
864f63b7b0 update VariantUnitManger specs 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
a9d85fd08f fix existing tests 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
2733e45e16 update the list of the unit on VariantUnitManager 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
e10d441153 load GeneralSettingsHelper#all_units from WeightsAndMeasures::UNITS 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
fb24678654 update units list on Spree::Admin::GeneralSettingsHelper#all_units
added a test to make sure that all units on WeightsAndMeasures::UNITS are list on all_units
2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
642cd85cb9 update WeightsAndMeasures#scale_for_unit_value to only return units that are selected on 'Available Units' list 2023-11-13 09:29:31 +01:00
Mohamed ABDELLANI
b3b86c428c test tax totals on the printed version of the invoice (v3) 2023-11-13 07:48:59 +01:00
Mohamed ABDELLANI
e37f9e54fd reimplement "order with taxes" tests under "invoices feature enabled" 2023-11-13 07:39:55 +01:00
Mohamed ABDELLANI
c759a0f646 move tests under shared_examples "order with tax" to context "when invoice feature is not enabled" 2023-11-13 07:39:55 +01:00
Mohamed ABDELLANI
13bfbc21e0 remove unecessary instructions from "Check display on each invoice: legacy and alternative" 2023-11-13 07:39:55 +01:00
Mohamed ABDELLANI
4eedf74ecd remove unecessary instructions from "contains right Payment Description at Checkout information"
1.When the user tries to print an invoice for an order (that doesn't have any previous invoices), an invoice will be generated automatically.
2.When the user tries to print an invoice for an order without specifing the id of the invoice, he'll get the latest invoice
2023-11-13 07:39:55 +01:00
Mohamed ABDELLANI
5be8ec0c5a set completed_at on the order used for testing 2023-11-13 07:39:55 +01:00
Mohamed ABDELLANI
1724e1d626 fix invoice feature flag enabling 2023-11-13 07:39:55 +01:00
Gaetan Craig-Riou
1107083bc9 Merge pull request #11733 from yasirazgar/11714_fix_bugsnag_warning
11714 -  Fix bugsnag warning
2023-11-13 16:52:20 +11:00
yasir azgar
703ef8a203 Update config/initializers/bugsnag.rb
Co-authored-by: Maikel <maikel@email.org.au>
2023-11-13 10:42:46 +05:30
yasir azgar
b119a97eaf Update config/initializers/bugsnag.rb
Co-authored-by: Maikel <maikel@email.org.au>
2023-11-13 10:42:46 +05:30
Yasir Azgar
5eed500786 supress bugsnag warn in dev 2023-11-13 10:42:46 +05:30
Yasir Azgar
eb82accb79 revert unwanted change 2023-11-13 10:42:46 +05:30
Yasir Azgar
866a1b4bcb 11714 fix bugsnag warn 2023-11-13 10:42:46 +05:30
Maikel Linke
6ce3572b24 Stabilise spec with sleep
I didn't look into what's going wrong here. A sleep is not ideal but
better than a retry.

That page needs a rewrite anyway and therefore I don't want to invest
more work now.
2023-11-13 14:21:10 +11:00
Maikel
b2c6551c26 Merge pull request #11797 from openfoodfoundation/dependabot/npm_and_yarn/cable_ready-5.0.2
chore(deps): bump cable_ready from 5.0.1 to 5.0.2
2023-11-13 12:48:56 +11:00
dependabot[bot]
54426f80df chore(deps): bump cable_ready from 5.0.1 to 5.0.2
Bumps [cable_ready](https://github.com/stimulusreflex/cable_ready) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/stimulusreflex/cable_ready/releases)
- [Changelog](https://github.com/stimulusreflex/cable_ready/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stimulusreflex/cable_ready/compare/v5.0.1...v5.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-12 23:27:36 +00:00
Maikel
709c4d20f9 Merge pull request #11786 from macanudo527/fix_autocorrect_rubocop
Fix Style Rubocop Errors
2023-11-13 10:25:03 +11:00
Ahmed Ejaz
8bac8ad4be 11067, fix lint issues 2023-11-11 16:04:28 +05:00
Ahmed Ejaz
2d55322a55 Merge branch 'master' into task/11067-admin_style_v3-product-clone 2023-11-11 16:00:15 +05:00
Ahmed Ejaz
ab93b06bac #11067, add specs 2023-11-11 15:58:29 +05:00
Ahmed Ejaz
0457755e27 Merge branch 'task/11067-admin_style_v3-product-clone' of https://github.com/chahmedejaz/openfoodnetwork into task/11067-admin_style_v3-product-clone 2023-11-11 15:54:58 +05:00
Ahmed Ejaz
d8904099dd #11067, remove messages to match with old UI UX 2023-11-11 15:47:59 +05:00
Ryan Murphy
5c4b06730b Fix navigation behavior on enterprise panel tabs 2023-11-10 12:26:16 -05:00
Filipe
5d76f98fec Merge pull request #11754 from mkllnk/reload-bug
Don't update order when not enough stock when editing as admin
2023-11-10 16:57:43 +00:00
Ahmed Ejaz
e1e46bcbc2 #11067, hide clone option for variant 2023-11-10 15:36:10 +05:00
Gaetan Craig-Riou
06a4cbafd4 Merge pull request #11788 from dacook/release-scripts
Add script for preparing translations
2023-11-10 13:56:04 +11:00
David Cook
d47128e355 Describe how to choose version number
Thanks Maikel for summarising this: https://community.openfoodnetwork.org/t/release-numbering/105/6
2023-11-10 12:14:52 +11:00
David Cook
0c6608f828 Add comments 2023-11-10 11:46:48 +11:00
Neal Chambers
7c14853add Safely autocorrect Style/RedundantDoubleSplatHashBraces
Inspecting 1509 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...............

Offenses:

spec/system/support/cuprite_setup.rb:13:5: C: [Corrected] Style/RedundantDoubleSplatHashBraces: Remove the redundant double splat and braces, use keyword arguments directly.
    **{ ...
    ^^^
spec/system/support/cuprite_setup.rb:14:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      browser_options:,
      ^^^^^^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:15:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      process_timeout: 60,
      ^^^^^^^^^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:16:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      timeout: 60,
      ^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:17:7: C: [Corrected] Layout/CommentIndentation: Incorrect indentation detected (column 6 instead of 4).
      # Don't load scripts from external sources, like google maps or stripe
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:18:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      url_whitelist: ["http://localhost", "http://0.0.0.0", "http://127.0.0.1"],
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:19:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      inspector: true,
      ^^^^^^^^^^^^^^^
spec/system/support/cuprite_setup.rb:20:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      headless:,
      ^^^^^^^^^
spec/system/support/cuprite_setup.rb:21:7: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
      js_errors: true
      ^^^^^^^^^^^^^^^

1509 files inspected, 9 offenses detected, 9 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
c3b4781a28 Safely autocorrect Style/RedundantConstantBase
Inspecting 1509 files
.........................................................................................................C.........................................C......................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................................................................................................................................................................................................................................................................................C.........................................................................................................................................................................CCC........................................C......................................................................................C......................................................................................................................................................................................................

Offenses:

app/controllers/split_checkout_controller.rb:5:33: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
class SplitCheckoutController < ::BaseController
                                ^^
app/controllers/webhook_endpoints_controller.rb:3:36: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
class WebhookEndpointsController < ::BaseController
                                   ^^
config.ru:5:9: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
require ::File.expand_path('config/environment', __dir__)
        ^^
spec/helpers/checkout_helper_spec.rb:168:68: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
      let!(:tax_rate) { create(:tax_rate, amount: 0.1, calculator: ::Calculator::DefaultTax.new) }
                                                                   ^^
spec/models/spree/order_spec.rb:619:25: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
    let(:fee_handler) { ::OrderFeesHandler.new(subject) }
                        ^^
spec/models/spree/payment_method_spec.rb:150:51: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
                                      calculator: ::Calculator::FlatRate.new(preferred_amount: 10))
                                                  ^^
spec/models/spree/payment_method_spec.rb:154:54: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
                                         calculator: ::Calculator::FlatPercentItemTotal
                                                     ^^
spec/models/spree/payment_spec.rb:429:49: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
            create(:payment_method, calculator: ::Calculator::FlatRate.new(preferred_amount: 10))
                                                ^^
spec/models/spree/payment_spec.rb:1002:11: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
          ::Calculator::FlatPercentItemTotal.new(preferred_flat_percent: 10)
          ^^
spec/models/spree/payment_spec.rb:1039:28: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
        let(:calculator) { ::Calculator::FlatPercentItemTotal.new(preferred_flat_percent: 10) }
                           ^^
spec/queries/complete_visible_orders_spec.rb:12:31: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
    let(:order_permissions) { ::Permissions::Order.new(user, filter_canceled) }
                              ^^
spec/services/paypal_items_builder_spec.rb:34:37: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
                        calculator: ::Calculator::DefaultTax.new)
                                    ^^
spec/services/paypal_items_builder_spec.rb:38:37: C: [Corrected] Style/RedundantConstantBase: Remove redundant ::.
                        calculator: ::Calculator::DefaultTax.new)
                                    ^^

1509 files inspected, 13 offenses detected, 13 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
ef928aa6fe Safely autocorrect Style/QuotedSymbols
Inspecting 1509 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.................................................................................................................................................................................................................................................................................................................................C............................................................C...........................................................................................................................................................................................................................................................................................................................................C.C.........................................................................................................................................C........................................................................................................................................

Offenses:

app/services/exchange_products_renderer.rb:50:13: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
      where("spree_variants.id": incoming_exchanges_variants)
            ^^^^^^^^^^^^^^^^^^^
lib/stripe/credit_card_cloner.rb:67:50: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
                                   { metadata: { "ofn-clone": true } },
                                                 ^^^^^^^^^^^
spec/controllers/api/v0/exchange_products_controller_spec.rb:59:52: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
          Spree::Product.includes(:variants).where("spree_variants.id": exchange.variants.map(&:id))
                                                   ^^^^^^^^^^^^^^^^^^^
spec/requests/api/orders_spec.rb:35:11: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
          "application/json": {
          ^^^^^^^^^^^^^^^^^^
spec/requests/api/v1/customers_spec.rb:39:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customers_collection"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:186:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customer"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:207:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customer"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:230:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/error_response"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:239:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/error_response"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:274:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/error_response"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:286:18: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
          schema "$ref": "#/components/schemas/error_response"
                 ^^^^^^
spec/requests/api/v1/customers_spec.rb:361:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customer"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:427:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/error_response"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:440:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customer"
               ^^^^^^
spec/requests/api/v1/customers_spec.rb:455:16: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
        schema "$ref": "#/components/schemas/customers_collection"
               ^^^^^^
spec/support/request/stripe_stubs.rb:72:42: C: [Corrected] Style/QuotedSymbols: Prefer single-quoted symbols when you don't need string interpolation or special symbols.
    stub = stub.with(body: { metadata: { "ofn-clone": true } })
                                         ^^^^^^^^^^^

1509 files inspected, 16 offenses detected, 16 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
3c7c345534 Safely autocorrect Style/ParenthesesAroundCondition
Inspecting 1509 files
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..............

Offenses:

spec/system/support/precompile_assets.rb:10:10: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
  next if
         ^
spec/system/support/precompile_assets.rb:10:11: C: [Corrected] Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an if.
  next if ( ...
          ^
spec/system/support/precompile_assets.rb:13:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/support/precompile_assets.rb:14:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.

1509 files inspected, 4 offenses detected, 4 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
69e7419a45 Safely autocorrect Style/NegatedIfElseCondition
Inspecting 1509 files
....................................................................................................................................................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................

Offenses:

app/mailers/spree/shipment_mailer.rb:15:25: C: [Corrected] Style/NegatedIfElseCondition: Invert the negated condition and swap the ternary branches.
      default_subject = !@delivery ? t('.picked_up_subject') : default_i18n_subject
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/matchers/table_matchers.rb:34:5: C: [Corrected] Style/NegatedIfElseCondition: Invert the negated condition and swap the if-else branches.
    if rows.count != expected_table.count ...
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1509 files inspected, 2 offenses detected, 2 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
0ec03da30e Regenerate Rubocop's TODO file 2023-11-10 09:13:57 +09:00
David Cook
95028d5347 Merge pull request #11790 from duleorlovic/11783_add_present
Check for .present? for ENV GOOGLE variables
2023-11-10 11:12:57 +11:00
Maikel
72dc00ba5c Merge pull request #11779 from filipefurtad0/stripe_version_in_sync_with_vcr_tests
Stripe version in sync with vcr tests
2023-11-10 10:43:28 +11:00
Ahmed Ejaz
e97676a680 Merge branch 'master' into task/11067-admin_style_v3-product-clone 2023-11-09 19:42:21 +05:00
Dusan Orlovic
0f30836c1d Check for .present? for ENV GOOGLE variables 2023-11-09 09:45:19 +01:00
David Cook
f754eac3a0 Add script for preparing translations 2023-11-09 17:42:09 +11:00
Maikel
ec1f23a947 Merge pull request #11781 from openfoodfoundation/dependabot/bundler/datafoodconsortium-connector-1.0.0.pre.alpha.9
chore(deps): bump datafoodconsortium-connector from 1.0.0.pre.alpha.8 to 1.0.0.pre.alpha.9
2023-11-09 16:46:05 +11:00
David Cook
023eb0633d Update all locales with the latest Transifex translations 2023-11-09 16:42:04 +11:00
Maikel Linke
0a88e8b8ac Update API documentation 2023-11-09 16:17:11 +11:00
Maikel Linke
cde57fcfb4 Update specs for changed attribute URI 2023-11-09 16:16:24 +11:00
Maikel Linke
eac632c81e Use new DFC Connector API to add an address 2023-11-09 16:16:24 +11:00
Maikel Linke
8d81802f47 Update DFC SKOS Parser monkey patch with current code 2023-11-09 16:16:24 +11:00
Maikel Linke
5d29dee848 Update DFC Importer to use shortened URIs
The new Connector code uses shortened URIs now.
2023-11-09 16:16:24 +11:00
dependabot[bot]
3ca426945f chore(deps): bump datafoodconsortium-connector
Bumps datafoodconsortium-connector from 1.0.0.pre.alpha.8 to 1.0.0.pre.alpha.9.

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-09 15:46:32 +11:00
Maikel Linke
71c50e1fcf Update warning message for item quantity 2023-11-09 10:56:41 +11:00
Maikel Linke
efc338aeeb Don't update order when not enough stock
There's a user-facing change here. When you tried to update the quantity
of a line item beyond available stock, two things used to happen:

1. A warning was displayed.
2. The item's quantity was updated to the highest possible.

Unfortunately, the logic to update the line item was also reloading the
page and the warning message disappeared before it could be
acknowledged. The easiest fix was to skip the update request. And in my
opinion, it's even better to let the user decide if they still want to
update or cancel the update.

Eventually, we want to replace all this custom Javascript logic with
StimulusJS anyway. So let's not put too much effort into this. It was
important though to resolve the flaky spec which made many builds fail.
2023-11-09 10:56:41 +11:00
Maikel Linke
d5dca97438 Spec tiny bug which caused a flaky spec
It still needs solving.
2023-11-09 10:56:41 +11:00
Maikel
4e52fc28ef Merge pull request #11756 from rioug/11712_DFC_add_image_to_product
[DFC API] add image to product
2023-11-09 09:37:06 +11:00
Maikel Linke
4c1334fb69 Record new version of Stripe requests 2023-11-09 08:56:46 +11:00
Maikel Linke
cb57807466 Streamline stripe test recording updates 2023-11-09 08:52:06 +11:00
Ahmed Ejaz
2af678cb28 Merge branch 'master' into task/11067-admin_style_v3-product-clone 2023-11-08 18:41:31 +05:00
Ahmed Ejaz
851ce281ea #11067, implement product clone 2023-11-08 18:36:22 +05:00
Maikel Linke
d0dd6e57ca Replace variable values with fixed values in Swagger doc 2023-11-08 17:12:42 +11:00
Maikel Linke
7dd0d0581c Codify re-recording of Stripe cassettes 2023-11-08 15:05:54 +11:00
filipefurtad0
9d50b11090 Adds re-recorded Stripe cassettes within Stripe gem folder name 2023-11-08 14:25:19 +11:00
filipefurtad0
7dac08a0be Sets flag to create folder with Stripe version 2023-11-08 14:24:19 +11:00
Gaetan Craig-Riou
f76bdf0c6f Fix rubocop warning 2023-11-08 13:57:35 +11:00
Gaetan Craig-Riou
11ee4b30c2 Update Swagger documentation to include ofn:image 2023-11-08 13:57:35 +11:00
Gaetan Craig-Riou
7987967824 Check product image url is present on supplied product endpoint 2023-11-08 13:57:35 +11:00
Gaetan Craig-Riou
12c6257a0f Pass the image url to DfcProvider::SuppliedProduct 2023-11-08 13:57:35 +11:00
Gaetan Craig-Riou
424954ec54 Add ofn:image to SuppliedProduct
Temporary solution as we wait for the DFC connector to be updated
to support "dfc_b:image" for SuppliedProduct
2023-11-08 13:57:35 +11:00
Maikel
cbc2ef54c8 Merge pull request #11778 from openfoodfoundation/dependabot/bundler/bullet-7.1.3
chore(deps-dev): bump bullet from 7.1.2 to 7.1.3
2023-11-08 13:57:04 +11:00
Maikel
13e7448739 Merge pull request #11777 from openfoodfoundation/dependabot/bundler/cuprite-0.15
chore(deps-dev): bump cuprite from 0.14.3 to 0.15
2023-11-08 13:56:28 +11:00
Maikel
3eb9cf994b Merge pull request #11758 from openfoodfoundation/dependabot/bundler/stripe-10.1.0
chore(deps): bump stripe from 10.0.0 to 10.1.0
2023-11-08 13:49:19 +11:00
Maikel
dd1f358d36 Merge pull request #11757 from dacook/buu-disabled-button
[BUU] Grey out disabled button
2023-11-08 13:48:23 +11:00
David Cook
9172c87fce Merge pull request #11701 from macanudo527/remove_bogus_gateways
Remove bogus gateways
2023-11-08 09:36:36 +11:00
Neal Chambers
af764bd38e Move payment_intent to Helper 2023-11-07 16:30:50 +09:00
Neal Chambers
31fda7169d Delete Bogus and BogusSimple Gateways from Locales 2023-11-07 11:19:26 +09:00
Neal Chambers
1456f3b7db Remove Bogus Gateway from Sample Data 2023-11-07 11:19:26 +09:00
Neal Chambers
3ddf3c05ae Remove References to Bogus in Pending Specs 2023-11-07 11:19:26 +09:00
Neal Chambers
6ba8c88ea7 Rewrite Specs to Use Paypal or Stripe Gateway instead of Bogus 2023-11-07 11:19:26 +09:00
Neal Chambers
0663f04535 Remove Simple References to Bogus Gateway 2023-11-07 11:19:26 +09:00
Neal Chambers
74870ff0ad Delete Bogus Gateway Files 2023-11-07 11:19:23 +09:00
dependabot[bot]
1c878e7fa9 chore(deps-dev): bump bullet from 7.1.2 to 7.1.3
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.2 to 7.1.3.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.2...7.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 10:00:55 +00:00
dependabot[bot]
19a385b4eb chore(deps-dev): bump cuprite from 0.14.3 to 0.15
Bumps [cuprite](https://github.com/rubycdp/cuprite) from 0.14.3 to 0.15.
- [Release notes](https://github.com/rubycdp/cuprite/releases)
- [Changelog](https://github.com/rubycdp/cuprite/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rubycdp/cuprite/compare/v0.14.3...v0.15)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 09:56:52 +00:00
Gaetan Craig-Riou
c42d9d7d54 Use type="hidden" to hide input
It looks some CSS we use is breaking the use of "hidden"
2023-11-06 16:54:48 +11:00
Rachel Arnould
1e15d32a24 Merge pull request #11679 from abdellani/new_and_unique_invoice_template
New and unique invoice template
2023-11-03 16:49:19 +01:00
dependabot[bot]
01b24a8383 chore(deps): bump stripe from 10.0.0 to 10.1.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 10.0.0 to 10.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/v10.0.0...v10.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>
2023-11-03 09:30:15 +00:00
Sigmund Petersen
40c14c6ae3 Merge pull request #11749 from mkllnk/cuprite
Clarify cuprite driver configuration
2023-11-03 09:59:36 +01:00
David Cook
f9fc1657a8 Grey out disabled button
It looks like the disabled-bg colour was being used for pagination, but I can't see where. This way we should be able to apply the styles more consistently in the future.
2023-11-03 17:28:20 +11:00
David Cook
38296eb967 Merge pull request #11755 from mkllnk/cleaning
Remove orphaned JSON data in admin pages
2023-11-03 16:02:10 +11:00
Maikel
eef7df8ce3 Merge pull request #11750 from dacook/buu-editing-part5c-show-summary-11059
[BUU] Showing error summary at top of form
2023-11-03 15:45:24 +11:00
Maikel Linke
f6903518c3 Remove orphaned JSON data in admin pages
This was left over data from commit:

- 79ba223e12
2023-11-03 15:16:22 +11:00
David Cook
7fe6f3fe89 Disable form elements in a disabled-section
I chose to use the 'elements' collection rather than choosing which elements to include (ie this supports inputs, textareas, buttons and anything else I didn't think of). It could be a bit simpler if we assume the element is a form. Even simpler if it's a fieldset (that has a disabled property). But I didn't want to limit it too much.

Unfortunately JS is quite ugly compared to Ruby. And 'prettier' made it uglier in my opinion.
2023-11-03 14:32:58 +11:00
David Cook
f63f37fd3b Wrap form element in a form
This makes it easier to control in the next commit.
2023-11-03 14:32:58 +11:00
David Cook
d0abbc5d2c Ensure error summary always shows when error
Best viewed with whitespace ignored.
2023-11-03 14:32:58 +11:00
David Cook
41cf0bedfc Fix: Handle missing attributes 2023-11-03 14:32:58 +11:00
David Cook
f05d27b58b Show error message summary at top of form 2023-11-03 14:32:58 +11:00
David Cook
a94c50f0c1 Count updated products
Ignoring variants for now.
2023-11-03 14:32:58 +11:00
David Cook
de915e8bd7 Capture variant errors when updating 2023-11-03 14:32:55 +11:00
Maikel Linke
d64b311230 Update all locales with the latest Transifex translations 2023-11-03 12:56:16 +11:00
Filipe
771bd93f5f Merge pull request #11677 from rioug/11359-vouchers-fix-tax-moving-back-in-checkout
[vouchers] fix tax calculation when moving back in the checkout process
2023-11-02 17:02:08 +00:00
David Cook
1d5ec6b8d2 Spec for updating products with variants
Trying to cover it more comprehensively, and revealing we have a lot of behaviour to update.
Products and their variants should always get saved (or not saved) together. This is considered the most intuitive behaviour.

There's still duplication with the "variant has error" context, but I try to avoid nesting shared_examples, it starts to get ugly. Happy to discuss though.
2023-11-02 15:42:40 +11:00
Maikel
eea08ac0a1 Merge pull request #11745 from openfoodfoundation/dependabot/bundler/sidekiq-7.2.0
chore(deps): bump sidekiq from 7.1.6 to 7.2.0
2023-11-02 15:33:53 +11:00
Maikel Linke
c4c5c97270 Clarify cuprite driver configuration
Rails is registering a driver called `cuprite`. And when we did that as
well the driver got registered three times somehow. It looked like our
driver options were used in the end but just to clarify I gave it a
unique name.

This was inspired by:

* https://github.com/ViewComponent/view_component/pull/1877

It suggests that it may avoid dead browser errors on CI. We'll see.
2023-11-02 14:07:33 +11:00
David Cook
e651e3cd5e Tiny spec refactor
I found this in my stashes
2023-11-02 11:05:45 +11:00
David Cook
39eeb0e917 Add spec for truthiness
It's generally expected that a #save method will return true on succes, and false on failure.
2023-11-02 11:05:45 +11:00
Ryan Murphy
7e5ad8c8a4 9048: Fix Stripe payment flash rendering issue 2023-11-01 07:33:06 -04:00
dependabot[bot]
744b0799a6 chore(deps): bump sidekiq from 7.1.6 to 7.2.0
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.1.6 to 7.2.0.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/sidekiq/sidekiq/compare/v7.1.6...v7.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 09:26:51 +00:00
David Cook
d8cc45c5c3 Merge pull request #11742 from filipefurtad0/vcr_payment_intent_validator_spec
Replaces mocks with VCR calls
2023-11-01 17:04:00 +11:00
David Cook
031abd6546 Merge pull request #11743 from openfoodfoundation/revert-11708-test-redis-5
Revert "replace hiredis gem with hiredis-client"
2023-11-01 16:08:49 +11:00
Maikel
6a236a8678 Revert "replace hiredis gem with hiredis-client" 2023-11-01 15:16:57 +11:00
Maikel
8e88ef021f Merge pull request #11738 from openfoodfoundation/dependabot/bundler/bootsnap-1.17.0
chore(deps): bump bootsnap from 1.16.0 to 1.17.0
2023-11-01 14:40:29 +11:00
Maikel
a1c6a43954 Merge pull request #11740 from openfoodfoundation/dependabot/bundler/newrelic_rpm-9.6.0
chore(deps): bump newrelic_rpm from 9.5.0 to 9.6.0
2023-11-01 14:00:16 +11:00
Maikel
512fee2a9b Merge pull request #11739 from openfoodfoundation/dependabot/bundler/view_component-3.7.0
chore(deps): bump view_component from 3.6.0 to 3.7.0
2023-11-01 13:59:02 +11:00
Maikel
e6e2f27ed4 Merge pull request #11736 from dacook/registration-noindex
Print robots tag for registration layout
2023-11-01 13:53:07 +11:00
Maikel
fb732e55bc Merge pull request #11734 from openfoodfoundation/dependabot/bundler/angular-rails-templates-1.2.1
chore(deps): bump angular-rails-templates from 1.2.0 to 1.2.1
2023-11-01 13:46:32 +11:00
Maikel
8f4f691cb2 Merge pull request #11735 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.22.1
chore(deps-dev): bump rubocop-rails from 2.21.2 to 2.22.1
2023-11-01 13:40:52 +11:00
Maikel
25a3149f48 Merge pull request #11702 from dacook/buu-editing-part5b-11059
[BUU] Mark changed fields, when error
2023-11-01 13:01:08 +11:00
Maikel
ddd410ceb5 Merge pull request #11729 from openfoodfoundation/dependabot/npm_and_yarn/browserify-sign-4.2.2
chore(deps): bump browserify-sign from 4.2.1 to 4.2.2
2023-11-01 12:50:20 +11:00
Maikel
e85a1cef7e Merge pull request #11708 from abdellani/test-redis-5
replace hiredis gem with hiredis-client
2023-11-01 10:02:25 +11:00
filipefurtad0
a88919299f Replaces mocks with VCR calls 2023-10-31 19:06:40 +00:00
dependabot[bot]
1134c9c07a chore(deps): bump newrelic_rpm from 9.5.0 to 9.6.0
Bumps [newrelic_rpm](https://github.com/newrelic/newrelic-ruby-agent) from 9.5.0 to 9.6.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.5.0...9.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 09:44:29 +00:00
dependabot[bot]
d3883c7302 chore(deps): bump view_component from 3.6.0 to 3.7.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.6.0...v3.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 09:44:08 +00:00
dependabot[bot]
a8de70c79e chore(deps): bump bootsnap from 1.16.0 to 1.17.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.16.0 to 1.17.0.
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.16.0...v1.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 09:42:54 +00:00
David Cook
18b79668a5 Merge pull request #11727 from openfoodfoundation/dependabot/bundler/valid_email2-5.1.1
chore(deps): bump valid_email2 from 5.1.0 to 5.1.1
2023-10-31 14:32:44 +11:00
David Cook
d79c5c39cf Merge pull request #11723 from openfoodfoundation/dependabot/bundler/rubocop-1.57.2
chore(deps-dev): bump rubocop from 1.57.1 to 1.57.2
2023-10-31 14:31:01 +11:00
David Cook
1d96747570 Merge pull request #11716 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.1.1
chore(deps): bump active_storage_validations from 1.0.4 to 1.1.1
2023-10-31 14:29:42 +11:00
David Cook
435bf6e6b0 Print robots tag for registration layout
This is copied from the darkswarm layout.
2023-10-31 14:03:32 +11:00
Mohamed ABDELLANI
6d0f7d7c81 render null shipment when shipment adjustment doesn't exist 2023-10-30 22:53:19 +01:00
Mohamed ABDELLANI
23a56d35a0 add tax_adjustment total to the invoice 2023-10-30 22:09:22 +01:00
Mohamed ABDELLANI
e16df2777a optimize DataPresenter#checkout_adjustments
reduce the complexity of the method
2023-10-30 21:58:37 +01:00
Mohamed ABDELLANI
c8f69c8778 always render shipment on the invoice 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
c513eb5d9d fix existing test 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
15aeb2f8e5 remove legacy template (used when invoice feature enable) 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
da89860f35 fix price per unit 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
c1ed8ed67c update the adjustments rows 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
716cf3e522 reorder the totals section 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
b7f601d140 show tax rate column regardless of the tax amount on the order 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
a08a2fd5f6 [skip ci] add terms of service link to the invoice. 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
a5fd0608c3 align the columns of the totals rows 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
a8f9b29a6d [skip ci]add the total price columns to the invoice 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
30537f7743 add "Weight/VOL." column to the invoice 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
b64058a71d swap tax rate with total price (incl tax) 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
1182544c47 update the view used when the invoice feature is enabled 2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
4634c2d965 add unit_price_price_and_unit to line_item serializer
*  unit_price_price_and_unit refers UnitPrice which refers to other attributes
that belong to variant and product.
Instead of collecting all the attributes that were using indirectly by the method and adding them to the serializers
I perefered to serialize the result of the method call.
2023-10-30 19:43:57 +01:00
Mohamed ABDELLANI
affecf53c6 add order cycle name to the invoice number section 2023-10-30 19:43:57 +01:00
dependabot[bot]
c27f616ac0 chore(deps-dev): bump rubocop-rails from 2.21.2 to 2.22.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.21.2 to 2.22.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.21.2...v2.22.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 09:10:27 +00:00
dependabot[bot]
16ff608e33 chore(deps): bump angular-rails-templates from 1.2.0 to 1.2.1
Bumps [angular-rails-templates](https://github.com/pitr/angular-rails-templates) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/pitr/angular-rails-templates/releases)
- [Changelog](https://github.com/pitr/angular-rails-templates/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pitr/angular-rails-templates/compare/v1.2.0...v1.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 09:08:50 +00:00
Maikel Linke
7f7f6f5c96 Remove unneeded require of hiredis-client 2023-10-30 16:28:18 +11:00
cyrillefr
a764cc0f89 Specs for the new action complete after capture
- In admin dashboard, clicking on capture leads to a completed order
- Modifications of actual specs to take into account new action
2023-10-29 22:05:50 +01:00
cyrillefr
7c89458a95 New locale (tooltip) 2023-10-29 22:05:50 +01:00
cyrillefr
31cc0494c2 Icon for the new action
- Similar to the actual capture action
2023-10-29 22:05:34 +01:00
cyrillefr
e1374d5837 Add Order completion after capturing event
- A new processing method
- Payment means that link to it
- Altering methods that handle next status choice
2023-10-29 21:58:03 +01:00
cyrillefr
d6daf25b98 Spec checking order in confirmation state transition to payment 2023-10-29 21:58:03 +01:00
cyrillefr
cd6c3c45e6 Allow an order in confirmation state to transition to payment 2023-10-29 21:58:03 +01:00
Ahmed Ejaz
df773aaee9 Merge branch 'master' into bugfix/11667-clone-tags-issue-for-OC 2023-10-28 14:57:43 +05:00
Ahmed Ejaz
adf65acee5 #11667, fix existing test case 2023-10-28 14:03:27 +05:00
Ahmed Ejaz
0e0b322707 #11667, assign tag_list to cloned exchange tag_list 2023-10-28 14:02:44 +05:00
dependabot[bot]
743a5e1a3c chore(deps): bump browserify-sign from 4.2.1 to 4.2.2
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 16:23:32 +00:00
dependabot[bot]
255872ebe3 chore(deps): bump valid_email2 from 5.1.0 to 5.1.1
Bumps [valid_email2](https://github.com/micke/valid_email2) from 5.1.0 to 5.1.1.
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v5.1.0...v5.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 09:45:13 +00:00
Gaetan Craig-Riou
33de80f13c Fix checking if shipping method changed
We now check if the shipping method changed before we actually select
it. Fix the related spec.The spec was wrong because order.select_shipping_method
fails silently. That means the shipping method wasn't getting
updated on the order, thus the test was passing.
2023-10-27 14:20:31 +11:00
Gaetan Craig-Riou
4f961098c4 Update all locales with the latest Transifex translations 2023-10-27 11:36:13 +11:00
Filipe
f1d4ec9fe7 Merge pull request #11684 from ccozkan/issue-11609
Fix content aligning in subscriptions table
2023-10-26 16:20:33 +01:00
Filipe
aa9cacada8 Merge pull request #11676 from openfoodfoundation/dependabot/bundler/stripe-10.0.0
chore(deps): bump stripe from 9.4.0 to 10.0.0
2023-10-26 15:41:49 +01:00
dependabot[bot]
0919b2bc6c chore(deps-dev): bump rubocop from 1.57.1 to 1.57.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.1 to 1.57.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.57.1...v1.57.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-26 12:57:54 +00:00
Filipe
a54de4b522 Merge pull request #11691 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.24
chore(deps): bump combine_pdf from 1.0.23 to 1.0.24
2023-10-26 13:56:44 +01:00
Filipe
b67acaae21 Merge pull request #11694 from prateek0411999/bugfix/11666-warning_forfeit_remaining_amount
add condition on warning_forfeit_remaining_amount note
2023-10-26 13:44:22 +01:00
Filipe
3da8341946 Merge pull request #11695 from ccozkan/issue-8943
Make update button on enterprises primary details form clickable upon input to name field
2023-10-26 13:12:27 +01:00
Filipe
7b3c6e9f58 Merge pull request #11688 from mkllnk/enterprise-fee-report
Avoid error when generating Enterprise fees w/ Tax Report by Producer
2023-10-26 12:43:19 +01:00
Mohamed ABDELLANI
d6890e9828 check key class before call Rails.cache.delete 2023-10-26 10:27:00 +01:00
dependabot[bot]
38485a8010 chore(deps): bump active_storage_validations from 1.0.4 to 1.1.1
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.0.4 to 1.1.1.
- [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/compare/1.0.4...1.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-26 09:25:54 +00:00
Mohamed ABDELLANI
5360df6cee replace hiredis gem with hiredis-client 2023-10-26 10:10:51 +01:00
David Cook
ed520ea679 Merge pull request #11703 from abdellani/remove-mini-portile2
removes mini_portile2
2023-10-26 09:40:38 +11:00
David Cook
7195314dc6 Merge pull request #11697 from openfoodfoundation/dependabot/bundler/mini_portile2-2.8.5
chore(deps): bump mini_portile2 from 2.8.4 to 2.8.5
2023-10-26 09:23:06 +11:00
Çağrı Özkan
924cee0876 Trigger build (empty commit) 2023-10-25 18:21:39 +03:00
Çağrı Özkan
7b21126a9c Use both onchange and oninput on ng_form.html.haml 2023-10-25 17:32:25 +03:00
Filipe
6280bfcebe Merge pull request #11706 from yasirazgar/11318_flaky_packing_report_spec
11318 - Fix flaky packing_report_spec.rb
2023-10-25 15:22:04 +01:00
Çağrı Özkan
38d1de896c Use oninput on ng_form.html.haml instead of onchange 2023-10-25 17:11:30 +03:00
dependabot[bot]
8fc4d6cd4d chore(deps): bump mini_portile2 from 2.8.4 to 2.8.5
Bumps [mini_portile2](https://github.com/flavorjones/mini_portile) from 2.8.4 to 2.8.5.
- [Release notes](https://github.com/flavorjones/mini_portile/releases)
- [Changelog](https://github.com/flavorjones/mini_portile/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/mini_portile/compare/v2.8.4...v2.8.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 08:20:25 +00:00
Mohamed ABDELLANI
d77a94d377 add comment about mini_protile2 gem 2023-10-25 09:17:21 +01:00
David Cook
fac354e678 Merge pull request #11700 from macanudo527/fix_stylehash_12
Fix Style/HashSyntax 13/13
2023-10-25 10:40:52 +11:00
yasir azgar
3ba208e3d3 11318 - fix flaky packing_report_spec
fix rubocop DurationArithmetic
2023-10-24 22:21:42 +05:30
David Cook
08ac46fd91 Refactor spec: Only create necessary records
This was creating a lot of records for every single test. Now it's much more efficient and spec conditions are clearer.
2023-10-24 16:44:34 +11:00
David Cook
671dc570ec Refactor: with form builder 2023-10-24 15:21:14 +11:00
David Cook
aa4630d74c Mark fields as changed if they contain unsaved values.
This can happen when there's a validation error. The field with error will also be marked changed, but the error style will override it.

I'd like to move this into a FormBuilder. Existing formbuilder gems don't seem to support it (though I didn't look very hard).
2023-10-24 15:21:14 +11:00
David Cook
04032e61e2 Prettier 2023-10-24 15:21:13 +11:00
David Cook
fdad45bb46 Rename 'modified' state to 'changed'
This conveniently matches the terminology used in both JavaScript and ActiveModel::Dirty.
2023-10-24 15:21:13 +11:00
David Cook
ceb9d9af92 Add comment
I decided to look into why this is so complicated, in case some of the complexity can be removed. It can't :(
2023-10-24 15:21:13 +11:00
David Cook
1534908895 Move generic method to base class
Because rubocop complained about the size of ProductSet.
2023-10-24 15:21:13 +11:00
David Cook
89e53c88f3 Move context up a level
Best viewed with whitespace ignored.
2023-10-24 15:21:13 +11:00
David Cook
8293f24ed3 Remove redundant context
Best viewed with whitespace ignored.
2023-10-24 15:21:13 +11:00
David Cook
224b6f514b Remove concept of master variant
from old bulk product screen. Hmm I just realised we're deleting that screen soon anyway.

But this helps clean up the spec before I refactor it further.
2023-10-24 15:21:13 +11:00
David Cook
be6481dac3 Refactor spec: combine expectations
These expectations have the same conditions, so why set it up three times?
2023-10-24 15:21:13 +11:00
David Cook
3710aa2149 Refactor spec
Better to explicitly test for the change, and specify expected values.
2023-10-24 15:21:13 +11:00
Neal Chambers
cf072fb56f Update .rubocop_todo.yml 2023-10-24 08:49:48 +09:00
Neal Chambers
dc607b654d Fix Style/HashSyntax 2023-10-24 08:49:34 +09:00
David Cook
a2f8b0db16 Update ansible group name 2023-10-24 10:37:32 +11:00
Maikel
42f5469de5 Merge pull request #11674 from mkllnk/money
Format money amounts according to locale, not currency
2023-10-24 09:47:37 +11:00
Sigmund Petersen
0d557eb0f2 Merge branch 'master' into dependabot/bundler/combine_pdf-1.0.24 2023-10-23 09:38:02 +02:00
prateek0411999
a113b5ba01 add condition on warning_forfeit_remaining_amount note 2023-10-23 10:45:35 +05:30
Gaetan Craig-Riou
d5d043880a Fix scenario when no shipment available
I though that once the shipping method was set it's available on the
order, but apparently it's not always the case. At least some of the
test scenario have order with no shipment, thus no shipping method set.
2023-10-23 15:38:01 +11:00
Gaetan Craig-Riou
25af178011 Refactor updating order state
It makes the code a bit easier to read
2023-10-23 15:37:53 +11:00
Gaetan Craig-Riou
9f426add8d Merge pull request #11690 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.2.3
chore(deps): bump tom-select from 2.2.2 to 2.2.3
2023-10-23 09:48:48 +11:00
Çağrı Özkan
e465015184 Add oninput:"make form dirty" to enterprise_form/name text field 2023-10-21 01:19:41 +03:00
Filipe
44a675bcda Merge branch 'master' into dependabot/bundler/combine_pdf-1.0.24 2023-10-20 16:44:08 +01:00
filipefurtad0
e645ef72a7 Update all locales with the latest Transifex translations 2023-10-20 12:27:28 +01:00
Konrad
2ba5ab7dc1 Merge pull request #11577 from jibees/10956-use-cable_ready-instead-of-morph
Admin, Orders list: when capturing an order, fix an issue that makes the tooltip invisible (+ errors in the console)
2023-10-20 11:56:53 +02:00
dependabot[bot]
06eac95a48 chore(deps): bump combine_pdf from 1.0.23 to 1.0.24
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.23 to 1.0.24.
- [Release notes](https://github.com/boazsegev/combine_pdf/releases)
- [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.23...v1.0.24)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-20 09:20:47 +00:00
dependabot[bot]
c734f982a1 chore(deps): bump tom-select from 2.2.2 to 2.2.3
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.2.2...v2.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-20 09:06:10 +00:00
Gaetan Craig-Riou
5ba21e486a Recalculate voucher voucher adjusment when needed
We need to recalculate the voucher adjustment(s) in the following
scenarii :
When a voucher as been added to the order and :
  * Moving to the payment step from details step, to take into account
    potential change in shipment fees. (this happen if we return to the
    details step after reaching the summary step)
  * Moving to the summary step from payment step, to take into account
    payment fees
2023-10-20 16:49:21 +11:00
Maikel Linke
b83651a7ae Avoid error when generating fee report
Instead some data is missing from the report. A slightly better outcome
but still wrong. This is tracked in another issue though.
2023-10-20 15:45:32 +11:00
Maikel Linke
4fc66f6585 Spec fee report failing on removed variant
Well, creating a unit test level spec in the first place. Edge cases
like this don't need to be tested in slow system specs.
2023-10-20 15:35:17 +11:00
Gaetan Craig-Riou
f9d2deeb17 Small clean up 2023-10-20 15:28:26 +11:00
Maikel Linke
43b1eca026 Remove unneeded report spec
Testing for the absence of behaviour is useful when changing code to
assert that the change is successful but in the long term, it doesn't
add any value. If you don't have any reason to believe that the report
may delete parameters then we don't need to test for that.
2023-10-20 14:22:43 +11:00
Maikel
d45fe44c9f Remove unused Code Climate badge
It always gave us a good score anyway because we ignored the bad code.
2023-10-20 10:22:42 +11:00
David Cook
8fad8b9f80 Merge pull request #11687 from filipefurtad0/fix_flaky_spec_#11686
Moves assertions within before do block
2023-10-20 09:57:41 +11:00
David Cook
801c30f4d5 Merge pull request #11685 from openfoodfoundation/dependabot/bundler/roadie-rails-3.1.0
chore(deps): bump roadie-rails from 3.0.0 to 3.1.0
2023-10-20 09:55:42 +11:00
David Cook
2d68d49c1f Merge pull request #11683 from openfoodfoundation/dependabot/npm_and_yarn/babel/traverse-7.23.2
chore(deps): bump @babel/traverse from 7.21.5 to 7.23.2
2023-10-20 09:51:32 +11:00
David Cook
3805988c6e Merge pull request #11682 from filipefurtad0/assert_status_on_order_confirmation_screen
Adds coverage on order confirmation page
2023-10-20 09:49:10 +11:00
Maikel
5d2d925eb6 Merge pull request #11547 from filipefurtad0/legal_invoices_associations_comparator_spec
Adds coverage on order-associated attributes
2023-10-20 08:52:27 +11:00
filipefurtad0
8d6ed5ec23 Moves assertions within before do block
Doing so, assures the removal of the invoice is finished, before clicking the 'Next - Order summary' button
2023-10-19 17:38:27 +01:00
filipefurtad0
c05716cea9 Addresses review suggestions from @dacook
I've noticed that it was necessary to include a reference to the order like 'order.adjustments << create(:adjustment, order:)' for the tests to pass

Updates test case description
2023-10-19 15:49:28 +01:00
dependabot[bot]
91f94505c2 chore(deps): bump roadie-rails from 3.0.0 to 3.1.0
Bumps [roadie-rails](https://github.com/Mange/roadie-rails) from 3.0.0 to 3.1.0.
- [Changelog](https://github.com/Mange/roadie-rails/blob/master/Changelog.md)
- [Commits](https://github.com/Mange/roadie-rails/compare/v3.0.0...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 09:22:55 +00:00
dependabot[bot]
f35388ef3a chore(deps): bump @babel/traverse from 7.21.5 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.5 to 7.23.2.
- [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.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 02:28:53 +00:00
Çağrı Özkan
a6bcac8a7d Remove text-center from subscription table td's 2023-10-19 05:16:20 +03:00
filipefurtad0
27ecd4224e Sets tests as shared example (further DRYes spec) 2023-10-18 19:12:58 +01:00
filipefurtad0
461ef48c3a DRYes spec 2023-10-18 18:26:42 +01:00
filipefurtad0
80f0b30e5c Adds coverage on order confirmation page
Related to the changes from PRs #11668 and #11114.
2023-10-18 16:02:31 +01:00
Filipe
caa655f500 Merge pull request #11668 from drummer83/master
Don't show credit owed when = 0 in order confirmation
2023-10-18 12:16:54 +01:00
Konrad
448eb8b3b1 Merge branch 'openfoodfoundation:master' into master 2023-10-18 12:41:12 +02:00
filipefurtad0
2004abc8be Sets pending test - issue #11350
changing the payment_total should not generate a new invoice; rather, it should update the current invoice
2023-10-18 11:20:48 +01:00
filipefurtad0
530cdacc77 Restructures tests as shared examples
Merges test files
2023-10-18 11:20:06 +01:00
filipefurtad0
8a1a14112b Moves tests to shared examples file 2023-10-18 11:20:05 +01:00
filipefurtad0
8b249ee050 Adds unit tests for different attributes 2023-10-18 11:19:03 +01:00
Maikel
0477bef53a Merge pull request #11657 from mkllnk/report-job-retries
Notify user about errors raised in reports
2023-10-18 15:38:34 +11:00
Gaetan Craig-Riou
b09054a76a Update order state when moving back through checkout step
Some important logic happens after the order transition from one state
to another. In particular, voucher are recalculated. To fix any
inconsistency, we make sure the order is the state matching the checkout
step we are on.
2023-10-18 09:45:05 +11:00
Gaetan Craig-Riou
d0e38c8d10 Add order event back_to_payment and back_to_address
It gives the possibility to move an order back to payment state or
address state when going through the checkout steps
2023-10-18 09:36:37 +11:00
dependabot[bot]
83269af410 chore(deps): bump stripe from 9.4.0 to 10.0.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 9.4.0 to 10.0.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/v9.4.0...v10.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 09:19:18 +00:00
Rachel Arnould
aecb55beb3 Merge pull request #11660 from dacook/products_v3_path
Hide old products screen when admin_style_v3 enabled
2023-10-17 10:45:01 +02:00
Gaetan Craig-Riou
d2952d46a6 Add the highlighted version of the "ship" icon 2023-10-17 13:35:01 +11:00
Gaetan Craig-Riou
7ce3fea7d5 Refactor tooltip on the backoffice orders page 2023-10-17 13:35:01 +11:00
Gaetan Craig-Riou
6a1664d2fd Refactor "What's this" tooltip 2023-10-17 13:33:15 +11:00
Gaetan Craig-Riou
01a13a814a Improve tooltip partial 2023-10-17 13:33:15 +11:00
Gaetan Craig-Riou
4639e53673 Remove insertToolTipMarkup
It's not great to have Stimulus controller rendering markup on `connect`
Stimulus is intended to add behavior to existing markup.
Plus add some documentation
2023-10-17 13:33:15 +11:00
Gaetan Craig-Riou
31c537c5e0 Revert to using morph instead of cable_ready
The issue is with with the stimilus tooltip controller, it add some
element to the DOM which create issue when it's modified by
StimulusReflex. See here for a more detailed explanation:
https://github.com/stimulusreflex/stimulus_reflex/issues/314#issuecomment-702479357
2023-10-17 13:33:15 +11:00
Jean-Baptiste Bellet
3525320590 We should use cable_ready.inner_html instead of morph
To be sure that every stimulus controllers attached to the DOM that is replaced is will connected.
What I saw is that when using `morph`, the stimulus controller (specially `tooltip_controller`) were not attached to the DOM (and not disconnected as well) that triggered some errors in the console.

Adds test case for payment capture thanks to @filipefurtad0
2023-10-17 13:33:15 +11:00
David Cook
ad9048c595 Merge pull request #11627 from dacook/reflex-locale
Ensure dynamic modals always use selected locale
2023-10-17 10:23:58 +11:00
Maikel Linke
c0938d1607 Simplify view with number helpers 2023-10-16 16:37:47 +11:00
Maikel Linke
fcb6e36480 Format money amounts according to locale
It used to be formatted according to the currency. So even if the
default currency is USD but your locale is French then you should see it
formatted as $10.000,00 instead of the US formatting of $10,000.00.
2023-10-16 11:19:11 +11:00
Maikel
c87a10a855 Merge pull request #11672 from openfoodfoundation/dependabot/bundler/bullet-7.1.2
chore(deps-dev): bump bullet from 7.1.1 to 7.1.2
2023-10-16 10:54:38 +11:00
Maikel
ba00106e38 Merge pull request #11671 from openfoodfoundation/dependabot/bundler/acts-as-taggable-on-10.0.0
chore(deps): bump acts-as-taggable-on from 9.0.1 to 10.0.0
2023-10-16 10:54:12 +11:00
dependabot[bot]
d76dbb3592 chore(deps-dev): bump bullet from 7.1.1 to 7.1.2
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.1 to 7.1.2.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.1...7.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-15 23:24:48 +00:00
dependabot[bot]
c4adcf93c0 chore(deps): bump acts-as-taggable-on from 9.0.1 to 10.0.0
Bumps [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on) from 9.0.1 to 10.0.0.
- [Release notes](https://github.com/mbleigh/acts-as-taggable-on/releases)
- [Changelog](https://github.com/mbleigh/acts-as-taggable-on/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mbleigh/acts-as-taggable-on/compare/v9.0.1...v10.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-15 23:23:51 +00:00
Maikel
9c5b986ab6 Merge pull request #11664 from openfoodfoundation/dependabot/bundler/rubocop-1.57.1
chore(deps-dev): bump rubocop from 1.57.0 to 1.57.1
2023-10-16 10:05:14 +11:00
Maikel
08e799c5fa Merge pull request #11663 from dacook/tag_release
Update tag_release script
2023-10-16 10:02:41 +11:00
drummer83
c2b82651ee Don't show credit owed when = 0 2023-10-13 20:51:12 +02:00
Konrad
246fceb214 Merge pull request #11634 from lauriejefferson/11610-left-align-all-table-content
[BUU] Left-align headers of new orders table
2023-10-13 19:58:09 +02:00
David Cook
6e6854f564 Fix payment state indicator
Now the correct class is added, we can see the little coloured circles again.
2023-10-13 19:25:12 +02:00
lauriejefferson
e234b71b25 removed empty spaces 2023-10-13 19:25:12 +02:00
lauriejefferson
2020a9fa76 changed table row alignment to align-left and removed padding from table header 2023-10-13 19:25:12 +02:00
Konrad
5859d2ff78 Merge pull request #11114 from lauriejefferson/not-paid-order-confirmations-resemble-paid-orders-7603
Not paid order confirmations resemble paid orders 7603
2023-10-13 18:52:10 +02:00
Konrad
d7b234c062 Merge pull request #11593 from rioug/11363-vouchers-fix-tax-included-in-price-amount
[Vouchers] Fix tax included in price amount
2023-10-13 18:22:11 +02:00
David Cook
8f30b27b58 Guard against nil values
These are validated and shouldn't be nil, but I suspect we have corrupt data causing problems here.
2023-10-13 15:54:24 +02:00
David Cook
a0b64cb58a Remove unnecessary set_locale calls
The locale is now set in ApplicationReflex
2023-10-13 15:54:24 +02:00
David Cook
2915048afa Always set locale for reflexes
I considered using I18nHelper like we do in controllers, but that is for choosing a locale, which we don't need to do for reflexes.
2023-10-13 15:54:24 +02:00
dependabot[bot]
52498b6bf4 chore(deps-dev): bump rubocop from 1.57.0 to 1.57.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.0 to 1.57.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.57.0...v1.57.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-13 09:58:15 +00:00
David Cook
9276469c53 Update checklist 2023-10-13 11:56:21 +11:00
David Cook
4eb169ea0d Add a shortcut to draft new release
Next time, we can add a script to randomly choose a food-related release name ;)
2023-10-13 11:30:25 +11:00
David Cook
a13c95433e Merge pull request #11548 from macanudo527/add_foreign_key_script
Add Spec that Generates Migrations for Missing Foreign Keys
2023-10-13 11:20:47 +11:00
David Cook
0b2a0d9e58 Update all locales with the latest Transifex translations 2023-10-13 11:15:45 +11:00
David Cook
655c16cca0 New bulk products screen shares path with old
The feature toggle will determine which bulk products screen shows. An additional products_old path is also temporarily added for easy reference.

Later, when the old screen is full removed, we'll probably rename the _v3 classes to tidy up.
2023-10-13 10:39:45 +11:00
Maikel
45db61be53 Merge pull request #11655 from openfoodfoundation/dependabot/bundler/devise-4.9.3
chore(deps): bump devise from 4.9.2 to 4.9.3
2023-10-13 08:30:08 +11:00
Maikel
604cc10c3f Merge pull request #11654 from openfoodfoundation/dependabot/bundler/rubocop-1.57.0
chore(deps-dev): bump rubocop from 1.56.4 to 1.57.0
2023-10-13 08:29:29 +11:00
lauriejefferson
43232a5d63 removed not-paid styling for credit owed 2023-10-12 11:50:30 -04:00
Konrad
cc8898e074 Merge pull request #11219 from abdellani/fix-tax-rates-rendering-when-invoice-enabled
fix Viewing an invoice with the instance's invoice setting set to alternative model leads to an error 500
2023-10-12 17:47:27 +02:00
Konrad
26fa85d89b Merge pull request #11651 from HillaryOkello/master
Display ordered lists uniform with unordered lists in Trix editor
2023-10-12 17:00:43 +02:00
Konrad
f87186373c Merge pull request #11647 from dacook/image-validation
Only validate image when changed
2023-10-12 15:42:22 +02:00
Maikel Linke
702f3b7784 Notify user about errors raised in reports 2023-10-12 16:31:13 +11:00
Maikel Linke
f61a2fa2bf Rescue errors in report generation
So we can report them to Bugsnag and the job isn't marked as failed and
therefore won't repeat.
2023-10-12 16:01:52 +11:00
Maikel Linke
477ca39e58 Update spec 2023-10-12 15:40:06 +11:00
Maikel Linke
f4fde0a42c Trying to clarify voucher tax amount
The whole concept is confusing. Maybe translators will find better
versions.
2023-10-12 15:20:17 +11:00
Maikel Linke
f83e78a5b8 Clarify adjustment data only for display
We are not creating a new adjustment here.
2023-10-12 15:16:38 +11:00
Maikel Linke
74c8f06e80 Simplify helper with extracted method 2023-10-12 14:17:41 +11:00
Maikel Linke
45dd5cc40a Style/SingleLineDoEndBlock: Prefer multiline do...end block 2023-10-12 10:10:42 +11:00
dependabot[bot]
4b38817aff chore(deps-dev): bump rubocop from 1.56.4 to 1.57.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.4 to 1.57.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.56.4...v1.57.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:55:03 +00:00
Maikel
17c1ccc509 Merge pull request #11653 from openfoodfoundation/dependabot/bundler/paranoia-2.6.3
chore(deps): bump paranoia from 2.6.2 to 2.6.3
2023-10-12 09:52:39 +11:00
Maikel
e3e7031a91 Merge pull request #11649 from openfoodfoundation/dependabot/bundler/rswag-specs-2.11.0
chore(deps-dev): bump rswag-specs from 2.10.1 to 2.11.0
2023-10-12 09:51:41 +11:00
Maikel
5526006add Merge pull request #11652 from openfoodfoundation/dependabot/bundler/responders-3.1.1
chore(deps): bump responders from 3.1.0 to 3.1.1
2023-10-12 09:27:56 +11:00
dependabot[bot]
1efff07953 chore(deps): bump devise from 4.9.2 to 4.9.3
Bumps [devise](https://github.com/heartcombo/devise) from 4.9.2 to 4.9.3.
- [Release notes](https://github.com/heartcombo/devise/releases)
- [Changelog](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heartcombo/devise/compare/v4.9.2...v4.9.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:18:53 +00:00
dependabot[bot]
a8b4e9b070 chore(deps-dev): bump rswag-specs from 2.10.1 to 2.11.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.10.1...2.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:12:51 +00:00
Maikel
903bf8a725 Merge pull request #11650 from openfoodfoundation/dependabot/bundler/rswag-api-2.11.0
chore(deps): bump rswag-api from 2.10.1 to 2.11.0
2023-10-12 09:11:17 +11:00
dependabot[bot]
b8b6641a05 chore(deps): bump paranoia from 2.6.2 to 2.6.3
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.6.2 to 2.6.3.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/v2.6.2...v2.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:07:31 +00:00
dependabot[bot]
0d3a1417d6 chore(deps): bump responders from 3.1.0 to 3.1.1
Bumps [responders](https://github.com/heartcombo/responders) from 3.1.0 to 3.1.1.
- [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.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:06:10 +00:00
Maikel
c047a2c70c Merge pull request #11648 from openfoodfoundation/dependabot/bundler/rswag-ui-2.11.0
chore(deps): bump rswag-ui from 2.10.1 to 2.11.0
2023-10-12 09:03:14 +11:00
Konrad
047360e839 Merge pull request #11646 from dacook/buu-products-menu
Show only the new products page in the menu
2023-10-11 21:31:38 +02:00
HillaryOkello
d8e5f7ae4c Remove padding-top for the ordered lists 2023-10-11 15:55:52 +03:00
Mohamed ABDELLANI
1c2aa1c370 fix linter issue 2023-10-11 11:00:37 +01:00
Mohamed ABDELLANI
c750602b52 remove duplicated code 2023-10-11 10:38:45 +01:00
dependabot[bot]
54d3b39b2e chore(deps): bump rswag-api from 2.10.1 to 2.11.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.10.1...2.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 09:27:01 +00:00
dependabot[bot]
61bfde4e80 chore(deps): bump rswag-ui from 2.10.1 to 2.11.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.10.1...2.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 09:24:44 +00:00
Mohamed ABDELLANI
7cb200e21e fix linting errors 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
4a74396bcc add 'app/models/invoice/data_presenter.rb' to Metrics/ClassLength:Exclude 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
9950dd90f7 fix display_checkout_taxes_hash 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
7eabb9a170 move include ::ActionView::Helpers::NumberHelper to Invoice::DataPresenter::Base 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
aa4798d35c add adjustables to the list of objects to serialize when creating an invoice 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
fc519da83b update the invoice system tests to run with invoice feature (enabled/disabled) 2023-10-11 09:27:16 +01:00
Mohamed ABDELLANI
d40338bed5 add adjustment originators to the order serialization
for some helpers like display_checkout_taxes_hash, it's needed to access the tax rates through the adjument's originator.
The adjustment's originator will store the minimal details: id, type and amount
2023-10-11 09:26:50 +01:00
Mohamed ABDELLANI
a2b06fa200 fix cloning all_eligible_adjustments array on DataPresenter#checkout_adjustments 2023-10-11 09:26:50 +01:00
Mohamed ABDELLANI
b027387bee add :originator_type to Invoice::AdjustmentSerializer 2023-10-11 09:26:50 +01:00
Mohamed ABDELLANI
68a6fb132a implement display_adjustment_tax_rates helper on the adjustment presenter
For every adjustment a list of tax rates will be created using TaxRateFinder.tax_rates_of.
This will prevent running the queries to find the tax rates during the invoice generation.
2023-10-11 09:26:50 +01:00
Mohamed ABDELLANI
33826631a3 reimplement the display_line_item_tax_rates helper on the line item presenter
1. reimplment the helper on the LintItem presenter
2. add the tax rate associated to the line items to the list of objects to serialize during the order serialization.
3. implement a presenter for the introducer tax rates.
2023-10-11 09:26:49 +01:00
Maikel
7fe7176e5d Merge pull request #11641 from dacook/release-template
Update feature toggle title
2023-10-11 16:56:56 +11:00
David Cook
472cd9b55c Merge pull request #11639 from openfoodfoundation/dependabot/bundler/bullet-7.1.1
chore(deps-dev): bump bullet from 7.1.0 to 7.1.1
2023-10-11 14:14:27 +11:00
David Cook
32b2e572b3 Merge pull request #11643 from openfoodfoundation/dependabot/bundler/sidekiq-7.1.6
chore(deps): bump sidekiq from 7.1.5 to 7.1.6
2023-10-11 14:01:13 +11:00
dependabot[bot]
ca2d175650 chore(deps-dev): bump bullet from 7.1.0 to 7.1.1
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.0 to 7.1.1.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.1.0...7.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 02:52:50 +00:00
David Cook
64ba01a55c Merge pull request #11637 from mkllnk/spec-report-order
Test customer report filtering without sorting
2023-10-11 13:49:25 +11:00
David Cook
69b2386c52 Merge pull request #11631 from openfoodfoundation/dependabot/bundler/awesome_nested_set-3.6.0
chore(deps): bump awesome_nested_set from 3.5.0 to 3.6.0
2023-10-11 13:47:55 +11:00
David Cook
fd6bd72e7a Merge pull request #11630 from openfoodfoundation/dependabot/bundler/stripe-9.4.0
chore(deps): bump stripe from 9.3.0 to 9.4.0
2023-10-11 13:46:49 +11:00
David Cook
b42cf9735f Only validate an image if it has been changed
Best viewed with whitespace ignored.
2023-10-11 10:12:52 +11:00
David Cook
31b5be73f9 Add spec 2023-10-11 10:12:52 +11:00
lauriejefferson
e056ba42db added 'credit owed' label and removed red styling when balance <= 0 2023-10-10 17:14:16 -04:00
David Cook
99205e435c Show only the new products page in the menu
When the feature toggle is enabled, we don't want to see the old products page. It's a bit broken and causes confusion. But we still want to be able to access it by the URL for now.
2023-10-10 22:09:26 +11:00
Konrad
0bd4fe315c Merge pull request #11620 from openfoodfoundation/dependabot/bundler/devise-i18n-1.12.0
chore(deps): bump devise-i18n from 1.11.0 to 1.12.0
2023-10-10 12:36:42 +02:00
dependabot[bot]
f57d139909 chore(deps): bump sidekiq from 7.1.5 to 7.1.6
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.1.5 to 7.1.6.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/sidekiq/sidekiq/compare/v7.1.5...v7.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-10 10:05:08 +00:00
David Cook
3d821722e1 Update feature toggle title
[skip ci] because this isn't covered (and doesn't need to be).
2023-10-10 16:30:49 +11:00
Maikel Linke
228f69f13e Test customer report filtering without sorting
The report doesn't seem to sort. So the specs don't expect that either
now. These specs were flaky before, depending on the random order in the
database query result.
2023-10-09 12:05:24 +11:00
Maikel
90c25d604b Merge pull request #11441 from macanudo527/fix_rails_HasManyOrHasOneDependent
Fix Rails/HasManyOrHasOneDependent
2023-10-09 11:44:23 +11:00
Maikel
b8f15ca52f Merge pull request #11632 from openfoodfoundation/dependabot/bundler/bullet-7.1.0
chore(deps-dev): bump bullet from 7.0.7 to 7.1.0
2023-10-09 10:56:00 +11:00
Konrad
6cfc20fcaa Merge pull request #11345 from abdellani/support-enabling-invoices-to-individual-users
Support enabling invoices to individual users
2023-10-08 22:22:33 +02:00
David Cook
1c0ebfe61e Add comment 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
95e7900585 test print invoice button under ACTIONS 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
13b366e7ff list send invoice and print invoice under actions even when the invoice feature is enabled 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
a9719a798f fix order mailer tests 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
f047deaf12 load the latest invoice when user tries to print an order 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
3f4eab2a0a update the invoice renderer to check if the feature is enable for individual user 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
dce096a56e check if invoices feature is enabled for the current user before showing invoices tab 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
614c8a5060 update order mailer to check if invoices feature is enabled for the current user 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
adecf64cf3 update bulk invoice job to check if the invoices feature is enabled for the current user 2023-10-08 21:47:17 +02:00
Mohamed ABDELLANI
bd2a1b3e22 check if invoices feature is enabled for the current user before printing a single invoice 2023-10-08 21:47:17 +02:00
Konrad
944925eb06 Merge pull request #11603 from murjax/prevent-customer-edit-shipped-9235
Prevent customers from editing shipped orders
2023-10-08 21:42:18 +02:00
Konrad
0a36f7983f Merge pull request #11623 from ccozkan/issue-11607-timeshift-in-customers-report
Fix occurring time shift in customers report results
2023-10-08 19:02:02 +02:00
Çağrı Özkan
877ea12645 Call in_time_zone on boundary parameters 2023-10-08 17:44:24 +02:00
Konrad
eb9c8bd678 Merge pull request #11618 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.0.7
chore(deps): bump trix from 2.0.6 to 2.0.7
2023-10-08 17:34:41 +02:00
Konrad
ef855e8887 Merge pull request #11619 from ccozkan/issue-11611
Add ability to customers report to filter with open ended boundaries
2023-10-08 16:28:52 +02:00
dependabot[bot]
ebfacea17b chore(deps): bump stripe from 9.3.0 to 9.4.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 9.3.0 to 9.4.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/v9.3.0...v9.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 12:25:38 +00:00
Rachel Arnould
abfd316b3d Merge pull request #11565 from dacook/buu-editing-part4-11059
[BUU] Inline error messages and validation
2023-10-06 14:23:58 +02:00
David Cook
117085aeba Transform weight before validation
I guess validates_length_from_database also validates numbers. That's not a bad thing.
So now it's being validated, we should validate the transformed value that will be saved to the database.
2023-10-06 14:15:07 +02:00
David Cook
9a9be8dacd Validate length of variant fields 2023-10-06 14:15:07 +02:00
David Cook
875d083a1d There's a gem for that [add gem] 2023-10-06 14:15:07 +02:00
David Cook
3ec6386e1c Validate length of some product fields
We know if the values are too long, so let's provide a useful message rather than generating an unhandled database error.
This code seems rather repetetive, it would be good to use a shared module. I wonder if there's a gem for that.

Note that the existing /products/*/edit screen doesn't even handle validation errors yet, but that's something for another day..
2023-10-06 14:15:07 +02:00
David Cook
fee126d6e1 Style form error messages
With an icon, and sentence case (upcase_first is similar to humanize, but simpler (https://dev.to/junko911/rails-helper-methods-to-change-the-form-of-strings-1h9c#upcase-first))
2023-10-06 14:15:07 +02:00
David Cook
3b19a19776 Show inline errors for product fields
The form helper () doesn't work for this case, but it seems we can call it directly like this instead. I'd like to fix the helper, but got stuck this time.
2023-10-06 14:15:07 +02:00
David Cook
5e478b8a76 Vertically align non-input content in table rows 2023-10-06 14:15:07 +02:00
David Cook
836f5a1fb3 Remove unused withError class
It added specificity but had no use.
I reviewed a couple of screens to make sure:
  - /admin/orders/Rx/customer
  - /admin/properties/new

I have to confess I don't know how Spree::Admin::BaseHelper is included, or where it's used.

Best viewed with whitespace ignored.
2023-10-06 14:15:07 +02:00
dependabot[bot]
734e80880b chore(deps-dev): bump bullet from 7.0.7 to 7.1.0
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.7 to 7.1.0.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/7.0.7...7.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 09:23:35 +00:00
dependabot[bot]
0adf44e525 chore(deps): bump awesome_nested_set from 3.5.0 to 3.6.0
Bumps [awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/collectiveidea/awesome_nested_set/releases)
- [Changelog](https://github.com/collectiveidea/awesome_nested_set/blob/master/CHANGELOG)
- [Commits](https://github.com/collectiveidea/awesome_nested_set/compare/v3.5.0...v3.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 09:16:36 +00:00
David Cook
9e04dc36d1 Merge pull request #11629 from mkllnk/tag-release
Add script to create patch release tags
2023-10-06 15:16:45 +11:00
Maikel Linke
74a8b1e721 Add script to create patch release tags 2023-10-06 13:58:37 +11:00
Neal Chambers
085d0f27f7 Move Timestamp Generation into its own Method 2023-10-06 11:19:31 +09:00
Neal Chambers
aaa42ce410 Add Filtering for Optional Relationships 2023-10-06 11:06:54 +09:00
Neal Chambers
3c51b48225 Fix Formatting and Bugs 2023-10-06 11:06:54 +09:00
Neal Chambers
6d22ec5605 Improve Migration Timestamping 2023-10-06 11:06:54 +09:00
Neal Chambers
2b4bf185d6 Replace Duplicate Model Detection with Column Specific Foreign Key Check 2023-10-06 11:06:54 +09:00
Neal Chambers
f02da9f59e Update schema.rb with new Foreign Keys 2023-10-06 11:06:54 +09:00
Neal Chambers
f1c61fa3aa Add Option to Write Migrations to Disk 2023-10-06 11:06:54 +09:00
Neal Chambers
fd8e94cb50 Update Migrations to Include Commented-Out Orphaned Record Query 2023-10-06 11:06:54 +09:00
Neal Chambers
2d6784b88d Allow Full Modulized Class Name to be Used for TODOs 2023-10-06 11:06:54 +09:00
Neal Chambers
d4c363ac39 Reduce Cyclomatic Complexity 2023-10-06 11:06:54 +09:00
Neal Chambers
099b2f455f Remove Unified Orphaned Records SQLs 2023-10-06 11:06:54 +09:00
Neal Chambers
9df42f596c Add SQL to Migration Files 2023-10-06 11:06:54 +09:00
Neal Chambers
7ec1f69e2a Create Foreign Key TODO 2023-10-06 11:06:54 +09:00
Neal Chambers
800d50d732 Add Foreign Key Column to Migrations 2023-10-06 11:06:54 +09:00
Neal Chambers
816ffe6e32 Convert rake task to spec 2023-10-06 11:06:54 +09:00
Neal Chambers
6729218846 Improve SQL query to Allow for Optional Relationships 2023-10-06 11:06:54 +09:00
Neal Chambers
72e75c0e2d Remove Delete on Cascade from Migrations 2023-10-06 11:06:54 +09:00
Neal Chambers
3590da6106 Remove Old Migrations 2023-10-06 11:06:54 +09:00
Neal Chambers
bf2c6128a7 Add Foreign Key Column 2023-10-06 11:06:54 +09:00
Neal Chambers
78cb4c6adc Add migrations to add foreign keys to database 2023-10-06 11:06:54 +09:00
Neal Chambers
5b87890141 Add SQL script to check for Orphaned Records 2023-10-06 11:06:54 +09:00
Neal Chambers
cb864411ee Add Rake Task that Generates Migrations for Missing Foreign Keys 2023-10-06 11:06:50 +09:00
David Cook
cd34e160bf Fix deleting of return_authorizations
return_authorizations have a stock_location_id, not the other way round. So there's no dependent field to nullify.
2023-10-06 10:58:49 +09:00
Neal Chambers
fec59e5ae2 Apply Changes Suggested by Code Review 2023-10-06 10:58:49 +09:00
Neal Chambers
cf07a055d0 Fix Rails/HasManyOrHasOneDependent with nil 2023-10-06 10:58:49 +09:00
Neal Chambers
e49489cd1c Fix invoices dependent relationship 2023-10-06 10:58:49 +09:00
Neal Chambers
d295a3bdae Update .rubocop_todo.yml for Reversions 2023-10-06 10:58:49 +09:00
Neal Chambers
2520d222bb Fix Rails/HasManyOrHasDependent with restrict_with_exception 2023-10-06 10:58:49 +09:00
Neal Chambers
180cd4abe6 Revert Complicated Rails/HasManyOrHasOneDependent Errors 2023-10-06 10:58:49 +09:00
Neal Chambers
e22e08e666 Change destroy to nullify 2023-10-06 10:58:49 +09:00
Neal Chambers
7c9bc58a4b Add nullify to orders relationship, instead of manually nullifying 2023-10-06 10:58:49 +09:00
Neal Chambers
921347f0f2 Update .rubocop_todo.yml 2023-10-06 10:58:49 +09:00
Neal Chambers
7f8ac94933 Fix Rails/HasManyOrHasOneDependent with nil 2023-10-06 10:58:49 +09:00
Neal Chambers
019b54ea95 Fix Rails/HasManyOrHasOneDependent with delete_all 2023-10-06 10:58:49 +09:00
Neal Chambers
070d2cb855 Fix stock_movements relation in variant 2023-10-06 10:58:49 +09:00
Neal Chambers
825342914d Fix Rails/HasManyOrHasOneDependent with nullify 2023-10-06 10:58:49 +09:00
Neal Chambers
b76fb10d46 Fix Rails/HasManyOrHasOneDependent with Destroy 2023-10-06 10:58:49 +09:00
Neal Chambers
53f5d63e4a Delete Rails/HasManyOrHasOneDependent TODOs 2023-10-06 10:58:49 +09:00
Maikel Linke
ff60dacebd Update all locales with the latest Transifex translations 2023-10-06 11:23:43 +11:00
David Cook
3f27fb69b3 Merge pull request #11625 from aisayo/patch-1
Update README.md
2023-10-05 09:52:03 +11:00
David Cook
ee13d1072c Merge pull request #11624 from filipefurtad0/make_seed_data_enteprise_visible
[dev ENV only] Adds attribute to enterprise factory
2023-10-05 09:10:23 +11:00
aisayo
97f315b363 Update README.md
Outdated instructions
2023-10-04 15:34:37 -04:00
filipefurtad0
0e699e9cee Adds attribute to enterprise factory
so that sample data rake task creates visible enterprises by default
2023-10-04 18:00:36 +01:00
lauriejefferson
0cda8d7d4c removed paid styling and added currency formatter to payment_total 2023-10-04 09:30:05 -04:00
Sigmund Petersen
4e8cd330b3 Merge pull request #11571 from dacook/buu-editing-fixups
[BUU] editing fixups
2023-10-04 13:48:31 +02:00
David Cook
6f43165006 Show generic error message when StimulusReflex fails
I decided not to invest the time to figure out how to test this..

The messages should have the same effect as the 500 error, but not technically a 500 because it's not handling a HTTP response. The documentation seems to state this covers server-side errors only (not network errors for example). I couldn't find any way to handle network errors with action cable.
2023-10-04 13:40:36 +02:00
David Cook
6d35b1ac71 Fix bulk form input styles
'header' fields are meant to be bold, and the field backgrounds are meant to match the cell background colour.
2023-10-04 13:40:36 +02:00
David Cook
cd63ab63d8 Refactor form code
Co-authored-by: Maikel <maikel@email.org.au>
2023-10-04 13:40:36 +02:00
David Cook
ed207e3df6 DRY up code 2023-10-04 13:40:36 +02:00
David Cook
4467758a9f Apply code suggestion
Co-authored-by: Jean-Baptiste Bellet <jb.bellet@gmail.com>
2023-10-04 13:40:36 +02:00
David Cook
136b370de1 Merge pull request #11621 from openfoodfoundation/dependabot/bundler/valid_email2-5.1.0
chore(deps): bump valid_email2 from 5.0.5 to 5.1.0
2023-10-04 15:33:26 +11:00
David Cook
7ffe318352 Merge pull request #11616 from openfoodfoundation/dependabot/bundler/sidekiq-7.1.5
chore(deps): bump sidekiq from 7.1.4 to 7.1.5
2023-10-04 15:21:03 +11:00
dependabot[bot]
2b2bb6d46b chore(deps): bump valid_email2 from 5.0.5 to 5.1.0
Bumps [valid_email2](https://github.com/micke/valid_email2) from 5.0.5 to 5.1.0.
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v5.0.5...v5.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 03:50:57 +00:00
dependabot[bot]
34829ea53e chore(deps): bump devise-i18n from 1.11.0 to 1.12.0
Bumps [devise-i18n](https://github.com/tigrish/devise-i18n) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/tigrish/devise-i18n/releases)
- [Changelog](https://github.com/tigrish/devise-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tigrish/devise-i18n/compare/v1.11.0...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 03:49:24 +00:00
David Cook
057a9f73ed Merge pull request #11605 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.21.2
chore(deps-dev): bump rubocop-rails from 2.21.1 to 2.21.2
2023-10-04 14:49:03 +11:00
Maikel
05b30a72e5 Merge pull request #11604 from openfoodfoundation/dependabot/bundler/valid_email2-5.0.5
chore(deps): bump valid_email2 from 5.0.3 to 5.0.5
2023-10-04 14:45:45 +11:00
Maikel
2ac2b30b14 Merge pull request #11588 from filipefurtad0/split_subscription_spec
Splits bottleneck system/admin/subscriptions_spec.rb
2023-10-04 13:33:20 +11:00
Çağrı Özkan
f93fcd347b Rubocop fix 2023-10-04 02:00:21 +03:00
Çağrı Özkan
a5a13761a8 Filter with open ended boundaries upon missing params 2023-10-04 01:05:41 +03:00
Ryan Murphy
4db6570039 9235: Prevent customers from editing shipped orders 2023-10-03 08:36:57 -04:00
dependabot[bot]
f4fce6e69c chore(deps): bump trix from 2.0.6 to 2.0.7
Bumps [trix](https://github.com/basecamp/trix) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.0.6...v2.0.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 09:52:21 +00:00
filipefurtad0
14caf3b25c Moves helper into support folder
Wraps SubscripionHelper module around definitions
2023-10-03 09:49:26 +01:00
filipefurtad0
181ddcefbc Updates rubocop_todo file
Removes local untracked files
2023-10-03 09:49:26 +01:00
filipefurtad0
bc73d09438 Declares enable_subscriptions separately 2023-10-03 09:49:26 +01:00
filipefurtad0
96432ebec2 Splits files into new folder
Creates helper file for existing methods
2023-10-03 09:49:26 +01:00
filipefurtad0
8bc2feda23 Asserts for subscription instructions and tab 2023-10-03 09:49:26 +01:00
filipefurtad0
b554308f10 Sets correct context 2023-10-03 09:49:26 +01:00
dependabot[bot]
db3cdd95a3 chore(deps): bump sidekiq from 7.1.4 to 7.1.5
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 7.1.4 to 7.1.5.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/sidekiq/sidekiq/compare/v7.1.4...v7.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 05:28:17 +00:00
David Cook
2558855ad5 Merge pull request #11595 from openfoodfoundation/dependabot/bundler/rubocop-1.56.4
chore(deps-dev): bump rubocop from 1.56.3 to 1.56.4
2023-10-03 16:26:21 +11:00
dependabot[bot]
372defe20f chore(deps-dev): bump rubocop-rails from 2.21.1 to 2.21.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.21.1...v2.21.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 09:18:16 +00:00
dependabot[bot]
0cd87a7bbf chore(deps): bump valid_email2 from 5.0.3 to 5.0.5
Bumps [valid_email2](https://github.com/micke/valid_email2) from 5.0.3 to 5.0.5.
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v5.0.3...v5.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 09:06:58 +00:00
Maikel
b122c93055 Merge pull request #11586 from macanudo527/fix_stylehash_11
Fix Style/HashSyntax 12/13
2023-10-02 16:25:21 +11:00
Maikel Linke
fec6caf576 Remove unnecessary Rubocop disable 2023-10-02 16:18:51 +11:00
Gaetan Craig-Riou
7f2c1feaf8 Fix rubocop warning 2023-10-02 15:58:13 +11:00
Gaetan Craig-Riou
1a66f3d94f Fix system spec to take into account discounted tax 2023-10-02 15:58:13 +11:00
Gaetan Craig-Riou
8d639c14cb Add a fake adjustment voucher tax on admin order page
When tax are included in price, voucher tax is stored in the voucher
adjustment and not as its own adjustment. So we add a "fake adjustment"
for display purposes.
2023-10-02 15:58:12 +11:00
Gaetan Craig-Riou
8254bd9625 Take into account voucher tax part when displaying tax included in price 2023-10-02 15:58:12 +11:00
Maikel
350ca3b778 Merge pull request #11479 from filipefurtad0/split_split_checkout
Splits checkout files
2023-10-02 12:01:20 +11:00
Konrad
8150a8b04a Merge pull request #11579 from macanudo527/remove_delegate_belongs_to
Remove Deprecated delegate_belongs_to
2023-10-01 13:19:22 +02:00
Konrad
11ea4d93a9 Merge pull request #11584 from openfoodfoundation/dependabot/npm_and_yarn/trix-2.0.6
chore(deps): bump trix from 2.0.5 to 2.0.6
2023-10-01 12:49:32 +02:00
Konrad
33d9ed4000 Merge pull request #11591 from dacook/admin-users-api-key-9833
Redirect to admin users edit path on success
2023-10-01 12:20:46 +02:00
Konrad
06ebeeac0f Merge pull request #11543 from rioug/11364-Voucher-fix-tax-report
[Vouchers] Fix Sales Tax Totals By Order report
2023-10-01 02:09:33 +02:00
dependabot[bot]
89414ba821 chore(deps-dev): bump rubocop from 1.56.3 to 1.56.4
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.3 to 1.56.4.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.56.3...v1.56.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-29 09:53:53 +00:00
lauriejefferson
7320bb5af1 removed styling for paid orders and removed row for non oustanding balance 2023-09-28 20:02:58 -04:00
Neal Chambers
f3382d78c4 Update .rubocop_todo.yml 2023-09-29 08:51:48 +09:00
Neal Chambers
57d2f04330 Fix Style/HashSyntax 2023-09-29 08:51:48 +09:00
Gaetan Craig-Riou
dd0279c983 Update all locales with the latest Transifex translations 2023-09-28 11:52:49 +02:00
David Cook
e844d71abc Redirect to edit path on success
Simply rendering the edit form on the posted path is problematic. For example if you refresh the path you get a 404.
But if there's errors, we want to render the form with unsaved values so you can see the errors and try again.
2023-09-28 09:41:44 +10:00
Maikel
c1587b689a Merge pull request #11589 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.136.0
chore(deps): bump aws-sdk-s3 from 1.135.0 to 1.136.0
2023-09-28 09:20:36 +10:00
Maikel Linke
3fc78e1f7f Update Rubocop todo file 2023-09-28 08:26:35 +10:00
filipefurtad0
a634283ec5 Removes unecessary shipping method setup - guest 2023-09-27 22:20:31 +01:00
filipefurtad0
adede9df03 Removes unecessary shipping method setup - details 2023-09-27 22:19:37 +01:00
filipefurtad0
6763095f26 Removes unecessary shipping method setup - payment 2023-09-27 22:19:37 +01:00
filipefurtad0
3702a2e7b1 Removes unecessary shipping method setup - summary 2023-09-27 22:19:31 +01:00
filipefurtad0
25c58426db Moves split-checkout files to own folder
Removes split_ prefix
2023-09-27 21:45:03 +01:00
dependabot[bot]
4d7f21eec4 chore(deps): bump aws-sdk-s3 from 1.135.0 to 1.136.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.135.0 to 1.136.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-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 09:05:00 +00:00
Gaetan Craig-Riou
33f3c660a4 Fix rubocop warning 2023-09-26 11:21:05 +02:00
filipefurtad0
a4abedf3e3 Fixes rubocop issues 2023-09-26 10:18:28 +01:00
filipefurtad0
d3f9f989f6 Moves summary-step scenarios into dedicated file 2023-09-26 10:18:28 +01:00
filipefurtad0
67793c78ad Moves payment-step scenarios into dedicated file 2023-09-26 10:18:28 +01:00
filipefurtad0
a0611057f0 Moves details-step/not selecting shipping method scenarios into dedicated file 2023-09-26 10:18:28 +01:00
filipefurtad0
b8f7d6102e Moves guest/out of stock scenarios into dedicated file 2023-09-26 10:18:28 +01:00
Gaetan Craig-Riou
b129b9f1d0 DRY up specs 2023-09-26 10:50:58 +02:00
Gaetan Craig-Riou
e9051f5c58 As per review comment, clarify specs
And some DRYing
2023-09-26 10:26:06 +02:00
David Cook
91b251acd4 Refactor 2023-09-26 10:56:44 +10:00
Neal Chambers
50eb8f31f2 Remove Deprecated delegate_belongs_to 2023-09-26 09:50:08 +09:00
David Cook
4e05047cc6 Merge pull request #11583 from macanudo527/fix_stylehash_10
Fix Style/HashSyntax 11/13
2023-09-26 10:38:54 +10:00
dependabot[bot]
8797132117 chore(deps): bump trix from 2.0.5 to 2.0.6
Bumps [trix](https://github.com/basecamp/trix) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/basecamp/trix/releases)
- [Commits](https://github.com/basecamp/trix/compare/v2.0.5...v2.0.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 09:14:02 +00:00
Gaetan Craig-Riou
02aaf6f692 Remove voucher validation on code format
The code doesn't rely on label match any more so this restriction
is not necessary anymore
2023-09-25 09:49:55 +02:00
Gaetan Craig-Riou
097b775fa0 Add metadata before saving adjustment
Rails may put it all in one transaction

Co-authored-by: Maikel <maikel@email.org.au>
2023-09-25 17:44:16 +10:00
Neal Chambers
48132b055f Update .rubocop_todo.yml 2023-09-25 13:15:54 +09:00
Neal Chambers
70e218d2e9 Fix Style/HashSyntax 2023-09-25 13:15:38 +09:00
Maikel
51f125e301 Merge pull request #11582 from macanudo527/fix_stylehash_9
Fix Style/HashSyntax 10/13
2023-09-25 13:43:38 +10:00
Neal Chambers
232ffb1eb8 Update .rubocop_todo.yml 2023-09-24 22:41:48 +09:00
Neal Chambers
35e8f88943 Fix Style/HashSyntax 2023-09-24 22:41:27 +09:00
Rachel Arnould
aa489d4cd6 Merge pull request #11185 from jibees/11155-improve-customer-addresses-report
Admin, reports: improve customer addresses report
2023-09-22 18:06:47 +02:00
Jean-Baptiste Bellet
2803f1c6b2 Group all orders by customer_id, email and distributor_id
Therefore have one (and only) row per customer

Co-Authored-By: Maikel <maikel@email.org.au>
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
9ce89125a4 Fix linter error: line is too long 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
d6c10170da Use plain text instead of computed date in specs
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Code-Conventions#prefer-plain-text-over-method-calls-in-expected-values
2023-09-22 16:44:33 +01:00
jibees
5eab033a80 Improve indentation
Co-Authored-By: Maikel <maikel@email.org.au>
2023-09-22 16:44:33 +01:00
Maikel Linke
adc5bf6e93 Simplify date filter in customers report 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
82ccdcca70 Customers report has only one report: Customers
No more `addresses` report

+ Fix pre-existing rubocop issues

+ Create method to simplify and remove CyclomaticComplexity error
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
5edc8d8ce1 Delete Mailing List report 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
c6c9cdca65 Add last completed order date 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
d2fbaa7cfd Add total amount spent at the shop for the customer 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
d55098f94f Add the number of orders for the customer 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
1378202732 Disable rubocop warning. Not sure how to handle it actually 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
cc26da6560 We'll need to get all the orders per line to count and sum them; prepare it 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
c134de850c Add filter on completed_at of an order 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
4f332504af Add new line at the end of file 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
9e295146cb Remove supplier filter 2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
baff4b5399 Rename 'distributor' to 'hub' 2023-09-22 16:44:33 +01:00
Gaetan Craig-Riou
19fc1fab8c As per review, visit page directly to save time
We still visit the page as user would do once to make sure it is
working.
2023-09-22 11:35:56 +02:00
Gaetan Craig-Riou
03ce39d5c5 Add metadata to tax related voucher adjustment
In the scenario where you have tax excluded from price, when adding
a voucher to an order, we create 2 voucher adjusments. One of them
represent the tax part of the voucher, and has a label starting with
"Tax". To better differentiate them and allow a reliable way to
query it, we add a metadata entry.
2023-09-22 11:16:21 +02:00
Gaetan Craig-Riou
0a68300e40 Remove Voucher scenario
It is now covered by unit test
2023-09-22 10:22:47 +02:00
Gaetan Craig-Riou
25adaaa6ea Simplify test set up 2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
f54846829d Add test for #voucher_tax_adjustment
And mock calls to VoucherAdjustmentsService
2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
9e49da8fae Add unit test for Reporting::Reports::SalesTax::SalesTaxTotalsByOrder
And a small refactoring.
Currently it only covers tax excluded from price
2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
3197480121 Prevent voucher from starting with "Tax"
Plus spec
2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
bec5ad55dd Use VoucherAdjustmentsService to retrieve tax part of the voucher 2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
7c34145ed7 Add voucher_included_tax and voucher_excluded_tax
It retrieves the tax part of the voucher adjustment for tax included
in price and tax excluded from price respectively.
2023-09-22 10:17:40 +02:00
Gaetan Craig-Riou
776f478038 Make update the only public method
I think this got lost when refactoring, but only `update` is meant
to be a public method, other than `new`.
2023-09-15 11:42:04 +02:00
Gaetan Craig-Riou
0c005ad734 Sales Tax Totals by order included tax, fix tax amount when voucher applied
Plus specs
2023-09-14 10:21:50 +02:00
Gaetan Craig-Riou
9925399292 Sales Tax Totals by order, fix tax amount when voucher applied
Apply the tax discount to the tax collumn when a voucher is added
to the order, and update total excluding tax accordingly.
2023-09-12 14:36:28 +02:00
Gaetan Craig-Riou
a7bceb0b28 Add spec scenario where a voucher is added to the order
Voucher tax portion needs to be removed from the tax amount so we
can display the correct tax in the report.
2023-09-12 14:14:01 +02:00
Gaetan Craig-Riou
29a4bf88d7 DRY up specs 2023-09-12 14:13:04 +02:00
lauriejefferson
3039ef5535 updated order partials and locales 2023-06-23 12:06:45 -04:00
lauriejefferson
d3dba87ca1 added styling and table rows for 'Not Paid' order confirmation' 2023-06-21 17:22:12 -04:00
838 changed files with 75564 additions and 14941 deletions

View File

@@ -1,9 +1,14 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
STRIPE_SECRET_TEST_API_KEY="bogus_key"
STRIPE_INSTANCE_SECRET_KEY="bogus_key"
STRIPE_CUSTOMER="bogus_customer"
STRIPE_ACCOUNT="bogus_account"
STRIPE_CLIENT_ID="bogus_client_id"
STRIPE_PUBLIC_TEST_API_KEY="bogus_stripe_publishable_key"
SITE_URL="test.host"

View File

@@ -10,23 +10,15 @@ assignees: ''
## 1. Preparation on Thursday
- [ ] Merge pull requests in the [Ready To Go] column
- [ ] Include translations
<details><summary>Command line instructions:</summary>
<pre>
<code>
git checkout master
git pull upstream master
tx pull --force
git commit -a -m "Update all locales with the latest Transifex translations"
git push upstream master
</code>
</pre>
</details>
- [ ] Create a tag: `git push upstream HEAD:refs/tags/vX.Y.Z`
- [ ] Include translations: `script/release/update_locales`
- [ ] Increment version number: `git push upstream HEAD:refs/tags/vX.Y.Z`
- Major: if server changes are required (eg. provision with ofn-install)
- Minor: larger change that is irreversible (eg. migration deleting data)
- Patch: all others. Shortcut: `script/release/tag`
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
- Select new release tag
- _Generate release notes_ and check to ensure all items are arranged in the right category.
- [ ] Notify [#instance-managers] of both user-facing :eyes: and :warning: API changes.
- [ ] Notify [#instance-managers] of user-facing :eyes:, API :warning: and experimental :construction: changes.
## 2. Testing
@@ -42,16 +34,16 @@ assignees: ''
<pre>
cd ofn-install
git pull
ansible-playbook --limit all-prod --extra-vars "git_version=vX.Y.Z" playbooks/deploy.yml
ansible-playbook --limit all_prod --extra-vars "git_version=vX.Y.Z" playbooks/deploy.yml
</pre>
</details>
- [ ] Notify [#instance-managers]:
> @instance_managers The new release has been deployed.
- [ ] Nudge next release manager
- [ ] [Create issue] for next release and confirm with next release manager in [#core-devs].
The full process is described at https://github.com/openfoodfoundation/openfoodnetwork/wiki/Releasing.
[Ready To Go]: #zenhub
[Ready To Go]: https://github.com/orgs/openfoodfoundation/projects/8?filterQuery=status%3A%22Ready+to+go+%F0%9F%9A%80%22
[Transifex pull request]: https://github.com/openfoodfoundation/openfoodnetwork/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+head%3Atransifex
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A
[releases]: https://github.com/openfoodfoundation/openfoodnetwork/releases
@@ -59,3 +51,5 @@ The full process is described at https://github.com/openfoodfoundation/openfoodn
[#testing]: https://openfoodnetwork.slack.com/app_redirect?channel=C02TZ6X00
[Deploy to Staging]: https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/stage.yml
[#global-community]: https://app.slack.com/client/T02G54U79/C59ADD8F2
[Create issue]: https://github.com/openfoodfoundation/openfoodnetwork/issues/new?assignees=&labels=&projects=&template=release.md&title=Release
[#core-devs]: https://openfoodnetwork.slack.com/archives/GK2T38QPJ

View File

@@ -22,7 +22,7 @@
Changelog Category (reviewers may add a label for the release notes):
- [x] User facing changes
- [ ] User facing changes
- [ ] API changes (V0, V1, DFC or Webhook)
- [ ] Technical changes only
- [ ] Feature toggled

18
.github/release.yml vendored
View File

@@ -1,6 +1,9 @@
changelog:
# Categorise according to what an instance manager needs to know
categories:
- title: "User-facing changes 👀"
# Add the right label if anything appears in here.
# Then re-generate the release notes.
- title: "❓❓❓ Uncategorised ❓❓❓"
labels:
- '*'
exclude:
@@ -9,15 +12,26 @@ changelog:
- dependencies
- feature toggled
- technical changes only
- user facing changes
# Posted in advance for #instance-managers
- title: "User-facing changes 👀"
labels:
- user facing changes
- title: "API changes ⚠️"
labels:
- api changes
- title: "Features under construction 🚧"
- title: "Experimental features for testing 🚧" # may be tested by instance managers
labels:
- feature toggled
# Instance managers ignore below
- title: "Technical changes 🛠️"
labels:
- technical changes only
- title: "Dependencies 📦"
labels:
- dependencies

View File

@@ -18,7 +18,7 @@ jobs:
uses: reviewdog/action-rubocop@v2
with:
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
reporter: github-pr-check
level: error
fail_on_error: true

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn pretty-quick --check --staged

View File

@@ -4,7 +4,9 @@
#
# The configuration is split into three files. Look into those files for more details.
#
require: rubocop-rails
require:
- rubocop-rails
- rubocop-rspec
inherit_from:
# The automatically generated todo list to ignore all current violations.
@@ -13,9 +15,10 @@ inherit_from:
# The relaxed style rules as a common starting point which we can refine.
- .rubocop_relaxed_styleguide.yml
# Our Open Food Network style guide. If you want to see all violations,
# Our Open Food Network style guides. If you want to see all violations,
# then use only that configuration:
#
# bundle exec rubocop -c .rubocop_styleguide.yml
#
- .rubocop_styleguide.yml
- .rubocop_rspec_styleguide.yml

View File

@@ -0,0 +1,21 @@
# OFN styleguide for rubocop-rspec
# Because there are so many, we will disable by default, and enable rules as needed.
Capybara:
Enabled: false
RSpec:
Enabled: false
FactoryBot:
Enabled: false
RSpec/ExpectChange:
Enabled: true
EnforcedStyle: block
RSpec/MultipleExpectations:
Max: 5 # Default 1
RSpec/MultipleMemoizedHelpers:
Max: 10 # Default 5

View File

@@ -5,22 +5,55 @@ AllCops:
NewCops: enable
SuggestExtensions: false
Exclude:
- 'bin/**/*'
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- 'vendor/**/*'
- 'node_modules/**/*'
- bin/**/*
- db/**/*
- config/**/*
- script/**/*
- vendor/**/*
- node_modules/**/*
# Excluding: inadequate Naming/FileName rule rejects GemFile name with camelcase
- 'engines/web/Gemfile'
- engines/web/Gemfile
## OFN SETTINGS
#
# Cop settings that have been agreed upon by the OFN community
Bundler/DuplicatedGem:
Enabled: false
Layout/LineLength:
Enabled: true
Max: 100
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
# Don't think this is a big issue, mostly picking up RPSEC scope definitions
# with lamdas and RSpec '.to change{}' blocks
Lint/AmbiguousBlockAssociation:
Enabled: false
Lint/MissingSuper:
Exclude:
- app/components/**/*
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
# Heaps of offences (> 100) in specs, mostly in situations where two or more
# instances of a model are required, but only one is referenced. Difficult to
# fix without making the spec look messy or rewriting it.
# Should definitely fix at some point.
Lint/UselessAssignment:
Exclude:
- spec/**/*
Metrics:
Enabled: true
Metrics/AbcSize:
Max: 30 # default 17
Metrics/BlockLength:
AllowedMethods: [
"class_eval",
@@ -46,13 +79,31 @@ Metrics/BlockLength:
"xdescribe",
]
Metrics/MethodLength:
Enabled: true
Max: 25 # default 10
Metrics/ParameterLists:
CountKeywordArgs: false
Metrics/PerceivedComplexity:
Enabled: true
Max: 14 # default 8
Naming/PredicateName:
Enabled: false
Naming/VariableNumber:
AllowedIdentifiers:
- street_address_1
- street_address_2
AllowedPatterns:
- _v[\d]+
Rails/ApplicationRecord:
Exclude:
# Migrations should not contain application code:
- "db/migrate/*.rb"
- db/migrate/*.rb
# Allow many-to-many associations without explicit model.
# - It avoids the additional code of a model class.
@@ -61,19 +112,23 @@ Rails/ApplicationRecord:
Rails/HasAndBelongsToMany:
Enabled: false
Rails/OutputSafety:
Exclude:
- spec/**/*
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"
- "touch_all"
- "update_all"
- "update_attribute"
- "update_column"
- "update_columns"
- touch
- touch_all
- update_all
- update_attribute
- update_column
- update_columns
Style/Documentation:
Enabled: false
Style/StringLiterals:
Style/FormatStringToken:
Enabled: false
Style/HashSyntax:
@@ -83,62 +138,5 @@ Style/HashSyntax:
Style/Send:
Enabled: true
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Layout/LineLength:
Enabled: true
Max: 100
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Naming/VariableNumber:
AllowedIdentifiers:
- street_address_1
- street_address_2
AllowedPatterns:
- _v[\d]+
Bundler/DuplicatedGem:
Enabled: false
## TEMPORARY/CONTESTED SETTINGS
#
# These are still to be decided upon, but recommended for inclusion by
# oeoeaio after scrutinising offenses the codebase
# Don't think this is a big issue, mostly picking up RPSEC scope definitions
# with lamdas and RSpec '.to change{}' blocks
Lint/AmbiguousBlockAssociation:
Enabled: false
# Heaps of offences (> 100) in specs, mostly in situations where two or more
# instances of a model are required, but only one is referenced. Difficult to
# fix without making the spec look messy or rewriting it.
# Should definitely fix at some point.
Lint/UselessAssignment:
Exclude:
- spec/**/*
Lint/MissingSuper:
Exclude:
- 'app/components/**/*'
Metrics/AbcSize:
Max: 30 # default 17
Metrics/MethodLength:
Enabled: true
Max: 25 # default 10
Metrics/PerceivedComplexity:
Enabled: true
Max: 14 # default 8
Naming/PredicateName:
Style/StringLiterals:
Enabled: false

View File

@@ -1,25 +1,16 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp`
# using RuboCop version 1.56.3.
# using RuboCop version 1.60.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
- 'spec/system/admin/tag_rules_spec.rb'
# Offense count: 17
# Offense count: 16
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'lib/active_merchant/billing/gateways/stripe_payment_intents_decorator.rb'
- 'lib/tasks/import_product_images.rake'
- 'lib/tasks/users.rake'
- 'spec/controllers/spree/admin/base_controller_spec.rb'
@@ -115,6 +106,11 @@ Lint/RedundantSafeNavigation:
Exclude:
- 'app/models/spree/payment.rb'
# Offense count: 1
Lint/SelfAssignment:
Exclude:
- 'app/models/spree/order/checkout.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
@@ -147,8 +143,8 @@ Metrics/AbcSize:
- 'lib/tasks/enterprises.rake'
- 'spec/services/order_checkout_restart_spec.rb'
# Offense count: 46
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
# Offense count: 9
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
@@ -158,27 +154,6 @@ Metrics/BlockLength:
- 'app/models/spree/shipment.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 'lib/tasks/data.rake'
- 'spec/factories.rb'
- 'spec/factories/address_factory.rb'
- 'spec/factories/enterprise_factory.rb'
- 'spec/factories/line_item_factory.rb'
- 'spec/factories/order_cycle_factory.rb'
- 'spec/factories/order_factory.rb'
- 'spec/factories/product_factory.rb'
- 'spec/factories/shipment_factory.rb'
- 'spec/factories/shipping_method_factory.rb'
- 'spec/factories/subscription_factory.rb'
- 'spec/factories/user_factory.rb'
- 'spec/factories/variant_factory.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
- 'spec/requests/checkout/stripe_sca_spec.rb'
- 'spec/support/cancan_helper.rb'
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
- 'spec/system/consumer/shopping/checkout_stripe_spec.rb'
- 'spec/system/consumer/shopping/variant_overrides_spec.rb'
# Offense count: 1
# Configuration parameters: CountBlocks, Max.
@@ -186,7 +161,7 @@ Metrics/BlockNesting:
Exclude:
- 'app/models/spree/payment/processing.rb'
# Offense count: 45
# Offense count: 46
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
@@ -204,6 +179,7 @@ Metrics/ClassLength:
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/models/enterprise.rb'
- 'app/models/invoice/data_presenter.rb'
- 'app/models/order_cycle.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/product_import/entry_validator.rb'
@@ -428,33 +404,18 @@ Rails/FindEach:
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/admin/enterprise_relationships_spec.rb'
# Offense count: 47
# Offense count: 11
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/customer.rb'
- 'app/models/enterprise.rb'
- 'app/models/order_cycle.rb'
- 'app/models/spree/address.rb'
- 'app/models/spree/adjustment.rb'
- 'app/models/spree/country.rb'
- 'app/models/spree/credit_card.rb'
- 'app/models/spree/order.rb'
- 'app/models/spree/payment.rb'
- 'app/models/spree/payment_method.rb'
- 'app/models/spree/property.rb'
- 'app/models/spree/return_authorization.rb'
- 'app/models/spree/shipment.rb'
- 'app/models/spree/shipping_category.rb'
- 'app/models/spree/shipping_method.rb'
- 'app/models/spree/stock_item.rb'
- 'app/models/spree/tax_rate.rb'
- 'app/models/spree/taxonomy.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
# Offense count: 25
# Offense count: 26
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
@@ -534,21 +495,7 @@ Rails/NegateInclude:
- 'lib/spree/localized_number.rb'
- 'spec/support/matchers/table_matchers.rb'
# Offense count: 16
Rails/OutputSafety:
Exclude:
- 'app/helpers/angular_form_helper.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/reports_helper.rb'
- 'app/helpers/spree/admin/base_helper.rb'
- 'app/helpers/spree/admin/navigation_helper.rb'
- 'app/helpers/spree/admin/orders_helper.rb'
- 'app/helpers/spree/admin/zones_helper.rb'
- 'lib/reporting/queries/query_builder.rb'
- 'lib/reporting/queries/query_interface.rb'
- 'lib/spree/money.rb'
# Offense count: 31
# Offense count: 32
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/Pluck:
Exclude:
@@ -567,6 +514,7 @@ Rails/Pluck:
- 'spec/lib/reports/lettuce_share_report_spec.rb'
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb'
- 'spec/support/api_helper.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
@@ -576,17 +524,18 @@ Rails/PluckInWhere:
Exclude:
- 'app/models/spree/variant.rb'
# Offense count: 5
# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: ActionMailer::Preview, ActiveSupport::TimeZone
Rails/RedundantActiveRecordAllMethod:
Exclude:
- 'app/models/spree/tax_rate.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
- 'spec/system/admin/product_import_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
# Offense count: 22
# Offense count: 20
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RedundantPresenceValidationOnBelongsTo:
Exclude:
@@ -603,7 +552,6 @@ Rails/RedundantPresenceValidationOnBelongsTo:
- 'app/models/spree/stock_item.rb'
- 'app/models/spree/stock_movement.rb'
- 'app/models/spree/tax_rate.rb'
- 'app/models/spree/variant.rb'
- 'app/models/subscription_line_item.rb'
- 'app/models/tag_rule.rb'
- 'app/models/variant_override.rb'
@@ -634,13 +582,11 @@ Rails/ResponseParsedBody:
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
- 'spec/controllers/user_registrations_controller_spec.rb'
# Offense count: 3
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RootPathnameMethods:
Exclude:
- 'spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb'
- 'spec/models/terms_of_service_file_spec.rb'
- 'spec/system/admin/configuration/terms_of_service_files_spec.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
@@ -700,7 +646,6 @@ Rails/UnknownEnv:
- 'app/models/spree/app_configuration.rb'
# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity.
Rails/UnusedRenderContent:
Exclude:
@@ -711,7 +656,7 @@ Rails/UnusedRenderContent:
- 'app/controllers/api/v0/taxons_controller.rb'
- 'app/controllers/api/v0/variants_controller.rb'
# Offense count: 56
# Offense count: 55
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/WhereEquals:
Exclude:
@@ -738,7 +683,6 @@ Rails/WhereEquals:
- 'app/serializers/api/order_serializer.rb'
- 'lib/open_food_network/enterprise_fee_calculator.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/customers/base.rb'
- 'lib/reporting/reports/products_and_inventory/base.rb'
- 'lib/tasks/data.rake'
- 'lib/tasks/data/anonymize_data.rake'
@@ -815,19 +759,6 @@ Style/ClassAndModuleChildren:
- 'spec/controllers/spree/admin/base_controller_spec.rb'
- 'spec/models/spree/payment_method_spec.rb'
# Offense count: 1
Style/ClassVars:
Exclude:
- 'lib/spree/core/delegate_belongs_to.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
# SupportedStyles: annotated, template, unannotated
# AllowedMethods: redirect
Style/FormatStringToken:
EnforcedStyle: unannotated
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
@@ -862,139 +793,28 @@ Style/HashConversion:
- 'spec/controllers/admin/inventory_items_controller_spec.rb'
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
# Offense count: 13
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
- 'app/forms/enterprise_fees_bulk_update.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/spree/preferences/configuration.rb'
- 'app/services/sets/model_set.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb'
- 'spec/models/product_importer_spec.rb'
- 'spec/support/cancan_helper.rb'
# Offense count: 1
# Configuration parameters: MinBranchesCount.
Style/HashLikeCase:
Exclude:
- 'app/models/enterprise.rb'
# Offense count: 1043
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
# SupportedShorthandSyntax: always, never, either, consistent
Style/HashSyntax:
Exclude:
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/return_authorization_spec.rb'
- 'spec/models/spree/shipment_spec.rb'
- 'spec/models/spree/shipping_method_spec.rb'
- 'spec/models/spree/shipping_rate_spec.rb'
- 'spec/models/spree/stock/availability_validator_spec.rb'
- 'spec/models/spree/stock_movement_spec.rb'
- 'spec/models/spree/tax_rate_spec.rb'
- 'spec/models/spree/user_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/models/spree/zone_spec.rb'
- 'spec/models/stripe_account_spec.rb'
- 'spec/models/variant_override_spec.rb'
- 'spec/models/voucher_spec.rb'
- 'spec/queries/complete_orders_with_balance_spec.rb'
- 'spec/queries/customers_with_balance_spec.rb'
- 'spec/queries/outstanding_balance_spec.rb'
- 'spec/queries/payments_requiring_action_spec.rb'
- 'spec/requests/api/v1/customers_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
- 'spec/requests/checkout/paypal_spec.rb'
- 'spec/requests/checkout/routes_spec.rb'
- 'spec/requests/checkout/stripe_sca_spec.rb'
- 'spec/requests/voucher_adjustments_spec.rb'
- 'spec/serializers/api/admin/customer_serializer_spec.rb'
- 'spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb'
- 'spec/serializers/api/admin/index_enterprise_serializer_spec.rb'
- 'spec/serializers/api/admin/order_serializer_spec.rb'
- 'spec/serializers/api/admin/variant_override_serializer_spec.rb'
- 'spec/serializers/api/enterprise_serializer_spec.rb'
- 'spec/serializers/api/order_serializer_spec.rb'
- 'spec/serializers/api/product_serializer_spec.rb'
- 'spec/services/cap_quantity_spec.rb'
- 'spec/services/cart_service_spec.rb'
- 'spec/services/checkout/payment_method_fetcher_spec.rb'
- 'spec/services/default_stock_location_spec.rb'
- 'spec/services/invoice_data_generator_spec.rb'
- 'spec/services/order_available_payment_methods_spec.rb'
- 'spec/services/order_available_shipping_methods_spec.rb'
- 'spec/services/order_cart_reset_spec.rb'
- 'spec/services/order_checkout_restart_spec.rb'
- 'spec/services/order_cycle_distributed_products_spec.rb'
- 'spec/services/order_cycle_form_spec.rb'
- 'spec/services/order_cycle_webhook_service_spec.rb'
- 'spec/services/order_data_masker_spec.rb'
- 'spec/services/order_factory_spec.rb'
- 'spec/services/order_fees_handler_spec.rb'
- 'spec/services/order_invoice_comparator_spec.rb'
- 'spec/services/order_payment_finder_spec.rb'
- 'spec/services/order_syncer_spec.rb'
- 'spec/services/order_tax_adjustments_fetcher_spec.rb'
- 'spec/services/order_workflow_spec.rb'
- 'spec/services/paypal_items_builder_spec.rb'
- 'spec/services/permissions/order_spec.rb'
- 'spec/services/place_proxy_order_spec.rb'
- 'spec/services/process_payment_intent_spec.rb'
- 'spec/services/product_tag_rules_filterer_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/search_orders_spec.rb'
- 'spec/services/sets/product_set_spec.rb'
- 'spec/services/tax_rate_finder_spec.rb'
- 'spec/services/user_default_address_setter_spec.rb'
- 'spec/services/variants_stock_levels_spec.rb'
- 'spec/services/voucher_adjustments_service_spec.rb'
- 'spec/support/controller_helper.rb'
- 'spec/support/controller_requests_helper.rb'
- 'spec/support/request/stripe_stubs.rb'
- 'spec/support/request/ui_component_helper.rb'
- 'spec/support/request/web_helper.rb'
- 'spec/system/admin/adjustments_spec.rb'
- 'spec/system/admin/bulk_product_update_spec.rb'
- 'spec/system/admin/configuration/states_spec.rb'
- 'spec/system/admin/configuration/tax_rates_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/enterprises_spec.rb'
- 'spec/system/admin/invoice_print_spec.rb'
- 'spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb'
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/payments_stripe_spec.rb'
- 'spec/system/admin/reports/enterprise_fee_summaries_spec.rb'
- 'spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb'
- 'spec/system/admin/reports/orders_and_fulfillment_spec.rb'
- 'spec/system/admin/reports/packing_report_spec.rb'
- 'spec/system/admin/reports/payments_report_spec.rb'
- 'spec/system/admin/reports/revenues_by_hub_spec.rb'
- 'spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb'
- 'spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb'
- 'spec/system/admin/reports_spec.rb'
- 'spec/system/admin/subscriptions_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
- 'spec/system/admin/variant_overrides_spec.rb'
- 'spec/system/admin/vouchers_spec.rb'
- 'spec/system/consumer/account/cards_spec.rb'
- 'spec/system/consumer/account/developer_settings_spec.rb'
- 'spec/system/consumer/account/payments_spec.rb'
- 'spec/system/consumer/account_spec.rb'
- 'spec/system/consumer/authentication_spec.rb'
- 'spec/system/consumer/multilingual_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/checkout_auth_spec.rb'
- 'spec/system/consumer/shopping/checkout_paypal_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
- 'spec/system/consumer/shopping/checkout_stripe_spec.rb'
- 'spec/system/consumer/shopping/orders_spec.rb'
- 'spec/system/consumer/shopping/products_spec.rb'
- 'spec/system/consumer/shopping/shopping_spec.rb'
- 'spec/system/consumer/shopping/unit_price_spec.rb'
- 'spec/system/consumer/shopping/variant_overrides_spec.rb'
- 'spec/system/consumer/split_checkout_spec.rb'
- 'spec/system/consumer/split_checkout_tax_incl_spec.rb'
- 'spec/system/consumer/split_checkout_tax_not_incl_spec.rb'
- 'spec/system/consumer/user_password_spec.rb'
- 'spec/system/consumer/white_label_spec.rb'
- 'spec/system/support/cuprite_setup.rb'
- 'spec/views/spree/orders/edit.html.haml_spec.rb'
- 'spec/views/spree/shared/_order_details.html.haml_spec.rb'
# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapToHash:
@@ -1011,19 +831,6 @@ Style/MissingRespondToMissing:
- 'app/models/spree/gateway.rb'
- 'app/models/spree/preferences/configuration.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/MultilineTernaryOperator:
Exclude:
- 'spec/system/admin/subscriptions_spec.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/NegatedIfElseCondition:
Exclude:
- 'app/mailers/spree/shipment_mailer.rb'
- 'spec/support/matchers/table_matchers.rb'
# Offense count: 22
# This cop supports safe autocorrection (--autocorrect).
Style/NestedModifier:
@@ -1052,7 +859,7 @@ Style/OpenStructUse:
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/serializers/api/enterprise_serializer_spec.rb'
# Offense count: 16
# Offense count: 15
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
@@ -1066,16 +873,8 @@ Style/OptionalBooleanParameter:
- 'app/models/spree/shipment.rb'
- 'engines/order_management/app/services/order_management/stock/estimator.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/spree/core/delegate_belongs_to.rb'
- 'spec/support/request/web_helper.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
Style/ParenthesesAroundCondition:
Exclude:
- 'spec/system/support/precompile_assets.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
@@ -1084,19 +883,6 @@ Style/PreferredHashMethods:
Exclude:
- 'app/controllers/api/v0/shipments_controller.rb'
# Offense count: 16
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
Style/QuotedSymbols:
Exclude:
- 'app/services/exchange_products_renderer.rb'
- 'lib/stripe/credit_card_cloner.rb'
- 'spec/controllers/api/v0/exchange_products_controller_spec.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/api/v1/customers_spec.rb'
- 'spec/support/request/stripe_stubs.rb'
# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Methods.
@@ -1105,25 +891,11 @@ Style/RedundantArgument:
- 'engines/dfc_provider/app/services/authorization_control.rb'
- 'spec/support/query_counter.rb'
# Offense count: 13
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantConstantBase:
Exclude:
- 'app/controllers/split_checkout_controller.rb'
- 'app/controllers/webhook_endpoints_controller.rb'
- 'config.ru'
- 'spec/helpers/checkout_helper_spec.rb'
- 'spec/models/spree/order_spec.rb'
- 'spec/models/spree/payment_method_spec.rb'
- 'spec/models/spree/payment_spec.rb'
- 'spec/queries/complete_visible_orders_spec.rb'
- 'spec/services/paypal_items_builder_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantDoubleSplatHashBraces:
Style/RedundantAssignment:
Exclude:
- 'spec/system/support/cuprite_setup.rb'
- 'spec/models/database_spec.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
@@ -1139,32 +911,6 @@ Style/RedundantInterpolation:
- 'lib/tasks/karma.rake'
- 'spec/base_spec_helper.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpArgument:
Exclude:
- 'app/models/spree/shipping_method.rb'
- 'lib/spree/i18n.rb'
# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'app/models/product_import/entry_validator.rb'
- 'app/models/spree/stock/availability_validator.rb'
- 'lib/reporting/reports/enterprise_fee_summary/summarizer.rb'
- 'lib/stripe/authorize_response_patcher.rb'
- 'lib/tasks/data.rake'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantStringEscape:
Exclude:
- 'app/models/spree/calculator.rb'
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
- 'spec/system/admin/enterprise_fees_spec.rb'
# Offense count: 19
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -1216,7 +962,7 @@ Style/SlicingWithRange:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'lib/discourse/single_sign_on.rb'
# Offense count: 28
# Offense count: 25
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
@@ -1238,6 +984,5 @@ Style/StringConcatenation:
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/services/embedded_page_service_spec.rb'
- 'spec/support/api_helper.rb'
- 'spec/support/features/datepicker_helper.rb'
- 'spec/system/admin/products_spec.rb'

20
Gemfile
View File

@@ -5,7 +5,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
ruby File.read('.ruby-version').chomp
gem 'dotenv-rails', require: 'dotenv/rails-now' # Load ENV vars before other gems
gem 'dotenv', require: 'dotenv/load' # Load ENV vars before other gems
gem 'rails'
@@ -17,7 +17,7 @@ gem "image_processing"
gem 'activemerchant', '>= 1.78.0'
gem 'angular-rails-templates', '>= 0.3.0'
gem 'awesome_nested_set'
gem 'ransack', '~> 2.6.0'
gem 'ransack', '~> 4.1.0'
gem 'responders'
gem 'rexml'
gem 'webpacker', '~> 5'
@@ -32,6 +32,7 @@ gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-7"
gem "fog-aws", "~> 2.0" # db2fog does not support v3
gem "mime-types" # required by fog
gem "validates_lengths_from_database"
gem "valid_email2"
gem "catalog", path: "./engines/catalog"
@@ -73,7 +74,7 @@ gem 'rswag-ui'
gem 'omniauth_openid_connect'
gem 'omniauth-rails_csrf_protection'
gem 'openid_connect', '~> 1.3'
gem 'openid_connect'
gem 'angularjs-rails', '1.8.0'
gem 'bugsnag'
@@ -92,14 +93,13 @@ gem 'bootsnap', require: false
gem 'geocoder'
gem 'gmaps4rails'
gem 'mimemagic', '> 0.3.5'
gem 'paper_trail', '~> 12.1'
gem 'paper_trail'
gem 'rack-rewrite'
gem 'rack-timeout'
gem 'roadie-rails'
gem 'hiredis'
gem 'puma'
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'redis'
gem 'sidekiq'
gem 'sidekiq-scheduler'
@@ -133,6 +133,8 @@ gem 'flipper-ui'
gem "view_component"
gem 'view_component_reflex', '3.1.14.pre9'
# mini_portile2 is needed when installing with Vargant
# https://openfoodnetwork.slack.com/archives/CEBMTRCNS/p1668439152992899
gem 'mini_portile2', '~> 2.8'
gem "faraday"
@@ -140,6 +142,8 @@ gem "private_address_check"
gem 'newrelic_rpm'
gem 'invisible_captcha'
group :production, :staging do
gem 'sd_notify' # For better Systemd process management. Used by Puma.
end
@@ -157,7 +161,7 @@ group :test, :development do
gem 'letter_opener', '>= 1.4.1'
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry', require: false
gem 'rswag-specs'
gem 'rswag'
gem 'shoulda-matchers'
gem 'stimulus_reflex_testing'
gem 'timecop'
@@ -182,8 +186,10 @@ group :development do
gem 'rails-erd'
gem 'rubocop'
gem 'rubocop-rails'
gem 'rubocop-rspec'
gem 'spring'
gem 'spring-commands-rspec'
gem 'spring-commands-rubocop'
gem 'web-console'
gem 'rack-mini-profiler', '< 3.0.0'

View File

@@ -90,7 +90,7 @@ GEM
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
active_storage_validations (1.0.4)
active_storage_validations (1.1.4)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
@@ -98,17 +98,18 @@ GEM
activejob (7.0.8)
activesupport (= 7.0.8)
globalid (>= 0.3.6)
activemerchant (1.123.0)
activemerchant (1.133.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
rexml (~> 3.2.5)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activerecord-import (1.5.0)
activerecord-import (1.5.1)
activerecord (>= 4.2)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -131,56 +132,57 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
acts-as-taggable-on (9.0.1)
activerecord (>= 6.0, < 7.1)
acts-as-taggable-on (10.0.0)
activerecord (>= 6.1, < 7.2)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.8.4)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
afm (0.2.2)
angular-rails-templates (1.2.0)
railties (>= 5.0, < 7.1)
angular-rails-templates (1.2.1)
railties (>= 5.0, < 7.2)
sprockets (>= 3.0, < 5)
sprockets-rails
tilt
angular_rails_csrf (5.0.0)
angular_rails_csrf (6.0.0)
railties (>= 3, < 8)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.8.0)
arel-helpers (2.14.0)
activerecord (>= 3.1.0, < 8)
ast (2.4.2)
attr_required (1.0.1)
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.826.0)
aws-sdk-core (3.183.0)
aws-eventstream (~> 1, >= 1.0.2)
attr_required (1.0.2)
awesome_nested_set (3.6.0)
activerecord (>= 4.0.0, < 7.2)
aws-eventstream (1.3.0)
aws-partitions (1.883.0)
aws-sdk-core (3.191.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.71.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-kms (1.77.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.135.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.143.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.1.1)
bcrypt (3.1.18)
base64 (0.2.0)
bcp47_spec (0.2.1)
bcrypt (3.1.19)
bigdecimal (3.0.2)
bindata (2.4.15)
bindex (0.8.1)
bootsnap (1.16.0)
bootsnap (1.18.3)
msgpack (~> 1.2)
bugsnag (6.26.0)
bugsnag (6.26.3)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (7.0.7)
bullet (7.1.6)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cable_ready (5.0.1)
@@ -190,11 +192,11 @@ GEM
railties (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.39.2)
capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
@@ -215,33 +217,34 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
combine_pdf (1.0.23)
combine_pdf (1.0.26)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (0.4.5)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
css_parser (1.11.0)
css_parser (1.16.0)
addressable
cuprite (0.14.3)
cuprite (0.15)
capybara (~> 3.0)
ferrum (~> 0.13.0)
ferrum (~> 0.14.0)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
datafoodconsortium-connector (1.0.0.pre.alpha.8)
datafoodconsortium-connector (1.0.0.pre.alpha.10)
virtual_assembly-semantizer (~> 1.0, >= 1.0.5)
date (3.3.3)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
date (3.3.4)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
debugger-linecache (1.2.0)
devise (4.9.2)
devise (4.9.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@@ -249,17 +252,16 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-i18n (1.11.0)
devise-i18n (1.12.0)
devise (>= 4.9.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.5.0)
digest (3.1.1)
docile (1.4.0)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
dotenv (3.1.0)
email_validator (2.2.4)
activemodel
erubi (1.12.0)
et-orbi (1.2.7)
tzinfo
@@ -270,20 +272,19 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.2)
ferrum (0.13)
faraday-net_http (3.1.0)
net-http
ferrum (0.14)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.23.0)
ffi (1.15.5)
ffi (1.16.3)
flipper (0.26.2)
concurrent-ruby (< 2)
flipper-active_record (0.26.2)
@@ -328,13 +329,11 @@ GEM
haml (5.2.2)
temple (>= 0.8.0)
tilt
hashdiff (1.0.1)
hashdiff (1.1.0)
hashery (2.1.2)
hashie (5.0.0)
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
@@ -344,10 +343,13 @@ GEM
ruby-vips (>= 2.0.17, < 3)
immigrant (0.3.6)
activerecord (>= 3.0)
io-console (0.6.0)
invisible_captcha (2.2.0)
rails (>= 5.2)
io-console (0.7.1)
ipaddress (0.8.3)
irb (1.6.4)
reline (>= 0.3.0)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
jmespath (1.6.2)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
@@ -355,41 +357,43 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (2.6.3)
json-canonicalization (0.3.2)
json-jwt (1.16.3)
json (2.7.1)
json-canonicalization (1.0.0)
json-jwt (1.16.5)
activesupport (>= 4.2)
aes_key_wrap
base64
bindata
faraday (~> 2.0)
faraday-follow_redirects
json-ld (3.2.5)
json-ld (3.3.1)
htmlentities (~> 4.3)
json-canonicalization (~> 0.3, >= 0.3.2)
json-canonicalization (~> 1.0)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.15)
rack (>= 2.2, < 4)
rdf (~> 3.2, >= 3.2.10)
json-schema (3.0.0)
rdf (~> 3.3)
json-schema (4.1.1)
addressable (>= 2.8)
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.7.1)
knapsack_pro (5.7.0)
jwt (2.8.0)
base64
knapsack_pro (6.0.4)
rake
language_server-protocol (3.17.0.3)
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.8.1)
launchy (2.5.2)
addressable (~> 2.8)
letter_opener (1.9.0)
launchy (>= 2.2, < 3)
link_header (0.0.8)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
@@ -400,35 +404,37 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.5.1)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
mime-types-data (3.2023.1205)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_magick (4.11.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.20.0)
monetize (1.12.0)
mini_portile2 (2.8.5)
minitest (5.22.2)
monetize (1.13.0)
money (~> 6.12)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.7.1)
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
net-imap (0.3.7)
net-http (0.4.1)
uri
net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0.1)
net-protocol
newrelic_rpm (9.5.0)
nio4r (2.5.9)
nokogiri (1.15.4)
newrelic_rpm (9.7.1)
nio4r (2.7.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oauth2 (1.4.11)
@@ -437,37 +443,39 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
omniauth (2.1.1)
omniauth (2.1.2)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth_openid_connect (0.6.1)
omniauth_openid_connect (0.7.1)
omniauth (>= 1.9, < 3)
openid_connect (~> 1.1)
openid_connect (1.4.2)
openid_connect (~> 2.2)
openid_connect (2.3.0)
activemodel
attr_required (>= 1.0.0)
json-jwt (>= 1.15.0)
net-smtp
rack-oauth2 (~> 1.21)
swd (~> 1.3)
email_validator
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.16)
mail
rack-oauth2 (~> 2.2)
swd (~> 2.0)
tzinfo
validate_email
validate_url
webfinger (~> 1.2)
webfinger (~> 2.0)
orm_adapter (0.5.0)
pagy (5.10.1)
activesupport
paper_trail (12.3.0)
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.23.0)
paranoia (2.6.2)
activerecord (>= 5.1, < 7.1)
parser (3.2.2.3)
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.24.0)
paranoia (2.6.3)
activerecord (>= 5.1, < 7.2)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
paypal-sdk-core (0.3.4)
@@ -475,7 +483,7 @@ GEM
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.11.0)
pdf-reader (2.12.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -486,25 +494,29 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.3)
puma (6.4.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
puma (6.4.2)
nio4r (~> 2.0)
query_count (1.1.1)
activerecord (>= 4.2)
railties (>= 4.2)
raabro (1.4.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-oauth2 (1.21.3)
rack-oauth2 (2.2.1)
activesupport
attr_required
httpclient
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (3.0.5)
rack
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.6)
rack
rack-rewrite (1.5.1)
@@ -553,39 +565,43 @@ GEM
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
ransack (2.6.0)
activerecord (>= 6.0.4)
activesupport (>= 6.0.4)
rake (13.1.0)
ransack (4.1.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdf (3.2.11)
rdf (3.3.1)
bcp47_spec (~> 0.2)
link_header (~> 0.0, >= 0.0.8)
rdoc (6.6.2)
psych (>= 4.0.0)
redcarpet (3.6.0)
redis (4.8.1)
redis-client (0.17.0)
redis (5.1.0)
redis-client (>= 0.17.0)
redis-client (0.20.0)
connection_pool
regexp_parser (2.8.1)
reline (0.3.3)
regexp_parser (2.9.0)
reline (0.4.1)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
responders (3.1.0)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.2.6)
roadie (5.0.1)
roadie (5.2.0)
css_parser (~> 1.4)
nokogiri (~> 1.8)
roadie-rails (3.0.0)
railties (>= 5.1, < 7.1)
nokogiri (~> 1.15)
roadie-rails (3.1.0)
railties (>= 5.1, < 8.0)
roadie (~> 5.0)
rodf (1.2.0)
builder (>= 3.0)
rubyzip (>= 1.0)
roo (2.10.0)
roo (2.10.1)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rspec (3.12.0)
@@ -597,10 +613,10 @@ GEM
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
rspec-rails (6.1.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
@@ -611,41 +627,53 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.12.1)
rswag-api (2.10.1)
railties (>= 3.1, < 7.1)
rswag-specs (2.10.1)
activesupport (>= 3.1, < 7.1)
json-schema (>= 2.2, < 4.0)
railties (>= 3.1, < 7.1)
rswag (2.13.0)
rswag-api (= 2.13.0)
rswag-specs (= 2.13.0)
rswag-ui (= 2.13.0)
rswag-api (2.13.0)
activesupport (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rswag-specs (2.13.0)
activesupport (>= 3.1, < 7.2)
json-schema (>= 2.2, < 5.0)
railties (>= 3.1, < 7.2)
rspec-core (>= 2.14)
rswag-ui (2.10.1)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.56.3)
base64 (~> 0.1.1)
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-rails (2.21.1)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (3.8.2)
fugit (~> 1.1, >= 1.1.6)
@@ -661,13 +689,13 @@ GEM
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
semantic_range (3.0.0)
shoulda-matchers (5.3.0)
shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
sidekiq (7.1.4)
sidekiq (7.2.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.14.0)
redis-client (>= 0.19.0)
sidekiq-scheduler (5.0.3)
rufus-scheduler (~> 3.2)
sidekiq (>= 6, < 8)
@@ -681,9 +709,11 @@ GEM
spreadsheet_architect (5.0.0)
caxlsx (>= 3.3.0, < 4)
rodf (>= 1.0.0, < 2)
spring (4.1.1)
spring (4.1.3)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
spring-commands-rubocop (0.4.0)
spring (>= 1.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -711,33 +741,35 @@ GEM
stimulus_reflex_testing (0.3.0)
stimulus_reflex (>= 3.3.0)
stringex (2.8.6)
stripe (9.3.0)
swd (1.3.0)
stringio (3.1.0)
stripe (10.10.0)
swd (2.0.3)
activesupport (>= 3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
faraday (~> 2.0)
faraday-follow_redirects
temple (0.8.2)
thor (1.2.2)
thor (1.3.0)
thread-local (1.1.0)
tilt (2.1.0)
tilt (2.3.0)
timecop (0.9.8)
timeout (0.4.0)
timeout (0.4.1)
ttfunk (1.7.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
valid_email2 (5.0.3)
uri (0.13.0)
valid_email2 (5.2.1)
activemodel (>= 3.2)
mail (~> 2.5)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
validates_lengths_from_database (0.8.0)
activerecord (>= 4)
vcr (6.2.0)
view_component (3.6.0)
view_component (3.11.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
@@ -754,10 +786,11 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webfinger (1.2.0)
webfinger (2.1.3)
activesupport
httpclient (>= 2.4)
webmock (3.18.1)
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.23.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -766,7 +799,7 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.7.0)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -778,7 +811,7 @@ GEM
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.11)
zeitwerk (2.6.13)
PLATFORMS
ruby
@@ -822,7 +855,7 @@ DEPENDENCIES
devise-token_authenticatable
dfc_provider!
digest
dotenv-rails
dotenv
factory_bot_rails (= 6.2.0)
faraday
ffaker
@@ -837,11 +870,11 @@ DEPENDENCIES
good_migrations
haml
highline (= 2.0.3)
hiredis
i18n
i18n-js (~> 3.9.0)
image_processing
immigrant
invisible_captcha
jquery-rails (= 4.4.0)
jquery-ui-rails (~> 4.2)
json
@@ -859,10 +892,10 @@ DEPENDENCIES
oauth2 (~> 1.4.7)
omniauth-rails_csrf_protection
omniauth_openid_connect
openid_connect (~> 1.3)
openid_connect
order_management!
pagy (~> 5.1)
paper_trail (~> 12.1)
paper_trail
paranoia (~> 2.4)
paypal-sdk-merchant (= 1.117.2)
pdf-reader
@@ -879,20 +912,21 @@ DEPENDENCIES
rails-erd
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (~> 2.6.0)
ransack (~> 4.1.0)
redcarpet
redis (>= 4.0)
redis
responders
rexml
roadie-rails
roo
rspec-rails (>= 3.5.2)
rspec-retry
rswag
rswag-api
rswag-specs
rswag-ui
rubocop
rubocop-rails
rubocop-rspec
sd_notify
select2-rails!
shoulda-matchers
@@ -902,6 +936,7 @@ DEPENDENCIES
spreadsheet_architect
spring
spring-commands-rspec
spring-commands-rubocop
state_machines-activerecord
stimulus_reflex (= 3.5.0.rc3)
stimulus_reflex_testing
@@ -909,6 +944,7 @@ DEPENDENCIES
stripe
timecop
valid_email2
validates_lengths_from_database
vcr
view_component
view_component_reflex (= 3.1.14.pre9)

View File

@@ -1,5 +1,4 @@
[![Build](https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/build.yml/badge.svg)](https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/build.yml)
[![Code Climate](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork.png)](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
# Open Food Network
@@ -45,7 +44,7 @@ We use [KnapsackPro](https://knapsackpro.com/) for optimal parallelisation of ou
## Licence
Copyright (c) 2012 - 2022 Open Food Foundation, released under the AGPL licence.
Copyright (c) 2012 - 2024 Open Food Foundation, released under the AGPL licence.
[survey]: https://docs.google.com/a/eaterprises.com.au/forms/d/1zxR5vSiU9CigJ9cEaC8-eJLgYid8CR8er7PPH9Mc-30/edit#
[slack-invite]: https://join.slack.com/t/openfoodnetwork/shared_invite/zt-9sjkjdlu-r02kUMP1zbrTgUhZhYPF~A

View File

@@ -248,7 +248,6 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
else
product.variant_unit = product.variant_unit_scale = null
$scope.packVariant product, product.master if product.master
if product.variants
for id, variant of product.variants
@@ -299,7 +298,6 @@ filterSubmitProducts = (productsToFilter) ->
if product.hasOwnProperty("id")
filteredProduct = {id: product.id}
filteredVariants = []
filteredMaster = null
hasUpdatableProperty = false
if product.hasOwnProperty("variants")
@@ -309,16 +307,6 @@ filterSubmitProducts = (productsToFilter) ->
variantHasUpdatableProperty = result.hasUpdatableProperty
filteredVariants.push filteredVariant if variantHasUpdatableProperty
if product.master?.hasOwnProperty("unit_value")
filteredMaster ?= { id: product.master.id }
filteredMaster.unit_value = product.master.unit_value
if product.master?.hasOwnProperty("unit_description")
filteredMaster ?= { id: product.master.id }
filteredMaster.unit_description = product.master.unit_description
if product.master?.hasOwnProperty("display_as")
filteredMaster ?= { id: product.master.id }
filteredMaster.display_as = product.master.display_as
if product.hasOwnProperty("sku")
filteredProduct.sku = product.sku
hasUpdatableProperty = true
@@ -350,9 +338,6 @@ filterSubmitProducts = (productsToFilter) ->
if product.hasOwnProperty("inherits_properties")
filteredProduct.inherits_properties = product.inherits_properties
hasUpdatableProperty = true
if filteredMaster?
filteredProduct.master_attributes = filteredMaster
hasUpdatableProperty = true
if filteredVariants.length > 0 # Note that the name of the property changes to enable mass assignment of variants attributes with rails
filteredProduct.variants_attributes = filteredVariants
hasUpdatableProperty = true

View File

@@ -24,6 +24,9 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
"order_bill_address_firstname",
"order_bill_address_lastname",
"order_bill_address_full_name",
"order_bill_address_full_name_reversed",
"order_bill_address_full_name_with_comma",
"order_bill_address_full_name_with_comma_reversed",
"variant_product_supplier_name",
"order_email",
"order_number",

View File

@@ -42,8 +42,10 @@ angular.module('admin.payments').factory 'Payment', (AdminStripeElements, curren
submit: =>
munged = @preprocess()
PaymentResource.create({order_id: munged.order_id}, munged, (response, headers, status)=>
$window.location.pathname = "/admin/orders/" + munged.order_id + "/payments"
PaymentResource.create({order_id: munged.order_id}, munged, (response, headers, status) ->
rawHtml = Object.values(response).join('').replace('[object Object]true', '')
document.body.innerHTML = rawHtml
$window.history.pushState({}, '', "/admin/orders/" + munged.order_id + "/payments")
, (response) ->
StatusMessage.display 'error', t("spree.admin.payments.source_forms.stripe.error_saving_payment")
)

View File

@@ -2,6 +2,9 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
class VariantUnitManager
@units:
'weight':
0.001:
name: 'mg'
system: 'metric'
1.0:
name: 'g'
system: 'metric'
@@ -21,12 +24,21 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
0.001:
name: 'mL'
system: 'metric'
0.01:
name: 'cL'
system: 'metric'
0.1:
name: 'dL'
system: 'metric'
1.0:
name: 'L'
system: 'metric'
1000.0:
name: 'kL'
system: 'metric'
4.54609:
name: 'gal'
system: 'metric'
'items':
1:
name: 'items'
@@ -60,8 +72,13 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
@compatibleUnitScales: (scale, unitType) ->
scaleSystem = @units[unitType][scale]['system']
(parseFloat(scale) for scale, scaleInfo of @units[unitType] when scaleInfo['system'] == scaleSystem).sort (a, b) ->
a - b
if availableUnits
available = availableUnits.split(",")
(parseFloat(scale) for scale, scaleInfo of @units[unitType] when scaleInfo['system'] == scaleSystem and available.includes(scaleInfo['name'])).sort (a, b) ->
a - b
else
(parseFloat(scale) for scale, scaleInfo of @units[unitType] when scaleInfo['system'] == scaleSystem).sort (a, b) ->
a - b
@systemOfMeasurement: (scale, unitType) ->
if @units[unitType][scale]

View File

@@ -32,9 +32,6 @@ jQuery(function($) {
});
}
// Make flash messages dissapear
setTimeout('$(".flash").fadeOut()', 5000);
// Highlight hovered table column
$('table tbody tr td.actions a').hover(function(){
var tr = $(this).closest('tr');

View File

@@ -1,22 +1,6 @@
// Shipments AJAX API
$(document).ready(function() {
handle_ship_click = function(){
var link = $(this);
var shipment_number = link.data('shipment-number');
var url = Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number + "/ship.json");
$.ajax({
type: "PUT",
url: url
}).done(function( msg ) {
window.location.reload();
}).error(function( msg ) {
console.log(msg);
});
}
$('.admin-order-edit-form a.ship').click(handle_ship_click);
//handle shipping method edit click
$('a.edit-method').click(toggleMethodEdit);
$('a.cancel-method').click(toggleMethodEdit);

View File

@@ -50,11 +50,11 @@ $(document).ready(function() {
if (quantity > maxQuantity) {
quantity = maxQuantity;
save.parents('tr').find('input.line_item_quantity').val(maxQuantity);
ofnAlert(t("js.admin.orders.quantity_adjusted"));
ofnAlert(t("js.admin.orders.quantity_unavailable"));
} else {
adjustItems(shipment_number, variant_id, quantity, true);
}
toggleItemEdit();
adjustItems(shipment_number, variant_id, quantity, true);
return false;
}
$('a.save-item').click(handle_save_click);

View File

@@ -14,7 +14,7 @@
{{'hubs_delivery' | t}}
.row
.columns.small-12
%a.cta-hub{"ng-href" => "{{::enterprise.path}}#/shop", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}",
%a.cta-hub{"ng-href" => "{{::enterprise.path}}#/shop_panel", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}",
"ng-class" => "{primary: enterprise.active, secondary: !enterprise.active}",
"ng-click" => "$close()",
"ofn-change-hub" => "enterprise"}

View File

@@ -12,7 +12,7 @@
.row
.columns.small-12
%a.cta-hub{"ng-repeat" => "hub in enterprise.hubs | filter:{id: '!'+enterprise.id} | orderBy:'-active'",
"ng-href" => "{{::hub.path}}#/shop", "ofn-empties-cart" => "hub",
"ng-href" => "{{::hub.path}}#/shop_panel", "ofn-empties-cart" => "hub",
"ng-class" => "::{primary: hub.active, secondary: !hub.active}",
"ng-click" => "$close()",
"ofn-change-hub" => "hub"}

View File

@@ -11,7 +11,7 @@
%filter-selector{ 'selector-set' => "productPropertySelectors", objects: "[product] | propertiesWithValuesOf" }
.product-description{"ng-if" => "product.description_html"}
%p.text-small{"ng-bind-html" => "::product.description_html"}
%p.text-small{"ng-bind-html" => "::product.description_html", "data-controller" => "add-blank-to-link"}
.columns.small-12.medium-6.large-6.product-img
%img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}

View File

@@ -1,14 +1,29 @@
# frozen_string_literal: true
class ConfirmModalComponent < ModalComponent
def initialize(id:, confirm_actions: nil, reflex: nil, controller: nil, message: nil,
confirm_reflexes: nil)
# @param actions_alignment_class [String] possible classes: 'justify-space-around', 'justify-end'
def initialize(
id:,
reflex: nil,
controller: nil,
message: nil,
confirm_actions: nil,
confirm_reflexes: nil,
confirm_button_class: :primary,
confirm_button_text: I18n.t('js.admin.modals.confirm'),
cancel_button_text: I18n.t('js.admin.modals.cancel'),
actions_alignment_class: 'justify-space-around'
)
super(id:, close_button: true)
@confirm_actions = confirm_actions
@reflex = reflex
@confirm_reflexes = confirm_reflexes
@controller = controller
@message = message
@confirm_button_class = confirm_button_class
@confirm_button_text = confirm_button_text
@cancel_button_text = cancel_button_text
@actions_alignment_class = actions_alignment_class
end
private

View File

@@ -1,10 +1,10 @@
%div{ id: @id, "data-controller": "modal #{@controller}", "data-action": "keyup@document->modal#closeIfEscapeKey", "data-#{@controller}-reflex-value": @reflex }
.reveal-modal-bg.fade{ "data-modal-target": "background", "data-action": "click->modal#close" }
.reveal-modal.fade.tiny.help-modal{ "data-modal-target": "modal" }
.reveal-modal.fade.tiny.modal-component{ "data-modal-target": "modal" }
= content
= render @message if @message
.modal-actions
%input{ class: "button icon-plus #{close_button_class}", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->modal#close" }
%input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions, "data-reflex": @confirm_reflexes }
%div{ class: "modal-actions #{@actions_alignment_class}" }
%input{ class: "button icon-plus #{close_button_class}", type: 'button', value: @cancel_button_text, "data-action": "click->modal#close" }
%input{ id: 'modal-confirm-button', class: "button icon-plus #{@confirm_button_class}", type: 'button', value: @confirm_button_text, "data-action": @confirm_actions, "data-reflex": @confirm_reflexes }

View File

@@ -1,4 +0,0 @@
.modal-actions {
display: flex;
justify-content: space-around;
}

View File

@@ -1,6 +1,6 @@
%div{ id: @id, "data-controller": "help-modal", "data-action": "keyup@document->help-modal#closeIfEscapeKey" }
.reveal-modal-bg.fade{ "data-help-modal-target": "background", "data-action": "click->help-modal#close" }
.reveal-modal.fade.small.help-modal{ "data-help-modal-target": "modal" }
.reveal-modal.fade.small.modal-component{ "data-help-modal-target": "modal" }
= content
- if close_button?

View File

@@ -1,10 +0,0 @@
.help-modal {
visibility: visible;
position: fixed;
top: 3em;
}
/* prevent arrow on selected admin menu item appearing above modal */
body.modal-open #admin-menu li.selected a::after {
z-index: 0;
}

View File

@@ -1,9 +1,11 @@
# frozen_string_literal: true
class ModalComponent < ViewComponent::Base
def initialize(id:, close_button: true)
def initialize(id:, close_button: true, instant: false, modal_class: :small)
@id = id
@close_button = close_button
@instant = instant
@modal_class = modal_class
end
private

View File

@@ -0,0 +1,8 @@
%div{ id: @id, "data-controller": "modal", "data-action": "keyup@document->modal#closeIfEscapeKey", "data-modal-instant-value": @instant }
.reveal-modal-bg.fade{ "data-modal-target": "background", "data-action": "click->modal#close" }
.reveal-modal.fade.modal-component{ "data-modal-target": "modal", class: @modal_class }
= content
- if close_button?
.text-center
%input{ class: "button icon-plus #{close_button_class}", type: 'button', value: t('js.admin.modals.close'), "data-action": "click->modal#close" }

View File

@@ -0,0 +1,56 @@
// class name 'modal' is already taken by 'custom-alert' and 'custom-confirm'.
.modal-component {
visibility: visible;
position: fixed;
top: 3em;
min-height: auto; // reset from reveal-modal
&.in {
padding: 1.2rem;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin-bottom: 0.5em;
}
img {
// Ensure image fits in container
max-width: 100%;
height: auto;
}
}
/* prevent arrow on selected admin menu item appearing above modal */
body.modal-open #admin-menu li.selected a::after {
z-index: 0;
}
.modal-actions {
display: flex;
text-align: center; // Ensure text inside fullwidth buttons are centred on small screens
&.justify-space-around {
justify-content: space-around;
}
&.justify-end {
justify-content: flex-end;
input[type="button"] {
margin: 0 5px;
}
@media only screen and (max-width: 1024px) {
flex-direction: column;
justify-content: space-around;
input[type="button"] {
margin: 5px 0;
}
}
}
}

View File

@@ -0,0 +1,8 @@
= render ConfirmModalComponent.new(id: dom_id(@order, :ship), 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"}
= hidden_field_tag :id, @order.id
= label_tag do
= check_box_tag :send_shipment_email, "1", true
= t('spree.admin.orders.shipment.mark_as_shipped_label_message')

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class ShipOrderComponent < ViewComponent::Base
def initialize(order:)
@order = order
end
end

View File

@@ -0,0 +1,4 @@
.vertical-ellipsis-menu{ "data-controller": "vertical-ellipsis-menu--component" }
%i.fa.fa-ellipsis-v{ "data-action": "click->vertical-ellipsis-menu--component#toggle" }
.vertical-ellipsis-menu-content{ "data-vertical-ellipsis-menu--component-target": "content" }
= content

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
module VerticalEllipsisMenu
class Component < ViewComponent::Base
end
end

View File

@@ -1,16 +1,13 @@
.vertical-ellipsis-menu {
position: relative;
width: $btn-relaxed-height;
i.fa-ellipsis-v {
cursor: pointer;
display: block;
height: $btn-relaxed-height;
width: $btn-relaxed-height;
line-height: $btn-relaxed-height;
text-align: center;
border-radius: 3px;
background-color: white;
padding: 9px 14px;
}
.vertical-ellipsis-menu-content {
@@ -20,7 +17,7 @@
padding-top: 5px;
padding-bottom: 5px;
background-color: white;
@include defaultBoxShadow;
box-shadow: $box-shadow;
border-radius: 3px;
min-width: 80px;
display: none;
@@ -30,7 +27,7 @@
display: block;
}
.vertical-ellipsis-menu-content-item {
& > a {
display: block;
padding: 5px 10px;
cursor: pointer;

View File

@@ -38,7 +38,8 @@ module Admin
@enterprise_fee_set = EnterpriseFeesBulkUpdate.new(params)
if @enterprise_fee_set.save
redirect_to redirect_path, notice: I18n.t(:enterprise_fees_update_notice)
flash[:success] = I18n.t(:enterprise_fees_update_notice)
redirect_to redirect_path
else
redirect_to redirect_path,
flash: { error: @enterprise_fee_set.errors.full_messages.to_sentence }

View File

@@ -3,9 +3,8 @@
module Admin
class EnterpriseRolesController < Admin::ResourceController
def index
@enterprise_roles = EnterpriseRole.by_user_email
@users = Spree::User.order('spree_users.email')
@my_enterprises = @all_enterprises = Enterprise.by_name
@enterprise_roles, @users, @all_enterprises = Admin::EnterpriseRolesQuery.query
@my_enterprises = @all_enterprises
end
def create

View File

@@ -2,6 +2,13 @@
module Admin
class OidcSettingsController < Spree::Admin::BaseController
def index; end
def index
@account = spree_current_user.oidc_account
end
def destroy
spree_current_user.oidc_account&.destroy
redirect_to admin_oidc_settings_path
end
end
end

View File

@@ -48,7 +48,7 @@ module Admin
@order_cycle_form = OrderCycleForm.new(@order_cycle, order_cycle_params, spree_current_user)
if @order_cycle_form.save
flash[:notice] = I18n.t(:order_cycles_create_notice)
flash[:success] = t('.success')
render json: { success: true,
edit_path: main_app.admin_order_cycle_incoming_path(@order_cycle) }
else
@@ -66,7 +66,7 @@ module Admin
if @order_cycle_form.save
update_nil_subscription_line_items_price_estimate(@order_cycle)
respond_to do |format|
flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1'
flash[:success] = t('.success') if params[:reloading] == '1'
format.html { redirect_to_after_update_path }
format.json { render json: { success: true } }
end
@@ -118,7 +118,7 @@ module Admin
@order_cycle = OrderCycle.find params[:id]
@order_cycle.clone!
redirect_to main_app.admin_order_cycles_path,
notice: I18n.t(:order_cycles_clone_notice, name: @order_cycle.name)
flash: { success: t('.success', name: @order_cycle.name) }
end
# Send notifications to all producers who are part of the order cycle
@@ -126,7 +126,7 @@ module Admin
OrderCycleNotificationJob.perform_later params[:id].to_i
redirect_to main_app.admin_order_cycles_path,
notice: I18n.t(:order_cycles_email_to_producers_notice)
flash: { success: t('.success') }
end
protected

View File

@@ -21,16 +21,10 @@ module Admin
def show
@report = report_class.new(spree_current_user, params, render: render_data?)
@rendering_options = rendering_options # also stores user preferences
@background_reports = OpenFoodNetwork::FeatureToggle
.enabled?(:background_reports, spree_current_user)
if @background_reports && request.post?
return background(report_format)
end
if params[:report_format].present?
export_report
if render_data?
render_in_background
else
show_report
end
@@ -38,13 +32,8 @@ module Admin
private
def export_report
send_data @report.render_as(report_format), filename: report_filename
end
def show_report
assign_view_data
@table = @report.render_as(:html) if render_data?
render "show"
end
@@ -53,7 +42,6 @@ module Admin
@report_subtypes = report_subtypes
@report_subtype = report_subtype
@report_title = report_title
@rendering_options = rendering_options
@data = Reporting::FrontendData.new(spree_current_user)
variant_id_in = params[:variant_id_in]&.compact_blank
@@ -70,7 +58,7 @@ module Admin
request.post?
end
def background(format)
def render_in_background
cable_ready[ScopedChannel.for_id(params[:uuid])]
.inner_html(
selector: "#report-table",
@@ -80,11 +68,11 @@ module Admin
block: "start"
).broadcast
blob = ReportBlob.create_for_upload_later!(report_filename)
ReportJob.perform_later(
report_class:, user: spree_current_user, params:,
format:, blob:, channel: ScopedChannel.for_id(params[:uuid]),
format: report_format,
filename: report_filename,
channel: ScopedChannel.for_id(params[:uuid]),
)
head :no_content

View File

@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'open_food_network/permissions'
require 'order_management/subscriptions/proxy_order_syncer'
module Admin
class SchedulesController < Admin::ResourceController

View File

@@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'api/admin/enterprise_serializer'
module Api
module V0
class EnterpriseAttachmentController < Api::V0::BaseController

View File

@@ -23,6 +23,8 @@ module Api
OrderWorkflow.new(@order).advance_to_payment if @order.line_items.any?
@order.recreate_all_fees!
render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok
end

View File

@@ -2,7 +2,7 @@
require 'open_food_network/address_finder'
class SplitCheckoutController < ::BaseController
class CheckoutController < BaseController
layout 'darkswarm'
include OrderStockCheck
@@ -23,12 +23,16 @@ class SplitCheckoutController < ::BaseController
before_action :hide_ofn_navigation, only: [:edit, :update]
def edit
redirect_to_step_based_on_order unless params[:step]
check_step if params[:step]
if params[:step].blank?
redirect_to_step_based_on_order
else
update_order_state
check_step
end
return if available_shipping_methods.any?
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
flash[:error] = I18n.t('checkout.errors.no_shipping_methods_available')
end
def update
@@ -51,10 +55,10 @@ class SplitCheckoutController < ::BaseController
private
def render_error
flash.now[:error] ||= I18n.t('split_checkout.errors.saving_failed')
flash.now[:error] ||= I18n.t('checkout.errors.saving_failed')
render status: :unprocessable_entity, cable_ready: cable_car.
replace("#checkout", partial("split_checkout/checkout")).
replace("#checkout", partial("checkout/checkout")).
replace("#flashes", partial("shared/flashes", locals: { flashes: flash }))
end
@@ -94,13 +98,29 @@ class SplitCheckoutController < ::BaseController
def update_order
return if params[:confirm_order] || @order.errors.any?
# Checking if shipping method updated before @order get updated. We can't use this guard
# clause in recalculate_voucher as by then the @order.shipping method would be the new one
shipping_method_updated = @order.shipping_method&.id != params[:shipping_method_id].to_i
@order.select_shipping_method(params[:shipping_method_id])
@order.update(order_params)
# We need to update voucher to take into account:
# * when moving away from "details" step : potential change in shipping method fees
# * when moving away from "payment" step : payment fees
recalculate_voucher(shipping_method_updated) if details_step? || payment_step?
@order.update_totals_and_states
validate_current_step
end
def recalculate_voucher(shipping_method_updated)
return if @order.voucher_adjustments.empty?
return unless shipping_method_updated
VoucherAdjustmentsService.new(@order).update
end
def validate_current_step
Checkout::Validation.new(@order, params).call && @order.errors.empty?
end
@@ -114,4 +134,15 @@ class SplitCheckoutController < ::BaseController
def order_params
@order_params ||= Checkout::Params.new(@order, params, spree_current_user).call
end
# Update order state based on the step we are loading to avoid discrepancy between step and order
# state. We need to do this when moving back to a previous checkout step, the update action takes
# care of moving the order state forward.
def update_order_state
return @order.back_to_payment if @order.confirmation? && payment_step?
return unless @order.after_delivery_state? && details_step?
@order.back_to_address
end
end

View File

@@ -13,6 +13,10 @@ module CheckoutSteps
params[:step] == "payment"
end
def details_step?
params[:step] == "details"
end
def redirect_to_step_based_on_order
case @order.state
when "cart", "address", "delivery"
@@ -36,12 +40,16 @@ module CheckoutSteps
redirect_to_step_based_on_order
end
# Checkout step and allowed order state
# * step details : order state in cart, address or delivery
# * step payment : order state is payment
# * step summary : order state is confirmation
def check_step
case @order.state
when "cart", "address", "delivery"
redirect_to checkout_step_path(:details) unless params[:step] == "details"
redirect_to checkout_step_path(:details) unless details_step?
when "payment"
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
redirect_to checkout_step_path(:payment) if summary_step?
end
end
end

View File

@@ -2,7 +2,7 @@
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def openid_connect
spree_current_user.link_from_omniauth(request.env["omniauth.auth"])
OidcAccount.link(spree_current_user, request.env["omniauth.auth"])
redirect_to admin_oidc_settings_path
end

View File

@@ -9,6 +9,7 @@ module Spree
helper 'admin/injection'
helper 'admin/orders'
helper 'admin/enterprises'
helper 'admin/terms_of_service'
helper 'enterprise_fees'
helper 'angular_form'

View File

@@ -32,10 +32,13 @@ module Spree
if @object.save
flash[:success] = flash_message_for(@object, :successfully_created)
redirect_to spree.admin_product_images_url(params[:product_id], @url_filters)
redirect_to location_after_save
else
respond_with(@object)
end
rescue ActiveStorage::IntegrityError
@object.errors.add :attachment, :integrity_error
respond_with(@object)
end
def update
@@ -44,10 +47,13 @@ module Spree
if @object.update(permitted_resource_params)
flash[:success] = flash_message_for(@object, :successfully_updated)
redirect_to spree.admin_product_images_url(params[:product_id], @url_filters)
redirect_to location_after_save
else
respond_with(@object)
end
rescue ActiveStorage::IntegrityError
@object.errors.add :attachment, :integrity_error
respond_with(@object)
end
def destroy
@@ -58,7 +64,7 @@ module Spree
flash[:success] = flash_message_for(@object, :successfully_removed)
end
redirect_to spree.admin_product_images_url(params[:product_id], @url_filters)
redirect_to location_after_save
end
private
@@ -76,7 +82,7 @@ module Spree
end
def location_after_save
spree.admin_product_images_url(@product)
params[:return_url] || spree.admin_product_images_url(params[:product_id], @url_filters)
end
def load_data

View File

@@ -90,7 +90,8 @@ module Spree
end
def invoice
Spree::OrderMailer.invoice_email(@order.id).deliver_later
Spree::OrderMailer.invoice_email(@order.id,
current_user_id: spree_current_user.id ).deliver_later
flash[:success] = t('admin.orders.invoice_email_sent')
respond_with(@order) { |format|
@@ -99,11 +100,16 @@ module Spree
end
def print
if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
@order = @order.invoices.find(params[:invoice_id]).presenter
if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, spree_current_user)
@order = if params[:invoice_id].present?
@order.invoices.find(params[:invoice_id]).presenter
else
OrderInvoiceGenerator.new(@order).generate_or_update_latest_invoice
@order.invoices.first.presenter
end
end
render_with_wicked_pdf InvoiceRenderer.new.args(@order)
render_with_wicked_pdf InvoiceRenderer.new.args(@order, spree_current_user)
end
private

View File

@@ -128,10 +128,6 @@ module Spree
def load_providers
providers = Gateway.providers.sort_by(&:name)
unless Rails.env.development? || Rails.env.test?
providers.reject! { |provider| provider.name.include? "Bogus" }
end
unless show_stripe?
providers.reject! { |provider| stripe_provider?(provider) }
end
@@ -197,7 +193,9 @@ module Spree
def clear_preference_cache
@payment_method.calculator.preferences.each_key do |key|
Rails.cache.delete(@payment_method.calculator.preference_cache_key(key))
# Only persisted models have cache keys.
cache_key = @payment_method.calculator.preference_cache_key(key)
Rails.cache.delete(cache_key) if cache_key
end
end

View File

@@ -33,23 +33,15 @@ module Spree
return
end
if @order.completed?
authorize_stripe_sca_payment
@payment.process_offline!
flash[:success] = flash_message_for(@payment, :successfully_created)
OrderWorkflow.new(@order).complete! unless @order.completed?
redirect_to spree.admin_order_payments_path(@order)
else
OrderWorkflow.new(@order).complete!
authorize_stripe_sca_payment
@payment.process_offline!
flash[:success] = Spree.t(:new_order_completed)
redirect_to spree.edit_admin_order_url(@order)
end
authorize_stripe_sca_payment
@payment.process_offline!
flash[:success] = flash_message_for(@payment, :successfully_created)
redirect_to spree.admin_order_payments_path(@order)
rescue Spree::Core::GatewayError => e
flash[:error] = e.message.to_s
redirect_to spree.new_admin_order_payment_path(@order)
redirect_to spree.admin_order_payments_path(@order)
end
end
@@ -67,6 +59,8 @@ module Spree
flash[:error] = t(:cannot_perform_operation)
end
rescue StandardError => e
logger.error e.message
Bugsnag.notify(e)
flash[:error] = e.message
ensure
redirect_to request.referer
@@ -140,7 +134,8 @@ module Spree
#
# Otherwise redirect user to that step
def can_transition_to_payment
return if @order.payment? || @order.complete? || @order.canceled? || @order.resumed?
return if @order.confirmation? || @order.payment? ||
@order.complete? || @order.canceled? || @order.resumed?
flash[:notice] = Spree.t(:fill_in_customer_info)
redirect_to spree.edit_admin_order_customer_url(@order)
@@ -184,7 +179,8 @@ module Spree
end
def allowed_events
%w{capture void_transaction credit refund resend_authorization_email}
%w{capture void_transaction credit refund resend_authorization_email
capture_and_complete_order}
end
end
end

View File

@@ -82,14 +82,10 @@ module Spree
def clone
@new = @product.duplicate
raise "Clone failed" unless @new.save
flash[:success] = if @new.save
Spree.t('notice_messages.product_cloned')
else
Spree.t('notice_messages.product_not_cloned')
end
redirect_to spree.edit_admin_product_url(@new)
flash[:success] = t('.success')
redirect_to spree.admin_products_url
end
def group_buy_options

View File

@@ -117,8 +117,8 @@ module Spree
def taxon_params
params.require(:taxon).permit(
:name, :parent_id, :position, :icon, :description, :permalink,
:taxonomy_id, :meta_description, :meta_keywords, :meta_title
:name, :parent_id, :position, :icon, :description, :permalink, :taxonomy_id,
:meta_description, :meta_keywords, :meta_title, :dfc_id
)
end
end

View File

@@ -33,8 +33,8 @@ module Spree
@user.spree_roles = roles.compact_blank.collect{ |r| Spree::Role.find(r) }
end
flash.now[:success] = Spree.t(:created_successfully)
render :edit
flash[:success] = Spree.t(:created_successfully)
redirect_to edit_admin_user_path(@user)
else
render :new
end
@@ -50,9 +50,11 @@ module Spree
@user.spree_roles = roles.compact_blank.collect{ |r| Spree::Role.find(r) }
end
flash.now[:success] = update_message
flash[:success] = update_message
redirect_to edit_admin_user_path(@user)
else
render :edit
end
render :edit
end
protected

View File

@@ -50,9 +50,8 @@ module Spree
flash[:success] = flash_message_for(@object, :successfully_updated)
redirect_to spree.admin_product_variants_url(params[:product_id], @url_filters)
else
redirect_to spree.edit_admin_product_variant_url(params[:product_id],
@object,
@url_filters)
load_data
render :edit
end
end

View File

@@ -8,6 +8,7 @@ module Spree
layout 'darkswarm'
invisible_captcha only: [:create], on_timestamp_spam: :render_alert_timestamp_error_message
skip_before_action :set_current_order, only: :show
prepend_before_action :load_object, only: [:show, :edit, :update]
prepend_before_action :authorize_actions, only: :new
@@ -101,5 +102,16 @@ module Spree
def user_params
::PermittedAttributes::User.new(params).call
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
})
)
end
end
end

View File

@@ -32,21 +32,21 @@ class VoucherAdjustmentsController < BaseController
def add_voucher
if voucher_params[:voucher_code].blank?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.voucher_not_found'))
@order.errors.add(:voucher_code, I18n.t('checkout.errors.voucher_not_found'))
return false
end
voucher = Voucher.find_by(code: voucher_params[:voucher_code], enterprise: @order.distributor)
if voucher.nil?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.voucher_not_found'))
@order.errors.add(:voucher_code, I18n.t('checkout.errors.voucher_not_found'))
return false
end
adjustment = voucher.create_adjustment(voucher.code, @order)
unless adjustment.persisted?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.add_voucher_error'))
@order.errors.add(:voucher_code, I18n.t('checkout.errors.add_voucher_error'))
adjustment.errors.each { |error| @order.errors.import(error) }
return false
end
@@ -62,7 +62,7 @@ class VoucherAdjustmentsController < BaseController
def update_payment_section
render cable_ready: cable_car.replace(
selector: "#checkout-payment-methods",
html: render_to_string(partial: "split_checkout/payment", locals: { step: "payment" })
html: render_to_string(partial: "checkout/payment", locals: { step: "payment" })
)
end
@@ -74,7 +74,7 @@ class VoucherAdjustmentsController < BaseController
replace(
"#voucher-section",
partial(
"split_checkout/voucher_section",
"checkout/voucher_section",
locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first }
)
)

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
class WebhookEndpointsController < ::BaseController
class WebhookEndpointsController < BaseController
before_action :load_resource, only: :destroy
def create

View File

@@ -21,15 +21,29 @@ module Admin
show_payment_methods = can?(:manage_payment_methods, enterprise) && is_shop
show_enterprise_fees = can?(:manage_enterprise_fees,
enterprise) && (is_shop || enterprise.is_primary_producer)
show_connected_apps = can?(:manage_connected_apps, enterprise) &&
feature?(:connected_apps, spree_current_user, enterprise)
build_enterprise_side_menu_items(is_shop, show_properties, show_shipping_methods,
show_payment_methods, show_enterprise_fees)
build_enterprise_side_menu_items(
is_shop:,
show_properties:,
show_shipping_methods:,
show_payment_methods:,
show_enterprise_fees:,
show_connected_apps:,
)
end
private
def build_enterprise_side_menu_items(is_shop, show_properties, show_shipping_methods,
show_payment_methods, show_enterprise_fees)
def build_enterprise_side_menu_items(
is_shop:,
show_properties:,
show_shipping_methods:,
show_payment_methods:,
show_enterprise_fees:,
show_connected_apps:
)
[
{ name: 'primary_details', icon_class: "icon-home", show: true, selected: 'selected' },
{ name: 'address', icon_class: "icon-map-marker", show: true },
@@ -50,6 +64,7 @@ module Admin
{ name: 'shop_preferences', icon_class: "icon-shopping-cart", show: is_shop },
{ name: 'users', icon_class: "icon-user", show: true },
{ name: 'white_label', icon_class: "icon-leaf", show: true },
{ name: 'connected_apps', icon_class: "icon-puzzle-piece", show: show_connected_apps },
]
end
end

View File

@@ -27,13 +27,6 @@ module Admin
Api::Admin::EnterpriseRelationshipSerializer
end
def admin_inject_enterprise_roles(enterprise_roles)
admin_inject_json_ams_array "ofn.admin",
"enterpriseRoles",
enterprise_roles,
Api::Admin::EnterpriseRoleSerializer
end
def admin_inject_payment_methods(payment_methods)
admin_inject_json_ams_array "admin.paymentMethods",
"paymentMethods",
@@ -117,15 +110,6 @@ module Admin
Api::CurrencyConfigSerializer
end
def admin_inject_enterprise_permissions(enterprise)
permissions =
{ can_manage_shipping_methods: can?(:manage_shipping_methods, enterprise),
can_manage_payment_methods: can?(:manage_payment_methods, enterprise),
can_manage_enterprise_fees: can?(:manage_enterprise_fees, enterprise) }
admin_inject_json "admin.enterprises", "enterprisePermissions", permissions
end
def admin_inject_hub_permissions(hub_permissions)
render partial: "admin/json/injection_ams", locals: { ngModule: "admin.variantOverrides",
name: "hubPermissions",
@@ -146,13 +130,6 @@ module Admin
Api::Admin::TaxonSerializer
end
def admin_inject_users(users)
admin_inject_json_ams_array "ofn.admin",
"users",
users,
Api::Admin::UserSerializer
end
def admin_inject_variant_overrides(variant_overrides)
admin_inject_json_ams_array "admin.variantOverrides",
"variantOverrides",

View File

@@ -2,12 +2,30 @@
module Admin
module OrdersHelper
AdjustmentData = Struct.new(:label, :amount)
# Adjustments to display under "Order adjustments".
#
# We exclude shipping method adjustments because they are displayed in a
# separate table together with the order line items.
def order_adjustments_for_display(order)
order.adjustments + order.all_adjustments.payment_fee.eligible
order.adjustments +
voucher_included_tax_representations(order) +
order.all_adjustments.payment_fee.eligible
end
def voucher_included_tax_representations(order)
return [] unless VoucherAdjustmentsService.new(order).voucher_included_tax.negative?
adjustment = order.voucher_adjustments.first
[
AdjustmentData.new(
I18n.t("admin.orders.edit.voucher_tax_included_in_price",
label: adjustment.label),
adjustment.included_tax
)
]
end
end
end

View File

@@ -0,0 +1,25 @@
# frozen_string_literal: true
module Admin
module TermsOfServiceHelper
def tos_need_accepting?
return false unless spree_user_signed_in?
return false if Spree::Config.enterprises_require_tos == false
return false if TermsOfServiceFile.current.nil?
!accepted_tos?
end
private
def accepted_tos?
file_uploaded_at = TermsOfServiceFile.updated_at
current_spree_user.terms_of_service_accepted_at.present? &&
current_spree_user.terms_of_service_accepted_at > file_uploaded_at &&
current_spree_user.terms_of_service_accepted_at < DateTime.now
end
end
end

View File

@@ -9,7 +9,7 @@ module AngularFormHelper
text, value = option_text_and_value(element).map(&:to_s)
%(<option value="#{ERB::Util.html_escape(value)}"\
#{html_attributes}>#{ERB::Util.html_escape(text)}</option>)
end.join("\n").html_safe
end.join("\n").html_safe # rubocop:disable Rails/OutputSafety
end
def ng_options_from_collection_for_select(collection, value_method, text_method, angular_field)

View File

@@ -10,7 +10,7 @@ module ApplicationHelper
return "" unless obj && obj.errors[method].present?
errors = obj.errors[method].map { |err| h(err) }.join('<br />').html_safe
errors = obj.errors[method].map { |err| h(err) }.join('<br />').html_safe # rubocop:disable Rails/OutputSafety
if options[:standalone]
content_tag(
@@ -36,7 +36,7 @@ module ApplicationHelper
hreflang: locale.to_s.gsub("_", "-").downcase,
href: "#{request.protocol}#{request.host_with_port}/locales/#{locale}"
)
end.join("\n").html_safe
end.join("\n").html_safe # rubocop:disable Rails/OutputSafety
end
def ng_form_for(name, *args, &)

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
class BulkFormBuilder < ActionView::Helpers::FormBuilder
def text_field(field, **opts)
# Mark field if it is changed (unsaved)
changed_method = "#{field}_changed?"
if object.respond_to?(changed_method) && object.public_send(changed_method)
opts[:class] = "#{opts[:class]} changed".strip
end
super(field, **opts)
end
end

View File

@@ -53,7 +53,9 @@ module CheckoutHelper
end
def display_checkout_tax_total(order)
Spree::Money.new order.total_tax, currency: order.currency
total_tax = order.total_tax + VoucherAdjustmentsService.new(order).voucher_included_tax
Spree::Money.new(total_tax, currency: order.currency)
end
def display_checkout_taxes_hash(order)
@@ -146,4 +148,10 @@ module CheckoutHelper
]
end
end
# Set the Page title of checkout process as step based like
# Checkout Details, Checkout Payment and Checkout Summary
def checkout_page_title
t("checkout_#{checkout_step}_title")
end
end

View File

@@ -5,7 +5,9 @@ module ReportsHelper
order_cycles.map do |oc|
orders_open_at = oc.orders_open_at&.to_fs(:short) || 'NA'
orders_close_at = oc.orders_close_at&.to_fs(:short) || 'NA'
# rubocop:disable Rails/OutputSafety
["#{oc.name} &nbsp; (#{orders_open_at} - #{orders_close_at})".html_safe, oc.id]
# rubocop:enable Rails/OutputSafety
end
end

View File

@@ -20,6 +20,6 @@ module SharedHelper
end
def current_shop_products_path
"#{main_app.enterprise_shop_path(current_distributor)}#/shop"
"#{main_app.enterprise_shop_path(current_distributor)}#/shop_panel"
end
end

View File

@@ -22,7 +22,7 @@ module ShopHelper
{ name: 'home', title: t(:shopping_tabs_home), show: show_home_tab?,
default: show_home_tab? },
{ name: 'shop', title: t(:shopping_tabs_shop), show: !require_customer?,
default: !show_home_tab? },
default: !show_home_tab?, shop: true },
{ name: 'about', title: t(:shopping_tabs_about), show: true },
{ name: 'producers', title: t(:shopping_tabs_producers), show: true },
{ name: 'contact', title: t(:shopping_tabs_contact), show: true },
@@ -45,7 +45,7 @@ module ShopHelper
end
def shopfront_closed_message?(order_cycles)
no_open_order_cycles?(order_cycles) && \
no_open_order_cycles?(order_cycles) &&
current_distributor.preferred_shopfront_closed_message.present?
end

View File

@@ -6,9 +6,6 @@ module Spree
def field_container(model, method, options = {}, &)
css_classes = options[:class].to_a
css_classes << 'field'
if error_message_on(model, method).present?
css_classes << 'withError'
end
content_tag(:div,
capture(&),
class: css_classes.join(' '),
@@ -20,7 +17,9 @@ module Spree
obj = object.respond_to?(:errors) ? object : instance_variable_get("@#{object}")
if obj && obj.errors[method].present?
# rubocop:disable Rails/OutputSafety
errors = obj.errors[method].map { |err| h(err) }.join('<br />').html_safe
# rubocop:enable Rails/OutputSafety
content_tag(:span, errors, class: 'formError')
else
''
@@ -113,12 +112,12 @@ module Spree
object.preferences.keys.map { |key|
preference_label = form.label("preferred_#{key}",
Spree.t(key.to_s.gsub("_from_list", "")) + ": ").html_safe
Spree.t(key.to_s.gsub("_from_list", "")) + ": ")
preference_field = preference_field_for(
form,
"preferred_#{key}",
{ type: object.preference_type(key) }, object
).html_safe
)
{ label: preference_label, field: preference_field }
}
end

View File

@@ -4,7 +4,10 @@ module Spree
module Admin
module GeneralSettingsHelper
def all_units
["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
[
WeightsAndMeasures::UNITS['weight'].values.pluck('name'),
WeightsAndMeasures::UNITS['volume'].values.pluck('name')
].flatten.uniq
end
end
end

View File

@@ -98,7 +98,9 @@ module Spree
options[:class] = (options[:class].to_s + " icon_link with-tip #{icon_name}").strip
options[:class] += ' no-text' if options[:no_text]
options[:title] = text if options[:no_text]
# rubocop:disable Rails/OutputSafety
text = options[:no_text] ? '' : raw("<span class='text'>#{text}</span>")
# rubocop:enable Rails/OutputSafety
options.delete(:no_text)
link_to(text, url, options)
end
@@ -131,14 +133,14 @@ module Spree
if html_options[:icon]
html_options[:class] += " #{html_options[:icon]}"
end
link_to(text_for_button_link(text, html_options), url, html_options)
link_to(text, url, html_options)
end
end
def text_for_button_link(text, _html_options)
s = ''
s << text
raw(s)
raw(s) # rubocop:disable Rails/OutputSafety
end
def configurations_sidebar_menu_item(link_text, url, options = {})

View File

@@ -7,7 +7,18 @@ module Spree
links = []
links << cancel_event_link if @order.can_cancel?
links << resume_event_link if @order.can_resume?
links.join('&nbsp;').html_safe
links.join('&nbsp;').html_safe # rubocop:disable Rails/OutputSafety
end
def generate_invoice_button(order)
if order.distributor.can_invoice?
button_link_to t(:create_or_update_invoice), generate_admin_order_invoices_path(@order),
data: { method: 'post' }, icon: 'icon-plus'
else
button_link_to t(:create_or_update_invoice), "#", data: {
confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name)
}, icon: 'icon-plus'
end
end
def line_item_shipment_price(line_item, quantity)
@@ -31,7 +42,6 @@ module Spree
end
def invoice_links
return [] if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
return [] unless Spree::Config[:enable_invoices?]
[send_invoice_link, print_invoice_link]
@@ -96,10 +106,8 @@ module Spree
def ship_order_link
{ name: t(:ship_order),
url: spree.fire_admin_order_path(@order, e: 'ship'),
method: 'put',
icon: 'icon-truck',
confirm: t(:are_you_sure) }
url: '#',
icon: 'icon-truck' }
end
def cancel_order_link

View File

@@ -31,7 +31,7 @@ module Spree
out = ''
out << fields.hidden_field(:_destroy) unless fields.object.new_record?
out << (link_to icon('icon-remove'), "#", class: 'remove')
out.html_safe
out.html_safe # rubocop:disable Rails/OutputSafety
end
end
end

View File

@@ -36,8 +36,7 @@ module Spree
end
def pretty_time(time)
[I18n.l(time.to_date, format: :long),
time.strftime("%l:%M %p")].join(" ")
I18n.l(time, format: :long)
end
end
end

View File

@@ -14,9 +14,11 @@ module TaxHelper
def display_line_items_taxes(line_item, display_zero: true)
if line_item.included_tax.positive?
Spree::Money.new(line_item.included_tax, currency: line_item.currency)
tax = line_item.included_tax + enterprise_fee_adjustments(line_item).total_included_tax
Spree::Money.new(tax, currency: line_item.currency)
elsif line_item.added_tax.positive?
Spree::Money.new(line_item.added_tax, currency: line_item.currency)
tax = line_item.added_tax + enterprise_fee_adjustments(line_item).total_additional_tax
Spree::Money.new(tax, currency: line_item.currency)
elsif display_zero
Spree::Money.new(0.00, currency: line_item.currency)
end
@@ -26,4 +28,10 @@ module TaxHelper
total = taxable.amount + taxable.additional_tax_total
Spree::Money.new(total, currency: taxable.currency)
end
private
def enterprise_fee_adjustments(line_item)
EnterpriseFeeAdjustments.new(line_item.enterprise_fee_adjustments)
end
end

View File

@@ -2,8 +2,8 @@
module TermsAndConditionsHelper
def link_to_platform_terms
link_to(t("terms_of_service"), TermsOfServiceFile.current_url, target: "_blank",
rel: "noopener")
content_tag(:a, t("terms_of_service"), href: TermsOfServiceFile.current_url, target: "_blank",
rel: "noopener")
end
def any_terms_required?(distributor)

View File

@@ -12,6 +12,6 @@ class ApplicationJob < ActiveJob::Base
def enable_active_storage_urls
ActiveStorage::Current.url_options ||=
Rails.application.config.action_controller.default_url_options
Rails.application.routes.default_url_options
end
end

View File

@@ -3,10 +3,13 @@
class BulkInvoiceJob < ApplicationJob
include CableReady::Broadcaster
delegate :render, to: ActionController::Base
attr_reader :options
def perform(order_ids, filepath, options = {})
@options = options
orders = sorted_orders(order_ids)
orders.filter!(&:invoiceable?) if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
orders.filter!(&:invoiceable?) if OpenFoodNetwork::FeatureToggle.enabled?(:invoices,
current_user)
orders.each(&method(:generate_invoice))
ensure_directory_exists filepath
@@ -29,13 +32,13 @@ class BulkInvoiceJob < ApplicationJob
end
def generate_invoice(order)
renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, current_user)
OrderInvoiceGenerator.new(order).generate_or_update_latest_invoice
order.invoices.first.presenter
else
order
end
invoice = renderer.render_to_string(renderer_data)
invoice = renderer.render_to_string(renderer_data, current_user)
pdf << CombinePDF.parse(invoice)
end
@@ -58,4 +61,10 @@ class BulkInvoiceJob < ApplicationJob
def pdf
@pdf ||= CombinePDF.new
end
def current_user
return unless options[:current_user_id]
@current_user ||= Spree::User.find(options[:current_user_id])
end
end

View File

@@ -0,0 +1,28 @@
# frozen_string_literal: true
class ConnectAppJob < ApplicationJob
include CableReady::Broadcaster
def perform(app, token, channel: nil)
url = "https://n8n.openfoodnetwork.org.uk/webhook/regen/connect-enterprise"
event = "connect-app"
enterprise = app.enterprise
payload = {
'@id': DfcBuilder.urls.enterprise_url(enterprise.id),
access_token: token,
}
response = WebhookDeliveryJob.perform_now(url, event, payload)
app.update!(data: JSON.parse(response))
return unless channel
selector = "#edit_enterprise_#{enterprise.id} #connected-app-discover-regen"
html = ApplicationController.render(
partial: "admin/enterprises/form/connected_apps",
locals: { enterprise: },
)
cable_ready[channel].morph(selector:, html:).broadcast
end
end

View File

@@ -9,18 +9,26 @@ class ReportJob < ApplicationJob
NOTIFICATION_TIME = 5.seconds
def perform(report_class:, user:, params:, format:, blob:, channel: nil)
def perform(report_class:, user:, params:, format:, filename:, channel: nil)
start_time = Time.zone.now
report = report_class.new(user, params, render: true)
result = report.render_as(format)
blob.store(result)
blob = ReportBlob.create!(filename, result)
execution_time = Time.zone.now - start_time
email_result(user, blob) if execution_time > NOTIFICATION_TIME
broadcast_result(channel, format, blob) if channel
rescue StandardError => e
Bugsnag.notify(e) do |payload|
payload.add_metadata :report, {
report_class:, user:, params:, format:
}
end
broadcast_error(channel)
end
def email_result(user, blob)
@@ -37,6 +45,13 @@ class ReportJob < ApplicationJob
).broadcast
end
def broadcast_error(channel)
cable_ready[channel].inner_html(
selector: "#report-table",
html: I18n.t("report_job.report_failed")
).broadcast
end
def actioncable_content(format, blob)
return blob.result if format.to_sym == :html

View File

@@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'order_management/subscriptions/summarizer'
# Confirms orders of unconfirmed proxy orders in recently closed Order Cycles
class SubscriptionConfirmJob < ApplicationJob
def perform

View File

@@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'order_management/subscriptions/summarizer'
class SubscriptionPlacementJob < ApplicationJob
def perform
proxy_orders.each do |proxy_order|

View File

@@ -46,5 +46,7 @@ class WebhookDeliveryJob < ApplicationJob
# Raise a failed request error and let job runner handle retrying.
# In theory, only 5xx errors should be retried, but who knows.
raise FailedWebhookRequestError, response.status.to_s unless response.success?
response.body
end
end

View File

@@ -46,16 +46,19 @@ module Spree
end
end
def invoice_email(order_or_order_id)
def invoice_email(order_or_order_id, options = {})
@order = find_order(order_or_order_id)
renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices)
current_user = if options[:current_user_id].present?
find_user(options[:current_user_id])
end
renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, current_user)
OrderInvoiceGenerator.new(@order).generate_or_update_latest_invoice
@order.invoices.first.presenter
else
@order
end
pdf = InvoiceRenderer.new.render_to_string(renderer_data)
pdf = InvoiceRenderer.new.render_to_string(renderer_data, current_user)
attach_file("invoice-#{@order.number}.pdf", pdf)
I18n.with_locale valid_locale(@order.user) do
@@ -80,5 +83,9 @@ module Spree
def attach_file(filename, file)
attachments[filename] = file if file.present?
end
def find_user(current_user_id)
Spree::User.find(current_user_id)
end
end
end

View File

@@ -12,7 +12,7 @@ module Spree
private
def base_subject
default_subject = !@delivery ? t('.picked_up_subject') : default_i18n_subject
default_subject = @delivery ? default_i18n_subject : t('.picked_up_subject')
"#{@shipment.order.distributor.name} #{default_subject} ##{@shipment.order.number}"
end
end

View File

@@ -1,7 +1,6 @@
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
include DelegateBelongsTo
include Spree::Core::Permalinks
include Spree::Preferences::Preferable
include Searchable

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
# An enterprise can be connected to other apps.
#
# Here we store keys and links to access the app.
class ConnectedApp < ApplicationRecord
belongs_to :enterprise
scope :connecting, -> { where(data: nil) }
scope :ready, -> { where.not(data: nil) }
end

View File

@@ -27,21 +27,24 @@ class ContentConfiguration < Spree::Preferences::Configuration
default: I18n.t(:content_configuration_pricing_table)
preference :producer_signup_case_studies_html, :text,
default: I18n.t(:content_configuration_case_studies)
preference :producer_signup_detail_html, :text, default: I18n.t(:content_configuration_detail)
preference :producer_signup_detail_html, :text,
default: I18n.t(:content_configuration_detail)
# Hubs sign-up page
preference :hub_signup_pricing_table_html, :text,
default: I18n.t(:content_configuration_pricing_table)
preference :hub_signup_case_studies_html, :text,
default: I18n.t(:content_configuration_case_studies)
preference :hub_signup_detail_html, :text, default: I18n.t(:content_configuration_detail)
preference :hub_signup_detail_html, :text,
default: I18n.t(:content_configuration_detail)
# Groups sign-up page
preference :group_signup_pricing_table_html, :text,
default: I18n.t(:content_configuration_pricing_table)
preference :group_signup_case_studies_html, :text,
default: I18n.t(:content_configuration_case_studies)
preference :group_signup_detail_html, :text, default: I18n.t(:content_configuration_detail)
preference :group_signup_detail_html, :text,
default: I18n.t(:content_configuration_detail)
# Main URLs
preference :menu_1, :boolean, default: true

View File

@@ -16,7 +16,7 @@ class Customer < ApplicationRecord
belongs_to :enterprise
belongs_to :user, class_name: "Spree::User", optional: true
has_many :orders, class_name: "Spree::Order"
has_many :orders, class_name: "Spree::Order", dependent: :nullify
before_validation :downcase_email
before_validation :empty_code
before_create :associate_user
@@ -70,6 +70,5 @@ class Customer < ApplicationRecord
throw :abort
end
Subscription.where(customer_id: id).destroy_all
orders.update_all(customer_id: nil)
end
end

View File

@@ -37,7 +37,7 @@ class Enterprise < ApplicationRecord
dependent: :destroy
has_and_belongs_to_many :groups, join_table: 'enterprise_groups_enterprises',
class_name: 'EnterpriseGroup'
has_many :producer_properties, foreign_key: 'producer_id'
has_many :producer_properties, foreign_key: 'producer_id', dependent: :destroy
has_many :properties, through: :producer_properties
has_many :supplied_products, class_name: 'Spree::Product',
foreign_key: 'supplier_id',
@@ -57,11 +57,12 @@ class Enterprise < ApplicationRecord
inverse_of: :distributor, foreign_key: :distributor_id
has_many :payment_methods, through: :distributor_payment_methods
has_many :shipping_methods, through: :distributor_shipping_methods
has_many :customers
has_many :inventory_items
has_many :tag_rules
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
has_many :connected_apps, dependent: :destroy
has_one :custom_tab, dependent: :destroy
delegate :latitude, :longitude, :city, :state_name, to: :address

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
# EnterpriseFeeAdjustments represent a collection of enterprise fee adjustments
#
class EnterpriseFeeAdjustments
def initialize(adjustments)
@adjustments = adjustments
end
def total_additional_tax
@adjustments.sum { |enterprise_fee| enterprise_fee.additional_tax_total.to_f }
end
def total_included_tax
@adjustments.sum { |enterprise_fee| enterprise_fee.included_tax_total.to_f }
end
end

View File

@@ -90,6 +90,7 @@ class Exchange < ApplicationRecord
exchange = dup
exchange.order_cycle = new_order_cycle
exchange.enterprise_fee_ids = enterprise_fee_ids
exchange.tag_list = tag_list
exchange.save!
clone_all_exchange_variants(exchange.id)
exchange

View File

@@ -26,4 +26,12 @@ class Invoice < ApplicationRecord
def cancel_previous_invoices
order.invoices.where.not(id:).update_all(cancelled: true)
end
def display_number
"#{order.distributor.id}-#{number}"
end
def previous_invoice
order.invoices.where("id < ?", id).first
end
end

View File

@@ -2,10 +2,11 @@
class Invoice
class DataPresenter
include ::ActionView::Helpers::NumberHelper
attr_reader :invoice
delegate :data, to: :invoice
delegate :number, :date, to: :invoice, prefix: true
delegate :display_number, :data, :previous_invoice, to: :invoice
delegate :date, to: :invoice, prefix: true
FINALIZED_NON_SUCCESSFUL_STATES = %w(canceled returned).freeze
@@ -49,30 +50,59 @@ class Invoice
Time.zone.parse(data[:completed_at])
end
def checkout_adjustments(exclude: [], reject_zero_amount: true)
def checkout_adjustments(exclude: [])
adjustments = all_eligible_adjustments
.reject { |a| a.originator.type == 'Spree::TaxRate' }
.map(&:clone)
adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' }
adjustments.reject! { |a| a.amount == 0 }
[:line_item, :shipment].each do |type|
next unless exclude.include? type
if exclude.include? :line_item
adjustments.reject! { |a|
a.adjustable_type == 'Spree::LineItem'
a.adjustable_type == "Spree::#{type.to_s.classify}"
}
end
if reject_zero_amount
adjustments.reject! { |a| a.amount == 0 }
end
adjustments
end
def display_checkout_taxes_hash
totals = OrderTaxAdjustmentsFetcher.new(nil).totals(all_tax_adjustments)
def shipment_adjustment
all_eligible_adjustments.find { |a| a.originator.type == 'Spree::ShippingMethod' }
end
totals.map do |tax_rate, tax_amount|
# contains limited information about the shipment
def shipment
shipment_adjustment&.adjustable || null_shipment
end
def null_shipment
Struct.new(
:amount,
:included_tax_total,
:additional_tax_total,
).new(0, 0, 0)
end
def display_shipment_amount_without_taxes
Spree::Money.new(shipment.amount - shipment.included_tax_total, currency:)
end
def display_shipment_amount_with_taxes
Spree::Money.new(shipment.amount + shipment.additional_tax_total, currency:)
end
def display_shipment_tax_rates
all_eligible_adjustments.select { |a|
a.originator.type == 'Spree::TaxRate' && a.adjustable_type == 'Spree::Shipment'
}.map(&:originator)
.map { |tr| number_to_percentage(tr.amount * 100, precision: 1) }.join(", ")
end
def display_checkout_taxes_hash
tax_adjustment_totals.map do |tax_rate_id, tax_amount|
tax_rate = tax_rate_by_id[tax_rate_id]
{
amount: Spree::Money.new(tax_amount, currency: order.currency),
amount: Spree::Money.new(tax_amount, currency:),
percentage: number_to_percentage(tax_rate.amount * 100, precision: 1),
rate_amount: tax_rate.amount,
}
@@ -83,8 +113,24 @@ class Invoice
I18n.l(invoice_date.to_date, format: :long)
end
def display_tax_adjustment_total
Spree::Money.new(all_tax_adjustments.map(&:amount).sum, currency:)
end
def tax_adjustment_totals
all_tax_adjustments.each_with_object(Hash.new(0)) do |adjustment, totals|
totals[adjustment.originator.id] += adjustment.amount
end
end
def tax_rate_by_id
all_tax_adjustments.each_with_object({}) do |adjustment, tax_rates|
tax_rates[adjustment.originator.id] = adjustment.originator
end
end
def all_tax_adjustments
all_eligible_adjustments.select { |a| a.originator_type == 'Spree::TaxRate' }
all_eligible_adjustments.select { |a| a.originator.type == 'Spree::TaxRate' }
end
def paid?

View File

@@ -0,0 +1,20 @@
# frozen_string_literal: false
class Invoice
class DataPresenter
class Adjustable < Invoice::DataPresenter::Base
attributes :id, :type, :currency, :included_tax_total, :additional_tax_total, :amount
def display_taxes(display_zero: false)
if included_tax_total.positive?
amount = Spree::Money.new(included_tax_total, currency:)
I18n.t(:tax_amount_included, amount:)
elsif additional_tax_total.positive?
Spree::Money.new(additional_tax_total, currency:)
elsif display_zero
Spree::Money.new(0.00, currency:)
end
end
end
end
end

View File

@@ -4,13 +4,20 @@ class Invoice
class DataPresenter
class Adjustment < Invoice::DataPresenter::Base
attributes :additional_tax_total, :adjustable_type, :amount, :currency, :included_tax_total,
:label, :originator_type
:label
array_attribute :tax_rates, class_name: 'TaxRate'
attributes_with_presenter :originator, class_name: 'AdjustmentOriginator'
attributes_with_presenter :adjustable
invoice_generation_attributes :additional_tax_total, :adjustable_type, :amount,
:included_tax_total
invoice_update_attributes :label
def display_amount
Spree::Money.new(amount, currency:)
def display_amount_with_taxes
Spree::Money.new(amount + additional_tax_total, currency:)
end
def display_amount_without_taxes
Spree::Money.new(amount - included_tax_total, currency:)
end
def display_taxes(display_zero: false)
@@ -23,6 +30,10 @@ class Invoice
Spree::Money.new(0.00, currency:)
end
end
def display_adjustment_tax_rates
tax_rates.map { |tr| number_to_percentage(tr.amount * 100, precision: 1) }.join(", ")
end
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: false
class Invoice
class DataPresenter
class AdjustmentOriginator < Invoice::DataPresenter::Base
attributes :id, :type, :amount
end
end
end

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