Compare commits

...

479 Commits

Author SHA1 Message Date
Jean-Baptiste Bellet
36aabbb5b6 Update all locales with the latest Transifex translations 2022-08-11 18:14:48 +02:00
Filipe
82f38c9aea Merge pull request #9456 from openfoodfoundation/dependabot/bundler/activemerchant-1.126.0
Bump activemerchant from 1.123.0 to 1.126.0
2022-08-11 17:10:31 +01:00
Filipe
689720b749 Merge pull request #9437 from jibees/8897-preselect-default-card-and-do-not-allow-to-charge-if-no-card-is-marked-as-default
User account, Credit cards: Do not allow to check "Allow charges" if no credit cards marked as default
2022-08-11 16:34:42 +01:00
Filipe
50600b9d00 Merge pull request #9462 from openfoodfoundation/dependabot/bundler/pagy-5.10.1
Bump pagy from 5.1.2 to 5.10.1
2022-08-11 16:20:03 +01:00
Rachel Arnould
abdef21381 Update FUNDING.yml 2022-08-11 14:45:42 +02:00
jibees
4a3bd510a7 Merge pull request #9544 from jibees/upgrade-yarn-
Upgrade `yarn.lock` since it seemed to be derived
2022-08-10 09:06:16 +02:00
jibees
bb85473eba Merge pull request #9550 from openfoodfoundation/dependabot/bundler/webmock-3.17.1
Bump webmock from 3.17.0 to 3.17.1
2022-08-10 08:57:39 +02:00
jibees
d5fa5e298e Merge pull request #9551 from openfoodfoundation/dependabot/bundler/debug-1.6.2
Bump debug from 1.6.1 to 1.6.2
2022-08-10 08:57:08 +02:00
Jean-Baptiste Bellet
dab4939819 Upgrade yarn.lock since it seemed to be derived 2022-08-10 08:45:24 +02:00
jibees
43b29af922 Merge pull request #9545 from Philwi/control-capybara-headless-mode-via-environment-variable
Control capybara headless mode for testing via environment variable
2022-08-10 08:05:26 +02:00
dependabot[bot]
2c1acc14e6 Bump debug from 1.6.1 to 1.6.2
Bumps [debug](https://github.com/ruby/debug) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.6.1...v1.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 06:02:35 +00:00
dependabot[bot]
84f9da4a23 Bump webmock from 3.17.0 to 3.17.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.17.0 to 3.17.1.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.17.0...v3.17.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 06:00:05 +00:00
jibees
d817319aa4 Merge pull request #9539 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.4
Bump sidekiq from 6.5.3 to 6.5.4
2022-08-10 07:58:25 +02:00
Philipp Winkler
093b851395 Control headless mode for testing via environment variable 2022-08-09 20:57:52 +02:00
Filipe
e3a150226e Merge pull request #9507 from openfoodfoundation/dependabot/bundler/stripe-7.0.0
Bump stripe from 5.42.0 to 7.0.0
2022-08-09 12:33:36 +01:00
Rachel Arnould
5122ed9af4 Update FUNDING.yml 2022-08-09 10:11:17 +02:00
Rachel Arnould
ac5a3beb15 Update FUNDING.yml 2022-08-09 10:10:44 +02:00
dependabot[bot]
19481fc55e Bump sidekiq from 6.5.3 to 6.5.4
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.3...v6.5.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 06:48:01 +00:00
Maikel Linke
c8cab8aae5 Update mocked responses to get a ListObject 2022-08-09 15:13:16 +10:00
dependabot[bot]
d7428015ac Bump stripe from 5.42.0 to 7.0.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.42.0 to 7.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/v5.42.0...v7.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>
2022-08-09 15:13:16 +10:00
Maikel
700f91efb5 Merge pull request #9449 from filipefurtad0/packing_report
Updates specs on Packing and Payment Reports
2022-08-09 14:56:22 +10:00
Maikel
43e4047447 Merge pull request #9495 from filipefurtad0/invoice_print_spec
Invoice print spec: added tax
2022-08-09 14:54:23 +10:00
Maikel
892e843e9e Merge pull request #9533 from filipefurtad0/remove_bye_bug
Removes byebug and pry-byebug; keeps pry 🧹
2022-08-09 10:39:21 +10:00
filipefurtad0
85904f57b8 Removes byebug and pry-byebug; keeps pry 2022-08-08 15:22:45 +01:00
jibees
b5e23717f2 Merge pull request #9531 from mkllnk/awesome-print
Remove unnecessary awesome_print gem
2022-08-08 14:21:11 +02:00
jibees
d8d99c930e Merge pull request #9530 from openfoodfoundation/dependabot/bundler/webmock-3.17.0
Bump webmock from 3.15.0 to 3.17.0
2022-08-08 14:09:48 +02:00
filipefurtad0
ce96094f49 Adds around block with time.freeze 2022-08-08 12:23:11 +01:00
Maikel Linke
6c655e6fbc Remove unnecessary awesome_print gem
Most people don't know it and it has now been superseeded by new
versions of irb and debug.
2022-08-08 15:39:59 +10:00
Maikel Linke
2d1483febb Remove misleading comment
That comment was in the original commit of this source code and was
related to another gem which has long been removed.
2022-08-08 15:38:30 +10:00
Maikel
42d7383ff0 Merge pull request #9446 from jibees/add-prettier
Add prettier linter for stimulusjs files
2022-08-08 14:41:47 +10:00
Maikel Linke
df4ddf45c4 Only check, not fix in pre-commit hook 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
e0b40222dd add pre-commit hook
with husky and pretty-quick
2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
61928cbc05 Run prettier formatter 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
c6884f96e1 Add prettier as a GH action 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
f0b5a04f6b Ignore everything but js files related to stimulusjs 2022-08-08 14:40:58 +10:00
Jean-Baptiste Bellet
b8ffddb533 Add prettier to our stack 2022-08-08 14:40:58 +10:00
dependabot[bot]
71536767b5 Bump webmock from 3.15.0 to 3.17.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.15.0 to 3.17.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.15.0...v3.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 04:18:03 +00:00
Maikel
938056d1d8 Merge pull request #9453 from openfoodfoundation/dependabot/bundler/angular_rails_csrf-5.0.0
Bump angular_rails_csrf from 4.5.0 to 5.0.0
2022-08-08 14:16:56 +10:00
Maikel
63d2d69d08 Clarify copying of test build URL
And removing an unused translation step
2022-08-08 12:47:28 +10:00
Maikel
78ec086111 Merge pull request #9501 from Michaelcode2/master
Added file "uk.yml" to directory openfoodnetwork/config/locales/
2022-08-08 12:34:01 +10:00
filipefurtad0
2aded5b459 Clarifies pending examples 2022-08-05 17:43:02 +01:00
filipefurtad0
5aa6b14756 Fixes tax values 2022-08-05 16:41:35 +01:00
filipefurtad0
07bd84ffbb Tests added tax - legacy and alternative invoices 2022-08-05 16:41:35 +01:00
filipefurtad0
d2794f328f Tests included tax - legacy and alternative invoices 2022-08-05 16:41:35 +01:00
filipefurtad0
8b146fc72a Adds included_in_price trait on broken specs 2022-08-05 16:41:35 +01:00
filipefurtad0
0c491a6651 Adds test case for added tax 2022-08-05 16:41:35 +01:00
filipefurtad0
e8529754f1 Updates order and product factory to consider added tax 2022-08-05 16:41:35 +01:00
dependabot[bot]
d95dc84c34 Bump pagy from 5.1.2 to 5.10.1
Bumps [pagy](https://github.com/ddnexus/pagy) from 5.1.2 to 5.10.1.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/5.1.2...5.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 14:59:59 +00:00
Filipe
b61ee0211f Merge pull request #9525 from filipefurtad0/adds_debug_gem
Adds debug gem to the stack
2022-08-05 15:58:45 +01:00
filipefurtad0
c777a00874 Adds debug gem to the stack, bundled with 2.1.4 2022-08-05 14:01:47 +01:00
jibees
a0a2dab44f Merge pull request #9523 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.3
Bump sidekiq from 6.5.1 to 6.5.3
2022-08-05 11:31:58 +02:00
jibees
f0aa7f44a5 Merge pull request #9524 from openfoodfoundation/dependabot/bundler/rubocop-1.33.0
Bump rubocop from 1.32.0 to 1.33.0
2022-08-05 11:31:18 +02:00
dependabot[bot]
a51940937a Bump rubocop from 1.32.0 to 1.33.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.32.0 to 1.33.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.32.0...v1.33.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 09:06:01 +00:00
dependabot[bot]
f1e401070a Bump sidekiq from 6.5.1 to 6.5.3
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.1 to 6.5.3.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.5.1...v6.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-05 09:05:41 +00:00
Jean-Baptiste Bellet
999b04ef99 Update all locales with the latest Transifex translations 2022-08-05 09:18:05 +02:00
Maikel
da5e8fcb9f Merge pull request #9130 from georgethoppil/remove-from-customerlist
Update orders and delete subscriptions when customer deleted
2022-08-05 10:35:07 +10:00
Rachel Arnould
e22b9997fe Update README.md 2022-08-04 16:58:51 +02:00
dependabot[bot]
609cbe2893 Bump angular_rails_csrf from 4.5.0 to 5.0.0
Bumps [angular_rails_csrf](https://github.com/jsanders/angular_rails_csrf) from 4.5.0 to 5.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/v4.5.0...v5.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>
2022-08-04 12:15:53 +00:00
jibees
425970aba2 Merge pull request #9519 from openfoodfoundation/dependabot/bundler/view_component-2.64.0
Bump view_component from 2.63.0 to 2.64.0
2022-08-04 14:14:32 +02:00
jibees
ace5151afa Merge pull request #9518 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.10
Bump @storybook/addon-docs from 6.5.9 to 6.5.10
2022-08-04 14:14:14 +02:00
jibees
3b652581b5 Merge pull request #9517 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.10
Bump @storybook/server from 6.5.9 to 6.5.10
2022-08-04 14:14:06 +02:00
jibees
17692e722a Merge pull request #9516 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.10
Bump @storybook/addon-controls from 6.5.9 to 6.5.10
2022-08-04 14:13:56 +02:00
jibees
a2826b0fdf Merge pull request #9515 from openfoodfoundation/dependabot/bundler/angular-rails-templates-1.2.0
Bump angular-rails-templates from 1.1.0 to 1.2.0
2022-08-04 14:13:43 +02:00
dependabot[bot]
d766f6c0b2 Bump view_component from 2.63.0 to 2.64.0
Bumps [view_component](https://github.com/github/view_component) from 2.63.0 to 2.64.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.63.0...v2.64.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>
2022-08-04 09:06:59 +00:00
dependabot[bot]
0f715e531c Bump @storybook/addon-docs from 6.5.9 to 6.5.10
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:54 +00:00
dependabot[bot]
fba83f847b Bump @storybook/server from 6.5.9 to 6.5.10
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:41 +00:00
dependabot[bot]
5603745744 Bump @storybook/addon-controls from 6.5.9 to 6.5.10
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.9 to 6.5.10.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:26 +00:00
dependabot[bot]
2b2f9c205e Bump angular-rails-templates from 1.1.0 to 1.2.0
Bumps [angular-rails-templates](https://github.com/pitr/angular-rails-templates) from 1.1.0 to 1.2.0.
- [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.1.0...v1.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 09:05:14 +00:00
jibees
feff2b726b Merge pull request #9430 from openfoodfoundation/dependabot/bundler/rspec-rails-5.1.2
Bump rspec-rails from 5.0.2 to 5.1.2
2022-08-04 09:51:54 +02:00
Maikel Linke
8b3d513aa2 Don't upgrade rspec-mocks which seems to be buggy
One of our specs failed even though it was correct:

- spec/controllers/spree/admin/base_controller_spec.rb
2022-08-04 15:54:43 +10:00
Filipe
dd17f98edb Merge pull request #9196 from jibees/8912-change-order-creation-form-steps-order
Admin, Order creation: Change steps ordering
2022-08-03 09:09:43 +01:00
Maikel
c9adcd1479 Merge pull request #9406 from filipefurtad0/oaf_reports_specs
Orders and fulfilments report specs improvement (cont. #9350)
2022-08-03 15:25:38 +10:00
jibees
29c8b0b1a5 Merge pull request #9504 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.10
Bump @babel/preset-env from 7.18.9 to 7.18.10
2022-08-02 15:13:04 +02:00
jibees
6404c7427c Merge pull request #9503 from openfoodfoundation/dependabot/bundler/webmock-3.15.0
Bump webmock from 3.14.0 to 3.15.0
2022-08-02 15:12:39 +02:00
jibees
85eab5b436 Merge pull request #9502 from openfoodfoundation/dependabot/bundler/view_component-2.63.0
Bump view_component from 2.62.0 to 2.63.0
2022-08-02 15:12:08 +02:00
Michael
912713a0c9 added Ukrainian lang. file uk.yml, corrected uk:Ukrainian 2022-08-02 13:22:17 +03:00
dependabot[bot]
ca3b9f8085 Bump @babel/preset-env from 7.18.9 to 7.18.10
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.9 to 7.18.10.
- [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.18.10/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:08:43 +00:00
dependabot[bot]
ac00a20639 Bump webmock from 3.14.0 to 3.15.0
Bumps [webmock](https://github.com/bblimke/webmock) from 3.14.0 to 3.15.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.14.0...v3.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-02 09:07:46 +00:00
dependabot[bot]
139c994e06 Bump view_component from 2.62.0 to 2.63.0
Bumps [view_component](https://github.com/github/view_component) from 2.62.0 to 2.63.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.62.0...v2.63.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>
2022-08-02 09:05:18 +00:00
Michael
3621616f7c Delete en_UA.yml 2022-08-02 11:53:17 +03:00
Michael
41ddd653a0 Added file "uk.yml" to openfoodnetwork/config/locales/
Added file "uk.yml" to directory openfoodnetwork/config/locales/
Ukrainian language translation (UA)
2022-08-02 11:52:36 +03:00
Michael
d8c7c0141a added Ukrainian translation file en_UA.yml 2022-08-02 11:34:12 +03:00
Rachel Arnould
3fa2dd4772 Merge pull request #9496 from saunmanoj888/change-translation-calculator-to-fees
Change translation for calculator section from Calculator to Fees
2022-08-02 10:10:23 +02:00
Rachel Arnould
cf26c465cc Merge pull request #9390 from binarygit/feature/update-orders-table
Feature/update orders table
2022-08-02 10:10:03 +02:00
Rachel Arnould
1bc50fd7cb Merge pull request #9404 from jibees/9384-reports-format-all-money-as-number
Admin, Reports: format all currency columns as numerical values (and no as currency value)
2022-08-02 10:09:22 +02:00
Maikel
719724de0b Merge pull request #9440 from mkllnk/webp
Support WEBP images again
2022-08-02 17:19:24 +10:00
saunmanoj888
804ed81acb Change translation for calculator section from Calculator to Fees 2022-07-31 01:04:02 +05:30
jibees
e980f8882c Merge pull request #9476 from openfoodfoundation/dependabot/bundler/bootsnap-1.13.0
Bump bootsnap from 1.12.0 to 1.13.0
2022-07-29 17:07:40 +02:00
dependabot[bot]
73f910e90c Bump bootsnap from 1.12.0 to 1.13.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.12.0...v1.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-29 09:03:09 +00:00
jibees
5135d32cd8 Merge pull request #9472 from openfoodfoundation/dependabot/bundler/dotenv-rails-2.8.1
Bump dotenv-rails from 2.7.6 to 2.8.1
2022-07-28 15:12:19 +02:00
jibees
91d87c887b Merge pull request #9469 from openfoodfoundation/dependabot/bundler/pdf-reader-2.10.0
Bump pdf-reader from 2.5.0 to 2.10.0
2022-07-28 15:10:52 +02:00
georgethoppil
786fe55fc8 Removing dependent destroy on order 2022-07-28 13:41:15 +02:00
georgethoppil
b202678a6b Delete proxy orders when subscription is deleted 2022-07-28 13:41:14 +02:00
GeorgeThoppil
0e8d2d307b Clearer translation wording for has_associated_subscriptions 2022-07-28 13:41:14 +02:00
GeorgeThoppil
832b8caa8b Update spec when deleting customer with subscription and remove unused translation key 2022-07-28 13:41:14 +02:00
GeorgeThoppil
a50b75659f Update orders and delete subscriptions when customer deleted 2022-07-28 13:41:14 +02:00
dependabot[bot]
df44898557 Bump dotenv-rails from 2.7.6 to 2.8.1
Bumps [dotenv-rails](https://github.com/bkeepers/dotenv) from 2.7.6 to 2.8.1.
- [Release notes](https://github.com/bkeepers/dotenv/releases)
- [Changelog](https://github.com/bkeepers/dotenv/blob/master/Changelog.md)
- [Commits](https://github.com/bkeepers/dotenv/compare/v2.7.6...v2.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 09:04:46 +00:00
dependabot[bot]
5a70985e0e Bump rspec-rails from 5.0.2 to 5.1.2
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.2 to 5.1.2.
- [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/v5.0.2...v5.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 08:50:45 +00:00
Jean-Baptiste Bellet
4791b570e4 Update specs ; Expect customer creation later when creating order
The terms are a bit confusing. Updating "Customer Details" updates attributes of the order which will later be used to create a customer.
Customers are not created while the order is in `cart` state. That happens later when the order advances automatically.
2022-07-28 09:52:37 +02:00
Jean-Baptiste Bellet
f087b7184c Update specs to reflect order steps changes 2022-07-28 09:31:42 +02:00
Jean-Baptiste Bellet
fa9c2b24f2 Select Customer Details as step title for Set Distribution step 2022-07-28 09:31:42 +02:00
Jean-Baptiste Bellet
e3683d25ca Change second step order: Customer Details instead of Order Details
This second step comes from a first one, which is Set Distribution
2022-07-28 09:31:42 +02:00
dependabot[bot]
21c0baa965 Bump activemerchant from 1.123.0 to 1.126.0
Bumps [activemerchant](https://github.com/activemerchant/active_merchant) from 1.123.0 to 1.126.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.126.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 01:10:42 +00:00
Maikel Linke
75a8d9caf0 Update translations 2022-07-28 11:09:29 +10:00
Maikel
1089a66fff Merge pull request #9465 from openfoodfoundation/dependabot/bundler/rails-6.1.6.1
Bump rails from 6.1.6 to 6.1.6.1
2022-07-28 11:08:39 +10:00
jibees
1feb7b4065 Merge pull request #9457 from openfoodfoundation/dependabot/bundler/i18n-1.12.0
Bump i18n from 1.8.10 to 1.12.0
2022-07-27 16:12:45 +02:00
dependabot[bot]
e7cbcf2b51 Bump pdf-reader from 2.5.0 to 2.10.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.5.0 to 2.10.0.
- [Release notes](https://github.com/yob/pdf-reader/releases)
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.5.0...v2.10.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>
2022-07-27 14:12:07 +00:00
jibees
7b7c6ec7d7 Merge pull request #9467 from openfoodfoundation/dependabot/bundler/combine_pdf-1.0.22
Bump combine_pdf from 1.0.21 to 1.0.22
2022-07-27 16:09:38 +02:00
jibees
db99ecf255 Merge pull request #9466 from openfoodfoundation/dependabot/bundler/json-2.6.2
Bump json from 2.6.1 to 2.6.2
2022-07-27 16:09:23 +02:00
dependabot[bot]
87846529a2 Bump combine_pdf from 1.0.21 to 1.0.22
Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.21 to 1.0.22.
- [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.21...v1.0.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:01:48 +00:00
dependabot[bot]
e50f298a0a Bump i18n from 1.8.10 to 1.12.0
Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.8.10 to 1.12.0.
- [Release notes](https://github.com/ruby-i18n/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ruby-i18n/i18n/compare/v1.8.10...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:00:22 +00:00
dependabot[bot]
bbc54d4467 Bump json from 2.6.1 to 2.6.2
Bumps [json](https://github.com/flori/json) from 2.6.1 to 2.6.2.
- [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.1...v2.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 13:00:22 +00:00
Jean-Baptiste Bellet
006bcd2cf8 Add Symbol class allowed for YAML deserialization 2022-07-27 15:00:19 +02:00
jibees
e56c803610 Merge pull request #9464 from openfoodfoundation/dependabot/bundler/bootsnap-1.12.0
Bump bootsnap from 1.10.1 to 1.12.0
2022-07-27 14:58:56 +02:00
jibees
5a9ff58bcf Merge pull request #9463 from openfoodfoundation/dependabot/bundler/active_storage_validations-0.9.8
Bump active_storage_validations from 0.9.7 to 0.9.8
2022-07-27 11:27:48 +02:00
Jean-Baptiste Bellet
7747f2592e Add BigDecimal classe allowed for YAML deserialization
The soft enforcement of the Rails 6.1.6.1 security update in picked up
one more classes that were serialized in the database with YAML: BigDecimal
2022-07-27 11:26:42 +02:00
dependabot[bot]
59504c3d84 Bump rails from 6.1.6 to 6.1.6.1
Bumps [rails](https://github.com/rails/rails) from 6.1.6 to 6.1.6.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.6...v6.1.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 07:29:49 +00:00
dependabot[bot]
57535af982 Bump bootsnap from 1.10.1 to 1.12.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.10.1 to 1.12.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.10.1...v1.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 07:29:10 +00:00
dependabot[bot]
66358240dc Bump active_storage_validations from 0.9.7 to 0.9.8
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 0.9.7 to 0.9.8.
- [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/0.9.8)

---
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>
2022-07-27 07:28:51 +00:00
jibees
a283a7fe49 Merge pull request #9451 from openfoodfoundation/dependabot/bundler/rubocop-1.32.0
Bump rubocop from 1.22.2 to 1.32.0
2022-07-27 09:27:23 +02:00
jibees
42cdfe3c1e Merge pull request #9455 from openfoodfoundation/dependabot/bundler/test-unit-3.5.3
Bump test-unit from 3.5.0 to 3.5.3
2022-07-27 09:26:52 +02:00
jibees
806dd6254b Merge pull request #9461 from openfoodfoundation/dependabot/bundler/valid_email2-4.0.3
Bump valid_email2 from 4.0.0 to 4.0.3
2022-07-27 09:26:34 +02:00
jibees
40b53442a8 Merge pull request #9460 from openfoodfoundation/dependabot/bundler/capybara-3.37.1
Bump capybara from 3.36.0 to 3.37.1
2022-07-27 09:26:01 +02:00
dependabot[bot]
7662d3fd6a Bump rubocop from 1.22.2 to 1.32.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.22.2 to 1.32.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.22.2...v1.32.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:29:18 +00:00
dependabot[bot]
e4ea9d8cd1 Bump test-unit from 3.5.0 to 3.5.3
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.5.0 to 3.5.3.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.5.0...3.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:29:16 +00:00
dependabot[bot]
c6374555b9 Bump valid_email2 from 4.0.0 to 4.0.3
Bumps [valid_email2](https://github.com/micke/valid_email2) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/micke/valid_email2/releases)
- [Changelog](https://github.com/micke/valid_email2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v4.0.0...v4.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:28:36 +00:00
dependabot[bot]
bda5ca33d9 Bump capybara from 3.36.0 to 3.37.1
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.36.0 to 3.37.1.
- [Release notes](https://github.com/teamcapybara/capybara/releases)
- [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md)
- [Commits](https://github.com/teamcapybara/capybara/compare/3.36.0...3.37.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 06:28:11 +00:00
jibees
7a10037de8 Merge pull request #9459 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.15.2
Bump rubocop-rails from 2.13.2 to 2.15.2
2022-07-27 08:27:58 +02:00
jibees
a8d5fede17 Merge pull request #9458 from openfoodfoundation/dependabot/bundler/view_component-2.62.0
Bump view_component from 2.57.1 to 2.62.0
2022-07-27 08:27:01 +02:00
dependabot[bot]
daa2bd5127 Bump rubocop-rails from 2.13.2 to 2.15.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.13.2 to 2.15.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.13.2...v2.15.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-27 02:08:59 +00:00
dependabot[bot]
506574aefd Bump view_component from 2.57.1 to 2.62.0
Bumps [view_component](https://github.com/github/view_component) from 2.57.1 to 2.62.0.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.57.1...v2.62.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>
2022-07-27 02:08:12 +00:00
Maikel
4f099da58f Merge pull request #9452 from openfoodfoundation/dependabot/bundler/rswag-specs-2.5.1
Bump rswag-specs from 2.4.0 to 2.5.1
2022-07-27 12:06:50 +10:00
Maikel Linke
59c9f0957b Simplify default card logic 2022-07-27 11:14:18 +10:00
jibees
6baa36cdaa Merge pull request #9454 from openfoodfoundation/dependabot/bundler/rails-i18n-7.0.5
Bump rails-i18n from 7.0.1 to 7.0.5
2022-07-26 17:15:10 +02:00
jibees
e0a8b320a9 Merge pull request #9450 from openfoodfoundation/dependabot/bundler/timecop-0.9.5
Bump timecop from 0.9.4 to 0.9.5
2022-07-26 17:12:24 +02:00
filipefurtad0
116f503cf6 Updates Payments reports spec 2022-07-26 16:07:29 +01:00
filipefurtad0
023ebe1909 Asserts on pre-filling of dates; removes manual date selection 2022-07-26 16:07:29 +01:00
dependabot[bot]
d54eb48662 Bump rswag-specs from 2.4.0 to 2.5.1
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [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.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:13:06 +00:00
dependabot[bot]
542e8e22bf Bump rails-i18n from 7.0.1 to 7.0.5
Bumps [rails-i18n](https://github.com/svenfuchs/rails-i18n) from 7.0.1 to 7.0.5.
- [Release notes](https://github.com/svenfuchs/rails-i18n/releases)
- [Changelog](https://github.com/svenfuchs/rails-i18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/svenfuchs/rails-i18n/commits/v7.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:12:46 +00:00
dependabot[bot]
e0426d6dc0 Bump timecop from 0.9.4 to 0.9.5
Bumps [timecop](https://github.com/travisjeffery/timecop) from 0.9.4 to 0.9.5.
- [Release notes](https://github.com/travisjeffery/timecop/releases)
- [Changelog](https://github.com/travisjeffery/timecop/blob/master/History.md)
- [Commits](https://github.com/travisjeffery/timecop/compare/v0.9.4...v0.9.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 14:10:19 +00:00
jibees
a09900c98d Merge pull request #9433 from openfoodfoundation/dependabot/bundler/rswag-api-2.5.1
Bump rswag-api from 2.4.0 to 2.5.1
2022-07-26 16:10:15 +02:00
jibees
f563fcad7f Merge pull request #9434 from openfoodfoundation/dependabot/bundler/letter_opener-1.8.1
Bump letter_opener from 1.7.0 to 1.8.1
2022-07-26 16:09:56 +02:00
jibees
34b76f8683 Merge pull request #9401 from openfoodfoundation/dependabot/bundler/selenium-webdriver-4.3.0
Bump selenium-webdriver from 4.0.3 to 4.3.0
2022-07-26 16:09:42 +02:00
jibees
ec82bdda97 Merge pull request #9376 from openfoodfoundation/dependabot/bundler/jwt-2.4.1
Bump jwt from 2.3.0 to 2.4.1
2022-07-26 16:09:32 +02:00
jibees
e4c2df4989 Merge pull request #9326 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.1
Bump sidekiq from 6.3.1 to 6.5.1
2022-07-26 16:09:22 +02:00
jibees
a1f577dc01 Merge pull request #9400 from openfoodfoundation/dependabot/bundler/rswag-ui-2.5.1
Bump rswag-ui from 2.4.0 to 2.5.1
2022-07-26 16:09:11 +02:00
jibees
edbf92424d Merge pull request #9377 from openfoodfoundation/dependabot/bundler/paranoia-2.6.0
Bump paranoia from 2.4.3 to 2.6.0
2022-07-26 16:08:58 +02:00
jibees
35c18664fc Merge pull request #9389 from jibees/9388-handle-plural-in-order-selection-component
Handle plural (and 0) on orders selection component
2022-07-26 15:57:58 +02:00
jibees
be568cdfa6 Update config/locales/en.yml
Co-authored-by: Maikel <maikel@email.org.au>
2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
0bb90d764c Allow charges is disabled if no saved cards marked as default 2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
34c8748b9c Mark the next credit cards with payment profile as default 2022-07-26 14:42:55 +02:00
Jean-Baptiste Bellet
875c22346e Add a tooltip on <td /> when input is disabled, ie no default saved cards
Co-Authored-By: Maikel <maikel@email.org.au>
2022-07-26 14:42:54 +02:00
filipefurtad0
c57d5a2408 Updates spec to smoke-test Pack by Product 2022-07-26 12:49:08 +01:00
Maikel
825058472b Merge pull request #9425 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.1.0
Bump stimulus from 3.0.1 to 3.1.0
2022-07-26 16:49:33 +10:00
Maikel Linke
b419f063dc Support WEBP images again
We introduced a list of formats we support and forgot to add webp. Now I
added that as allowed format again and modified the error message.

I removed the first sentence from the error message because it's very
similar to the default error which is shown as well.
2022-07-26 11:09:41 +10:00
Maikel Linke
0ebc803e22 Simplify reports SQL query 2022-07-26 11:05:41 +10:00
dependabot[bot]
cd2119707a Bump rswag-ui from 2.4.0 to 2.5.1
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [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.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:56:05 +00:00
dependabot[bot]
8c27406a7a Bump paranoia from 2.4.3 to 2.6.0
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.4.3 to 2.6.0.
- [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/2.4.3...v2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:49 +00:00
dependabot[bot]
b6defc76a8 Bump jwt from 2.3.0 to 2.4.1
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/jwt/ruby-jwt/releases)
- [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jwt/ruby-jwt/compare/v2.3.0...v2.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:29 +00:00
dependabot[bot]
50529d7ab3 Bump sidekiq from 6.3.1 to 6.5.1
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.3.1 to 6.5.1.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.3.1...v6.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:55:12 +00:00
dependabot[bot]
b695f3d47f Bump selenium-webdriver from 4.0.3 to 4.3.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.0.3 to 4.3.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits/selenium-4.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:54:43 +00:00
dependabot[bot]
90ce61fa47 Bump letter_opener from 1.7.0 to 1.8.1
Bumps [letter_opener](https://github.com/ryanb/letter_opener) from 1.7.0 to 1.8.1.
- [Release notes](https://github.com/ryanb/letter_opener/releases)
- [Changelog](https://github.com/ryanb/letter_opener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ryanb/letter_opener/compare/v1.7.0...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:13:23 +00:00
dependabot[bot]
7c2352f2d6 Bump rswag-api from 2.4.0 to 2.5.1
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.4.0 to 2.5.1.
- [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.4.0...2.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:13:07 +00:00
dependabot[bot]
ef7194af85 Bump stimulus from 3.0.1 to 3.1.0
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/stimulusjs/stimulus/releases)
- [Changelog](https://github.com/hotwired/stimulus/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stimulusjs/stimulus/compare/v3.0.1...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-25 14:12:14 +00:00
Jean-Baptiste Bellet
09adc8f690 In Enterprise Fees Summary report, SUM column should be numeric
+ update specs as well
2022-07-25 15:08:39 +02:00
filipefurtad0
86b448445f Adds test cases on Distributor Totals by Supplier 2022-07-22 14:05:33 +01:00
filipefurtad0
ba9ba7da95 Adds test cases to OC Supplier Totals by Distributor 2022-07-22 14:05:33 +01:00
filipefurtad0
f02e1ea04a Adds test cases to Order Cycle Supplier Totals 2022-07-22 14:05:33 +01:00
filipefurtad0
f88b31ec67 Adds assertion on table headers for different sub-report types 2022-07-22 14:05:33 +01:00
filipefurtad0
6906dd47e8 Changes I18n to strings and cleans up Order Cycle Customer Totals 2022-07-22 14:04:58 +01:00
Jean-Baptiste Bellet
2a35c48498 Do not format price as currency, but as number
for all the `Packing Reports`, ie
Pack By Customer
Pack By Supplier
Pack By Product
2022-07-22 09:28:36 +02:00
Jean-Baptiste Bellet
ce0031934a Do not format sum_total as currency, but as number
For the `Bulk Co-op Supplier Report` report
2022-07-22 09:27:52 +02:00
Jean-Baptiste Bellet
4766c7a00b Update all locales with the latest Transifex translations 2022-07-21 17:42:52 +02:00
jibees
9d470c7a18 Merge pull request #9416 from aintluks/fix-label-button-terms-of-service
Fix button labels on terms of service
2022-07-21 17:38:28 +02:00
jibees
9cb0d66f39 Merge pull request #9426 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.9
Bump @babel/preset-env from 7.18.6 to 7.18.9
2022-07-21 17:38:07 +02:00
dependabot[bot]
7ba6f8c04b Bump @babel/preset-env from 7.18.6 to 7.18.9
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.6 to 7.18.9.
- [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.18.9/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 15:03:18 +00:00
jibees
19ff6d011a Merge pull request #9415 from saunmanoj888/fix-for-shipping-method-radio-button
Fix text alignment for category radio button under shipping method
2022-07-21 17:02:29 +02:00
jibees
9b1dcdcc78 Merge pull request #9412 from binarygit/optimize-notes-and-tracking-workflow
Optimize notes and tracking workflow
2022-07-21 17:02:03 +02:00
jibees
5eb3c486b2 Merge pull request #9383 from jibees/9382-can-send-invoice-if-ABN-is-not-required
Can send invoice if ABN is not required
2022-07-21 17:01:41 +02:00
jibees
20ee0d5009 Merge pull request #9301 from mkllnk/3975-unsupported-image
Allow SVG images for products and show errors when uploading unsupported file
2022-07-21 16:56:11 +02:00
Jean-Baptiste Bellet
a3cb1e6ecc Can Allow charges only if one card is marked as default 2022-07-21 14:42:36 +02:00
jibees
89d68c7708 Merge pull request #9374 from openfoodfoundation/dependabot/bundler/spring-4.0.0
Bump spring from 3.0.0 to 4.0.0
2022-07-21 08:56:33 +02:00
jibees
371d517436 Merge pull request #9432 from mkllnk/mayhem
Run Mayhem for API only when triggered manually
2022-07-21 08:51:12 +02:00
jibees
17a016eca5 Merge pull request #9431 from mkllnk/roo
Bump roo from old master to 2.9.0
2022-07-21 08:46:06 +02:00
Jean-Baptiste Bellet
2b67a0fa80 Specify a list of content-types
Then remove specific image format that aren't handled by a web browser (such as `image/x+xcf)`

+ List allowed image formats for enterprises and groups
2022-07-21 08:42:17 +02:00
Maikel Linke
84fcc8f1ac Upgrade spring binstubs
I ran `bundle exec spring binstub --all` after reading about the update
in the changelog.
2022-07-21 10:55:31 +10:00
Maikel
baefe37d0b Merge pull request #9367 from openfoodfoundation/dependabot/bundler/activerecord-import-1.4.0
Bump activerecord-import from 1.3.0 to 1.4.0
2022-07-21 10:45:56 +10:00
Maikel Linke
1e13d579ba Run Mayhem for API only when triggered manually
It currently always fails and we are not using it. We may use it in the
future though and the results can be interesting. So I'm keeping it but
it's not triggered on every pull request. How to trigger:

https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow
2022-07-21 10:37:58 +10:00
Maikel Linke
becfb09b3c Bump roo from old master to 2.9.0
This release doesn't include the latest two pull requests but we don't
need those features and it's an upgrade already. Dependabot will now
pick up new releases instead of every new commit to the master branch of
the gem source. That should be less work for us.
2022-07-21 10:29:45 +10:00
Filipe
4767030035 Merge pull request #9429 from filipefurtad0/matomo_tag_change
Adds js window element to container code
2022-07-20 10:27:16 +01:00
filipefurtad0
b20385db95 Moves matomo tag to upper position within head section 2022-07-20 09:38:37 +01:00
jibees
019911068a Merge pull request #9402 from openfoodfoundation/dependabot/bundler/oauth2-1.4.10
Bump oauth2 from 1.4.7 to 1.4.10
2022-07-20 09:36:19 +02:00
jibees
da266fed40 Merge pull request #9428 from openfoodfoundation/dependabot/npm_and_yarn/terser-4.8.1
Bump terser from 4.8.0 to 4.8.1
2022-07-20 09:35:39 +02:00
Maikel Linke
dd6c066f5a DRY view with JS translation 2022-07-20 17:01:10 +10:00
dependabot[bot]
9de939c1b1 Bump terser from 4.8.0 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 05:48:56 +00:00
Lucas da Costa
35030bfd02 Fix button labels on terms of service 2022-07-19 22:53:30 -03:00
Maikel
3833fb6e52 Merge pull request #9394 from jibees/9167-api-v1,-customers-endpoint-region-and-country-as-object
API v1: Provide customer address with region and country objects including id code
2022-07-20 09:41:11 +10:00
filipefurtad0
0a03c0a0fb Adds js window element to container code 2022-07-19 19:29:02 +01:00
binarygit
0599acbcb8 Refactor shipments.js 2022-07-19 13:37:05 +05:45
binarygit
97dcd44662 Display alert box before deleting note/tracking info 2022-07-19 13:37:05 +05:45
binarygit
1165c997bc Add styles on notes/tracking info when hoving over their delete buttons 2022-07-19 13:36:58 +05:45
binarygit
1d54777d72 Replace view with status column in past orders table 2022-07-19 13:30:11 +05:45
Maikel
0144e940c4 Remove release step to merge Transifex PR 2022-07-19 17:38:37 +10:00
Jean-Baptiste Bellet
753a643bf1 Simplify main method by creating two private methods
Include some unit tests
2022-07-19 09:50:06 +10:00
Maikel Linke
19018c2564 Split address transformation for easier reading 2022-07-19 09:49:42 +10:00
Maikel Linke
c8a65d2fac Simplify with customer accessor 2022-07-19 09:49:42 +10:00
Maikel Linke
6c0d4cffe5 Allow customer's address update with country code
The customer endpoint now serves 2-letter ISO codes for countries and
accepts these for updates. It also serves and accepts region codes
(abbreviations) like VIC for Victoria.

Updates treat these fields as case-insensitive and either code or name
have to be present.

This commit also updates the Swagger documentation.
2022-07-19 09:49:42 +10:00
binarygit
6b042e4a17 Display notes field in admin/orders/new only after an item has been added 2022-07-18 16:15:37 +05:45
binarygit
ae2c56b29d Omit tracking info row from shipping email when empty 2022-07-18 14:55:36 +05:45
saunmanoj888
55feb7648d Fix text alignment for category radio button under shipping method 2022-07-16 23:17:06 +05:30
Jean-Baptiste Bellet
cc135c8190 API V1, Customer endpoint: region and country as object 2022-07-15 14:54:33 +02:00
binarygit
2f01351ad2 Enable users to delete only non-empty tracking info/notes 2022-07-15 11:34:37 +05:45
Maikel Linke
3d6842db80 Update translations 2022-07-14 11:54:23 +10:00
Maikel
e1dd92b406 Merge pull request #9395 from openfoodfoundation/transifex
Transifex
2022-07-14 11:50:18 +10:00
Maikel
a8160aac8a Merge pull request #9399 from binarygit/feature/update-note/tracking
Update note and tracking fields workflow
2022-07-14 11:49:09 +10:00
binarygit
5e7bfc05d2 Remove link from order number in open/past orders table 2022-07-13 20:10:45 +05:45
binarygit
3c741f0686 Add flash after an order is cancelled 2022-07-13 18:45:43 +05:45
Jean-Baptiste Bellet
afa40ea82f Authorize product and not @product 2022-07-13 14:26:11 +02:00
Transifex-Openfoodnetwork
6a9fcd0b30 Updating translations for config/locales/en_GB.yml 2022-07-13 04:17:52 +10:00
Jean-Baptiste Bellet
a80cf37fa6 Handle errors message formatting 2022-07-12 18:29:28 +02:00
Jean-Baptiste Bellet
073bad2118 Allow svg images to be resized/cropped 2022-07-12 15:53:32 +02:00
binarygit
6ad0749ce8 Refactor: create parent_node var to find child elements 2022-07-12 14:11:53 +05:45
Transifex-Openfoodnetwork
5a40ccb7df Updating translations for config/locales/it.yml 2022-07-12 18:07:07 +10:00
binarygit
a56375eaf8 Spec: can delete note/tracking info on an order 2022-07-12 13:33:34 +05:45
Transifex-Openfoodnetwork
5221e776da Updating translations for config/locales/de_DE.yml 2022-07-11 20:44:12 +10:00
Transifex-Openfoodnetwork
a290779ef7 Updating translations for config/locales/en_FR.yml 2022-07-11 19:31:07 +10:00
Transifex-Openfoodnetwork
ac2b8e1ebe Updating translations for config/locales/fr.yml 2022-07-11 19:28:51 +10:00
jibees
a1adcadd6c Merge pull request #9371 from openfoodfoundation/dependabot/bundler/devise-4.8.1
Bump devise from 4.8.0 to 4.8.1
2022-07-11 11:26:43 +02:00
dependabot[bot]
4a53c818fd Bump oauth2 from 1.4.7 to 1.4.10
Bumps [oauth2](https://github.com/oauth-xx/oauth2) from 1.4.7 to 1.4.10.
- [Release notes](https://github.com/oauth-xx/oauth2/releases)
- [Changelog](https://github.com/oauth-xx/oauth2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/oauth-xx/oauth2/compare/v1.4.7...v1.4.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 09:06:54 +00:00
dependabot[bot]
fa59117fd5 Bump devise from 4.8.0 to 4.8.1
Bumps [devise](https://github.com/heartcombo/devise) from 4.8.0 to 4.8.1.
- [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.8.0...v4.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 08:52:18 +00:00
jibees
3b6b2ea936 Merge pull request #9372 from openfoodfoundation/dependabot/bundler/rack-timeout-0.6.3
Bump rack-timeout from 0.6.0 to 0.6.3
2022-07-11 10:51:00 +02:00
jibees
ef4a71c048 Merge pull request #9375 from openfoodfoundation/dependabot/bundler/redis-4.7.1
Bump redis from 4.7.0 to 4.7.1
2022-07-11 10:50:35 +02:00
jibees
bc82401c24 Merge pull request #9393 from openfoodfoundation/dependabot/bundler/awesome_nested_set-3.5.0
Bump awesome_nested_set from 3.4.0 to 3.5.0
2022-07-11 10:49:54 +02:00
jibees
849ceeaa96 Merge pull request #9392 from openfoodfoundation/dependabot/npm_and_yarn/moment-2.29.4
Bump moment from 2.29.3 to 2.29.4
2022-07-11 10:49:35 +02:00
jibees
77bac0c24e Merge pull request #9396 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.1.0
Bump tom-select from 2.0.3 to 2.1.0
2022-07-11 09:17:15 +02:00
binarygit
227220e2a6 Add focus to tracking when edit tracking is clicked 2022-07-09 14:40:04 +05:45
binarygit
b88c85555e Add delete tracking feature 2022-07-09 14:39:20 +05:45
binarygit
b7a49ced39 Add focus to note when edit note is clicked 2022-07-09 14:33:01 +05:45
binarygit
dc31ebebb1 Add delete note feature 2022-07-09 13:23:38 +05:45
Filipe
2f550725e3 Merge pull request #9368 from jibees/9178-add-note-on-order
Admin, Edit order: Can add note on order
2022-07-08 12:13:18 +01:00
Filipe
3834724d45 Merge pull request #9236 from AgriculturaFamiliar/add-map-whatsapp-link
Show whatsapp link on contact modal on map
2022-07-08 12:10:18 +01:00
dependabot[bot]
ce39f3c119 Bump tom-select from 2.0.3 to 2.1.0
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.0.3...v2.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-08 09:05:33 +00:00
Transifex-Openfoodnetwork
7aaa31b137 Updating translations for config/locales/en_FR.yml 2022-07-08 11:27:15 +10:00
Transifex-Openfoodnetwork
656143db48 Updating translations for config/locales/fr.yml 2022-07-08 11:24:09 +10:00
Filipe
decfbc9658 Merge pull request #9356 from jibees/9248-add-tags-to-a-producer-only-order-cycle
Add tags to producer-only order cycle interface
2022-07-07 23:45:02 +01:00
Filipe
e91a87d83b Merge pull request #9295 from filipefurtad0/destroy_order_state_confirmation
Restarts checkout flow, when emptying the cart
2022-07-07 22:47:44 +01:00
Filipe
040422c6c0 Merge pull request #9380 from jibees/9068-bulk-product-update-creating-new-on_demand-variant
Admin, Products list: fix variant creation when unit is not well formatted and on_demand is checked or on_hand is filled
2022-07-07 22:39:23 +01:00
dependabot[bot]
7535883416 Bump moment from 2.29.3 to 2.29.4
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 08:10:37 +00:00
Jean-Baptiste Bellet
f71c84cea5 Handle save method as it should be: return false if any errors occurs 2022-07-07 09:56:14 +02:00
Maikel Linke
1586320115 Update translations 2022-07-07 13:56:55 +10:00
Maikel
13f81ca20e Merge pull request #9350 from filipefurtad0/adds_reports_specs
Adds system specs on orders and fulfillment reports
2022-07-07 13:51:12 +10:00
dependabot[bot]
25b5b66ae1 Bump awesome_nested_set from 3.4.0 to 3.5.0
Bumps [awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set) from 3.4.0 to 3.5.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.4.0...v3.5.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>
2022-07-07 03:45:48 +00:00
dependabot[bot]
f2b02f6c6b Bump activerecord-import from 1.3.0 to 1.4.0
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/zdennis/activerecord-import/releases)
- [Changelog](https://github.com/zdennis/activerecord-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zdennis/activerecord-import/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:45:13 +00:00
dependabot[bot]
3139ba7ad0 Bump rack-timeout from 0.6.0 to 0.6.3
Bumps [rack-timeout](https://github.com/zombocom/rack-timeout) from 0.6.0 to 0.6.3.
- [Release notes](https://github.com/zombocom/rack-timeout/releases)
- [Changelog](https://github.com/zombocom/rack-timeout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zombocom/rack-timeout/compare/v0.6.0...v0.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:45:12 +00:00
Maikel
1ab1e20bb7 Merge pull request #9378 from openfoodfoundation/dependabot/bundler/rails-6.1.6
Bump rails from 6.1.4.4 to 6.1.6
2022-07-07 13:43:58 +10:00
Maikel
f3806ea5ea Merge pull request #9381 from openfoodfoundation/transifex
Transifex
2022-07-07 13:39:23 +10:00
Maikel
182a7f0f93 Merge pull request #9352 from filipefurtad0/price_breakdown_spec
Adds price breakdown assertion
2022-07-07 13:36:45 +10:00
Jean-Baptiste Bellet
6f228781d4 Check for product_set errors
+ update specs: can't save variant that is not well filled. Now display errors (instead of a generic one)
2022-07-06 10:46:54 +02:00
Jean-Baptiste Bellet
c39b00b6c2 do not set on_demand and on_hand if variant has errors
+ update specs

Co-Authored-By: Maikel <maikel@email.org.au>
2022-07-06 10:46:54 +02:00
Jean-Baptiste Bellet
06b1c9aa40 Handle plural (and 0) on orders selection component 2022-07-06 09:48:12 +02:00
lauriewayne
75b71738df Update FUNDING.yml
took away @
2022-07-05 07:02:03 -07:00
lauriewayne
8cb07c4a37 Update FUNDING.yml 2022-07-05 06:59:27 -07:00
lauriewayne
4cbd520cb9 Create FUNDING.yml
added @ofnusa to Open Collective line
2022-07-05 06:56:44 -07:00
Jean-Baptiste Bellet
b2a0310e6f Handle the case when errors is a string 2022-07-05 15:48:31 +02:00
jibees
d71994189c Creating new variants specs
Co-Authored-By: Filipe <49817236+filipefurtad0@users.noreply.github.com>
2022-07-05 10:21:48 +02:00
Jean-Baptiste Bellet
89809aed5f Add counter on note input 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
de8c71d098 Create a controller that handle a counter for an input text 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
576faff3d7 Spec: can edit/save note on an order 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
90af6bd22d Handle note saving with a new action on existing API controller 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
3f1099d968 Add edit note line on an order 2022-07-05 10:09:20 +02:00
Jean-Baptiste Bellet
7fbe893927 Add note to spree_orders object 2022-07-05 10:09:20 +02:00
Transifex-Openfoodnetwork
c6ab9f8a6a Updating translations for config/locales/it.yml 2022-07-05 16:42:36 +10:00
Jean-Baptiste Bellet
e4be757d96 use the can_invoice method that check both ABN and configuration boolean
+ specs Specify an empty ABN number
+ update specs
2022-07-04 15:35:49 +02:00
filipefurtad0
e44845c327 Creates system spec for orders and fulfilment report; adds existing test cases to this file 2022-07-04 11:08:54 +01:00
filipefurtad0
c8cab86b0c Stubs order and adds assertions 2022-07-04 11:07:00 +01:00
Transifex-Openfoodnetwork
a3cbe8e878 Updating translations for config/locales/en_FR.yml 2022-07-04 19:52:28 +10:00
Transifex-Openfoodnetwork
727c74907d Updating translations for config/locales/fr.yml 2022-07-04 19:51:29 +10:00
Transifex-Openfoodnetwork
04c38a3c1d Updating translations for config/locales/de_DE.yml 2022-07-02 08:22:44 +10:00
Jean-Baptiste Bellet
9b51f85e9a Create a context around "creating new variants"
Reproducing bug #9068
2022-07-01 16:42:04 +02:00
Jean-Baptiste Bellet
90fe3fc66c Update all locales with the latest Transifex translations 2022-07-01 14:26:24 +02:00
Filipe
5a2aee6d79 Merge pull request #9349 from openfoodfoundation/transifex
Transifex
2022-07-01 12:06:53 +01:00
dependabot[bot]
544377a624 Bump rails from 6.1.4.4 to 6.1.6
Bumps [rails](https://github.com/rails/rails) from 6.1.4.4 to 6.1.6.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4.4...v6.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 11:06:24 +00:00
Filipe
2a49b91a8b Merge pull request #9347 from openfoodfoundation/dependabot/bundler/view_component-2.57.1
Bump view_component from 2.41.0 to 2.57.1
2022-07-01 12:05:42 +01:00
Filipe
8abd636b68 Merge pull request #9342 from openfoodfoundation/dependabot/bundler/view_component_storybook-0.11.1
Bump view_component_storybook from 0.10.1 to 0.11.1
2022-07-01 12:05:28 +01:00
Filipe
244cce7392 Merge pull request #9365 from mkllnk/ch
Add Swiss language files
2022-07-01 12:04:57 +01:00
Filipe
9d39efdd7b Merge pull request #9318 from saunmanoj888/translation-missing-order-cycle-status
Add translation for order-cycle-status on new order creation from admin
2022-07-01 12:03:45 +01:00
Filipe
a0531ca356 Merge pull request #9332 from openfoodfoundation/dependabot/bundler/geocoder-1.8.0
Bump geocoder from 1.7.0 to 1.8.0
2022-07-01 12:00:02 +01:00
Filipe
8cac98ceb4 Merge pull request #9321 from leopengilley/master
Styled text colour of admin order dropdown menu #9296
2022-07-01 10:48:11 +01:00
Filipe
3d5d9d1191 Merge pull request #9353 from saunmanoj888/fix-password-prefilled-issue
Disable auto fill option for password on /admin/users/[ID] page
2022-07-01 10:41:29 +01:00
dependabot[bot]
a5f6773a4d Bump redis from 4.7.0 to 4.7.1
Bumps [redis](https://github.com/redis/redis-rb) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.7.0...v4.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 09:34:11 +00:00
Filipe
e563de0248 Merge pull request #9330 from openfoodfoundation/dependabot/bundler/roadie-rails-3.0.0
Bump roadie-rails from 2.2.0 to 3.0.0
2022-07-01 10:33:11 +01:00
Filipe
81d2e63d6f Merge pull request #9357 from jibees/9180-close-mobile-menu-on-click-anywhere
Close menu on click outside the menu and outside the hamburger icon
2022-07-01 10:16:43 +01:00
dependabot[bot]
43b09640a9 Bump spring from 3.0.0 to 4.0.0
Bumps [spring](https://github.com/rails/spring) from 3.0.0 to 4.0.0.
- [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/v3.0.0...v4.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 08:47:51 +00:00
Filipe
9b2ae41392 Merge pull request #9359 from openfoodfoundation/dependabot/bundler/sidekiq-scheduler-4.0.2
Bump sidekiq-scheduler from 3.1.0 to 4.0.2
2022-07-01 09:46:00 +01:00
Arthur Vieira
066879fe62 Add icons to whatsapp links
Uses the font awesome 4 WhatsApp icon in .svg format (which is under the
Open Font License) in the pages where an enterprise's WhatsApp number
appears as an hyperlink.
2022-06-30 19:19:10 -03:00
Arthur
54ec4e5016 Update app/views/shopping_shared/tabs/_contact.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-06-30 19:19:10 -03:00
Arthur Vieira
e483ef8ccd Fix whatsapp phone tooltip in registration
The tooltip on the contact step of the registration form now displays
the proper text, which has been added in the source language file.
2022-06-30 19:19:10 -03:00
Arthur Vieira
0deb3cd782 Replace url generation with 'whatsapp_url' method
As suggested by mkllnk's following comment:
1eda7d8a4c (r890656117)
2022-06-30 19:19:10 -03:00
Arthur Vieira
624485ff25 Add whatsapp link to contact tab view 2022-06-30 19:19:10 -03:00
Arthur Vieira
cace62a718 Add producer whatsapp link to producers list
Adds WhatsApp number with wa.me link between phone number and e-mail
address in the producers list profile.
2022-06-30 19:19:10 -03:00
Arthur Vieira
77360f41af Show WhatsApp link on contact modal on map
Strips '+' and ' ' characters from the phone number for the generated
link, but doesn't guarantee the link is valid because the number
registered isn't validated for now.
2022-06-30 19:19:10 -03:00
Arthur Vieira
79e762a815 Add whatsapp number to registration form
Creates a field  on the contact step of the enterprise registration form
to create an enterprise with a WhatsApp phone number, with corresponding
i18n keys for the field's name and placeholder text.
2022-06-30 19:19:10 -03:00
Arthur Vieira
62ee3c2de1 Add admin view field for whatsapp number
Creates a field and tooltip in
/admin/enterprises/<enterprise>/edit#!/contact for updating the
enterprise's WhatsApp phone number, with corresponding i18n keys for the
name of the field, placeholder and tooltip text.
2022-06-30 19:19:10 -03:00
Arthur Vieira
b565b6ba4d Add whatsapp_phone to permitted attributes
Allows creating and updating the enterprise's WhatsApp phone number in
the registration form and contact edit views.
2022-06-30 19:19:10 -03:00
Arthur Vieira
a2bc61475b Add whatsapp_phone column to enterprises 2022-06-30 19:19:06 -03:00
Transifex-Openfoodnetwork
8052e8b775 Updating translations for config/locales/en_FR.yml 2022-06-30 17:39:47 +10:00
Transifex-Openfoodnetwork
e4d290d59c Updating translations for config/locales/fr.yml 2022-06-30 17:39:36 +10:00
jibees
96df2cb307 Merge pull request #9370 from openfoodfoundation/dependabot/bundler/rack-mini-profiler-2.3.4
Bump rack-mini-profiler from 2.3.3 to 2.3.4
2022-06-30 08:34:18 +02:00
Maikel
1bc13215a2 Merge pull request #9360 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.114.0
Bump aws-sdk-s3 from 1.113.0 to 1.114.0
2022-06-30 11:45:05 +10:00
dependabot[bot]
a09b1ce54c Bump rack-mini-profiler from 2.3.3 to 2.3.4
Bumps [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler) from 2.3.3 to 2.3.4.
- [Release notes](https://github.com/MiniProfiler/rack-mini-profiler/releases)
- [Changelog](https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/MiniProfiler/rack-mini-profiler/compare/v2.3.3...v2.3.4)

---
updated-dependencies:
- dependency-name: rack-mini-profiler
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-29 18:22:46 +00:00
Filipe
122421be0f Merge pull request #9340 from openfoodfoundation/dependabot/bundler/wicked_pdf-2.6.3
Bump wicked_pdf from 2.1.0 to 2.6.3
2022-06-29 19:21:35 +01:00
Filipe
899a796896 Merge pull request #9348 from jibees/9315-add-boolean-to-set-enterprise-phone-number-mandatory-or-not
Add boolean to specify if enterprise  number (ABN, GST, SIRET, ...) is mandatory or not to generate invoices
2022-06-29 19:07:55 +01:00
Filipe
deb22d788f Merge pull request #9363 from jibees/9316-new-action-dropdown-for-bulk-invoice-printing
Admin, Orders list: new actions dropdown for bulk invoice printing
2022-06-29 18:20:32 +01:00
Jean-Baptiste Bellet
77d12a3e54 Can add tags on simple order_cycle: specs
Simple order cycle: enterprise users selling only their own produce
2022-06-29 09:51:15 +02:00
jibees
d245609b16 Merge pull request #9366 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.1.0
Bump shoulda-matchers from 5.0.0 to 5.1.0
2022-06-29 08:49:06 +02:00
dependabot[bot]
b806e08624 Bump shoulda-matchers from 5.0.0 to 5.1.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.0.0 to 5.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/v5.0.0...v5.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>
2022-06-29 03:54:32 +00:00
Maikel
b902de652a Merge pull request #9358 from openfoodfoundation/dependabot/bundler/redis-4.7.0
Bump redis from 4.5.1 to 4.7.0
2022-06-29 13:53:33 +10:00
Maikel Linke
0afd0fe2f1 Add Swiss language files
We usually don't do this manually but these files haven't been
completely translated yet and Mikel is keen to use them.
2022-06-29 10:49:49 +10:00
Jean-Baptiste Bellet
8ba59079b3 Reverse per_page and actions components left <-> right 2022-06-28 18:12:47 +02:00
Jean-Baptiste Bellet
8d66f33230 per_page control can now be set on the right of the page 2022-06-28 18:12:20 +02:00
Jean-Baptiste Bellet
77e384ab71 Replace button by a drop-down
+ update specs as well
2022-06-28 17:39:41 +02:00
Jean-Baptiste Bellet
7a1bd660c4 Prepare ofn-drop-down to have a "disabled" state and a "prepend" element 2022-06-28 17:39:41 +02:00
jibees
0ed56a46af Merge pull request #9362 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.18.6
Bump @babel/preset-env from 7.18.2 to 7.18.6
2022-06-28 15:23:01 +02:00
Jean-Baptiste Bellet
fdba33baa3 Pass the form, and re-init() on object change
I can't make angularjs directive synchronized to scope object, this seems to be a hack, but it works.

Also add form in the scope (which was not added...)
2022-06-28 15:05:11 +02:00
Jean-Baptiste Bellet
6f303a5244 Add tags interface for a producer only order cycle
Add tags for first (and unique) outgoing exchange for a simple OC

Order Cycle can have tags
2022-06-28 15:05:11 +02:00
Transifex-Openfoodnetwork
850ad5165c Updating translations for config/locales/ko.yml 2022-06-28 21:25:14 +10:00
dependabot[bot]
85e3111e75 Bump @babel/preset-env from 7.18.2 to 7.18.6
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.2 to 7.18.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.18.6/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 09:04:51 +00:00
Jean-Baptiste Bellet
5ad09a6fab Check if user can/can't print invoice in case of company number mandatory or present 2022-06-28 09:58:34 +02:00
Jean-Baptiste Bellet
bb6298d06d Check for enterprise_number_required_on_invoices boolean
if true, then can edit invoice ;

if false, then print a confirm alert popup to specify that a enterprise number must be set for this enterprise
2022-06-28 09:53:46 +02:00
Jean-Baptiste Bellet
3a1fde40c5 Add a Spree config option: enterprise_number_required_on_invoices 2022-06-28 09:50:12 +02:00
filipefurtad0
43b6ab5dc5 Updates spec after merging #9325 2022-06-28 07:37:08 +01:00
Maikel
ee464ca457 Merge pull request #9334 from openfoodfoundation/dependabot/bundler/bullet-7.0.2
Bump bullet from 6.1.5 to 7.0.2
2022-06-28 12:25:53 +10:00
dependabot[bot]
c27f35ee6e Bump aws-sdk-s3 from 1.113.0 to 1.114.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.113.0 to 1.114.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>
2022-06-28 02:25:51 +00:00
Maikel
79cc8b6f3e Merge pull request #9331 from openfoodfoundation/dependabot/bundler/devise-i18n-1.10.2
Bump devise-i18n from 1.10.0 to 1.10.2
2022-06-28 12:24:59 +10:00
dependabot[bot]
1676dba9da Bump sidekiq-scheduler from 3.1.0 to 4.0.2
Bumps [sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) from 3.1.0 to 4.0.2.
- [Release notes](https://github.com/moove-it/sidekiq-scheduler/releases)
- [Changelog](https://github.com/sidekiq-scheduler/sidekiq-scheduler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moove-it/sidekiq-scheduler/compare/v3.1.0...v4.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 02:02:17 +00:00
dependabot[bot]
e26e6bb855 Bump redis from 4.5.1 to 4.7.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.5.1 to 4.7.0.
- [Release notes](https://github.com/redis/redis-rb/releases)
- [Changelog](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/redis-rb/compare/v4.5.1...v4.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 02:01:57 +00:00
Maikel
c2c8e8dfcd Merge pull request #9343 from openfoodfoundation/dependabot/bundler/arel-helpers-2.14.0
Bump arel-helpers from 2.12.1 to 2.14.0
2022-06-28 12:01:33 +10:00
Maikel
61f0b433aa Merge pull request #9345 from openfoodfoundation/dependabot/bundler/test-prof-1.0.9
Bump test-prof from 1.0.7 to 1.0.9
2022-06-28 12:01:05 +10:00
Jean-Baptiste Bellet
e2e455533e Close menu on click outside the menu and outside the hambuger icon 2022-06-27 18:57:40 +02:00
filipefurtad0
2ba9d250f2 Adds assertion on price breakdown modal 2022-06-27 11:24:57 +01:00
Maikel
79bf8f0053 Merge pull request #9354 from mkllnk/time-spec
Fix time in reports spec
2022-06-27 17:41:20 +10:00
Maikel Linke
721fc0fd3f Fix time in reports spec
Some specs were starting to fail because I created an order in the past
while the default report is for the last month only. It didn't include
that order any more.

I now defined the dates everywhere to remove this variable of the
current date.
2022-06-27 17:07:56 +10:00
Maikel
6a80cb8bfa Merge pull request #9313 from filipefurtad0/some_clean_ups_on_report_specs
Updating system specs after reports overhaul
2022-06-27 16:33:56 +10:00
saunmanoj888
8d5616b351 Disable auto fill option for password on /admin/users/[ID] page 2022-06-26 23:45:18 +05:30
Filipe
45214ed923 Merge pull request #9325 from jibees/8899-shopfront-display-fee-name-in-the-tooltip-of-a-price-product-
In the shopfront, display fee name in the tooltip of a price product breakdown
2022-06-24 20:49:32 +01:00
Transifex-Openfoodnetwork
e28905b176 Updating translations for config/locales/en_GB.yml 2022-06-24 05:24:50 +10:00
filipefurtad0
d63aca3129 Removes 'pending' after #9229 merge 2022-06-23 10:40:11 +01:00
filipefurtad0
be7d44a603 Updates payments_report_spec.rb 2022-06-23 10:24:20 +01:00
filipefurtad0
98eecb1b3e Updates packing report spec 2022-06-23 10:24:20 +01:00
filipefurtad0
db8eb52359 Updates enterprise_summary_fee spec 2022-06-23 10:24:20 +01:00
filipefurtad0
b0d29c6dbc Updates spec settings to address timeout error 2022-06-23 10:24:20 +01:00
filipefurtad0
54bcd75f3f Corrects namespace; adds pending on failing examples - payment_r 2022-06-23 10:24:20 +01:00
filipefurtad0
32e247bf75 Removes spree namespace; adds pending on failing examples - packing_r 2022-06-23 10:24:20 +01:00
filipefurtad0
5892eab4e3 Removes spree namespace; adds pending on failing examples - enterprise_fee_r 2022-06-23 10:24:20 +01:00
dependabot[bot]
9da7bcb134 Bump view_component from 2.41.0 to 2.57.1
Bumps [view_component](https://github.com/github/view_component) from 2.41.0 to 2.57.1.
- [Release notes](https://github.com/github/view_component/releases)
- [Changelog](https://github.com/github/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/github/view_component/compare/v2.41.0...v2.57.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 04:11:33 +00:00
Maikel
0ce5718b2b Merge pull request #9329 from openfoodfoundation/dependabot/bundler/web-console-4.2.0
Bump web-console from 4.1.0 to 4.2.0
2022-06-23 14:10:25 +10:00
dependabot[bot]
d12754fe83 Bump roadie-rails from 2.2.0 to 3.0.0
Bumps [roadie-rails](https://github.com/Mange/roadie-rails) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/Mange/roadie-rails/releases)
- [Changelog](https://github.com/Mange/roadie-rails/blob/master/Changelog.md)
- [Commits](https://github.com/Mange/roadie-rails/compare/v2.2.0...v3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:58:49 +00:00
Maikel
c268999ec6 Merge pull request #9346 from openfoodfoundation/dependabot/bundler/puma-5.6.4
Bump puma from 5.6.2 to 5.6.4
2022-06-23 13:56:49 +10:00
dependabot[bot]
b81ce0ad1c Bump puma from 5.6.2 to 5.6.4
Bumps [puma](https://github.com/puma/puma) from 5.6.2 to 5.6.4.
- [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/v5.6.2...v5.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:30:12 +00:00
Maikel Linke
49166dd503 Update translations 2022-06-23 13:30:09 +10:00
dependabot[bot]
00f3a698f4 Bump test-prof from 1.0.7 to 1.0.9
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.7 to 1.0.9.
- [Release notes](https://github.com/test-prof/test-prof/releases)
- [Changelog](https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/test-prof/test-prof/compare/v1.0.7...v1.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 03:30:07 +00:00
Maikel
45e4b00891 Merge pull request #9328 from openfoodfoundation/dependabot/bundler/good_migrations-0.2.1
Bump good_migrations from 0.1.0 to 0.2.1
2022-06-23 13:29:01 +10:00
Maikel
d71073e0ed Merge pull request #9339 from openfoodfoundation/transifex
Transifex
2022-06-23 12:20:51 +10:00
Maikel
165456b8c8 Merge pull request #9229 from mkllnk/report-currency-formatting
Format money amounts in report spreadsheets as numbers
2022-06-23 12:18:02 +10:00
saunmanoj888
12eff626f4 Add translation for statuses in order_controller.js.coffee 2022-06-23 01:33:51 +05:30
dependabot[bot]
eee7075d9d Bump arel-helpers from 2.12.1 to 2.14.0
Bumps [arel-helpers](https://github.com/camertron/arel-helpers) from 2.12.1 to 2.14.0.
- [Release notes](https://github.com/camertron/arel-helpers/releases)
- [Changelog](https://github.com/camertron/arel-helpers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/camertron/arel-helpers/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 13:55:57 +00:00
jibees
5642e4835c Merge pull request #9335 from openfoodfoundation/dependabot/bundler/i18n-js-3.9.2
Bump i18n-js from 3.9.0 to 3.9.2
2022-06-22 15:55:44 +02:00
dependabot[bot]
f12d62604b Bump view_component_storybook from 0.10.1 to 0.11.1
Bumps [view_component_storybook](https://github.com/jonspalmer/view_component_storybook) from 0.10.1 to 0.11.1.
- [Release notes](https://github.com/jonspalmer/view_component_storybook/releases)
- [Changelog](https://github.com/jonspalmer/view_component_storybook/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/jonspalmer/view_component_storybook/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 13:55:25 +00:00
Transifex-Openfoodnetwork
db51b7dcf4 Updating translations for config/locales/de_DE.yml 2022-06-22 23:54:59 +10:00
jibees
d328e098ce Merge pull request #9327 from openfoodfoundation/dependabot/bundler/ffaker-2.21.0
Bump ffaker from 2.20.0 to 2.21.0
2022-06-22 15:53:44 +02:00
dependabot[bot]
d77c693829 Bump wicked_pdf from 2.1.0 to 2.6.3
Bumps [wicked_pdf](https://github.com/mileszs/wicked_pdf) from 2.1.0 to 2.6.3.
- [Release notes](https://github.com/mileszs/wicked_pdf/releases)
- [Changelog](https://github.com/mileszs/wicked_pdf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mileszs/wicked_pdf/compare/2.1.0...2.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 09:02:28 +00:00
Transifex-Openfoodnetwork
213aa03c8b Updating translations for config/locales/en_FR.yml 2022-06-22 18:14:49 +10:00
Transifex-Openfoodnetwork
cc48a3396b Updating translations for config/locales/fr.yml 2022-06-22 18:14:15 +10:00
Maikel
fbf4513e96 Merge pull request #9314 from turrisxyz/Pinned-Dependencies-GitHub
chore: Set permissions for GitHub actions
2022-06-22 12:07:07 +10:00
Maikel
5ecf678257 Merge pull request #9293 from openfoodfoundation/master-1
Updated Docker installation instructions
2022-06-22 11:54:14 +10:00
dependabot[bot]
5e5ade9681 Bump bullet from 6.1.5 to 7.0.2
Bumps [bullet](https://github.com/flyerhzm/bullet) from 6.1.5 to 7.0.2.
- [Release notes](https://github.com/flyerhzm/bullet/releases)
- [Changelog](https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/6.1.5...7.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 01:27:27 +00:00
Maikel
6a22650fee Merge pull request #9333 from openfoodfoundation/dependabot/bundler/bugsnag-6.24.2
Bump bugsnag from 6.24.1 to 6.24.2
2022-06-22 11:25:43 +10:00
Maikel
8d1e1e6e04 Merge pull request #9322 from mkllnk/fix-schema
Remove accidental modification of the db schema
2022-06-22 11:23:54 +10:00
Filipe
b977bc77c8 Merge pull request #9272 from jibees/7905-retrieve-order-already-placed-on-user-confirmation-with-customer-email
On user confirmation, retrieve and link all orders to the new user that were already placed with the same email
2022-06-21 18:12:58 +01:00
dependabot[bot]
421cbcc745 Bump i18n-js from 3.9.0 to 3.9.2
Bumps [i18n-js](https://github.com/fnando/i18n-js) from 3.9.0 to 3.9.2.
- [Release notes](https://github.com/fnando/i18n-js/releases)
- [Changelog](https://github.com/fnando/i18n-js/blob/v3.9.2/CHANGELOG.md)
- [Commits](https://github.com/fnando/i18n-js/compare/v3.9.0...v3.9.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:37:08 +00:00
dependabot[bot]
9455341908 Bump bugsnag from 6.24.1 to 6.24.2
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.24.1 to 6.24.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.24.1...v6.24.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:35:44 +00:00
dependabot[bot]
4c0d7c039f Bump geocoder from 1.7.0 to 1.8.0
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/alexreisner/geocoder/releases)
- [Changelog](https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alexreisner/geocoder/compare/v1.7.0...v1.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:35:04 +00:00
Filipe
6b00319e4a Merge pull request #9191 from jibees/9186-inverse-hide-columns-UX-by-a-columns-to-show
Admin, Reports: Inverting logic from "Columns to hide" to "Columns to show"
2022-06-21 17:34:31 +01:00
dependabot[bot]
5da9ec7dc2 Bump devise-i18n from 1.10.0 to 1.10.2
Bumps [devise-i18n](https://github.com/tigrish/devise-i18n) from 1.10.0 to 1.10.2.
- [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.10.0...v1.10.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:34:22 +00:00
dependabot[bot]
edf1dd52eb Bump web-console from 4.1.0 to 4.2.0
Bumps [web-console](https://github.com/rails/web-console) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/rails/web-console/releases)
- [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/rails/web-console/compare/v4.1.0...v4.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:33:16 +00:00
dependabot[bot]
024c9b5473 Bump good_migrations from 0.1.0 to 0.2.1
Bumps [good_migrations](https://github.com/testdouble/good-migrations) from 0.1.0 to 0.2.1.
- [Release notes](https://github.com/testdouble/good-migrations/releases)
- [Changelog](https://github.com/testdouble/good-migrations/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testdouble/good-migrations/compare/v0.1.0...v0.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:32:37 +00:00
dependabot[bot]
55e65a713b Bump ffaker from 2.20.0 to 2.21.0
Bumps [ffaker](https://github.com/ffaker/ffaker) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/ffaker/ffaker/releases)
- [Changelog](https://github.com/ffaker/ffaker/blob/main/Changelog.md)
- [Commits](https://github.com/ffaker/ffaker/compare/v2.20.0...v2.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 16:31:48 +00:00
Filipe
4b33593a8a Merge pull request #9271 from AgriculturaFamiliar/9256-update-aws-sdk
Remove old aws-sdk gem
2022-06-21 17:26:52 +01:00
Filipe
dd079c4dce Merge pull request #9154 from openfoodfoundation/ability-to-desactivate-users
Add disabled_at logic on spree users
2022-06-21 16:57:35 +01:00
Jean-Baptiste Bellet
400a490ec5 Display fee name instead of fee type
+ update specs as well
2022-06-21 16:08:45 +02:00
Jean-Baptiste Bellet
3c05fc3c80 Add fees name for a variant to its serializer 2022-06-21 14:42:22 +02:00
Jean-Baptiste Bellet
976e326bbd Add method fees_name_by_type_for that returns fees name for a variant 2022-06-21 14:20:59 +02:00
François Turbelin
606a56a64d Improve specs 2022-06-21 10:08:12 +02:00
François Turbelin
31f8864b4a Add system spec for Admin user disable feature 2022-06-21 10:08:12 +02:00
François Turbelin
76ea7089d9 Implement suggestions 2022-06-21 10:08:12 +02:00
François Turbelin
bc9dcc7cbc Block disabled users from logging in 2022-06-21 10:08:12 +02:00
François Turbelin
39a6b5d20f Add disabled_at logic on spree users 2022-06-21 10:08:12 +02:00
Maikel
f6e2cb52e0 Merge pull request #9323 from mkllnk/mime
Restore dependency to mime-types
2022-06-21 11:19:56 +10:00
Maikel Linke
5406978e2d Restore dependency to mime-types
Our db2fog backups require the mime-types gem but it was removed with
paperclip. Luckily, backups have still been working because the gem was
still available.
2022-06-21 10:52:57 +10:00
Maikel
553046addb Merge pull request #9255 from jibees/fix-admin-taxonomies-interface
Fix admin taxonomies interface
2022-06-21 09:41:55 +10:00
Maikel
d5bec7e538 Merge pull request #9269 from jibees/fix-@order-distributor-website-in-/order/ORDER_ID-page
As a customer, on an order page, distributor website should link to the order that is actually showing
2022-06-21 09:39:46 +10:00
Jean-Baptiste Bellet
bc43028cb1 On User confirmation, link all already placed orders to this new user
if user.email == customer.email

Co-Authored-By: Maikel <maikel@email.org.au>
2022-06-20 15:39:22 +02:00
Diego de Araújo Martinez Camarinha
a4fa4a4803 Remove aws sdk patch
This was introduced because an old version of the aws sdk was used. Now
with a newer version installed, this should not be need anymore
2022-06-20 07:10:53 -03:00
Diego de Araújo Martinez Camarinha
c4bd37413d Remove old aws-sdk dependency
It is on version 1.67.0 and has an old json dependency that makes
bundler unable to solve conflicts. That means it's not possible to
install other gems because of it
2022-06-20 07:10:53 -03:00
Maikel Linke
d78cbce4f3 Remove accidental modification of the db schema
fa74dae99c changed the schema file even
though the migration doesn't touch the database structure. A previous
development version of the migration did this but the finally merged
version didn't. So this schema is not valid. Let's hope that nobody set
up a new instance with the changed schema and we just fix it to what it
was before.
2022-06-20 14:47:29 +10:00
Maikel Linke
ae8f14a671 Avoid style warnings in spec and reduce indent
Defining a spec within a module is not necessary. It's better to use the
standard describe syntax.
2022-06-20 13:26:20 +10:00
Maikel Linke
d085d15b99 Add example for report regression testing
I've done it only for a CSV file now but we can extend that to other
formats and test the actual result including formatting.
2022-06-20 13:26:18 +10:00
Maikel Linke
e37ec4b552 Avoid auto-formatting currencies
Each report can define formats for each column. But currency formatting
was also applied to all columns that had "price" in the name. Removing
this automation gives us more control and we can decide for each case.

At the moment, the currency formatting in Excel spreadsheets is not
ideal and it's easier to keep it as number.

This PR introduces a visual regression as prices are not formatted as
nicely but the columns can be used in calculations.
2022-06-20 13:18:41 +10:00
LioPeng
fd4409c24d Styled text colour of admin order dropdown menu 2022-06-20 12:15:13 +10:00
Rachel Arnould
40f3d4df4f Merge pull request #9312 from filipefurtad0/revert_9268_supplier_totals
Splits results per supplier on OC Distributor Totals by Supplier report
2022-06-17 10:53:19 +02:00
Jean-Baptiste Bellet
049620add7 Update all locales with the latest Transifex translations 2022-06-17 09:33:01 +02:00
jibees
d7073c03d0 Merge pull request #9294 from openfoodfoundation/transifex
Transifex
2022-06-17 09:31:17 +02:00
jibees
19b57aa74e Merge pull request #9246 from jibees/9228-do-not-include-shipping-method-in-the-summary-row-for-Order-Cycle-Distributer-Totals-by-Supplier-report
Do not include shipping method in the summary row for the Order Cycle Distributer Totals by Supplier report
2022-06-17 09:30:31 +02:00
jibees
06685fb1c1 Merge pull request #9308 from jibees/update-yarn-lock
Update yarn.lock
2022-06-17 09:30:12 +02:00
saunmanoj888
85a1a3627a Add translation for order-cycle-status on new order creation from admin 2022-06-16 23:28:11 +05:30
neilnaveen
5c1bdc7698 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2022-06-16 01:08:27 +00:00
filipefurtad0
0a70e091cd Reverts #9268 for supplier totals 2022-06-15 13:50:22 +01:00
filipefurtad0
9ab672d0b1 Restarts checkout flow for state 'confirmation' 2022-06-15 10:35:40 +01:00
Jean-Baptiste Bellet
7f52789dcf Update yarn.lock 2022-06-15 10:26:26 +02:00
jibees
df6e107dd3 Merge pull request #9305 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.9
Bump @storybook/addon-docs from 6.5.7 to 6.5.9
2022-06-15 09:09:38 +02:00
jibees
64cc6d21f1 Merge pull request #9307 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.9
Bump @storybook/addon-controls from 6.5.7 to 6.5.9
2022-06-15 09:09:26 +02:00
dependabot[bot]
f04c5bace1 Bump @storybook/addon-controls from 6.5.7 to 6.5.9
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.7 to 6.5.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.9/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.9/addons/controls)

---
updated-dependencies:
- dependency-name: "@storybook/addon-controls"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-15 06:41:36 +00:00
dependabot[bot]
55f4f54e18 Bump @storybook/addon-docs from 6.5.7 to 6.5.9
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.7 to 6.5.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.9/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.9/addons/docs)

---
updated-dependencies:
- dependency-name: "@storybook/addon-docs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-15 06:41:29 +00:00
jibees
95586a0e38 Merge pull request #9306 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.9
Bump @storybook/server from 6.5.7 to 6.5.9
2022-06-15 08:40:47 +02:00
Jean-Baptiste Bellet
8ba8a95eb7 Convert key to sym, as it could be a string (in case of dynamic header)
ie. the tax rate

Update specs to check this case when feature toggle is activated or not
2022-06-14 15:39:06 +02:00
dependabot[bot]
d9f82ff619 Bump @storybook/server from 6.5.7 to 6.5.9
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.7 to 6.5.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.9/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.9/app/server)

---
updated-dependencies:
- dependency-name: "@storybook/server"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 09:04:50 +00:00
filipefurtad0
f3ff835902 Adds a spec to assert on the order state change 2022-06-14 08:58:54 +01:00
Maikel Linke
004c7eef9e Show SVG product images 2022-06-14 15:35:55 +10:00
Maikel Linke
f3f0a84915 Display image upload error as alert
Not the nicest UX but better than nothing.
2022-06-14 15:11:26 +10:00
Maikel Linke
5f11b6a650 Respond with errors if image upload fails 2022-06-14 15:06:17 +10:00
Maikel Linke
6b733ad7e2 Increase readability of image controller spec
Best viewed without whitespace changes.

- Decrease indent.
- Move `let` to top like in other specs.
- Avoid `let!` to speed up the specs.
2022-06-14 14:56:40 +10:00
Maikel Linke
831aa3aae0 Simplify ProductImagesController 2022-06-14 14:50:55 +10:00
Maikel
e733e9a5f8 Merge pull request #9300 from filipefurtad0/enterprise_factory_logo_promo
Adds optional promo and logo images as traits to the enterprise factory
2022-06-14 09:19:43 +10:00
filipefurtad0
464496befa Adds traits to enterprise_factory and spec 2022-06-13 16:40:55 +01:00
filipefurtad0
9c8756bf42 Makes the spec red: deletes file attachement from assertion 2022-06-13 16:26:09 +01:00
Filipe
ef0a346076 Merge pull request #9212 from jibees/9140-assign-a-customer-to-an-order-in-admin-section
When creating an order, and assigning a customer, fill all the customer inputs in the shipping/billing address form
2022-06-13 14:57:31 +01:00
Filipe
8b7d474f4c Merge pull request #9177 from jibees/9067-save-all-data-when-submitting-the-form
Admin, Create a new product: re-fill the form with fields values if any validation errors occurs when submitting
2022-06-13 14:54:02 +01:00
Jean-Baptiste Bellet
bf40e59bec Should link to order.distributor website
- order: the order summary the customer is seeing on this page
 - current_order: the order is the customer is check-outing

+ add specs
2022-06-13 14:52:20 +02:00
Jean-Baptiste Bellet
7920c1c4e8 Update Customers reports spec for feature report_inverse_columns_logic 2022-06-13 14:39:12 +02:00
Jean-Baptiste Bellet
16babf8250 Don't modify params object, but use an intermediate variable
`@params_fields_to_show`
2022-06-13 14:39:12 +02:00
Jean-Baptiste Bellet
214a470896 Remove the report Subtype selector in the Rendering Options section
+ add all sub-reports in the index page
all of this is behind a feature toggle
2022-06-13 14:39:12 +02:00
Transifex-Openfoodnetwork
8b1b9f1460 Updating translations for config/locales/en_GB.yml 2022-06-13 19:54:52 +10:00
Transifex-Openfoodnetwork
0335d8ac4f Updating translations for config/locales/fr_CH.yml 2022-06-11 00:52:56 +10:00
Transifex-Openfoodnetwork
91818a256b Updating translations for config/locales/de_CH.yml 2022-06-11 00:44:06 +10:00
Konrad
ba69a9fbeb Updated installation instructions 2022-06-10 15:36:43 +02:00
Filipe
9fee4f1554 Merge pull request #9203 from AgriculturaFamiliar/remove-closed-associated-adjustments-button
Remove closed associated adjustments button
2022-06-10 10:10:50 +01:00
Jean-Baptiste Bellet
68bd1df312 Handle rename with context menu on the first taxon ie. the root one
Also rename the main input field (sort of title) when updating the root taxon name with contextual menu
2022-06-02 16:03:16 +02:00
Jean-Baptiste Bellet
4bbbae68c7 Do not send parent_id is it's something else than a number
When moving element on top, `new_parent.attr("id")` was `taxonomy_tree` which was causing DB error
2022-06-02 15:41:44 +02:00
Jean-Baptiste Bellet
817b5f437f Authorize :position params 2022-06-02 15:41:44 +02:00
Jean-Baptiste Bellet
121c9eed3b Replace Spree.url().clone() by new URL() 2022-06-02 15:41:44 +02:00
Arthur
05c8414e0d Merge branch 'openfoodfoundation:master' into remove-closed-associated-adjustments-button 2022-06-01 16:03:43 -03:00
Jean-Baptiste Bellet
78c2f76a3f Introduce FeatureToggle for columns logic
relative to a46416a98
2022-05-31 15:57:39 +02:00
Jean-Baptiste Bellet
c102eecb18 Introduce FeatureToggle for columns logic
This commit is relative to 9094a65ab commit
2022-05-31 15:57:39 +02:00
Jean-Baptiste Bellet
a6dc19f717 Introduce FeatureToggle for columns logic
Key is `report_inverse_columns_logic`

This commit is relative to 985893667 commit
2022-05-31 15:57:38 +02:00
Jean-Baptiste Bellet
8fec5f1464 Use mixins useRenderCustomer 2022-05-31 09:00:24 +02:00
Jean-Baptiste Bellet
39b7f56e6d Use mixins useSearchCustomer
Prefer composition vs. inheritance
2022-05-31 08:57:11 +02:00
Jean-Baptiste Bellet
a46416a98e Change UX to transform from fields_to_hide to fields_to_show
Fill `params[:fields_to_show]` with its default value
2022-05-30 15:34:08 +02:00
Jean-Baptiste Bellet
9094a65ab6 Remove fields_to_hide as unecessary 2022-05-30 15:34:08 +02:00
Jean-Baptiste Bellet
9858936677 Starts transforming fields_to_hide to fields_to_show 2022-05-30 15:34:08 +02:00
Jean-Baptiste Bellet
454e4a4100 Initialize on_demand checkbox value 2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
70baccd76c Create a method to handle redirect after save
and the get rid of rubocop linter error
2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
72ce2e5598 Initialize display_as 2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
df1b126852 Initialize unit_value_with_description
+ Specify to empty field since its now filled with default value `1.0`
2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
134202bedd Initialize value for variant_unit_with_scale 2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
f6981e4320 Initialize value with ng-model: product.description 2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
c78e734dee Initialize with submitted value on_hand 2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
be0065ad1a Initialize value with @product.price
Co-Authored-By: Maikel <maikel@email.org.au>
2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
68f8413cda Remplace collection_select by select and fill the selected item
+ add tom-select controller
2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
e058cd3e06 Create spec to check that every filled fields must be filled on for submit
when validation errors occurs
2022-05-30 14:54:47 +02:00
Jean-Baptiste Bellet
ec338bca9c Do not include shipping method in the summary row 2022-05-30 11:14:29 +02:00
Arthur Vieira
e0241b6866 Remove test associated without 'unlock' selected
Leaves the other test that should be the default behaviour and renames
it accordingly.
2022-05-26 10:12:39 -03:00
Arthur Vieira
95010fcd12 Remove the unlock condition in shipment controller
This assumes unlock is always true so the shipment's fee adjustments
always opens and closes.
2022-05-26 09:21:48 -03:00
Arthur Vieira
0fb9cc0f2a Remove associated adjustments radio button
Removes the 'Associated Adjustment Closed' options from the order edit
page (/admin/orders/XXXXX/edit).
2022-05-26 09:12:19 -03:00
Jean-Baptiste Bellet
760de3b507 Do not set null value to select controller 2022-05-24 12:35:23 +02:00
Jean-Baptiste Bellet
5e27795a15 Special method to handle customer with no bill_address 2022-05-24 12:30:11 +02:00
Jean-Baptiste Bellet
2c29b1f60f Replace Angular directive and use stimulus controller
+ Update specs as well
2022-05-24 12:30:00 +02:00
Jean-Baptiste Bellet
ce058c6e36 Create a SelectCustomer controller
To be used in `/admin/orders/ORDER_ID/customer` page

 - Fetch `/admin/search/customers.json?` with query as params
 - Render each items response thanks to `renderOption()` method
 - `onItemSelect()` is here to fill the associated form in the page
2022-05-24 12:30:00 +02:00
Jean-Baptiste Bellet
5018f824f5 Prepare tom-select controller to inherit others controllers 2022-05-24 12:30:00 +02:00
Jean-Baptiste Bellet
68cb8d9965 Formatting file 2022-05-24 12:30:00 +02:00
233 changed files with 22170 additions and 2738 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: openfoodfoundation
patreon: # Replace with a single Patreon username
open_collective: #
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -10,7 +10,6 @@ assignees: ''
## Preparation on Thursday
- [ ] Merge pull requests in the [Ready To Go] column
- [ ] Merge [Transifex pull request]
- [ ] Include translations: `tx pull --force`
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
- [ ] Notify [#instance-managers] of user-facing changes.
@@ -18,24 +17,12 @@ assignees: ''
## Testing
- [ ] [Find build] of the release commit and copy it below.
- [ ] Move this issue to Test Ready and notify testers.
- [ ] Test: :warning: link to the build of the release commit https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master
- [ ] Move this issue to Test Ready.
- [ ] Notify testers.
- [ ] Test build: <!-- paste build link here, e.g. https://semaphore...builds/1234 -->
## Finish on Tuesday
- [ ] Update translations unless content has been removed from config/locales/en.yml between this release draft and current master.
<details><summary>Command line instructions</summary>
<pre>
git checkout master # same version as the release draft
git fetch upstream
git diff upstream/master -- config/locales/en.yml
tx pull --force # if no changes or only additions in the locale
git checkout --detach # if we need to commit new translations
git commit -a -m "Update translations"
git tag vx.y.z # put the release number in here
git push upstream vx.y.z
</pre>
</details>
- [ ] Publish and notify [#global-community]:
> The next release is ready: https://github.com/openfoodfoundation/openfoodnetwork/releases/latest
- [ ] Deploy the new release to all managed instances.

View File

@@ -10,8 +10,14 @@ on:
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
brakeman-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Brakeman Scan
runs-on: ubuntu-latest
steps:

View File

@@ -12,6 +12,9 @@ env:
RSPEC_RETRY_RETRY_COUNT: 3
RAILS_ENV: test
permissions:
contents: read
jobs:
rspec:
runs-on: ubuntu-18.04

View File

@@ -16,3 +16,16 @@ jobs:
reporter: github-pr-check
level: error
fail_on_error: true
prettier:
name: runner / prettier
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: error
fail_on_error: true

View File

@@ -1,5 +1,5 @@
name: 'Mayhem for API'
on: [push]
on: workflow_dispatch
jobs:
test:
if: ${{ github.repository_owner == 'openfoodfoundation' }}

4
.husky/pre-commit Executable file
View File

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

21
.prettierignore Normal file
View File

@@ -0,0 +1,21 @@
# Basically, ignore everythings expect app/webpacker/controllers/*.js and app/webpacker/packs/*.js
*.css
*.scss
*.md
*.yml
*.yaml
*.json
*.html
babel.config.js
postcss.config.js
.storybook/
/app/assets/
/config/
/coverage/
/engines/
/public/
/spec/
/tmp/
/vendor/

1
.prettierrc.json Normal file
View File

@@ -0,0 +1 @@
{}

View File

@@ -29,6 +29,7 @@ gem 'rails_safe_tasks', '~> 1.0'
gem "activerecord-import"
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-6"
gem "fog-aws", "~> 2.0" # db2fog does not support v3
gem "mime-types" # required by fog
gem "valid_email2"
@@ -69,7 +70,6 @@ gem 'rswag-api'
gem 'rswag-ui'
gem 'angularjs-rails', '1.8.0'
gem 'aws-sdk', '1.67.0'
gem 'bugsnag'
gem 'haml'
gem 'redcarpet'
@@ -104,7 +104,7 @@ gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'immigrant'
gem 'roo', github: "roo-rb/roo" # master is currently needed for Ruby 3.x (awaiting new release)
gem 'roo'
gem 'spreadsheet_architect'
gem 'whenever', require: false
@@ -140,8 +140,6 @@ group :production, :staging do
end
group :test, :development do
# Pretty printed test output
gem 'awesome_print'
gem 'bullet'
gem 'capybara'
gem 'cuprite'
@@ -158,10 +156,10 @@ group :test, :development do
gem 'shoulda-matchers'
gem 'timecop'
gem 'webdrivers'
gem 'debug', '>= 1.0.0'
end
group :test do
gem 'byebug'
gem 'pdf-reader'
gem 'rails-controller-testing'
gem 'simplecov', require: false
@@ -176,7 +174,6 @@ group :development do
gem 'foreman'
gem 'listen'
gem 'pry', '~> 0.13.0'
gem 'pry-byebug', '~> 3.9.0'
gem 'rubocop'
gem 'rubocop-rails'
gem 'spring'

View File

@@ -24,14 +24,6 @@ GIT
sass-rails
thor (>= 0.14)
GIT
remote: https://github.com/roo-rb/roo.git
revision: 709464c77623be2bc09b2103405d90ded7604a75
specs:
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
PATH
remote: engines/catalog
specs:
@@ -59,67 +51,67 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
actioncable (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailbox (6.1.6.1)
actionpack (= 6.1.6.1)
activejob (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
mail (>= 2.7.1)
actionmailer (6.1.4.4)
actionpack (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailer (6.1.6.1)
actionpack (= 6.1.6.1)
actionview (= 6.1.6.1)
activejob (= 6.1.6.1)
activesupport (= 6.1.6.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.4)
actionview (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionpack (6.1.6.1)
actionview (= 6.1.6.1)
activesupport (= 6.1.6.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actiontext (6.1.4.4)
actionpack (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actiontext (6.1.6.1)
actionpack (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
nokogiri (>= 1.8.5)
actionview (6.1.4.4)
activesupport (= 6.1.4.4)
actionview (6.1.6.1)
activesupport (= 6.1.6.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
active_storage_validations (0.9.7)
active_storage_validations (0.9.8)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
activejob (6.1.4.4)
activesupport (= 6.1.4.4)
activejob (6.1.6.1)
activesupport (= 6.1.6.1)
globalid (>= 0.3.6)
activemerchant (1.123.0)
activemerchant (1.126.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (6.1.4.4)
activesupport (= 6.1.4.4)
activerecord (6.1.4.4)
activemodel (= 6.1.4.4)
activesupport (= 6.1.4.4)
activerecord-import (1.3.0)
activemodel (6.1.6.1)
activesupport (= 6.1.6.1)
activerecord (6.1.6.1)
activemodel (= 6.1.6.1)
activesupport (= 6.1.6.1)
activerecord-import (1.4.0)
activerecord (>= 4.2)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -129,14 +121,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activesupport (= 6.1.4.4)
marcel (~> 1.0.0)
activestorage (6.1.6.1)
actionpack (= 6.1.6.1)
activejob (= 6.1.6.1)
activerecord (= 6.1.6.1)
activesupport (= 6.1.6.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.4)
activesupport (6.1.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -149,61 +141,55 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
angular-rails-templates (1.1.0)
railties (>= 4.2, < 7)
angular-rails-templates (1.2.0)
railties (>= 5.0, < 7.1)
sprockets (>= 3.0, < 5)
sprockets-rails
tilt
angular_rails_csrf (4.5.0)
railties (>= 3, < 7)
angular_rails_csrf (5.0.0)
railties (>= 3, < 8)
angularjs-file-upload-rails (2.4.1)
angularjs-rails (1.8.0)
arel-helpers (2.12.1)
activerecord (>= 3.1.0, < 7)
arel-helpers (2.14.0)
activerecord (>= 3.1.0, < 8)
ast (2.4.2)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
awesome_print (1.9.2)
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.570.0)
aws-sdk (1.67.0)
aws-sdk-v1 (= 1.67.0)
aws-sdk-core (3.130.0)
aws-partitions (1.601.0)
aws-sdk-core (3.131.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.55.0)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.57.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.113.0)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sdk-v1 (1.67.0)
json (~> 1.4)
nokogiri (~> 1)
aws-sigv4 (1.4.0)
aws-sigv4 (1.5.0)
aws-eventstream (~> 1, >= 1.0.2)
axlsx_styler (1.1.0)
activesupport (>= 3.1)
caxlsx (>= 2.0.2)
bcrypt (3.1.16)
bcrypt (3.1.18)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.10.1)
bootsnap (1.13.0)
msgpack (~> 1.2)
bugsnag (6.24.1)
bugsnag (6.24.2)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (6.1.5)
bullet (7.0.2)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
cable_ready (5.0.0.pre3)
rails (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.36.0)
capybara (3.37.1)
addressable
matrix
mini_mime (>= 0.1.3)
@@ -228,14 +214,15 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
combine_pdf (1.0.21)
combine_pdf (1.0.22)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.1.9)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.9.0)
css_parser (1.11.0)
addressable
cuprite (0.13)
capybara (>= 2.1, < 4)
@@ -250,8 +237,11 @@ GEM
debase-ruby_core_source (= 0.10.12)
msgpack
debase-ruby_core_source (0.10.12)
debug (1.6.2)
irb (>= 1.3.6)
reline (>= 0.3.1)
debugger-linecache (1.2.0)
devise (4.8.0)
devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
@@ -259,21 +249,20 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-i18n (1.10.0)
devise-i18n (1.10.2)
devise (>= 4.8.0)
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.4.4)
diff-lcs (1.5.0)
digest (3.1.0)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
dry-inflector (0.2.1)
e2mmap (0.1.0)
erubi (1.10.0)
et-orbi (1.2.4)
erubi (1.11.0)
et-orbi (1.2.7)
tzinfo
excon (0.81.0)
execjs (2.7.0)
@@ -282,21 +271,16 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
faraday (2.3.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
faraday-net_http (2.0.3)
ferrum (0.11)
addressable (~> 2.5)
cliver (~> 0.3)
concurrent-ruby (~> 1.1)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.20.0)
ffaker (2.21.0)
ffi (1.15.5)
flipper (0.20.4)
flipper-active_record (0.20.4)
@@ -324,17 +308,17 @@ GEM
nokogiri (>= 1.5.11, < 2.0.0)
foreman (0.87.2)
formatador (0.2.5)
fugit (1.4.5)
et-orbi (~> 1.1, >= 1.1.8)
fugit (1.5.3)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.7.0)
geocoder (1.8.0)
globalid (1.0.0)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
good_migrations (0.1.0)
good_migrations (0.2.1)
activerecord (>= 3.1)
railties (>= 3.1)
haml (5.2.2)
@@ -345,16 +329,19 @@ GEM
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
i18n (1.8.10)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n-js (3.9.0)
i18n-js (3.9.2)
i18n (>= 0.6.6)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
immigrant (0.3.6)
activerecord (>= 3.0)
io-console (0.5.11)
ipaddress (0.8.3)
irb (1.4.1)
reline (>= 0.3.0)
jmespath (1.6.1)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
@@ -362,7 +349,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (2.6.1)
json (2.6.2)
json-schema (2.8.1)
addressable (>= 2.4)
json_spec (1.1.5)
@@ -370,18 +357,18 @@ GEM
rspec (>= 2.0, < 4.0)
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.3.0)
jwt (2.4.1)
knapsack (4.0.0)
rake
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
libv8-node (15.14.0.1)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.13.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -389,6 +376,9 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
@@ -397,41 +387,41 @@ GEM
mini_portile2 (2.8.0)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.15.0)
minitest (5.16.2)
monetize (1.12.0)
money (~> 6.12)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.4.2)
msgpack (1.5.4)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.13.3)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
oauth2 (1.4.10)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
pagy (5.1.2)
pagy (5.10.1)
activesupport
paper_trail (12.1.0)
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.21.0)
paranoia (2.4.3)
activerecord (>= 4.0, < 6.2)
parser (3.1.0.0)
parallel (1.22.1)
paranoia (2.6.0)
activerecord (>= 5.1, < 7.1)
parser (3.1.2.0)
ast (~> 2.4.1)
paypal-sdk-core (0.3.4)
multi_json (~> 1.0)
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.5.0)
pdf-reader (2.10.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -442,16 +432,13 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
public_suffix (4.0.6)
puma (5.6.2)
public_suffix (4.0.7)
puma (5.6.4)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.0)
rack (2.2.3)
rack-mini-profiler (2.3.3)
rack (2.2.4)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-protection (2.1.0)
rack
@@ -460,23 +447,23 @@ GEM
rack-rewrite (1.5.1)
rack-ssl (1.4.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.6.0)
rails (6.1.4.4)
actioncable (= 6.1.4.4)
actionmailbox (= 6.1.4.4)
actionmailer (= 6.1.4.4)
actionpack (= 6.1.4.4)
actiontext (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activemodel (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
rack-test (2.0.2)
rack (>= 1.3)
rack-timeout (0.6.3)
rails (6.1.6.1)
actioncable (= 6.1.6.1)
actionmailbox (= 6.1.6.1)
actionmailer (= 6.1.6.1)
actionpack (= 6.1.6.1)
actiontext (= 6.1.6.1)
actionview (= 6.1.6.1)
activejob (= 6.1.6.1)
activemodel (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
bundler (>= 1.15.0)
railties (= 6.1.4.4)
railties (= 6.1.6.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -485,17 +472,17 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rails-i18n (7.0.1)
rails-i18n (7.0.5)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
rails_safe_tasks (1.0.0)
railties (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
railties (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
method_source
rake (>= 0.13)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
@@ -507,37 +494,42 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.5.1)
regexp_parser (2.2.0)
redis (4.7.1)
regexp_parser (2.5.0)
reline (0.3.1)
io-console (~> 0.5)
request_store (1.5.0)
rack (>= 1.4)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
roadie (4.0.0)
roadie (5.0.1)
css_parser (~> 1.4)
nokogiri (~> 1.8)
roadie-rails (2.2.0)
railties (>= 5.1, < 6.2)
roadie (>= 3.1, < 5.0)
roadie-rails (3.0.0)
railties (>= 5.1, < 7.1)
roadie (~> 5.0)
rodf (1.1.1)
builder (>= 3.0)
dry-inflector (~> 0.1)
rubyzip (>= 1.0)
roo (2.9.0)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-core (3.10.2)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rspec-expectations (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.2)
rspec-rails (5.1.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
@@ -547,28 +539,29 @@ GEM
rspec-support (~> 3.10)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.2)
rswag-api (2.4.0)
railties (>= 3.1, < 7.0)
rswag-specs (2.4.0)
activesupport (>= 3.1, < 7.0)
rspec-support (3.10.3)
rswag-api (2.5.1)
railties (>= 3.1, < 7.1)
rswag-specs (2.5.1)
activesupport (>= 3.1, < 7.1)
json-schema (~> 2.2)
railties (>= 3.1, < 7.0)
rswag-ui (2.4.0)
actionpack (>= 3.1, < 7.0)
railties (>= 3.1, < 7.0)
rubocop (1.22.2)
railties (>= 3.1, < 7.1)
rswag-ui (2.5.1)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.33.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-rails (2.13.2)
rubocop-ast (1.19.1)
parser (>= 3.1.1.0)
rubocop-rails (2.15.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
@@ -576,9 +569,9 @@ GEM
ruby-rc4 (0.1.5)
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.4)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (3.7.0)
rufus-scheduler (3.8.1)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
sass-rails (5.0.8)
@@ -588,23 +581,22 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
selenium-webdriver (4.0.3)
selenium-webdriver (4.3.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shoulda-matchers (5.0.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
sidekiq (6.3.1)
sidekiq (6.5.4)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.5.0)
sidekiq-scheduler (4.0.2)
redis (>= 4.2.0)
sidekiq-scheduler (3.1.0)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
sidekiq (>= 4)
tilt (>= 1.4.0)
simplecov (0.21.2)
docile (~> 1.1)
@@ -616,7 +608,7 @@ GEM
axlsx_styler (>= 1.0.0, < 2)
caxlsx (>= 2.0.2, < 4)
rodf (>= 1.0.0, < 2)
spring (3.0.0)
spring (4.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
@@ -634,35 +626,34 @@ GEM
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stringex (2.8.5)
stripe (5.42.0)
stripe (7.0.0)
temple (0.8.2)
test-prof (1.0.7)
test-unit (3.5.0)
test-prof (1.0.9)
test-unit (3.5.3)
power_assert
thor (1.2.1)
thread-local (1.1.0)
thwait (0.2.0)
e2mmap
tilt (2.0.10)
timecop (0.9.4)
tilt (2.0.11)
timecop (0.9.5)
ttfunk (1.7.0)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.1.0)
uniform_notifier (1.14.2)
valid_email2 (4.0.0)
unicode-display_width (2.2.0)
uniform_notifier (1.16.0)
valid_email2 (4.0.3)
activemodel (>= 3.2)
mail (~> 2.5)
view_component (2.41.0)
view_component (2.64.0)
activesupport (>= 5.0.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
view_component_storybook (0.10.1)
view_component_storybook (0.11.1)
view_component (>= 2.36)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.1.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
@@ -671,7 +662,7 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.14.0)
webmock (3.17.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -680,18 +671,19 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
wicked_pdf (2.1.0)
wicked_pdf (2.6.3)
activesupport
wkhtmltopdf-binary (0.12.6.5)
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.3)
zeitwerk (2.6.0)
PLATFORMS
ruby
@@ -712,14 +704,11 @@ DEPENDENCIES
angularjs-rails (= 1.8.0)
arel-helpers (~> 2.12)
awesome_nested_set
awesome_print
aws-sdk (= 1.67.0)
aws-sdk-s3
bigdecimal (= 3.0.2)
bootsnap
bugsnag
bullet
byebug
cable_ready (= 5.0.0.pre3)
cancancan (~> 1.15.0)
capybara
@@ -730,6 +719,7 @@ DEPENDENCIES
database_cleaner
db2fog!
ddtrace
debug (>= 1.0.0)
debugger-linecache
devise
devise-encryptable
@@ -765,6 +755,7 @@ DEPENDENCIES
knapsack
letter_opener (>= 1.4.1)
listen
mime-types
mimemagic (> 0.3.5)
mini_racer (= 0.4.0)
monetize (~> 1.11)
@@ -778,7 +769,6 @@ DEPENDENCIES
pdf-reader
pg (~> 1.2.3)
pry (~> 0.13.0)
pry-byebug (~> 3.9.0)
puma
rack-mini-profiler (< 3.0.0)
rack-rewrite
@@ -794,7 +784,7 @@ DEPENDENCIES
responders
rexml
roadie-rails
roo!
roo
rspec-rails (>= 3.5.2)
rspec-retry
rswag-api

View File

@@ -39,7 +39,7 @@ We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. B
## Licence
Copyright (c) 2012 - 2021 Open Food Foundation, released under the AGPL licence.
Copyright (c) 2012 - 2022 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

@@ -10,6 +10,7 @@
scope.$emit "offClick"
element.click (event) ->
return if event.target.closest(".ofn-drop-down").classList.contains "disabled" || event.target.classList.contains "disabled"
if !scope.expanded
event.stopPropagation()
scope.deregistrationCallback = scope.$on "offClick", ->

View File

@@ -20,7 +20,7 @@ angular.module("admin.orders").controller "orderCtrl", ($scope, shops, orderCycl
$scope.distributor_id && $scope.order_cycle_id
for oc in $scope.orderCycles
oc.name_and_status = "#{oc.name} (#{oc.status})"
oc.name_and_status = "#{oc.name} (#{t("admin.order_cycles.status.#{oc.status}")})"
for shop in $scope.shops
shop.disabled = !$scope.distributorHasOrderCycles(shop)

View File

@@ -1,62 +0,0 @@
angular.module("admin.orders").directive 'customerSearchOverride', ->
restrict: 'C'
scope:
distributorId: '@'
link: (scope, element, attr) ->
if $('#customer_autocomplete_template').length > 0
customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text())
formatCustomerResult = (customer) ->
customerTemplate
customer: customer
bill_address: customer.bill_address
ship_address: customer.ship_address
element.select2
placeholder: Spree.translations.choose_a_customer
minimumInputLength: 3
ajax:
url: '/admin/search/customers.json'
datatype: 'json'
data: (term, page) ->
{
q: term
distributor_id: scope.distributorId # modified
}
results: (data, page) ->
{ results: data }
dropdownCssClass: 'customer_search'
formatResult: formatCustomerResult
formatSelection: (customer) ->
_.each [
'bill_address'
'ship_address'
], (address) ->
data = customer[address]
address_parts = [
'firstname'
'lastname'
'company'
'address1'
'address2'
'city'
'zipcode'
'phone'
]
attribute_wrapper = '#order_' + address + '_attributes_'
if data # modified
_.each address_parts, (part) ->
$(attribute_wrapper + part).val data[part]
return
$(attribute_wrapper + 'state_id').select2 'val', data['state_id']
$(attribute_wrapper + 'country_id').select2 'val', data['country_id']
else
_.each address_parts, (part) ->
$(attribute_wrapper + part).val ''
return
$(attribute_wrapper + 'state_id').select2 'val', ''
$(attribute_wrapper + 'country_id').select2 'val', ''
return
$('#order_email').val customer.email
$('#user_id').val customer.user_id # modified
customer.email

View File

@@ -8,7 +8,7 @@ angular.module("admin.products")
$scope.processVariantUnitWithScale()
$scope.processUnitValueWithDescription()
$scope.processUnitPrice()
$scope.placeholder_text = new OptionValueNamer($scope.product.master).name()
$scope.placeholder_text = new OptionValueNamer($scope.product.master).name() if $scope.product.variant_unit_scale
$scope.variant_unit_options = VariantUnitManager.variantUnitOptions()
@@ -21,6 +21,8 @@ angular.module("admin.products")
else
$scope.product.variant_unit = $scope.product.variant_unit_with_scale
$scope.product.variant_unit_scale = null
else if $scope.product.variant_unit && $scope.product.variant_unit_scale
$scope.product.variant_unit_with_scale = VariantUnitManager.getUnitWithScale($scope.product.variant_unit, parseFloat($scope.product.variant_unit_scale))
else
$scope.product.variant_unit = $scope.product.variant_unit_scale = null
@@ -32,6 +34,10 @@ angular.module("admin.products")
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_description = match[3]
else
value = $scope.product.master.unit_value
value /= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
$scope.product.master.unit_value_with_description = value + " " + $scope.product.master.unit_description
$scope.processUnitPrice = ->
price = $scope.product.price

View File

@@ -13,3 +13,9 @@ angular.module("ofn.admin").factory "ProductImageService", (FileUploader, SpreeA
@imageUploader.onSuccessItem = (image, response) =>
product.thumb_url = response.thumb_url
product.image_url = response.image_url
@imageUploader.onErrorItem = (image, response) =>
if Array.isArray(response.errors)
message = response.errors.join("\n")
else
message = response.error.toString()
alert(message)

View File

@@ -36,10 +36,13 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
options = for unit_type, _ of @units
for scale in @unitScales(unit_type, available)
name = @getUnitName(scale, unit_type)
["#{I18n.t(unit_type)} (#{name})", "#{unit_type}_#{scale}"]
["#{I18n.t(unit_type)} (#{name})", @getUnitWithScale(unit_type, scale)]
options.push [[I18n.t('items'), 'items']]
options = [].concat options...
@getUnitWithScale: (unit_type, scale) ->
"#{unit_type}_#{scale}"
@getUnitName: (scale, unitType) ->
if @units[unitType][scale]
@units[unitType][scale]['name']

View File

@@ -25,13 +25,12 @@ $(document).ready(function() {
var link = $(this);
var shipment_number = link.data('shipment-number');
var selected_shipping_rate_id = link.parents('tbody').find("select#selected_shipping_rate_id[data-shipment-number='" + shipment_number + "']").val();
var unlock = link.parents('tbody').find("input[name='open_adjustment'][data-shipment-number='" + shipment_number + "']:checked").val();
var url = Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number + ".json");
$.ajax({
type: "PUT",
url: url,
data: { shipment: { selected_shipping_rate_id: selected_shipping_rate_id, unlock: unlock } }
data: { shipment: { selected_shipping_rate_id: selected_shipping_rate_id } }
}).done(function( msg ) {
window.location.reload();
}).error(function( msg ) {
@@ -40,25 +39,94 @@ $(document).ready(function() {
}
$('[data-hook=admin_order_edit_form] a.save-method').click(handle_shipping_method_save);
//handle tracking edit click
//handle tracking info edit/delete
// Show the input field to edit the tracking info
// And hide the input field when cancel is clicked
$('a.edit-tracking').click(toggleTrackingEdit);
$('a.cancel-tracking').click(toggleTrackingEdit);
handle_tracking_save = function(){
var link = $(this);
var shipment_number = link.data('shipment-number');
var tracking = link.parents('tbody').find('input#tracking').val();
var url = Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number + ".json");
saveTrackingInfo = function(){
let shipmentNumber = $(this).data('shipment-number');
let tracking = document.getElementById('tracking').value
makeApiCall(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } } )
}
deleteTrackingInfo = function(){
let shipmentNumber = $(this).data('shipment-number');
let tracking = ''
confirmDelete(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } })
}
trackingUrl = function(shipmentNumber){
return Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipmentNumber + ".json");
}
$('[data-hook=admin_order_edit_form] a.save-tracking').click(saveTrackingInfo);
$('[data-hook=admin_order_edit_form] a.delete-tracking').click(deleteTrackingInfo);
// handle note edit/delete
// Show the input field to edit the note
// And hide the input field when cancel is clicked
$('a.edit-note.icon-edit').click(toggleNoteEdit);
$('a.cancel-note').click(toggleNoteEdit);
saveNote = function(){
let note = document.getElementById('note').value
makeApiCall(getNoteUrl(), { note: note })
}
deleteNote = function(){
let note = ''
confirmDelete(getNoteUrl(), { note: note })
}
getNoteUrl = function(){
return Spree.url( Spree.routes.orders_api + "/" + order_number);
}
confirmDelete = function(url, params){
displayDeleteAlert(function(confirmation) {
if (confirmation) {
makeApiCall(url, params)
}
});
}
$('[data-hook=admin_order_edit_form] a.save-note').click(saveNote);
$('[data-hook=admin_order_edit_form] a.delete-note').click(deleteNote);
// Makes API call for notes/tracking info
makeApiCall = function(url, params) {
$.ajax({
type: "PUT",
url: url,
data: { shipment: { tracking: tracking } }
data: params
}).done(function( msg ) {
window.location.reload();
}).error(function( msg ) {
console.log(msg);
});
}
$('[data-hook=admin_order_edit_form] a.save-tracking').click(handle_tracking_save);
displayDeleteAlert = function(callback) {
i18nKey = "are_you_sure";
$('#custom-confirm .message').html(
` ${t(i18nKey)}
<div class="form">
</div>`);
$('#custom-confirm button.confirm').unbind( "click" ).click(() => {
$('#custom-confirm').hide();
callback(true);
});
$('#custom-confirm button.cancel').click(() => {
$('#custom-confirm').hide();
callback(false)
});
$('#custom-confirm').show();
}
});

View File

@@ -141,8 +141,26 @@ doAdjustItems = function(shipment_number, variant_id, quantity, inventory_units,
toggleTrackingEdit = function(){
var link = $(this);
link.parents('tbody').find('tr.edit-tracking').toggle();
link.parents('tbody').find('tr.show-tracking').toggle();
var parent_node = link.parents('tbody')
let input = parent_node.find('#tracking')[0]
parent_node.find('tr.edit-tracking').toggle();
// Set focus on input and
// put cursor at it's end
input.focus()
input.setSelectionRange(-1, -1)
parent_node.find('tr.show-tracking').toggle();
}
toggleNoteEdit = function(){
var link = $(this);
var parent_node = link.parents('tbody')
let input = parent_node.find('#note')[0]
parent_node.find('tr.edit-note').toggle();
// Set focus on input and
// put cursor at it's end
input.focus()
input.setSelectionRange(-1, -1)
parent_node.find('tr.show-note').toggle();
}
toggleMethodEdit = function(){

View File

@@ -8,13 +8,18 @@ handle_move = (e, data) ->
node = data.rslt.o
new_parent = data.rslt.np
url = Spree.url(base_url).clone()
url.pathname = url.pathname + '/' + node.attr("id")
url = new URL(base_url)
url.pathname = url.pathname + '/' + node.attr("id")
data = {
_method: "put",
"taxon[position]": position,
"taxon[parent_id]": if !isNaN(new_parent.attr("id")) then new_parent.attr("id") else undefined
}
$.ajax
type: "POST",
dataType: "json",
url: url.toString(),
data: ({_method: "put", "taxon[parent_id]": new_parent.attr("id"), "taxon[position]": position }),
data: data,
error: handle_ajax_error
true
@@ -26,11 +31,16 @@ handle_create = (e, data) ->
position = data.rslt.position
new_parent = data.rslt.parent
data = {
"taxon[name]": name,
"taxon[position]": position
"taxon[parent_id]": if !isNaN(new_parent.attr("id")) then new_parent.attr("id") else undefined
}
$.ajax
type: "POST",
dataType: "json",
url: base_url.toString(),
data: ({"taxon[name]": name, "taxon[parent_id]": new_parent.attr("id"), "taxon[position]": position }),
data: data,
error: handle_ajax_error,
success: (data,result) ->
node.attr('id', data.id)
@@ -39,8 +49,10 @@ handle_rename = (e, data) ->
last_rollback = data.rlbk
node = data.rslt.obj
name = data.rslt.new_name
# change the name inside the main input field as well if taxon is the root one
document.getElementById("taxonomy_name").value = name if node.parents("[id]").attr("id") == "taxonomy_tree"
url = Spree.url(base_url).clone()
url = new URL(base_url)
url.pathname = url.pathname + '/' + node.attr("id")
$.ajax
@@ -53,8 +65,8 @@ handle_rename = (e, data) ->
handle_delete = (e, data) ->
last_rollback = data.rlbk
node = data.rslt.obj
delete_url = base_url.clone()
delete_url.setPath delete_url.path() + '/' + node.attr("id")
delete_url = new URL(base_url)
delete_url.pathname = delete_url.pathname + '/' + node.attr("id")
if confirm(Spree.translations.are_you_sure_delete)
$.ajax
type: "POST",

View File

@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
templateUrl: "admin/tags_input.html"
scope:
object: "="
form: "="
tagsAttr: "@?"
tagListAttr: "@?"
findTags: "&"
@@ -18,7 +19,15 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
scope.limitReached = scope.object[scope.tagsAttr].length >= scope.max if scope.max != undefined
scope.object[scope.tagListAttr] = (tag.text for tag in scope.object[scope.tagsAttr]).join(",")
scope.$watch "object", (newObject) ->
scope.object = newObject
init()
$timeout ->
init()
init = ->
return unless scope.object
# Initialize properties if necessary
scope.tagsAttr ||= "tags"
scope.tagListAttr ||= "tag_list"

View File

@@ -5,15 +5,16 @@ angular.module("admin.utils").factory "ErrorsParser", ->
return defaultContent unless errors?
errorsString = ""
if errors.length > 0
if Array.isArray(errors)
# it is an array of errors
errorsString = errors.join("\n") + "\n"
else
else if typeof errors == "object"
# it is a hash of errors
keys = Object.keys(errors)
for key in keys
errorsString += errors[key].join("\n") + "\n"
else # string
errorsString = errors
this.defaultIfEmpty(errorsString, defaultContent)
defaultIfEmpty: (content, defaultContent) =>

View File

@@ -20,3 +20,6 @@ angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, $http, Credit
).finally ->
window.location.reload()
$scope.hasOneDefaultSavedCards = () ->
$scope.savedCreditCards.some((card) -> card.is_default)

View File

@@ -26,4 +26,8 @@ angular.module('mm.foundation.offcanvas').directive 'offCanvasWrap', ($window) -
# Bind hiding of the off-canvas that only happens when screen width is over 1024px.
win.bind 'resize.body', ->
isolatedScope.hide() if $(window).width() > 1024
win.bind 'click.body', (e) ->
if e.target.closest(".left-off-canvas-menu") == null && e.target.closest(".left-off-canvas-toggle") == null
isolatedScope.hide()
}

View File

@@ -1,8 +1,12 @@
%div.contact-container
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone"}
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone || enterprise.whatsapp_phone"}
%p.modal-header {{'contact' | t}}
%p{"ng-if" => "::enterprise.phone", "ng-bind" => "::enterprise.phone"}
%p{"ng-if" => "::enterprise.whatsapp_phone"}
%img{ src: image_path("/map_icons/social-logos/whatsapp.svg") }
%a{"ng-href" => "{{::enterprise.whatsapp_url}}", target: "_blank", "ng-bind" => "::enterprise.whatsapp_phone"}
%p{"ng-if" => "::enterprise.email_address"}
%a{"ng-href" => "{{::enterprise.email_address | stripUrl}}", target: "_blank", mailto: true}
%span.obfuscatedEmail.email{"ng-bind" => "::enterprise.email_address | stripUrl"}

View File

@@ -9,19 +9,19 @@
%span{"ng-bind" => "::'item_cost' | t"}
%li{"ng-if" => "::variant.fees.admin"}
.right {{ ::variant.fees.admin | localizeCurrency }}
%span{"ng-bind" => "::'admin_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.admin"}
%li{"ng-if" => "::variant.fees.sales"}
.right {{ ::variant.fees.sales | localizeCurrency }}
%span{"ng-bind" => "::'sales_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.sales"}
%li{"ng-if" => "::variant.fees.packing"}
.right {{ ::variant.fees.packing | localizeCurrency }}
%span{"ng-bind" => "::'packing_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.packing"}
%li{"ng-if" => "::variant.fees.transport"}
.right {{ ::variant.fees.transport | localizeCurrency }}
%span{"ng-bind" => "::'transport_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.transport"}
%li{"ng-if" => "::variant.fees.fundraising"}
.right {{ ::variant.fees.fundraising | localizeCurrency }}
%span{"ng-bind" => "::'fundraising_fee' | t"}
%span{"ng-bind" => "::variant.fees_name.fundraising"}
%li
%strong
.right = {{ ::variant.price_with_fees | localizeCurrency }}

View File

@@ -19,6 +19,7 @@ module Admin
:enable_invoices?,
:invoice_style2?,
:enable_receipt_printing?,
:enterprise_number_required_on_invoices?,
)
end
end

View File

@@ -46,6 +46,14 @@ module Admin
# Initialize data
params[:display_summary_row] = true if request.get?
if OpenFoodNetwork::FeatureToggle.enabled?(:report_inverse_columns_logic,
spree_current_user)
@params_fields_to_show = if request.get?
@report.columns.keys
else
params[:fields_to_show]
end
end
@data = Reporting::FrontendData.new(spree_current_user)
end

View File

@@ -26,6 +26,13 @@ module Api
}
end
def update
authorize! :admin, order
order.update!(order_params)
render json: order, serializer: Api::OrderDetailedSerializer, current_order: order
end
def ship
authorize! :admin, order
@@ -72,6 +79,10 @@ module Api
includes(line_items: { variant: [:product, :stock_items, :default_price] }).
first!
end
def order_params
params.permit(:note)
end
end
end
end

View File

@@ -6,20 +6,21 @@ module Api
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
product = Spree::Product.find(params[:product_id])
authorize! :update, product
if @product.images.first.nil?
@image = Spree::Image.create(
attachment: params[:file],
viewable_id: @product.master.id,
viewable_type: 'Spree::Variant'
)
render json: @image, serializer: ImageSerializer, status: :created
image = product.images.first || Spree::Image.new(
viewable_id: product.master.id,
viewable_type: 'Spree::Variant'
)
success_status = image.persisted? ? :ok : :created
if image.update(attachment: params[:file])
render json: image, serializer: ImageSerializer, status: success_status
else
@image = @product.images.first
@image.update(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
error_json = { errors: image.errors.full_messages }
render json: error_json, status: :unprocessable_entity
end
end
end

View File

@@ -28,19 +28,14 @@ module Api
authorize! :read, Spree::Shipment
@shipment = @order.shipments.find_by!(number: params[:id])
params[:shipment] ||= []
unlock = params[:shipment].delete(:unlock)
if unlock == 'yes'
@shipment.fee_adjustment.fire_events(:open)
end
@shipment.fee_adjustment.fire_events(:open)
if @shipment.update(shipment_params)
@order.updater.update_totals_and_states
end
if unlock == 'yes'
@shipment.fee_adjustment.close
end
@shipment.fee_adjustment.close
render json: @shipment.reload, serializer: Api::ShipmentSerializer, status: :ok
end

View File

@@ -73,7 +73,7 @@ module Api
def taxon_params
return if params[:taxon].blank?
params.require(:taxon).permit([:name, :parent_id])
params.require(:taxon).permit([:name, :parent_id, :position])
end
end
end

View File

@@ -5,9 +5,10 @@ require 'open_food_network/permissions'
module Api
module V1
class CustomersController < Api::V1::BaseController
include AddressTransformation
skip_authorization_check only: :index
before_action :set_customer, only: [:show, :update, :destroy]
before_action :authorize_action, only: [:show, :update, :destroy]
def index
@@ -17,44 +18,44 @@ module Api
end
def show
render json: Api::V1::CustomerSerializer.new(@customer, include_options)
render json: Api::V1::CustomerSerializer.new(customer, include_options)
end
def create
authorize! :update, Enterprise.find(customer_params[:enterprise_id])
@customer = Customer.new(customer_params)
customer = Customer.new(customer_params)
if @customer.save
render json: Api::V1::CustomerSerializer.new(@customer), status: :created
if customer.save
render json: Api::V1::CustomerSerializer.new(customer), status: :created
else
invalid_resource! @customer
invalid_resource! customer
end
end
def update
if @customer.update(customer_params)
render json: Api::V1::CustomerSerializer.new(@customer)
if customer.update(customer_params)
render json: Api::V1::CustomerSerializer.new(customer)
else
invalid_resource! @customer
invalid_resource! customer
end
end
def destroy
if @customer.destroy
render json: Api::V1::CustomerSerializer.new(@customer)
if customer.destroy
render json: Api::V1::CustomerSerializer.new(customer)
else
invalid_resource! @customer
invalid_resource! customer
end
end
private
def set_customer
@customer = Customer.find(params[:id])
def customer
@customer ||= Customer.find(params[:id])
end
def authorize_action
authorize! action_name.to_sym, @customer
authorize! action_name.to_sym, customer
end
def search_customers
@@ -77,7 +78,8 @@ module Api
:phone, :latitude, :longitude,
:first_name, :last_name,
:street_address_1, :street_address_2,
:postal_code, :locality, :region, :country,
:postal_code, :locality,
{ region: [:name, :code], country: [:name, :code] },
]
).to_h
@@ -89,39 +91,6 @@ module Api
attributes
end
def transform_address!(attributes, from, to)
return unless attributes.key?(from)
address = attributes.delete(from)
if address.nil?
attributes[to] = nil
return
end
address.transform_keys! do |key|
{
phone: :phone, latitude: :latitude, longitude: :longitude,
first_name: :firstname, last_name: :lastname,
street_address_1: :address1, street_address_2: :address2,
postal_code: :zipcode,
locality: :city,
region: :state_name,
country: :country,
}.with_indifferent_access[key]
end
if address[:state_name].present?
address[:state] = Spree::State.find_by(name: address[:state_name])
end
if address[:country].present?
address[:country] = Spree::Country.find_by(name: address[:country])
end
attributes["#{to}_attributes"] = address
end
def editable_enterprises
OpenFoodNetwork::Permissions.new(current_api_user).editable_enterprises.select(:id)
end

View File

@@ -39,6 +39,7 @@ class ApplicationController < ActionController::Base
include Spree::Core::ControllerHelpers::Common
before_action :set_cache_headers # prevent cart emptying via cache when using back button #1213
before_action :check_disabled_user, if: :spree_user_signed_in?
before_action :set_after_login_url
include RawParams
@@ -159,6 +160,14 @@ class ApplicationController < ActionController::Base
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
def check_disabled_user
return unless current_spree_user.disabled
flash[:success] = nil
flash.now[:error] = I18n.t("devise.failure.disabled")
sign_out current_spree_user
end
end
require 'spree/i18n/initializer'

View File

@@ -0,0 +1,48 @@
# frozen_string_literal: true
# Our internal data structures are different to the API data strurctures.
module AddressTransformation
extend ActiveSupport::Concern
def transform_address!(attributes, from, to)
return unless attributes.key?(from)
address = attributes.delete(from)
if address.nil?
attributes[to] = nil
return
end
address.transform_keys! do |key|
{
phone: :phone, latitude: :latitude, longitude: :longitude,
first_name: :firstname, last_name: :lastname,
street_address_1: :address1, street_address_2: :address2,
postal_code: :zipcode,
locality: :city,
region: :state,
country: :country,
}.with_indifferent_access[key]
end
address[:state] = find_state(address) if address[:state].present?
address[:country] = find_country(address) if address[:country].present?
attributes["#{to}_attributes"] = address
end
private
def find_state(address)
Spree::State.find_by("LOWER(abbr) = ? OR LOWER(name) = ?",
address.dig(:state, :code)&.downcase,
address.dig(:state, :name)&.downcase)
end
def find_country(address)
Spree::Country.find_by("LOWER(iso) = ? OR LOWER(name) = ?",
address.dig(:country, :code)&.downcase,
address.dig(:country, :name)&.downcase)
end
end

View File

@@ -42,6 +42,10 @@ module Spree
@order.update_order!
end
if params[:set_distribution_step] && @order.update(order_params)
return redirect_to spree.admin_order_customer_path(@order)
end
unless order_params.present? && @order.update(order_params) && @order.line_items.present?
if @order.line_items.empty? && !params[:suppress_error_msg]
@order.errors.add(:line_items, Spree.t('errors.messages.blank'))
@@ -55,7 +59,7 @@ module Spree
redirect_to spree.edit_admin_order_path(@order)
else
# Jump to next step if order is not complete
redirect_to spree.admin_order_customer_path(@order)
redirect_to spree.admin_order_payments_path(@order)
end
end
@@ -126,7 +130,7 @@ module Spree
end
def require_distributor_abn
return if @order.distributor.abn.present?
return if @order.distributor.can_invoice?
flash[:error] = t(:must_have_valid_business_number,
enterprise_name: @order.distributor.name)

View File

@@ -30,12 +30,11 @@ module Spree
@object.attributes = permitted_resource_params
if @object.save
flash[:success] = flash_message_for(@object, :successfully_created)
if params[:button] == "add_another"
redirect_to spree.new_admin_product_path
else
redirect_to spree.admin_products_path
end
redirect_after_save
else
# Re-fill the form with deleted params on product
@on_hand = request.params[:product][:on_hand]
@on_demand = request.params[:product][:on_demand]
render :new
end
end
@@ -138,6 +137,14 @@ module Spree
private
def redirect_after_save
if params[:button] == "add_another"
redirect_to spree.new_admin_product_path
else
redirect_to spree.admin_products_path
end
end
def product_set_from_params
collection_hash = Hash[products_bulk_params[:products].each_with_index.map { |p, i|
[i, p]

View File

@@ -49,7 +49,10 @@ module Spree
# Using try because we may not have a card here
if @credit_card.try(:destroy)
remove_shop_authorizations if @credit_card.is_default
if @credit_card.is_default
remove_shop_authorizations
mark_as_default_next_credit_card if credit_cards_with_payment_profile.count > 0
end
flash[:success] = I18n.t(:card_has_been_removed, number: "x-#{@credit_card.last_digits}")
else
flash[:error] = I18n.t(:card_could_not_be_removed)
@@ -67,6 +70,14 @@ module Spree
@credit_card.user.customers.update_all(allow_charges: false)
end
def mark_as_default_next_credit_card
credit_cards_with_payment_profile.first.update(is_default: true)
end
def credit_cards_with_payment_profile
spree_current_user.credit_cards.with_payment_profile
end
def create_customer(token)
Stripe::Customer.create(email: spree_current_user.email, source: token)
end

View File

@@ -4,6 +4,8 @@ module Spree
class OrdersController < ::BaseController
include OrderCyclesHelper
include Rails.application.routes.url_helpers
include CablecarResponses
layout 'darkswarm'
@@ -99,7 +101,8 @@ module Spree
else
flash[:error] = I18n.t(:orders_could_not_cancel)
end
redirect_to request.referer || main_app.order_path(@order)
render status: :found,
operations: cable_car.redirect_to(url: request.referer || main_app.order_path(@order))
end
private

View File

@@ -44,6 +44,14 @@ module Spree
end
end
def print_invoice_link
if @order.distributor.can_invoice?
print_invoice_link_with_url
else
notify_about_required_enterprise_number
end
end
def ticket_links
return [] unless Spree::Config[:enable_receipt_printing?]
@@ -78,13 +86,20 @@ module Spree
confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) }
end
def print_invoice_link
def print_invoice_link_with_url
{ name: t(:print_invoice),
url: spree.print_admin_order_path(@order),
icon: 'icon-print',
target: "_blank" }
end
def notify_about_required_enterprise_number
{ name: t(:print_invoice),
url: "#",
icon: 'icon-print',
confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) }
end
def print_ticket_link
{ name: t(:print_ticket),
url: print_ticket_admin_order_path(@order),

View File

@@ -41,8 +41,8 @@ class CustomerSchema < JsonApiSchema
street_address_2: "",
postal_code: "1234",
locality: "Melbourne",
region: "Victoria",
country: "Australia",
region: { code: "Vic", name: "Victoria" },
country: { code: "AU", name: "Australia" },
}
end

View File

@@ -10,7 +10,7 @@ class Customer < ApplicationRecord
belongs_to :enterprise
belongs_to :user, class_name: "Spree::User"
has_many :orders, class_name: "Spree::Order"
before_destroy :check_for_orders
before_destroy :update_orders_and_delete_canceled_subscriptions
belongs_to :bill_address, class_name: "Spree::Address"
alias_attribute :billing_address, :bill_address
@@ -52,10 +52,12 @@ class Customer < ApplicationRecord
self.user = user || Spree::User.find_by(email: email)
end
def check_for_orders
return true unless orders.any?
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_orders'))
throw :abort
def update_orders_and_delete_canceled_subscriptions
if Subscription.where(customer_id: id).not_canceled.any?
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_subscriptions'))
throw :abort
end
Subscription.where(customer_id: id).destroy_all
orders.update_all(customer_id: nil)
end
end

View File

@@ -84,8 +84,8 @@ class Enterprise < ApplicationRecord
has_one_attached :promo_image
has_one_attached :terms_and_conditions
validates :logo, content_type: %r{\Aimage/.*\Z}
validates :promo_image, content_type: %r{\Aimage/.*\Z}
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :terms_and_conditions, content_type: {
in: "application/pdf",
message: I18n.t(:enterprise_terms_and_conditions_type_error),
@@ -312,6 +312,10 @@ class Enterprise < ApplicationRecord
correct_instagram_url self[:instagram]
end
def whatsapp_url
correct_whatsapp_url self[:whatsapp_phone]
end
def inventory_variants
if prefers_product_selection_from_inventory_only?
Spree::Variant.visible_for(self)
@@ -408,6 +412,8 @@ class Enterprise < ApplicationRecord
end
def can_invoice?
return true unless Spree::Config.enterprise_number_required_on_invoices?
abn.present?
end
@@ -446,6 +452,10 @@ class Enterprise < ApplicationRecord
url&.sub(%r{(https?://)?}, '')
end
def correct_whatsapp_url(phone_number)
phone_number && "https://wa.me/" + phone_number.tr('+ ', '')
end
def correct_instagram_url(url)
url && strip_url(url).sub(%r{www.instagram.com/}, '').delete("@")
end

View File

@@ -28,8 +28,8 @@ class EnterpriseGroup < ApplicationRecord
has_one_attached :logo
has_one_attached :promo_image
validates :logo, content_type: %r{\Aimage/.*\Z}
validates :promo_image, content_type: %r{\Aimage/.*\Z}
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
scope :by_position, -> { order('position ASC') }
scope :on_front_page, -> { where(on_front_page: true) }

View File

@@ -5,7 +5,7 @@
# This reduces the need to keep Orders in sync with their parent Subscriptions
class ProxyOrder < ApplicationRecord
belongs_to :order, class_name: 'Spree::Order', dependent: :destroy
belongs_to :order, class_name: 'Spree::Order'
belongs_to :subscription
belongs_to :order_cycle

View File

@@ -129,6 +129,7 @@ module Spree
preference :enable_invoices?, :boolean, default: true
preference :invoice_style2?, :boolean, default: false
preference :enable_receipt_printing?, :boolean, default: false
preference :enterprise_number_required_on_invoices?, :boolean, default: true
# Stripe payments
preference :stripe_connect_enabled, :boolean, default: false

View File

@@ -11,15 +11,19 @@ module Spree
has_one_attached :attachment
validates :attachment, attached: true, content_type: %r{\Aimage/.*\Z}
validates :attachment, attached: true, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
validate :no_attachment_errors
def variant(name)
attachment.variant(SIZES[name])
if attachment.variable?
attachment.variant(SIZES[name])
else
attachment
end
end
def url(size)
return unless attachment.variable?
return unless attachment.attached?
Rails.application.routes.url_helpers.url_for(variant(size))
end

View File

@@ -433,7 +433,7 @@ module Spree
all_adjustments.destroy_all
payments.clear
shipments.destroy_all
restart_checkout_flow if state == "payment"
restart_checkout_flow if state.in?(["payment", "confirmation"])
end
def state_changed(name)

View File

@@ -41,7 +41,7 @@ module Spree
accepts_nested_attributes_for :bill_address
accepts_nested_attributes_for :ship_address
after_create :associate_customers
after_create :associate_customers, :associate_orders
validate :limit_owned_enterprises
@@ -113,6 +113,12 @@ module Spree
self.customers = Customer.where(email: email)
end
def associate_orders
Spree::Order.where(customer: customers).find_each do |order|
order.associate_user!(self)
end
end
def can_own_more_enterprises?
owned_enterprises.reload.size < enterprise_limit
end
@@ -144,6 +150,14 @@ module Spree
"#{self.class.name};#{id}"
end
def disabled
disabled_at.present?
end
def disabled=(value)
self.disabled_at = value == '1' ? Time.zone.now : nil
end
protected
def password_required?

View File

@@ -172,6 +172,11 @@ module Spree
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle).fees_by_type_for self
end
def fees_name_by_type_for(distributor, order_cycle)
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor,
order_cycle).fees_name_by_type_for self
end
def option_value(opt_name)
option_values.detect { |o| o.option_type.name == opt_name }.try(:presentation)
end

View File

@@ -17,9 +17,9 @@ class Subscription < ApplicationRecord
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
belongs_to :bill_address, class_name: "Spree::Address"
belongs_to :ship_address, class_name: "Spree::Address"
has_many :subscription_line_items, inverse_of: :subscription
has_many :subscription_line_items, inverse_of: :subscription, dependent: :destroy
has_many :order_cycles, through: :schedule
has_many :proxy_orders
has_many :proxy_orders, dependent: :destroy
has_many :orders, through: :proxy_orders
alias_attribute :billing_address, :bill_address

View File

@@ -14,9 +14,9 @@ module Api
attributes :name, :id, :description, :latitude, :longitude,
:long_description, :website, :instagram, :linkedin, :twitter,
:facebook, :is_primary_producer, :is_distributor, :phone, :visible,
:email_address, :hash, :logo, :promo_image, :path, :pickup, :delivery,
:icon, :icon_font, :producer_icon_font, :category
:facebook, :is_primary_producer, :is_distributor, :phone, :whatsapp_phone,
:whatsapp_url, :visible, :email_address, :hash, :logo, :promo_image, :path, :pickup,
:delivery, :icon, :icon_font, :producer_icon_font, :category
attributes :taxons, :supplied_taxons

View File

@@ -7,9 +7,9 @@ module Api
attributes :name, :id, :description, :latitude, :longitude, :long_description, :website,
:instagram, :linkedin, :twitter, :facebook, :is_primary_producer, :is_distributor,
:phone, :visible, :email_address, :hash, :logo, :promo_image, :path, :category,
:active, :producers, :orders_close_at, :hubs, :taxons, :supplied_taxons, :pickup,
:delivery, :preferred_product_low_stock_display
:phone, :whatsapp_phone, :whatsapp_url, :visible, :email_address, :hash, :logo,
:promo_image, :path, :category, :active, :producers, :orders_close_at, :hubs,
:taxons, :supplied_taxons, :pickup, :delivery, :preferred_product_low_stock_display
has_one :address, serializer: Api::AddressSerializer
has_many :supplied_properties, serializer: Api::PropertySerializer

View File

@@ -11,8 +11,18 @@ module Api
attribute :street_address_2, &:address2
attribute :postal_code, &:zipcode
attribute :locality, &:city
attribute :region, &:state_name
attribute :country, ->(object, _) { object.country.name }
attribute :region do |object|
{
name: object.state.name,
code: object.state.abbr,
}
end
attribute :country do |object|
{
name: object.country.name,
code: object.country.iso,
}
end
end
end
end

View File

@@ -4,7 +4,8 @@ class Api::VariantSerializer < ActiveModel::Serializer
attributes :id, :is_master, :product_name, :sku,
:options_text, :unit_value, :unit_description, :unit_to_display,
:display_as, :display_name, :name_to_display,
:price, :on_demand, :on_hand, :fees, :price_with_fees,
:price, :on_demand, :on_hand,
:fees, :fees_name, :price_with_fees,
:tag_list, :thumb_url,
:unit_price_price, :unit_price_unit
@@ -15,6 +16,10 @@ class Api::VariantSerializer < ActiveModel::Serializer
object.fees_by_type_for(options[:current_distributor], options[:current_order_cycle])
end
def fees_name
object.fees_name_by_type_for(options[:current_distributor], options[:current_order_cycle])
end
def price_with_fees
if options[:enterprise_fee_calculator]
object.price + options[:enterprise_fee_calculator].indexed_fees_for(object)

View File

@@ -25,10 +25,10 @@ module PermittedAttributes
def self.basic_permitted_attributes
[
:id, :name, :visible, :permalink, :owner_id, :contact_name, :email_address, :phone,
:is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin, :twitter,
:description, :long_description, :logo, :promo_image, :terms_and_conditions,
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions,
:abn, :acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
:whatsapp_phone, :is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin,
:twitter, :description, :long_description, :logo, :promo_image, :terms_and_conditions,
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions, :abn,
:acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
:preferred_product_selection_from_inventory_only, :preferred_shopfront_message,
:preferred_shopfront_closed_message, :preferred_shopfront_taxon_order,
:preferred_shopfront_producer_order, :preferred_shopfront_order_cycle_order,

View File

@@ -15,7 +15,7 @@ module PermittedAttributes
private
def permitted_attributes
[:email, :password, :password_confirmation]
[:email, :password, :password_confirmation, :disabled]
end
end
end

View File

@@ -97,6 +97,7 @@ module Sets
variants_attributes.each do |attributes|
create_or_update_variant(product, attributes)
end
product.errors.empty?
end
def create_or_update_variant(product, variant_attributes)
@@ -114,6 +115,11 @@ module Sets
variant = product.variants.create(variant_attributes)
if variant.errors.present?
product.errors.merge!(variant.errors)
return false
end
begin
variant.on_demand = on_demand if on_demand.present?
variant.on_hand = on_hand.to_i if on_hand.present?

View File

@@ -15,6 +15,13 @@
= f.label :phone, t('.phone')
.omega.eight.columns
= f.text_field :phone, { placeholder: t('.phone_placeholder') }
.row
.alpha.three.columns
= f.label :whatsapp_phone, t('.whatsapp_phone')
%div{'ofn-with-tip' => t('.whatsapp_phone_tip')}
%a= t('admin.whats_this')
.omega.eight.columns
= f.text_field :whatsapp_phone, { placeholder: t('.whatsapp_phone_placeholder') }
.row
.alpha.three.columns
= f.label :website, t('.website')

View File

@@ -20,5 +20,10 @@
= check_box_tag 'preferences[enable_receipt_printing?]', '1', Spree::Config[:enable_receipt_printing?]
= label_tag nil, t('.enable_receipt_printing?')
.field.align-center
= hidden_field_tag 'preferences[enterprise_number_required_on_invoices?]', '0'
= check_box_tag 'preferences[enterprise_number_required_on_invoices?]', '1', Spree::Config[:enterprise_number_required_on_invoices?]
= label_tag nil, t('.enterprise_number_required_on_invoices?')
.form-buttons{"data-hook" => "buttons"}
= button t(:update), 'icon-refresh'

View File

@@ -19,6 +19,10 @@
%tr.products
%td{ ng: { include: "'admin/panels/exchange_products_simple.html'" } }
%br
= label_tag t('.tags')
%tags-with-translation{ object: 'order_cycle.outgoing_exchanges[0]', form: 'order_cycle_form' }
%br/
= label_tag t('.fees')
= render 'coordinator_fees', f: f

View File

@@ -1,8 +1,12 @@
- if @report_subtypes.present? && @report_subtypes.count > 1
.row
.alpha.two.columns= label_tag nil, t(:report_type)
.omega.fourteen.columns
= select_tag(:report_subtype, options_for_select(@report_subtypes, @report_subtype))
- if feature?(:report_inverse_columns_logic, spree_current_user)
%input{type: 'hidden', name: 'report_subtype', value: @report_subtype}
- else
.row
.alpha.two.columns= label_tag nil, t(:report_type)
.omega.fourteen.columns
= select_tag(:report_subtype, options_for_select(@report_subtypes, @report_subtype))
- if @report.header_option? || @report.summary_row_option?
.row
@@ -19,10 +23,16 @@
- if @report.available_headers.present?
.row
.alpha.two.columns= label_tag nil, t(:report_hide_columns)
.omega.fourteen.columns
= select_tag(:fields_to_hide, options_for_select(@report.available_headers, params[:fields_to_hide]),
class: "select2 fullwidth", multiple: true)
- if feature? :report_inverse_columns_logic, spree_current_user
.alpha.two.columns= label_tag nil, t(:report_columns)
.omega.fourteen.columns
= select_tag(:fields_to_show, options_for_select(@report.available_headers, @params_fields_to_show),
class: "select2 fullwidth", multiple: true)
- else
.alpha.two.columns= label_tag nil, t(:report_hide_columns)
.omega.fourteen.columns
= select_tag(:fields_to_hide, options_for_select(@report.available_headers, params[:fields_to_hide]),
class: "select2 fullwidth", multiple: true)
.row.rendering-options
.alpha.two.columns

View File

@@ -0,0 +1,5 @@
%ul{style: "margin-left: 12pt"}
- report_subtypes.each do |report_subtype|
%li
- url = main_app.admin_report_url(report_type: report_type, report_subtype: report_subtype[1])
= link_to report_subtype[0], url

View File

@@ -17,9 +17,7 @@
%td
- begin
= I18n.t!(:description, scope: [:admin, :reports, report_type])
- if feature? :report_inverse_columns_logic, spree_current_user
= render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }
- rescue I18n::MissingTranslationData
%ul{style: "margin-left: 12pt"}
- report_subtypes.each do |report_subtype|
%li
- url = main_app.admin_report_url(report_type: report_type, report_subtype: report_subtype[1])
= link_to report_subtype[0], url
= render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }

View File

@@ -14,6 +14,6 @@
= t(".using_default_terms_html", tos_link: link_to_platform_terms)
= form_for [main_app, :admin, @new_file] do |f|
= f.label :attachment
= f.label :attachment, t(".attachment")
= f.file_field :attachment
= f.submit
= f.submit t(".create_terms_of_service")

View File

@@ -1,7 +1,7 @@
- if Spree::Config.matomo_tag_manager_url.present?
:javascript
var _mtm = _mtm || [];
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
var u="#{Spree::Config.matomo_tag_manager_url}";

View File

@@ -14,6 +14,7 @@
= favicon_link_tag "/favicon-staging.ico"
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
%link{href: asset_pack_path("media/fonts/OFN-v2.woff"), rel: "preload", as: "font", crossorigin: "anonymous"}
= render "layouts/matomo_tag"
= language_meta_tags
= stylesheet_pack_tag "darkswarm", "data-turbo-track": "reload"
@@ -57,6 +58,5 @@
= inject_currency_config
= yield :injection_data
= render "layouts/matomo_tag"
= render "layouts/login_modal"

View File

@@ -38,6 +38,11 @@
= t :producers_contact_phone
%span{"ng-bind" => "::producer.phone"}
%p.word-wrap{"ng-if" => "::producer.whatsapp_phone"}
%a{"ng-href" => "{{::producer.whatsapp_url}}", target: "_blank"}
%img{ src: image_pack_path("social-logos/whatsapp.svg") }
%span{"ng-bind" => "::producer.whatsapp_phone"}
%p.word-wrap{"ng-if" => "::producer.email_address"}
%a{"ng-href" => "{{::producer.email_address | stripUrl}}", target: "_blank", mailto: true}
%span.obfuscatedEmail.email{"ng-bind" => "::producer.email_address | stripUrl"}

View File

@@ -24,6 +24,10 @@
.small-12.columns.field
%label{ for: 'enterprise_phone' }= t(".phone_field")+":"
%input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } }
.row
.small-12.columns.field
%label{ "for" => 'enterprise_whatsapp_phone', 'data-toggle' => "tooltip", 'title' => "{{'registration.steps.contact.whatsapp_phone_tooltip' | t}}" }= t(".whatsapp_phone_field")+":"
%input.chunky.small-12.columns{ id: 'enterprise_whatsapp_phone', name: 'whatsapp_phone', placeholder: "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", ng: { model: 'enterprise.whatsapp_phone' } }
.small-12.medium-12.large-5.hide-for-small-only
.row.buttons

View File

@@ -18,7 +18,7 @@
= current_distributor.address.zipcode
.small-12.large-4.columns
- if current_distributor.website || current_distributor.email_address || current_distributor.phone
- if current_distributor.website || current_distributor.email_address || current_distributor.phone || current_distributor.whatsapp_phone
%div.center
.header
= t :shopping_contact_web
@@ -26,6 +26,11 @@
- if current_distributor.phone.present?
= current_distributor.phone
%br
- if current_distributor.whatsapp_phone.present?
%a{href: current_distributor.whatsapp_url, target: "_blank" }
%img{ src: image_pack_path("social-logos/whatsapp.svg") }
= current_distributor.whatsapp_phone
%br
- if current_distributor.website.present?
%a{href: "http://#{current_distributor.website}", target: "_blank" }
= current_distributor.website

View File

@@ -6,6 +6,8 @@
= render 'spree/admin/orders/insufficient_stock_lines', insufficient_stock_lines: @order.insufficient_stock_lines
= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order }
- if order.line_items.exists?
= render partial: "spree/admin/orders/note", locals: { order: @order }
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.line_item_adjustments, :title => t(".line_item_adjustments")}
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => order_adjustments_for_display(@order), :title => t(".order_adjustments")}

View File

@@ -0,0 +1,26 @@
%table.index.edit-note-table
%tr.edit-note.hidden.total
%td{ colspan: "5", data: { controller: "input-char-count" }, style: "position: relative;" }
%label
= t(".note_label")
= text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } }
%span.edit-note-count{ data: { "input-char-count-target": "count" }, style: "position: absolute; right: 7px; top: 7px; font-size: 11px;" }
%td.actions
= link_to '', '', class: 'save-note icon_link icon-ok no-text with-tip', data: { action: 'save' }, title: I18n.t('actions.save')
= link_to '', '', class: 'cancel-note icon_link icon-cancel no-text with-tip', data: { action: 'cancel' }, title: I18n.t('actions.cancel')
%tr.show-note.total
%td{ :colspan => "5" }
- if order.note.present?
%strong
= t(".note_label")
= order.note
- else
= t(".no_note_present")
%td.actions
= link_to '', '', class: 'edit-note icon_link icon-edit no-text with-tip', data: { action: 'edit' }, title: Spree.t('edit')
- if @order.note.present?
= link_to '', '', class: 'delete-note icon_link icon-trash no-text with-tip', data: { action: 'remove' }, title: Spree.t('delete')

View File

@@ -1,4 +1,5 @@
.per-page{'ng-show' => '!RequestMonitor.loading && orders.length > 0'}
- position ||= ""
.per-page{'ng-show' => '!RequestMonitor.loading && orders.length > 0', class: ("right" if position == "right") }
%input.per-page-select.ofn-select2{type: 'number', data: 'per_page_options', 'min-search' => 999, 'ng-model' => 'per_page', 'ng-change' => 'fetchResults()'}
%span.per-page-feedback

View File

@@ -40,18 +40,6 @@
= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method)
= select_tag :selected_shipping_rate_id, options_for_select(shipment.shipping_rates.backend.map { |sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id), { :class => 'select2 fullwidth', :data => { 'shipment-number' => shipment.number } }
- if shipment.fee_adjustment&.closed?
%div.field.omega.four.columns
%label
= Spree.t(:associated_adjustment_closed)
%ul
%li
= radio_button_tag :open_adjustment, 'yes', false, :data => { 'shipment-number' => shipment.number }
= "Yes"
%li
= radio_button_tag :open_adjustment, 'no', true, :data => {'shipment-number' => shipment.number }
= "No"
%td.actions
- if can? :update, shipment
= link_to '', '', :class => 'save-method icon_link icon-ok no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'save' }, title: I18n.t('actions.save')
@@ -97,3 +85,5 @@
%td.actions
- if can?(:update, shipment) && shipment.can_modify?
= link_to '', '', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => { :action => 'edit' }, :title => Spree.t('edit')
- if shipment.tracking.present?
= link_to '', '', :class => 'delete-tracking icon_link icon-trash no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'remove' }, :title => Spree.t('delete')

View File

@@ -1,19 +0,0 @@
<script type='text/template' id='customer_autocomplete_template'>
<div class='customer-autocomplete-item'>
<div class='customer-details'>
<h5>{{customer.email}}</h5>
{{#if bill_address.firstname }}
<strong>{{t 'bill_address' }}</strong>
{{bill_address.firstname}} {{bill_address.lastname}}<br>
{{bill_address.address1}}, {{bill_address.address2}}<br>
{{bill_address.city}}<br>
{{#if bill_address.state_id }}
{{bill_address.state.name}}
{{else}}
{{bill_address.state_name}}
{{/if}}
{{bill_address.country.name}}
{{/if}}
</div>
</div>
</script>

View File

@@ -17,8 +17,8 @@
%legend{:align => "center"}= Spree.t(:customer_search)
- content_for :main_ng_app_name do
= "admin.orders"
= hidden_field_tag :customer_search_override, nil, distributor_id: @order.distributor_id, :class => 'fullwidth title customer-search-override'
= render :partial => "spree/admin/orders/customer_details/autocomplete", :formats => :js
%label{for: "customer_search_override"}= Spree.t(:choose_a_customer)
%select{name: "customer_search_override", "data-controller": "select-customer", "data-select-customer-distributor-value": @order.distributor_id, class: "primary", placeholder: Spree.t(:choose_a_customer) }
= render :partial => 'spree/shared/error_messages', :locals => { :target => @order }

View File

@@ -20,11 +20,22 @@
= render partial: 'filters'
.row.index-controls{'ng-show' => '!RequestMonitor.loading && orders.length > 0'}
= render partial: 'per_page_controls'
%div{style: "display: flex; justify-content: space-between;"}
- if Spree::Config[:enable_invoices?]
.ofn-drop-down-with-prepend
.ofn-drop-down-prepend{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
{{ "spree.admin.orders.index.selected" | t:{count: selected_orders.length} }}
.ofn-drop-down{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
%span{ :class => 'icon-reorder' }
="#{t('admin.actions')}".html_safe
%span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" }
%div.menu{ 'ng-show' => "expanded" }
%div.menu_item
%span.name.invoices-modal{'ng-controller' => 'bulkInvoiceCtrl', 'ng-click' => 'createBulkInvoice()' }
= t('.print_invoices')
- if Spree::Config[:enable_invoices?]
%button.invoices-modal{'ng-controller' => 'bulkInvoiceCtrl', 'ng-click' => 'createBulkInvoice()', 'ng-disabled' => 'selected_orders.length == 0'}
= t('.print_invoices')
= render partial: 'per_page_controls', locals: { position: "right" }
%table#listing_orders.index.responsive{width: "100%", 'ng-init' => 'initialise()', 'ng-show' => "!RequestMonitor.loading && orders.length > 0" }
%colgroup

View File

@@ -9,7 +9,7 @@
\#
= @order.number
= render 'spree/admin/shared/order_tabs', :current => 'Order Details'
= render 'spree/admin/shared/order_tabs', :current => 'Customer Details'
= csrf_meta_tags
@@ -21,6 +21,7 @@
= render 'spree/admin/orders/_form/distribution_fields'
-# This param passed to stop validation error in next page due to no line items in order yet:
= hidden_field_tag 'suppress_error_msg', "true"
= hidden_field_tag "set_distribution_step", "true"
= button_tag :class => 'secondary radius expand small', :id => 'update-button' do
%i.icon-arrow-right
= t(:next)

View File

@@ -1,4 +1,4 @@
.six.columns.omega{ "ng-if" => "product.variant_unit_with_scale != 'items'" }
= f.field_container :display_as do
= f.label :product_display_as, t('.display_as')
%input#product_display_as.fullwidth{name: "product[display_as]", placeholder: "{{ placeholder_text }}", type: "text"}
%input#product_display_as.fullwidth{name: "product[display_as]", placeholder: "{{ placeholder_text }}", type: "text", value: @product.master.display_as}

View File

@@ -11,7 +11,7 @@
= f.field_container :supplier do
= f.label :supplier_id, t(".supplier")
%span.required *
= f.collection_select(:supplier_id, @producers, :id, :name, {:include_blank => true, :selected => select_only_item(@producers)}, {:class => "select2 fullwidth"})
= f.select :supplier_id, options_from_collection_for_select(@producers, :id, :name, @product.supplier_id), {}, { "data-controller": "tom-select", class: "primary" }
= f.error_message_on :supplier
.eight.columns.omega
= f.field_container :name do
@@ -25,17 +25,17 @@
= f.field_container :units do
= f.label :variant_unit_with_scale, t(".units")
%span.required *
%select.select2.fullwidth{ id: 'product_variant_unit_with_scale', 'ng-model' => 'product.variant_unit_with_scale', 'ng-options' => 'unit[1] as unit[0] for unit in variant_unit_options' }
%select{id: 'product_variant_unit_with_scale', 'ng-model' => 'product.variant_unit_with_scale', 'ng-options' => 'unit[1] as unit[0] for unit in variant_unit_options',"data-controller": "tom-select", class: "primary"}
%option{'value' => '', 'ng-hide' => "hasUnit(product)"}
%input{ type: 'hidden', 'ng-value' => 'product.variant_unit', name: 'product[variant_unit]' }
%input{ type: 'hidden', 'ng-value' => 'product.variant_unit_scale', name: 'product[variant_unit_scale]' }
%input{ type: 'hidden', 'ng-value': 'product.variant_unit', "ng-init": "product.variant_unit='#{@product.variant_unit}'", name: 'product[variant_unit]' }
%input{ type: 'hidden', 'ng-value': 'product.variant_unit_scale', "ng-init": "product.variant_unit_scale='#{@product.variant_unit_scale}'", name: 'product[variant_unit_scale]' }
.two.columns
= f.field_container :unit_value do
= f.label :unit_value_with_description, t(".value"), 'ng-disabled' => "!hasUnit(product)"
%span.required *
%input.fullwidth{ id: 'product_unit_value_with_description', 'ng-model' => 'product.master.unit_value_with_description', :type => 'text', placeholder: "eg. 2", 'ng-disabled' => "!hasUnit(product)" }
%input{ type: 'hidden', 'ng-value' => 'product.master.unit_value', name: 'product[unit_value]' }
%input{ type: 'hidden', 'ng-value' => 'product.master.unit_description', name: 'product[unit_description]' }
%input{ type: 'hidden', 'ng-value': 'product.master.unit_value', "ng-init": "product.master.unit_value='#{@product.master.unit_value}'", name: 'product[unit_value]' }
%input{ type: 'hidden', 'ng-value': 'product.master.unit_description', "ng-init": "product.master.unit_description='#{@product.master.unit_description}'", name: 'product[unit_description]' }
= render 'display_as', f: f
.six.columns.omega{ 'ng-show' => "product.variant_unit_with_scale == 'items'" }
= f.field_container :unit_name do
@@ -50,7 +50,7 @@
= f.label :price, t(".price")
%span.required *
%br/
= f.text_field :price, { "class" => "fullwidth", "ng-model" => "product.price" }
= f.text_field :price, { "class": "fullwidth", "ng-model": "product.price", "ng-value": "'#{@product.price}'" }
= f.error_message_on :price
.four.columns{ ng: { app: 'ofn.admin'}}
= f.field_container :unit_price do
@@ -77,20 +77,20 @@
= f.field_container :on_hand do
= f.label :on_hand, t(".on_hand")
%br/
= f.text_field :on_hand, class: 'fullwidth'
= f.text_field :on_hand, class: 'fullwidth', value: @on_hand
= f.error_message_on :on_hand
.three.columns.omega
= f.field_container :on_demand do
= f.label :on_demand, t(".on_demand")
%br/
= f.check_box :on_demand
= f.check_box :on_demand, value: '1', checked: @on_demand == '1'
= f.error_message_on :on_demand
.sixteen.columns.alpha
= f.field_container :description do
= f.label :product_description, t(".product_description")
%br/
%text-angular{'id' => 'product_description', 'name' => 'product[description]', 'class' => 'text-angular', "textangular-links-target-blank" => true, 'ta-toolbar' => "[['bold','italics','underline','clear'],['insertLink']]"}
%text-angular{'id' => 'product_description', 'name' => 'product[description]', 'class' => 'text-angular', "textangular-links-target-blank" => true, 'ta-toolbar' => "[['bold','italics','underline','clear'],['insertLink']]", "ng-model": "product.description"}
= sanitize(@product.description)
= f.error_message_on :description
.four.columns.omega{ style: "text-align: center" }

View File

@@ -1,5 +1,5 @@
%fieldset#calculator_fields.no-border-bottom
%legend{align: "center"}= t(:calculator)
%legend{align: "center"}= t(:fees)
#preference-settings
.row
.alpha.four.columns

View File

@@ -44,22 +44,22 @@
%nav.menu
%ul
- order_details_classes = "active" if current == "Order Details"
%li{ class: order_details_classes }
= link_to_with_icon 'icon-edit', t(:order_details), spree.edit_admin_order_url(@order)
- customer_details_classes = "active" if current == "Customer Details"
%li{ class: customer_details_classes }
= link_to_with_icon 'icon-user', t(:customer_details), spree.admin_order_customer_url(@order)
- adjustments_classes = "active" if current == "Adjustments"
%li{ class: adjustments_classes }
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
- order_details_classes = "active" if current == "Order Details"
%li{ class: order_details_classes }
= link_to_with_icon 'icon-edit', t(:order_details), spree.edit_admin_order_url(@order)
- payments_classes = "active" if current == "Payments"
%li{ class: payments_classes }
= link_to_with_icon 'icon-credit-card', t(:payments), spree.admin_order_payments_url(@order)
- adjustments_classes = "active" if current == "Adjustments"
%li{ class: adjustments_classes }
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
- if @order.completed?
- authorizations_classes = "active" if current == "Return Authorizations"
%li{ class: authorizations_classes }

View File

@@ -27,7 +27,7 @@
-# The 'Category' label here is just a logical descriptor for the data we are trying to collect for 'requires_ship_address'
-# and does not relate to shipping categories in any way.
= f.label :require_ship_address, t(:category)
.two.columns
.three.columns
= f.radio_button :require_ship_address, true
&nbsp;
= f.label :delivery, t(:delivery)

View File

@@ -18,9 +18,13 @@
.omega.five.columns
= f.field_container :password do
= f.label :password, t(".password")
= f.password_field :password, class: "fullwidth"
= f.password_field :password, class: "fullwidth", autocomplete: "new-password"
= f.error_message_on :password
= f.field_container :password do
= f.label :password_confirmation, t(".confirm_password")
= f.password_field :password_confirmation, class: "fullwidth"
= f.error_message_on :password_confirmation
= f.error_message_on :password_confirmation
= f.field_container :disabled do
= f.label :disabled, t(".disabled")
= f.check_box :disabled
= f.error_message_on :disabled

View File

@@ -10,7 +10,7 @@
= t(:order_back_to_store)
.columns.small-12.medium-6
- if @order.distributor.website.present?
= link_to_service "https://", current_order.distributor.website, class: "button expand" do
= link_to_service "https://", @order.distributor.website, class: "button expand" do
= t(:order_back_to_website)
- else
&nbsp;

View File

@@ -14,7 +14,7 @@
= item.variant.options_text
%br
- if @shipment.tracking
- if @shipment.tracking.present?
%p.lead
= t('.track_information', tracking: @shipment.tracking)

View File

@@ -7,10 +7,11 @@
%th= t(".allow_charges?")
%tr.customer{ id: "customer{{ customer.id }}", ng: { repeat: "customer in customers" } }
%td.shop{ ng: { bind: 'shopsByID[customer.enterprise_id].name' } }
%td.allow_charges
%td.allow_charges{ tooltip: "{{ hasOneDefaultSavedCards() ? null : \'" + t('.no_default_saved_cards_tooltip') + "\' }}" }
%input{ type: 'checkbox',
name: 'allow_charges',
ng: { model: 'customer.allow_charges',
change: 'customer.update()',
disabled: "!hasOneDefaultSavedCards()",
"true-value" => "true",
"false-value" => "false" } }

View File

@@ -11,8 +11,7 @@
%th.order7.show-for-large-up.text-right= t('.cancel')
%tbody.transaction-group{"ng-repeat" => "order in Orders.changeable", "ng-class-odd"=>"'odd'", "ng-class-even"=>"'even'"}
%tr.order-row
%td.order1
%a{"ng-href" => "{{::order.path}}", "ng-bind" => "::order.number"}
%td.order1{"ng-bind" => "::order.number"}
%td.order2
%a{"ng-href" => "{{::Orders.shopsByID[order.shop_id].hash}}#{main_app.shop_path}", "ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order3.show-for-large-up{"ng-bind" => "::order.changes_allowed_until"}

View File

@@ -8,16 +8,16 @@
%th.order4.show-for-large-up= t('.items')
%th.order5.text-right= t('.total')
%th.order6.text-right.show-for-large-up= t('.paid?')
%th.order7.text-right= t('.view')
%th.order7.text-right= t('.status')
%tbody.transaction-group{"ng-repeat" => "order in Orders.all | filter:{changes_allowed:false} as pastOrders", "ng-class-odd"=>"'odd'", "ng-class-even"=>"'even'"}
%tr.order-row
%td.order1
%a{"ng-href" => "{{::order.path}}", "ng-bind" => "::order.number"}
%td.order1{"ng-bind" => "::order.number"}
%td.order2
%a{"ng-href" => "{{::Orders.shopsByID[order.shop_id].hash}}#{main_app.shop_path}", "ng-bind" => "::Orders.shopsByID[order.shop_id].name"}
%td.order3.show-for-large-up{"ng-bind" => "::order.completed_at"}
%td.order4.show-for-large-up{"ng-bind" => "::order.item_count"}
%td.order5.text-right{"ng-class" => "{'debit': order.payment_state != 'paid', 'credit': order.payment_state == 'paid'}","ng-bind" => "::order.total | localizeCurrency"}
%td.order6.text-right.show-for-large-up{"ng-class" => "{'debit': order.payment_state != 'paid', 'credit': order.payment_state == 'paid'}", "ng-bind" => "::(order.payment_state == 'paid' ? 'say_yes' : 'say_no') | t"}
%td.order7.text-right
%a{"ng-href" => "{{::order.path}}" }= t('.view')
%td.order7.text-right{ "ng-switch" => "::order.state" }
%a{ "ng-switch-when" => "complete", "ng-href" => "{{::order.path}}" }= t('.completed')
%span{ "ng-switch-when" => "canceled" }= t('.cancelled')

View File

@@ -11,36 +11,36 @@ export default class extends Controller {
// private
populateSelect(sourceId) {
this.removeCurrentOptions()
this.populateNewOptions(sourceId)
this.removeCurrentOptions();
this.populateNewOptions(sourceId);
}
removeCurrentOptions() {
this.selectTarget.innerHTML = ""
this.selectTarget.innerHTML = "";
this.selectTarget.tomselect?.clear()
this.selectTarget.tomselect?.clearOptions()
this.selectTarget.tomselect?.clear();
this.selectTarget.tomselect?.clearOptions();
}
populateNewOptions(sourceId) {
const options = this.dependantOptionsFor(sourceId)
const options = this.dependantOptionsFor(sourceId);
options.forEach((item) => {
this.addOption(item[0], item[1])
this.addOption(item[0], item[1]);
});
this.selectTarget.tomselect?.sync()
this.selectTarget.tomselect?.addItem(options[0]?.[1])
this.selectTarget.tomselect?.sync();
this.selectTarget.tomselect?.addItem(options[0]?.[1]);
}
addOption(label, value) {
const newOption = document.createElement("option")
newOption.innerHTML = label
newOption.value = value
this.selectTarget.appendChild(newOption)
const newOption = document.createElement("option");
newOption.innerHTML = label;
newOption.value = value;
this.selectTarget.appendChild(newOption);
}
dependantOptionsFor(sourceId) {
return this.optionsValue.find((option) => option[0] === sourceId)[1]
return this.optionsValue.find((option) => option[0] === sourceId)[1];
}
}

View File

@@ -3,7 +3,7 @@
// or:
// div{data: {controller: "example"}}
import { Controller } from "stimulus"
import { Controller } from "stimulus";
export default class extends Controller {
// connect() is a built-in lifecycle callback for Stimulus Controllers. It fires when the
@@ -11,7 +11,7 @@ export default class extends Controller {
// injected into the DOM. This means initialization is not tied to the page load event, but
// will also happen dynamically if and when new DOM elements are added or removed.
connect() {
console.log("We're connected!")
console.log("We're connected!");
}
}

View File

@@ -1,20 +1,20 @@
import { Controller } from "stimulus"
import { Controller } from "stimulus";
document.addEventListener('turbolinks:before-cache', () =>
document.getElementById('flash').remove()
)
document.addEventListener("turbolinks:before-cache", () =>
document.getElementById("flash").remove()
);
export default class extends Controller {
connect() {
setTimeout(this.fadeout.bind(this), 3000)
setTimeout(this.fadeout.bind(this), 3000);
}
fadeout() {
this.element.classList.add("animate-hide-500")
setTimeout(this.close.bind(this), 500)
this.element.classList.add("animate-hide-500");
setTimeout(this.close.bind(this), 500);
}
close() {
this.element.remove()
this.element.remove();
}
}

View File

@@ -1,22 +1,24 @@
import { Controller } from "stimulus"
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["checkout", "guest"];
static values = {
distributor: String,
session: { type: String, default: "guest-checkout" }
session: { type: String, default: "guest-checkout" },
};
connect() {
if(!this.hasGuestTarget) { return }
if (!this.hasGuestTarget) {
return;
}
if(this.usingGuestCheckout()) {
if (this.usingGuestCheckout()) {
this.showCheckout();
}
}
login() {
window.dispatchEvent(new Event("login:modal:open"))
window.dispatchEvent(new Event("login:modal:open"));
}
showCheckout() {
@@ -30,6 +32,6 @@ export default class extends Controller {
}
usingGuestCheckout() {
return sessionStorage.getItem(this.sessionValue) === this.distributorValue
return sessionStorage.getItem(this.sessionValue) === this.distributorValue;
}
}

View File

@@ -1,33 +1,33 @@
import { Controller } from "stimulus"
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["background", "modal"]
static targets = ["background", "modal"];
open() {
this.backgroundTarget.style.display = "block"
this.modalTarget.style.display = "block"
this.backgroundTarget.style.display = "block";
this.modalTarget.style.display = "block";
setTimeout(() => {
this.modalTarget.classList.add("in")
this.backgroundTarget.classList.add("in")
document.querySelector("body").classList.add("modal-open")
})
this.modalTarget.classList.add("in");
this.backgroundTarget.classList.add("in");
document.querySelector("body").classList.add("modal-open");
});
}
close() {
this.modalTarget.classList.remove("in")
this.backgroundTarget.classList.remove("in")
document.querySelector("body").classList.remove("modal-open")
this.modalTarget.classList.remove("in");
this.backgroundTarget.classList.remove("in");
document.querySelector("body").classList.remove("modal-open");
setTimeout(() => {
this.backgroundTarget.style.display = "none"
this.modalTarget.style.display = "none"
}, 200)
this.backgroundTarget.style.display = "none";
this.modalTarget.style.display = "none";
}, 200);
}
closeIfEscapeKey(e) {
if (e.code == "Escape") {
this.close()
this.close();
}
}
}

View File

@@ -1,11 +1,15 @@
import { Controller } from "stimulus"
import { Controller } from "stimulus";
export default class extends Controller {
static values = { target: String }
static values = { target: String };
open() {
let helpModal = document.getElementById(this.targetValue)
let helpModalController = this.application.getControllerForElementAndIdentifier(helpModal, "help-modal");
let helpModal = document.getElementById(this.targetValue);
let helpModalController =
this.application.getControllerForElementAndIdentifier(
helpModal,
"help-modal"
);
helpModalController.open();
}
}

View File

@@ -0,0 +1,21 @@
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["count", "input"];
connect() {
this.inputTarget.addEventListener("keyup", this.countCharacters.bind(this));
this.countCharacters();
}
countCharacters() {
this.displayCount(
this.inputTarget.value.length,
this.inputTarget.maxLength
);
}
displayCount(count, max) {
this.countTarget.textContent = `${count}/${max}`;
}
}

View File

@@ -1,61 +1,70 @@
import { Controller } from "stimulus"
import CableReady from "cable_ready"
import { Controller } from "stimulus";
import CableReady from "cable_ready";
export default class extends Controller {
static targets = ["background", "modal", "email"]
static values = { email: String }
static targets = ["background", "modal", "email"];
static values = { email: String };
connect() {
if(this.hasModalTarget) {
window.addEventListener("login:modal:open", this.open)
if (this.hasModalTarget) {
window.addEventListener("login:modal:open", this.open);
if(location.hash.substr(1).includes("/login")) {
this.open()
if (location.hash.substr(1).includes("/login")) {
this.open();
}
}
}
call(event) {
event.preventDefault()
window.dispatchEvent(new Event("login:modal:open"))
event.preventDefault();
window.dispatchEvent(new Event("login:modal:open"));
}
emailOnInput(event) {
this.emailValue = event.currentTarget.value
this.emailValue = event.currentTarget.value;
this.emailTargets.forEach((element) => {
element.value = this.emailValue
})
element.value = this.emailValue;
});
}
open = () => {
if(!location.hash.substr(1).includes("/login")) {
history.pushState({}, "", "#/login")
if (!location.hash.substr(1).includes("/login")) {
history.pushState({}, "", "#/login");
}
this.backgroundTarget.style.display = "block"
this.modalTarget.style.display = "block"
this.backgroundTarget.style.display = "block";
this.modalTarget.style.display = "block";
setTimeout(() => {
this.modalTarget.classList.add("in")
this.backgroundTarget.classList.add("in")
document.querySelector("body").classList.add("modal-open")
})
this.modalTarget.classList.add("in");
this.backgroundTarget.classList.add("in");
document.querySelector("body").classList.add("modal-open");
});
window._paq?.push(['trackEvent', 'Signin/Signup', 'Login Modal View', window.location.href])
}
window._paq?.push([
"trackEvent",
"Signin/Signup",
"Login Modal View",
window.location.href,
]);
};
close() {
history.pushState({}, "", window.location.pathname + window.location.search)
history.pushState(
{},
"",
window.location.pathname + window.location.search
);
this.modalTarget.classList.remove("in")
this.backgroundTarget.classList.remove("in")
this.modalTarget.classList.remove("in");
this.backgroundTarget.classList.remove("in");
document.querySelector("body").classList.remove("modal-open")
document.querySelector("body").classList.remove("modal-open");
setTimeout(() => {
this.backgroundTarget.style.display = "none"
this.modalTarget.style.display = "none"
}, 200)
this.backgroundTarget.style.display = "none";
this.modalTarget.style.display = "none";
}, 200);
}
resend_confirmation(event) {
@@ -63,19 +72,21 @@ export default class extends Controller {
method: "POST",
body: JSON.stringify({
spree_user: { email: this.emailValue },
tab: event.currentTarget.dataset.tab
tab: event.currentTarget.dataset.tab,
}),
headers: { "Content-type": "application/json; charset=UTF-8" }
}).then(data => data.json()).then(CableReady.perform)
headers: { "Content-type": "application/json; charset=UTF-8" },
})
.then((data) => data.json())
.then(CableReady.perform);
}
returnHome() {
window.location = "/"
window.location = "/";
}
disconnect() {
if(this.hasModalTarget) {
window.removeEventListener("login:modal:open", this.open)
if (this.hasModalTarget) {
window.removeEventListener("login:modal:open", this.open);
}
}
}

View File

@@ -0,0 +1,50 @@
export const useRenderCustomer = (controller) => {
Object.assign(controller, {
renderOption(item, escape) {
if (!item.bill_address) {
return this.renderWithNoBillAddress(item, escape);
}
return `<div class='customer-autocomplete-item'>
<div class='customer-details'>
<h5>${escape(item.email)}</h5>
${
item.bill_address.firstname
? `<strong>${I18n.t("bill_address")}</strong>
${item.bill_address.firstname} ${
item.bill_address.lastname
}<br>
${item.bill_address.address1}, ${
item.bill_address.address2
}<br>
${item.bill_address.city}
<br>
${
item.bill_address.state_id &&
item.bill_address.state &&
item.bill_address.state.name
? item.bill_address.state.name
: item.bill_address.state_name
}
${
item.bill_address.country &&
item.bill_address.country.name
? item.bill_address.country.name
: item.bill_address.country_name
}
`
: ""
}
</div>
</div>`;
},
renderWithNoBillAddress(item, escape) {
return `<div class='customer-autocomplete-item'>
<div class='customer-details'><h5>${escape(
item.email
)}</h5></div>
</div>`;
},
});
};

View File

@@ -0,0 +1,22 @@
export const useSearchCustomer = (controller) => {
Object.assign(controller, {
load: function (query, callback) {
var params = {
q: query,
distributor_id: this.distributorValue,
};
fetch("/admin/search/customers.json?" + new URLSearchParams(params))
.then((response) => response.json())
.then((json) => {
this.items = json;
callback(json);
})
.catch((error) => {
this.items = [];
console.log(error);
callback();
});
},
});
};

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