Compare commits

...

968 Commits

Author SHA1 Message Date
Jean-Baptiste Bellet
ffba628691 Update all locales with the latest Transifex translations 2022-12-08 21:36:51 +01:00
Filipe
8b416a8eda Merge pull request #10106 from openfoodfoundation/dependabot/bundler/knapsack_pro-3.5.0
Bump knapsack_pro from 3.4.2 to 3.5.0
2022-12-08 19:27:04 +00:00
dependabot[bot]
e11d644a95 Merge pull request #10122 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.9 2022-12-08 11:09:34 +00:00
dependabot[bot]
26131d105e Merge pull request #10121 from openfoodfoundation/dependabot/bundler/rubocop-1.40.0 2022-12-08 11:08:50 +00:00
dependabot[bot]
cfa0a502f1 Bump @floating-ui/dom from 1.0.8 to 1.0.9
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.8 to 1.0.9.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.9/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 09:02:00 +00:00
dependabot[bot]
869a6b42d3 Bump rubocop from 1.39.0 to 1.40.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.39.0 to 1.40.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.39.0...v1.40.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-12-08 09:01:46 +00:00
dependabot[bot]
fdf3a0d7b7 Merge pull request #10118 from openfoodfoundation/dependabot/bundler/nokogiri-1.13.10 2022-12-08 07:48:22 +00:00
dependabot[bot]
1f98ef5074 Bump nokogiri from 1.13.9 to 1.13.10
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.9...v1.13.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 04:08:49 +00:00
Filipe
996d3afe4f Merge pull request #9983 from cillian/remove-exchange-tags-n1-query
Remove N+1 query loading tags for each order cycle exchange
2022-12-07 17:38:41 +00:00
dependabot[bot]
2aea5d4957 Merge pull request #10111 from openfoodfoundation/dependabot/npm_and_yarn/express-4.18.2 2022-12-07 14:02:04 +00:00
dependabot[bot]
a328888fc2 Bump express from 4.17.1 to 4.18.2
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 13:47:24 +00:00
jibees
c33c4860c8 Merge pull request #10110 from jibees/remove-test-prof
Remove `test-prof` as no longer required
2022-12-07 14:47:02 +01:00
jibees
efe8030786 Merge pull request #10071 from filipefurtad0/knapsack_fine_tuning
Simplifies build.yml syntax
2022-12-07 14:46:48 +01:00
Jean-Baptiste Bellet
76412bfcae Remove test-prof as no longer required 2022-12-07 14:29:58 +01:00
dependabot[bot]
8ee05789ef Merge pull request #10105 from openfoodfoundation/dependabot/bundler/json-2.6.3 2022-12-06 09:40:21 +00:00
dependabot[bot]
e2a8ab16b4 Merge pull request #10104 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.8 2022-12-06 09:39:49 +00:00
dependabot[bot]
6fb337b81c Bump knapsack_pro from 3.4.2 to 3.5.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.4.2...v3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 09:04:54 +00:00
dependabot[bot]
387a46e1db Bump json from 2.6.2 to 2.6.3
Bumps [json](https://github.com/flori/json) from 2.6.2 to 2.6.3.
- [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.2...v2.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 09:02:33 +00:00
dependabot[bot]
1db85e295b Bump @floating-ui/dom from 1.0.7 to 1.0.8
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.8/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 09:01:30 +00:00
dependabot[bot]
fee99a95f8 Merge pull request #10086 from openfoodfoundation/dependabot/bundler/bugsnag-6.25.0 2022-12-05 14:00:17 +00:00
dependabot[bot]
ab70a85866 Merge pull request #10095 from openfoodfoundation/dependabot/npm_and_yarn/js-big-decimal-1.3.13 2022-12-05 10:03:54 +00:00
dependabot[bot]
d31c2d95b3 Merge pull request #10096 from openfoodfoundation/dependabot/bundler/debug-1.7.0 2022-12-05 10:03:38 +00:00
dependabot[bot]
44af982b3e Merge pull request #10094 from openfoodfoundation/dependabot/bundler/digest-3.1.1 2022-12-05 10:02:51 +00:00
dependabot[bot]
2ea22248e0 Bump digest from 3.1.0 to 3.1.1
Bumps [digest](https://github.com/ruby/digest) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/ruby/digest/releases)
- [Commits](https://github.com/ruby/digest/compare/v3.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 09:49:09 +00:00
dependabot[bot]
9d58f16012 Bump debug from 1.6.3 to 1.7.0
Bumps [debug](https://github.com/ruby/debug) from 1.6.3 to 1.7.0.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.6.3...v1.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 09:48:38 +00:00
dependabot[bot]
f2838105fe Bump js-big-decimal from 1.3.12 to 1.3.13
Bumps [js-big-decimal](https://github.com/royNiladri/js-big-decimal) from 1.3.12 to 1.3.13.
- [Release notes](https://github.com/royNiladri/js-big-decimal/releases)
- [Commits](https://github.com/royNiladri/js-big-decimal/compare/v1.3.12...v1.3.13)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 09:48:27 +00:00
Konrad
07c29df801 Merge pull request #10039 from abdellani/fix_missing_products_in_bulk_coop_packing_sheets_report
fix Missing products in Bulk co-op Packing Sheets report
2022-12-02 18:19:47 +01:00
Konrad
6ac21eaab4 Merge pull request #9999 from abdellani/add-ability-to-save-rendering-options-per-report
Add ability to save rendering options per report
2022-12-02 14:33:37 +01:00
dependabot[bot]
ff0b84c9c0 Merge pull request #10084 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.14 2022-12-02 10:27:52 +00:00
dependabot[bot]
26f40dea6f Merge pull request #10085 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.14 2022-12-02 10:27:32 +00:00
dependabot[bot]
188a0f5d25 Merge pull request #10087 from openfoodfoundation/dependabot/npm_and_yarn/decode-uri-component-0.2.2 2022-12-02 09:41:01 +00:00
dependabot[bot]
454c3d6e31 Bump @storybook/addon-docs from 6.5.13 to 6.5.14
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.13 to 6.5.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.14/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.14/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-12-02 09:30:22 +00:00
dependabot[bot]
f76f885ffa Bump @storybook/addon-controls from 6.5.13 to 6.5.14
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.13 to 6.5.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.14/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.14/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-12-02 09:30:01 +00:00
dependabot[bot]
f654e52fbb Bump decode-uri-component from 0.2.0 to 0.2.2
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 09:29:54 +00:00
dependabot[bot]
b8400e3655 Merge pull request #10083 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.14 2022-12-02 09:29:23 +00:00
dependabot[bot]
8168f122a0 Bump bugsnag from 6.24.2 to 6.25.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.24.2 to 6.25.0.
- [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.2...v6.25.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 09:04:18 +00:00
dependabot[bot]
7a2084e4e7 Bump @storybook/server from 6.5.13 to 6.5.14
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.13 to 6.5.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.14/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.14/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-12-02 09:01:21 +00:00
Jean-Baptiste Bellet
92dcf926b5 Update all locales with the latest Transifex translations 2022-12-01 17:44:16 +01:00
jibees
1fcc98af80 Merge pull request #10026 from abdellani/make_default_time_at_00_00_instead_of_12_00
Make default time at 00 00 instead of 12 00
2022-12-01 17:43:08 +01:00
dependabot[bot]
67dbf552b1 Merge pull request #10078 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.117.2 2022-12-01 09:54:36 +00:00
dependabot[bot]
899879b88d Merge pull request #10077 from openfoodfoundation/dependabot/bundler/wkhtmltopdf-binary-0.12.6.6 2022-12-01 09:53:08 +00:00
dependabot[bot]
9a57935709 Bump aws-sdk-s3 from 1.117.1 to 1.117.2
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.117.1 to 1.117.2.
- [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-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 09:04:02 +00:00
dependabot[bot]
5de928f452 Bump wkhtmltopdf-binary from 0.12.6.5 to 0.12.6.6
Bumps [wkhtmltopdf-binary](https://github.com/zakird/wkhtmltopdf_binary_gem) from 0.12.6.5 to 0.12.6.6.
- [Release notes](https://github.com/zakird/wkhtmltopdf_binary_gem/releases)
- [Changelog](https://github.com/zakird/wkhtmltopdf_binary_gem/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zakird/wkhtmltopdf_binary_gem/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 09:03:12 +00:00
Rachel Arnould
524d68496a Merge pull request #10054 from jibees/10034-change-orders-page-colors
[WIP 🚧 ] Admin/Orders, behind feature toggle `admin_style_v2`: adjust colors
2022-11-30 10:58:14 +01:00
dependabot[bot]
b117608229 Merge pull request #10072 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.2.1 2022-11-30 09:20:16 +00:00
dependabot[bot]
1ccd580c7b Merge pull request #10073 from openfoodfoundation/dependabot/bundler/timecop-0.9.6 2022-11-30 09:18:51 +00:00
dependabot[bot]
bff38b2c5b Bump timecop from 0.9.5 to 0.9.6
Bumps [timecop](https://github.com/travisjeffery/timecop) from 0.9.5 to 0.9.6.
- [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.5...v0.9.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 09:03:43 +00:00
dependabot[bot]
eb911d9fe3 Bump stimulus from 3.2.0 to 3.2.1
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 3.2.0 to 3.2.1.
- [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.2.0...v3.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-30 09:01:01 +00:00
Sigmund Petersen
9fa46d378f Merge pull request #10070 from filipefurtad0/fix_authentication_spec_#9913
Adds expectation to assure login was sucessful
2022-11-30 09:48:01 +01:00
filipefurtad0
2e5f0d302f Removes unecessary syntax 2022-11-30 09:05:19 +01:00
filipefurtad0
3c4845813d Adds expectation to assure login was sucessful 2022-11-29 16:45:01 +01:00
dependabot[bot]
7166fa6a25 Merge pull request #10068 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.2.0 2022-11-29 14:28:33 +00:00
dependabot[bot]
9d36d1942e Merge pull request #10067 from openfoodfoundation/dependabot/bundler/view_component-2.78.0 2022-11-29 11:27:23 +00:00
Mohamed ABDELLANI
9dc3f2d69e add new parameter defaultDate to flatpickr to decide the default value when selector is opened 2022-11-29 11:12:33 +01:00
Filipe
7b07817bbf Merge pull request #10065 from openfoodfoundation/revert-9927-lazy-load-product-images
Revert "Load product images in the shop lazily to improve performance"
2022-11-29 10:27:54 +01:00
dependabot[bot]
a36627927d Merge pull request #10066 from openfoodfoundation/dependabot/bundler/bullet-7.0.4 2022-11-29 09:11:21 +00:00
dependabot[bot]
cc80949d56 Bump stimulus from 3.1.1 to 3.2.0
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 3.1.1 to 3.2.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.1.1...v3.2.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-11-29 09:01:55 +00:00
dependabot[bot]
5c8bbb3a38 Bump view_component from 2.77.0 to 2.78.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.77.0 to 2.78.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.77.0...v2.78.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-11-29 09:01:38 +00:00
dependabot[bot]
e8669f0178 Bump bullet from 7.0.3 to 7.0.4
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.3 to 7.0.4.
- [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/7.0.3...7.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 09:01:23 +00:00
jibees
ef31e1d063 Revert "Load product images in the shop lazily to improve performance" 2022-11-29 09:55:39 +01:00
Jean-Baptiste Bellet
4ef5609b0e This needs to be !important actually ;( 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
4e70a86fa9 Customize color for flatpickr 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
44f52c21db This is not only available when open or active but also when closed 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
e8b8a8961e Update links on the top to be blue as well 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
9a849bb2ee Default rule: a element are blue and darker blue by default 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
9c8525b797 Change default body text color 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
a9edc0cb9c Use the default blue for the link and a darker one when hovering 2022-11-28 14:36:51 +01:00
Jean-Baptiste Bellet
7556eee5d4 Do not display: flex; a td but its child
Actually, having `td.actions` with `display: flex;` cancel the `table-cell` height computation and it's then impossible to solve.
The solution here is to have a child (`div.flex`) that is `display: flex` and then the parent `td` can compute its height (as the same than its current row).
2022-11-28 14:36:51 +01:00
Filipe
44760ce8b6 Merge pull request #10014 from openfoodfoundation/dependabot/bundler/stripe-8.0.0
Bump stripe from 7.1.0 to 8.0.0
2022-11-28 12:03:33 +01:00
Mohamed ABDELLANI
005d5cafde test if the rendering options are stored for every reports seperately and if they persiste after logout 2022-11-28 11:35:00 +01:00
Jean-Baptiste Bellet
25ab334d73 Add box shadow on icon 2022-11-28 11:09:09 +01:00
dependabot[bot]
85dc32ffcb Merge pull request #10061 from openfoodfoundation/dependabot/bundler/bootsnap-1.15.0 2022-11-28 09:30:09 +00:00
dependabot[bot]
763d922510 Bump bootsnap from 1.14.0 to 1.15.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.14.0 to 1.15.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.14.0...v1.15.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-11-28 09:02:58 +00:00
jibees
a8bb05c575 Merge pull request #10058 from filipefurtad0/reduce_number_of_nodes
Removes the number of nodes for system specs
2022-11-28 08:38:36 +01:00
Konrad
0ce1ccf2d6 Merge pull request #10040 from abdellani/add_variant_sku_to_ocst_report
add variant sku to the OCST report
2022-11-27 21:28:07 +01:00
Konrad
e288c7a551 Merge pull request #9956 from jibees/9626-resize-and-crop-logo-instead-of-just-resizing-should-fit-into-a-square
Enterprise logo: Resize and crop logo instead of just resizing --> logo should fit into a square
2022-11-27 20:28:55 +01:00
Konrad
dc030182db Merge pull request #10023 from abdellani/add-hub-filter-to-orders-and-distributors
Add filter by distributor in "Orders And Distributors" report
2022-11-27 19:52:19 +01:00
Konrad
ddd0b939fe Merge pull request #9968 from openfoodfoundation/9964-xero-reports-bugnsag-error-missing-target-element-checkbox-for-csv-select-controller
Xero report: Avoid js error due to missing element, check it exists before setting any properties
2022-11-27 19:20:16 +01:00
filipefurtad0
a4b6c05d58 Removes the number of nodes for system specs 2022-11-27 16:49:23 +01:00
Jean-Baptiste Bellet
b3d0c0f2d5 Adjust bg color for items for multi selector 2022-11-25 16:56:15 +01:00
Jean-Baptiste Bellet
3afd8b7189 Adjust color, size and padding for one item selector
Unfortunately `!important` is necessary... 😭 😭 😭
2022-11-25 16:53:31 +01:00
Jean-Baptiste Bellet
7d51bd7b83 Add secondary button 2022-11-25 16:47:48 +01:00
Jean-Baptiste Bellet
974842300c Prepare buttons to have a border
(and a background with the same color than the border)
2022-11-25 16:47:31 +01:00
Jean-Baptiste Bellet
9474b574ad Do not apply button to td.actions icons 2022-11-25 16:45:21 +01:00
jibees
3a490a1f26 Merge pull request #10056 from filipefurtad0/remove_performance_spec
Removes performance spec and folder
2022-11-25 16:09:23 +01:00
filipefurtad0
fce3c46e55 Removes performance spec and folder 2022-11-25 15:40:36 +01:00
dependabot[bot]
a95bef141f Merge pull request #10051 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.7 2022-11-25 09:10:29 +00:00
Mohamed ABDELLANI
e25f4b1daa integrate ReportRenderingOptions in the View/Controller 2022-11-25 09:10:53 +01:00
David Cook
f25fb19fe8 Merge pull request #10053 from filipefurtad0/knapsackpro_api_key_engines
[knapsack] Updates subfolder syntax and adds separate API key for engine tests
2022-11-25 12:37:28 +11:00
David Cook
25ed405da7 Merge pull request #10052 from openfoodfoundation/dependabot/bundler/knapsack_pro-3.4.2
Bump knapsack_pro from 3.4.1 to 3.4.2
2022-11-25 11:14:18 +11:00
David Cook
00176b2b95 Merge pull request #10047 from filipefurtad0/fix_rspec_mocks_deprecation
Replaces stub with allow
2022-11-25 11:12:11 +11:00
David Cook
8f25718e62 Merge pull request #9973 from jibees/9972-remove-question-mark-from-capybara-saved-screenshots-in-order-to-save-it-through-ghactions
Sanitize `image_name` by removing all questions marks when saving any capybara screenshots
2022-11-25 09:51:56 +11:00
Jean-Baptiste Bellet
98b9395c31 Adjust table to reflect the new design
colors, size, border, padding/margin, ...
2022-11-24 16:46:22 +01:00
Jean-Baptiste Bellet
540c673924 Basically change colors for progress stuff 2022-11-24 16:45:45 +01:00
Jean-Baptiste Bellet
4149c14e8d Basically change colors for button components 2022-11-24 16:45:31 +01:00
Jean-Baptiste Bellet
af43fe9a5b Basically change colors for form inputs, fieldset 2022-11-24 16:45:03 +01:00
Jean-Baptiste Bellet
2a3c4d6649 Basically change colors for powertip component 2022-11-24 16:44:28 +01:00
Jean-Baptiste Bellet
c954187322 Basically change colors for select2 components 2022-11-24 16:44:09 +01:00
Jean-Baptiste Bellet
dbb7155114 Globally change body color 2022-11-24 16:43:33 +01:00
Jean-Baptiste Bellet
27b396cbc2 Add some colors and useful shadow
Will be used in the next coming commits
2022-11-24 16:43:02 +01:00
Jean-Baptiste Bellet
1abc406156 Do not ignore scss files in v2 folder
Starts with good habits.
2022-11-24 15:20:46 +01:00
Jean-Baptiste Bellet
5cab0f7f3d Use a darker orange color for selected menu 2022-11-24 15:20:46 +01:00
Rachel Arnould
56ce4ab04f Merge pull request #10025 from jibees/9998-new-admin-style
Admin, behind feature toggle `admin_style_v2`: new navigation menu
2022-11-24 14:59:04 +01:00
filipefurtad0
d351bf9a9a Adds Dir.glob syntax to include subdirectories 2022-11-24 12:56:17 +01:00
filipefurtad0
b447e4052c Removes empty spaces to comply to Dir.glob syntax 2022-11-24 12:07:16 +01:00
filipefurtad0
29196375f5 Adds separate API key for engine tests 2022-11-24 11:47:59 +01:00
Sigmund Petersen
23570be6a1 Merge pull request #10043 from filipefurtad0/flaky_complex_creating_specific
Adds retry: 3 to flaky example
2022-11-24 11:31:09 +01:00
Mohamed ABDELLANI
845133d3f6 group line_items by [customer,variant] in bulk/coop/packing_sheets 2022-11-24 11:06:09 +01:00
Mohamed ABDELLANI
b6a7ca3047 create ReportRenderingOptions model 2022-11-24 10:25:59 +01:00
dependabot[bot]
6652b7fe5c Bump knapsack_pro from 3.4.1 to 3.4.2
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.4.1...v3.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 09:06:09 +00:00
dependabot[bot]
6cb17905cd Bump @floating-ui/dom from 1.0.6 to 1.0.7
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.7/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 09:01:15 +00:00
dependabot[bot]
6aa449aacb Merge pull request #10050 from openfoodfoundation/dependabot/npm_and_yarn/minimatch-3.1.2 2022-11-24 08:34:11 +00:00
Jean-Baptiste Bellet
c2f82202a6 sanitize image_name by removing all questions marks
Co-Authored-By: David Cook <david@redcliffs.net>
2022-11-24 07:49:14 +01:00
David Cook
6c219b31a3 Update all locales with the latest Transifex translations 2022-11-24 16:14:16 +11:00
dependabot[bot]
b889f31c1a Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 05:12:35 +00:00
David Cook
83c7764456 Merge pull request #9895 from filipefurtad0/adds_knapsack_pro
Adds knapsack_pro to the stack; updates configs
2022-11-24 16:11:19 +11:00
Konrad
23c3573b8f Merge pull request #10032 from vviekk/viv/latlong
Removing 'required' tag for 'Latitude / Longitude' for Enterprises
2022-11-23 23:45:20 +01:00
Konrad
7c8a3bd7c9 Merge pull request #9955 from jibees/fix-deprecation-warning
Fix deprecation warnings around class loading during initialization
2022-11-23 20:16:15 +01:00
filipefurtad0
b66d263bc6 Replaces stub with allow 2022-11-23 15:12:09 +01:00
filipefurtad0
9afa75d91c Adds retry: 3 to flaky example 2022-11-23 12:57:21 +01:00
Mohamed ABDELLANI
d15708d4e3 test if OCST report includes variant's sku 2022-11-23 09:51:26 +01:00
Mohamed ABDELLANI
dafbefe8e3 add sku to OCST report as hidden by default column 2022-11-23 09:50:34 +01:00
vviekk
9d33402d9e Merge branch 'master' into viv/latlong 2022-11-22 16:38:19 +05:30
dependabot[bot]
abf8d44935 Merge pull request #10028 from openfoodfoundation/dependabot/bundler/bootsnap-1.14.0 2022-11-22 10:44:08 +00:00
dependabot[bot]
fb15b19e88 Merge pull request #10029 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.17.3 2022-11-22 10:41:41 +00:00
dependabot[bot]
e5c6ff433c Merge pull request #10037 from openfoodfoundation/dependabot/bundler/view_component-2.77.0 2022-11-22 09:37:48 +00:00
dependabot[bot]
bb35629960 Bump view_component from 2.76.0 to 2.77.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.76.0 to 2.77.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.76.0...v2.77.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-11-22 09:09:25 +00:00
filipefurtad0
c4e75dc557 Removes knapsack non-pro 2022-11-21 15:04:47 +01:00
filipefurtad0
10d1d2066e Merges separate knapsack_pro build files into one
Renames jobs

Includes jest and karma tests in build file

Renames jest karma job

Moves build setup into build.yml file

Changes job names

Re-distributes nodes according to run-time
2022-11-21 15:04:15 +01:00
filipefurtad0
3c53214daa Enables fixed_queue_split 2022-11-21 10:02:14 +00:00
filipefurtad0
40a9c36c85 Increases nr of nodes for system specs 2022-11-21 10:02:14 +00:00
filipefurtad0
48ecbaaa16 Enables queue mode only for system tests 2022-11-21 10:02:14 +00:00
filipefurtad0
ef7684e079 Disables queue mode 2022-11-21 10:02:14 +00:00
filipefurtad0
04c3b8b9cf Sets failing performance specs as pending 2022-11-21 10:02:14 +00:00
filipefurtad0
fd3a54a904 Creates key for test_the_rest specs 2022-11-21 10:02:14 +00:00
filipefurtad0
236abe485a Splits test-the-rest specs 2022-11-21 10:02:14 +00:00
filipefurtad0
8fb11b9151 Increases ci_node_total for system specs 2022-11-21 10:02:14 +00:00
filipefurtad0
b9471d4f01 Sets same API key for models and engines 2022-11-21 10:02:14 +00:00
filipefurtad0
b5da120805 Splits engines
Keeps test-the-rest specs running without Knapsack
2022-11-21 10:02:14 +00:00
filipefurtad0
da5976d85d Splits model specs 2022-11-21 10:02:14 +00:00
filipefurtad0
9e1047288f Runs all the test-the-rest specs 2022-11-21 10:02:14 +00:00
filipefurtad0
ff9985dd88 Further splits the build 2022-11-21 10:02:14 +00:00
filipefurtad0
e62eca93c1 Simplifies settings 2022-11-21 10:02:14 +00:00
filipefurtad0
8d532ae262 Enables knapsack_pro by default 2022-11-21 10:02:14 +00:00
filipefurtad0
d2f28e2095 Makes API key public 2022-11-21 10:02:14 +00:00
filipefurtad0
dbd5186dfa Enables slow file pattern to run on system specs 2022-11-21 10:02:14 +00:00
filipefurtad0
61cb7c4402 Removes knapsack_pro config from spec_helper.rb 2022-11-21 10:02:14 +00:00
filipefurtad0
ccfb83d2cd Splits build into 50 jobs 2022-11-21 10:02:14 +00:00
filipefurtad0
d6aa0168b2 Creates fork disabling on forks
Changes run job to use bash file
2022-11-21 10:02:14 +00:00
filipefurtad0
2a8ef5a45e Updates build.yml to run the build the first time with knapsack_pro 2022-11-21 10:02:14 +00:00
filipefurtad0
c423641102 Adds knapsack_pro to the stack; updates configs 2022-11-21 10:02:14 +00:00
vviekk
22559a755f Removing 'required' tag for 'Latitude / Longitude' for Enterprises
Empty/Null values are valid in db and for existing use-cases
2022-11-21 15:19:28 +05:30
dependabot[bot]
e877f94e07 Bump rubocop-rails from 2.17.2 to 2.17.3
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.17.2 to 2.17.3.
- [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.17.2...v2.17.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 09:08:43 +00:00
dependabot[bot]
820fff0528 Bump bootsnap from 1.13.0 to 1.14.0
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.13.0 to 1.14.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.13.0...v1.14.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-11-21 09:04:43 +00:00
Jean-Baptiste Bellet
09bcc772ff Remove useless line
Co-Authored-By: David Cook <david@redcliffs.net>
2022-11-21 09:49:06 +01:00
Jean-Baptiste Bellet
49e376f9b6 New design of the admin navigation menu! 2022-11-21 09:48:35 +01:00
Jean-Baptiste Bellet
85d3f5f9d7 Download OpenSans font also at 700 weight
needed in the navigation
2022-11-21 09:48:35 +01:00
Jean-Baptiste Bellet
9dd81604e9 Put navigation menu into span even if no icon next to it 2022-11-21 09:48:35 +01:00
Jean-Baptiste Bellet
61d3f79444 Add admin-v2 scss style file 2022-11-21 09:48:35 +01:00
Cillian O'Ruanaidh
b33d382069 Order BatchTaggableTagsQuery by name for consistency and to avoid flakey test failure 2022-11-18 15:05:03 +00:00
Cillian O'Ruanaidh
a8816b3788 Remove debugging code left in by accident 2022-11-18 14:40:30 +00:00
dependabot[bot]
204295dc91 Merge pull request #10013 from openfoodfoundation/dependabot/bundler/rswag-ui-2.8.0 2022-11-18 13:50:23 +00:00
dependabot[bot]
4ed71f1883 Merge pull request #10015 from openfoodfoundation/dependabot/bundler/rswag-api-2.8.0 2022-11-18 13:49:55 +00:00
jibees
92585b65c5 Merge pull request #10002 from heroinedor/fix/ofn-install-ci-unlock
unlock the ofn-install installation process
2022-11-18 11:38:43 +01:00
Pipo Bimbo
099f75befb pg_stat_statement extension already installed with ofn-install -> https://github.com/openfoodfoundation/ofn-install/blob/master/roles/datadog/tasks/pg_stats.yml#L2 2022-11-18 10:44:02 +01:00
Pipo Bimbo
2eaf79b149 missing dependency for ofn-install process 2022-11-18 10:44:02 +01:00
Jean-Baptiste Bellet
60f0a58508 Add admin-v2 on admin body if admin_style_v2 feature toggled on 2022-11-18 09:46:05 +01:00
Mohamed ABDELLANI
688020a304 test filtering by distributor (orders_and_distributors_report_spec) 2022-11-18 08:55:16 +01:00
Mohamed ABDELLANI
4b1bd362e0 [skip ci] add hub filter to the Order and Distributors report 2022-11-18 07:29:08 +01:00
Jean-Baptiste Bellet
23f9c41fec Update all locales with the latest Transifex translations 2022-11-17 17:58:42 +01:00
Konrad
8510379178 Merge pull request #9985 from binarygit/add-spinner-when-enterprise-sells-changes
[Admin][Enterprise Settings] Show spinner when enterprise sells option changes
2022-11-17 16:59:55 +01:00
dependabot[bot]
4b3465de78 Bump rswag-api from 2.7.0 to 2.8.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.7.0...2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 10:21:18 +00:00
dependabot[bot]
415f12c1bc Merge pull request #10012 from openfoodfoundation/dependabot/bundler/rswag-specs-2.8.0 2022-11-17 10:07:13 +00:00
dependabot[bot]
e3821df73a Merge pull request #10011 from openfoodfoundation/dependabot/bundler/view_component-2.76.0 2022-11-17 10:06:48 +00:00
dependabot[bot]
b358468952 Bump stripe from 7.1.0 to 8.0.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 7.1.0 to 8.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/v7.1.0...v8.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-11-17 09:03:39 +00:00
dependabot[bot]
c1c0a72184 Bump rswag-ui from 2.7.0 to 2.8.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.7.0...2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 09:03:22 +00:00
dependabot[bot]
b5a93a9a88 Bump rswag-specs from 2.7.0 to 2.8.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.7.0...2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 09:02:04 +00:00
dependabot[bot]
23cf18f9c4 Bump view_component from 2.75.0 to 2.76.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.75.0 to 2.76.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.75.0...v2.76.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-11-17 09:01:12 +00:00
Sigmund Petersen
5cef0e1939 Merge pull request #9946 from filipefurtad0/fixes_minor_build_issues
Fixes minor issues in the build
2022-11-16 18:22:24 +01:00
Sigmund Petersen
7243e49f92 Merge pull request #9958 from filipefurtad0/fix_flaky_taxonomy
Fix flaky taxonomy spec by asserting on page redirect and adding retry: 3
2022-11-16 14:59:29 +01:00
jibees
f58a187c9f Merge pull request #9986 from openfoodfoundation/dependabot/bundler/cuprite-0.14.3
Bump cuprite from 0.13 to 0.14.3
2022-11-16 14:55:41 +01:00
filipefurtad0
d728424859 Asserts on page redirect, after Update click 2022-11-16 12:19:02 +00:00
Sigmund Petersen
52487a270d Merge pull request #9889 from mkllnk/dfc-products
Activate DfcProvider with feature toggle, not prod
2022-11-16 12:26:44 +01:00
dependabot[bot]
d9772cbe01 Bump cuprite from 0.13 to 0.14.3
Bumps [cuprite](https://github.com/rubycdp/cuprite) from 0.13 to 0.14.3.
- [Release notes](https://github.com/rubycdp/cuprite/releases)
- [Commits](https://github.com/rubycdp/cuprite/compare/v0.13...v0.14.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 10:42:14 +00:00
Sigmund Petersen
1688bf09e3 Merge pull request #9988 from filipefurtad0/bump_cuprite-0.14.3
Cuprite bump: Updates helper to click on css element...
2022-11-16 11:41:09 +01:00
dependabot[bot]
53b1b5c062 Merge pull request #9995 from openfoodfoundation/dependabot/bundler/paranoia-2.6.1 2022-11-16 10:23:01 +00:00
filipefurtad0
c3ff1f78ce Updates GETTING_STARTED.md 2022-11-16 09:56:51 +00:00
filipefurtad0
487e2e4316 Deletes unused specs.rake file 2022-11-16 09:56:51 +00:00
filipefurtad0
05cae1cdf3 Removes obsolete/failing performance specs 2022-11-16 09:56:51 +00:00
filipefurtad0
50e9819a2a Fixes build.yml to replace rake task syntax 2022-11-16 09:56:51 +00:00
filipefurtad0
bb838e5a5a Moves flatpickr spec into admin folder 2022-11-16 09:56:51 +00:00
dependabot[bot]
cf5414dbfd Merge pull request #9987 from openfoodfoundation/dependabot/bundler/rubocop-1.39.0 2022-11-16 09:41:01 +00:00
dependabot[bot]
fd68f91996 Merge pull request #9961 from openfoodfoundation/dependabot/bundler/rails-i18n-7.0.6 2022-11-16 09:40:26 +00:00
dependabot[bot]
927e131e87 Merge pull request #9996 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.6 2022-11-16 09:25:20 +00:00
dependabot[bot]
3aa8a8510a Merge pull request #9994 from openfoodfoundation/dependabot/npm_and_yarn/loader-utils-1.4.2 2022-11-16 09:09:36 +00:00
jibees
089c7b0011 Merge pull request #9940 from filipefurtad0/fix_developer_settings_spec
Clears Stripe settings after example run
2022-11-16 10:07:33 +01:00
dependabot[bot]
76d5abcf50 Bump @floating-ui/dom from 1.0.4 to 1.0.6
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.4 to 1.0.6.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.6/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 09:02:05 +00:00
dependabot[bot]
6b6c5c03d6 Bump paranoia from 2.6.0 to 2.6.1
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/v2.6.0...v2.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 09:01:40 +00:00
dependabot[bot]
d9003aeccf Bump loader-utils from 1.4.1 to 1.4.2
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 07:51:33 +00:00
filipefurtad0
1a3c4008fd Applies helpers to relevant specs 2022-11-15 19:03:14 +00:00
filipefurtad0
4b067e2ece Creates separate helpers for enabling Stripe and keys 2022-11-15 19:03:14 +00:00
Filipe
94db55dd43 Merge pull request #9993 from openfoodfoundation/revert-9926-cache-address
Revert "Cache address JSON to avoid database queries"
2022-11-15 10:18:51 +00:00
jibees
6dcc50ad15 Revert "Cache address JSON to avoid database queries" 2022-11-15 10:40:22 +01:00
filipefurtad0
760635da1f Updates helper to click on css element...
...instead of passing empty_keys
2022-11-14 12:23:53 +00:00
dependabot[bot]
11480f20c5 Bump rubocop from 1.38.0 to 1.39.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.38.0 to 1.39.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.38.0...v1.39.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-11-14 09:05:05 +00:00
jibees
911d816233 Merge pull request #9979 from filipefurtad0/fix_flaky_bom_3
[Flaky BOM] Bumps retry: 2 -> 3
2022-11-14 09:21:17 +01:00
binarygit
8fc721c651 [Admin, Enterprise Settings] Show spinner when enterprise sells changes 2022-11-13 16:24:35 +05:45
Konrad
c2d5ea4a5a Merge pull request #9942 from mkllnk/taxonomies-spec
Avoid image load error and show errors in spec
2022-11-12 20:30:04 +01:00
Konrad
59d555165f Merge pull request #9936 from dacook/minor-admin-updates
Code cleanup: admin interface
2022-11-12 19:43:44 +01:00
Konrad
2eca3d5ef8 Merge pull request #9914 from openfoodfoundation/dependabot/bundler/spreadsheet_architect-5.0.0
Bump spreadsheet_architect from 4.2.0 to 5.0.0
2022-11-11 22:49:17 +01:00
Konrad
5fc17b51d2 Merge pull request #9887 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.117.1
Bump aws-sdk-s3 from 1.117.0 to 1.117.1
2022-11-11 21:15:58 +01:00
Konrad
c6178f5df9 Merge pull request #9877 from mkllnk/ignored-columns
Remove outdated ignoring of Paperclip columns
2022-11-11 21:08:42 +01:00
Cillian O'Ruanaidh
fbe6dcba7a Remove N+1 query loading tags for each order cycle exchange 2022-11-11 17:01:46 +00:00
Sigmund Petersen
bd718406f4 Merge pull request #9980 from openfoodfoundation/filipefurtad0-add-knapsackpro-badge-to-readme
Adds KnapsackPro badge to enable unlimited plan use
2022-11-11 13:20:58 +01:00
Filipe
ca4d92bf99 Adds KnapsackPro badge to enable KnapsackPro use
As requested per email: "Please add the Knapsack Pro badge to your open source project readme"
2022-11-11 11:46:24 +00:00
filipefurtad0
2f7cb4d3ca Bumps retry: 2 -> 3 2022-11-11 10:51:11 +00:00
David Cook
1e24988bd1 Remove label from bug report template
I accidentally added it last week.
2022-11-11 09:31:08 +11:00
Konrad
c44195c8a0 Merge pull request #9911 from viniciusueharaweb/9781-improve-shipping-category-not-found-error-message
[Product Import] Wrong error message when shipping category does not match predefined shipping categories
2022-11-10 22:48:25 +01:00
Konrad
5b44dc9609 Corrected missspelling of 'mispelling' in en.yml 2022-11-10 20:53:30 +01:00
Jean-Baptiste Bellet
dff9c6d333 Update all locales with the latest Transifex translations 2022-11-10 20:39:17 +01:00
Filipe
4b3184a6ef Merge pull request #9923 from mkllnk/cache-country
Cache default country for an hour
2022-11-10 19:10:29 +00:00
Filipe
f1dd69a4f7 Merge pull request #9926 from mkllnk/cache-address
Cache address JSON to avoid database queries
2022-11-10 18:18:03 +00:00
Filipe
24eda1bfae Merge pull request #9927 from mkllnk/lazy-load-product-images
Load product images in the shop lazily to improve performance
2022-11-10 18:11:56 +00:00
Konrad
ae09f7a415 Merge pull request #9869 from abdellani/fix-unit_value_with_description-calculation-on-products-page_admin_dashboard
use js-big-decimal to calculate unit_value_with_description in products page
2022-11-10 18:47:16 +01:00
dependabot[bot]
d8d1b38a4d Merge pull request #9967 from openfoodfoundation/dependabot/npm_and_yarn/socket.io-parser-4.0.5 2022-11-10 10:09:27 +00:00
Filipe
a7353eb69f Merge pull request #9575 from apricot12/9487-Dimensions-Packing-Reports
Added HEIGHT, WEIGHT, WIDTH, DEPTH columns to packing reports by customer.
2022-11-10 09:55:26 +00:00
jibees
8a702daccd Merge pull request #9966 from filipefurtad0/fix_flaky_spec_9902_2
Increases retry option from 2 to 3
2022-11-10 10:05:05 +01:00
jibees
f4de39ae00 Merge pull request #9965 from filipefurtad0/adds_retry_to_BOM_spec
Adds retry option to flaky BOM spec
2022-11-10 10:04:33 +01:00
Jean-Baptiste Bellet
4f265eed2a Check that target exists before setting properties
In case of Xero reports, there are no checkbox
2022-11-10 09:55:36 +01:00
Jean-Baptiste Bellet
bdf132a833 Format file according to our prettier configuration 2022-11-10 09:49:28 +01:00
dependabot[bot]
177e3d5885 Bump socket.io-parser from 4.0.4 to 4.0.5
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-09 22:15:43 +00:00
Filipe
b7fcc0b4fc Merge pull request #9924 from jibees/9757-BOM-show-only-one-modal-when-changing-date-range-
BOM: Display confirm modal on date range change only one time
2022-11-09 18:42:28 +00:00
filipefurtad0
86d38bbaa5 Increases retry option from 2 to 3 2022-11-09 17:19:13 +00:00
filipefurtad0
36bc17c8b4 Adds retry option to flaky examples 2022-11-09 16:36:36 +00:00
dependabot[bot]
7c7e5aaa59 Bump rails-i18n from 7.0.5 to 7.0.6
Bumps [rails-i18n](https://github.com/svenfuchs/rails-i18n) from 7.0.5 to 7.0.6.
- [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/compare/v7.0.5...v7.0.6)

---
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-11-09 09:01:46 +00:00
Konrad
b22beea5fc Merge pull request #9945 from jibees/9944-translate-columns-in-packing-and-xero-reports
Packing reports: translate columns name in the columns selector component
2022-11-09 09:55:21 +01:00
Jean-Baptiste Bellet
262b546836 Add some visual spacing 2022-11-08 14:59:23 +01:00
Jean-Baptiste Bellet
4bfd39caec The info tip indicates image should be 100*100, so display it at 100*100 size 2022-11-08 14:54:47 +01:00
Jean-Baptiste Bellet
58c8eae08c Enterprise logo: resize and crop at the center of image instead of just resize
Should fit in a square format
2022-11-08 14:54:11 +01:00
dependabot[bot]
2c17a2bafe Merge pull request #9952 from openfoodfoundation/dependabot/npm_and_yarn/babel-loader-8.3.0 2022-11-08 09:35:27 +00:00
dependabot[bot]
c25375f00a Merge pull request #9951 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.20.2 2022-11-08 09:34:45 +00:00
dependabot[bot]
7322362eea Merge pull request #9949 from openfoodfoundation/dependabot/bundler/capybara-3.38.0 2022-11-08 09:34:21 +00:00
dependabot[bot]
94b14d16bf Merge pull request #9950 from openfoodfoundation/dependabot/npm_and_yarn/husky-8.0.2 2022-11-08 09:33:39 +00:00
dependabot[bot]
116764166c Merge pull request #9954 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.8 2022-11-08 09:33:21 +00:00
dependabot[bot]
de807b1ee0 Merge pull request #9948 from openfoodfoundation/dependabot/npm_and_yarn/loader-utils-1.4.1 2022-11-08 09:32:05 +00:00
Mohamed ABDELLANI
70e47f3929 fix: convert @attrs[:units] to big decimal instead of float in the unit converter 2022-11-08 10:26:00 +01:00
Mohamed ABDELLANI
b203803eb9 fix test: change product_unit_value_with_description value to float (2 digits precision) 2022-11-08 10:26:00 +01:00
Mohamed ABDELLANI
44d719fcb5 use js-big-decimal to calculate unit_value_with_description 2022-11-08 10:26:00 +01:00
Jean-Baptiste Bellet
cb1b24695e Fix deprecation warnings around class loading during initialization
```
Fix deprecation warnings around class loading during initialization
Thi2022-11-08T08:54:57.542Z pid=40093 tid=nl9 WARN: DEPRECATION WARNING: Initialization autoloaded the constants ReportsHelper, DateTimeStringValidator et IntegerArrayValidator.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ReportsHelper, for example,
the expected changes won't be reflected in that stale Module object.

These autoloaded constants have been unloaded.

In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:

    Rails.application.reloader.to_prepare do
      # Autoload classes and modules needed at boot time here.
    end

That block runs when the application boots, and every time there is a reload.
For historical reasons, it may run twice, so it has to be idempotent.

Check the "Autoloading and Reloading Constants" guide to learn more about how
Rails autoloads and reloads.
```
2022-11-08 10:07:29 +01:00
dependabot[bot]
2a8731c8da Bump sidekiq from 6.5.7 to 6.5.8
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.7 to 6.5.8.
- [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.7...v6.5.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:04:23 +00:00
dependabot[bot]
ed81ce8ada Bump babel-loader from 8.2.5 to 8.3.0
Bumps [babel-loader](https://github.com/babel/babel-loader) from 8.2.5 to 8.3.0.
- [Release notes](https://github.com/babel/babel-loader/releases)
- [Changelog](https://github.com/babel/babel-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel-loader/compare/v8.2.5...v8.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:03:02 +00:00
dependabot[bot]
1c0132ca4d Bump @babel/preset-env from 7.19.4 to 7.20.2
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.4 to 7.20.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.20.2/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:02:37 +00:00
dependabot[bot]
c1cd524157 Bump husky from 8.0.1 to 8.0.2
Bumps [husky](https://github.com/typicode/husky) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v8.0.1...v8.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:02:01 +00:00
dependabot[bot]
2198f12922 Bump capybara from 3.37.1 to 3.38.0
Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.37.1 to 3.38.0.
- [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.37.1...3.38.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:01:35 +00:00
dependabot[bot]
d86498c81e Bump loader-utils from 1.4.0 to 1.4.1
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 08:36:50 +00:00
Jean-Baptiste Bellet
3e9647590d Packing report don't need untranslated headers for xlxs, csv format 2022-11-07 15:53:39 +01:00
Jean-Baptiste Bellet
f4572cb8cb nil is the value of :report_format when GETting a report page
This method is used in `custom_headers()` method that handle headers customization. Then, it's `@report.available_headers`
2022-11-07 11:44:01 +01:00
Maikel Linke
122fe8253e Avoid image load error and show errors in spec
I stumbled across some spec code which was hiding an unexpected error. So I
fixed it properly. This code is to be replaced soon anyway and this is a tiny
step in that direction.
2022-11-07 16:07:41 +11:00
Maikel
85017893d3 Merge pull request #9939 from jibees/fix-flatpickr-system-spec
Fix flatpickr system spec: `spec/system/flatpickr_spec.rb`
2022-11-07 15:37:57 +11:00
Maikel
35a8f6be74 Merge pull request #9935 from dacook/update-transifex
Update Transifex config format for latest version
2022-11-07 15:28:08 +11:00
Jean-Baptiste Bellet
9464f49031 Fix flatpickr system spec
On `/admin/orders`, we now have a date range picker.
This spec seems to test only the behavior of flatpickr, which is an external dependencies ; we probably shouldn't test it since it's not our responsibilities. Leave the spec as it for now.
2022-11-04 15:29:36 +01:00
Jean-Baptiste Bellet
39e5613db8 When confirm modal is dismissed, reset daterange picker to previous values
+ update specs as well
2022-11-04 14:18:29 +01:00
David Cook
20c0449128 Remove unnecessary case
Seems cleaner to me.

Best viewed with whitespace ignored.
2022-11-04 14:26:41 +11:00
David Cook
5405d6f525 Ensure all text inputs have full width
I think `url` and `tel` are currently unused, but I think we should use them in the future.
2022-11-04 14:26:39 +11:00
David Cook
9ef07cb110 Update GETTING_STARTED.md
[doc] Link to info about loading sample data

[skip ci]
2022-11-04 14:20:48 +11:00
David Cook
8d49ad9d18 Update Transifex config for APIv3
I installed the latest version of the CLI client (1.4.1), and the old config no longer worked. This config contains:
 - o: organisation
 - p: project
 - r: resource

You may need to upgrade your installation:

    tx update
2022-11-04 09:46:11 +11:00
Jean-Baptiste Bellet
228e484f02 Flatpicker instance can now handle flatpickr:change event
With:
```
detail: {
  startDate: "2022-10-02",
  endDate: "2022-10-10"
}
```
2022-11-03 16:57:03 +01:00
Jean-Baptiste Bellet
66a684920a allSaved() method from LineItems needs to be spy 2022-11-03 15:55:48 +01:00
Jean-Baptiste Bellet
1a241e4953 Only call confirmRefresh() on time, on date range change
Previously, when changing the date range, we had several modals that opened.
Now, the `confirmRefresh()` method should be open only one time.

Update specs as well:
 - use the method `accept_confirm`
 - Removing pending and sleep as the spec is now green
2022-11-03 15:55:48 +01:00
dependabot[bot]
74529cd595 Merge pull request #9930 from openfoodfoundation/dependabot/bundler/view_component-2.75.0 2022-11-03 13:50:27 +00:00
jibees
d69c2f8314 Merge pull request #9931 from filipefurtad0/fix_flaky_spec_9805_4
Sets retry: 3 on flaky example
2022-11-03 14:46:39 +01:00
jibees
3f00e523d3 Merge pull request #9932 from filipefurtad0/fix_flaky_bom_2
Sets retry: 3 for BOM spec
2022-11-03 14:45:51 +01:00
filipefurtad0
c10f5ce5df Sets retry: 3 for BOM spec 2022-11-03 13:13:42 +00:00
filipefurtad0
6bf332ef20 Sets retry: 3 on flaky example 2022-11-03 12:48:22 +00:00
dependabot[bot]
ef27e4f241 Bump view_component from 2.74.1 to 2.75.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.74.1 to 2.75.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.74.1...v2.75.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-11-03 09:03:30 +00:00
David Cook
af2c185f9f Update release issue template
Fix link 😳
2022-11-03 17:59:46 +11:00
David Cook
d7558a9aea Update release issue template
Add link to slack channel
2022-11-03 17:55:17 +11:00
David Cook
076244ee1c Update translations 2022-11-03 17:30:01 +11:00
Maikel
2e2488a25e Make Github expand the issue title on pull request 2022-11-03 14:11:51 +11:00
Maikel Linke
762beb7c1c Load product images in the shop lazily
The browser decides when to load the image, usually when it's close to
the viewport.
2022-11-03 14:02:01 +11:00
Maikel Linke
118c1f7cbd Cache address JSON to avoid database queries
We found that our database is quite busy querying the country all the
time. One source of these queries is the shop front which serializes
enterprises including their addresses. But addresses should be safe to
cache because:

- country records never change
- state records never change
- updating any other attribute changes the cache key

The caching was previously removed when the state_name attribute was
added. That is technically correct because it's possible to change a
state's name without updating the address. Then the cache would be out
of date. But we never update state names. And if we did, we would need
to invalidate the cache now.
2022-11-03 13:07:59 +11:00
Maikel Linke
8009b37723 Spec the AddressSerializer before changing it 2022-11-03 13:01:02 +11:00
dependabot[bot]
bf950d7c69 Merge pull request #9922 from openfoodfoundation/dependabot/npm_and_yarn/stimulus-3.1.1 2022-11-02 07:42:12 +00:00
Maikel Linke
a2c4242994 Simplify Address code
The DefaultCountry code has a fallback already.
2022-11-02 16:21:15 +11:00
Maikel Linke
392aeb7321 Remove unused method loading default country
And another unused method.
2022-11-02 16:21:15 +11:00
Maikel Linke
f971131888 Cache default country for an hour
The default country usually never changes after the initial setup of an
instance.
2022-11-02 15:33:43 +11:00
Maikel
257959448a Merge pull request #9921 from openfoodfoundation/dependabot/bundler/rubocop-1.38.0
Bump rubocop from 1.37.1 to 1.38.0
2022-11-02 13:00:57 +11:00
Maikel
ba4e7e440d Merge pull request #9896 from jibees/improve-reliability-of-specs
Flaky ; Add a `retry` on spec
2022-11-02 11:25:16 +11:00
Maikel
cb83069101 Merge pull request #9920 from filipefurtad0/webmock_do_not_always_require
Disables default loading of webmock and some seldom used gems
2022-11-02 11:10:05 +11:00
Maikel
456355da79 Merge pull request #9893 from jibees/small-improvments-on-script/rspec-slow-repeat-file
Small improvements on `script/rspec-slow-repeat` file
2022-11-02 11:01:04 +11:00
dependabot[bot]
2dc3c472c1 Bump stimulus from 3.1.0 to 3.1.1
Bumps [stimulus](https://github.com/stimulusjs/stimulus) from 3.1.0 to 3.1.1.
- [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.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 09:30:31 +00:00
dependabot[bot]
dfec0c3caf Bump rubocop from 1.37.1 to 1.38.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.37.1 to 1.38.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.37.1...v1.38.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-11-01 09:30:16 +00:00
filipefurtad0
73596308ab Disables default loading of some other seldom used gems 2022-10-31 22:10:58 +00:00
filipefurtad0
b736db0d7b Disables default loading of webmock gem 2022-10-31 22:07:07 +00:00
Jean-Baptiste Bellet
3ff1cd0793 Prefer to killall descendants instead of just killing yes processes 2022-10-31 16:11:32 +01:00
Jean-Baptiste Bellet
b93f6dfdad Add convenient logging when failing 2022-10-31 16:11:32 +01:00
Jean-Baptiste Bellet
9ba0695652 Trap CTRL+C to exit all yes commands 2022-10-31 16:11:31 +01:00
Jean-Baptiste Bellet
df42a88150 Retry specs as couldn't make it reliable 2022-10-31 15:34:04 +01:00
dependabot[bot]
8b73660d75 Merge pull request #9915 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.4 2022-10-31 10:11:54 +00:00
dependabot[bot]
f214c1f14f Merge pull request #9916 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.0.3 2022-10-31 09:41:02 +00:00
Jean-Baptiste Bellet
0eff4d3906 Add some comment on the purpose 2022-10-31 10:19:36 +01:00
Jean-Baptiste Bellet
84831266f1 Remove useless information 2022-10-31 10:19:14 +01:00
dependabot[bot]
5e1d4892b1 Bump active_storage_validations from 1.0.2 to 1.0.3
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/igorkasyanchuk/active_storage_validations/releases)
- [Changelog](https://github.com/igorkasyanchuk/active_storage_validations/blob/master/CHANGES.md)
- [Commits](https://github.com/igorkasyanchuk/active_storage_validations/compare/1.0.2...1.0.3)

---
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-10-31 09:05:49 +00:00
dependabot[bot]
7260bf1041 Bump @floating-ui/dom from 1.0.3 to 1.0.4
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.4/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-31 09:04:17 +00:00
dependabot[bot]
ded0604d18 Bump spreadsheet_architect from 4.2.0 to 5.0.0
Bumps [spreadsheet_architect](https://github.com/westonganger/spreadsheet_architect) from 4.2.0 to 5.0.0.
- [Release notes](https://github.com/westonganger/spreadsheet_architect/releases)
- [Changelog](https://github.com/westonganger/spreadsheet_architect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/westonganger/spreadsheet_architect/compare/v4.2.0...v5.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-31 09:03:40 +00:00
Maikel
01a907de9f Merge pull request #9907 from filipefurtad0/fix_flaky_spec_9805_2
Adds retry: 2 option
2022-10-31 11:46:53 +11:00
Maikel
5e0a08d99b Merge pull request #9906 from filipefurtad0/fix_flaky_spec_9902
Wraps success message around within block; adds retry option
2022-10-31 11:45:49 +11:00
Vinicius Uehara
6da442eb97 Fix trailing whitespace 2022-10-30 21:42:48 -03:00
Maikel
7b5debb76b Merge pull request #9904 from openfoodfoundation/dependabot/npm_and_yarn/js-big-decimal-1.3.12
Bump js-big-decimal from 1.3.10 to 1.3.12
2022-10-31 11:41:46 +11:00
Vinicius Uehara
f6cc9fca26 Prioritize attribute errors over product validations
With product validations being prioritized, custom and
insightful error messages were being overwriten by
general and ambiguous model validations, which
were confusing users
2022-10-30 20:02:08 -03:00
Vinicius Uehara
1f498e6052 Improve shipping category not found error message 2022-10-30 20:02:05 -03:00
filipefurtad0
32fb898962 Adds retry: 2 option 2022-10-28 18:32:21 +01:00
filipefurtad0
df8fd88682 Wraps success message around within block; adds retry option 2022-10-28 18:03:45 +01:00
Konrad
68b2e48fb3 Merge pull request #9900 from ijdershem/idersh/issue-9845
[9845] Make checkout terms and conditions label clickable
2022-10-28 14:28:06 +02:00
Konrad
0202bb40cf Merge pull request #9827 from saunmanoj888/fix-vairant-unit-decimal-issue
Fix unit description UI issue on updating a Product having imperial weight (oz)
2022-10-28 13:52:00 +02:00
Filipe
f7c62dfe45 Merge pull request #9862 from drummer83/master
Format reports as list, even if only one sub-type available
2022-10-28 12:13:42 +01:00
Konrad
1c185c2ca4 Merge pull request #9823 from abdellani/fix-product-duplication
Fix product duplication
2022-10-28 12:51:01 +02:00
dependabot[bot]
883f01e3e6 Bump js-big-decimal from 1.3.10 to 1.3.12
Bumps [js-big-decimal](https://github.com/royNiladri/js-big-decimal) from 1.3.10 to 1.3.12.
- [Release notes](https://github.com/royNiladri/js-big-decimal/releases)
- [Commits](https://github.com/royNiladri/js-big-decimal/compare/v1.3.10...v1.3.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-28 09:04:17 +00:00
jibees
8ccc88d770 Merge pull request #9897 from filipefurtad0/fix_flaky_spec_9805
Wraps expectation on within block
2022-10-28 10:47:04 +02:00
jibees
133512e4f4 Merge pull request #9898 from filipefurtad0/fix_flaky_spec_9894
Changes click method making it overlap-safe
2022-10-28 10:45:52 +02:00
dependabot[bot]
86b4570fc2 Merge pull request #9901 from openfoodfoundation/dependabot/bundler/test-prof-1.0.11 2022-10-28 07:45:14 +00:00
dependabot[bot]
3c996fdfb3 Bump test-prof from 1.0.10 to 1.0.11
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.10 to 1.0.11.
- [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.10...v1.0.11)

---
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-10-28 07:02:29 +00:00
dependabot[bot]
8048dc2c8b Merge pull request #9891 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.17.2 2022-10-28 07:01:20 +00:00
ijdershem-jf
0f9f4b07a8 [9845] Make checkout terms and conditions label clickable; associate label with input using correct for attribute 2022-10-27 20:30:42 -06:00
filipefurtad0
a6fdefff08 Changes click method making it overlap-safe 2022-10-27 21:25:45 +01:00
filipefurtad0
6a28918654 Wraps expectation on within block 2022-10-27 19:15:08 +01:00
Konrad
d544233bac Merge pull request #9780 from jibees/9777-select-the-right-country
Admin, Enterprise Details: Fix country selection on business address panel
2022-10-27 14:32:52 +02:00
dependabot[bot]
d577d60de6 Bump rubocop-rails from 2.17.1 to 2.17.2
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.17.1 to 2.17.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.17.1...v2.17.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 10:26:01 +00:00
Sigmund Petersen
473a35f330 Merge pull request #9892 from filipefurtad0/dependabot_exclude_push_from_build_double
Excludes build triggers using /** syntax for branch pushes
2022-10-27 12:24:40 +02:00
filipefurtad0
2fd8ffa413 Excludes build triggers using /** syntax for branch pushes 2022-10-27 11:00:39 +01:00
Jean-Baptiste Bellet
bbf400a83b /proc/cpuinfo is not available on Darwin arch (ie. mac) 2022-10-27 11:19:55 +02:00
Maikel Linke
56667f6142 Simplify test setup with enabled features
If a feature is activated or not depends on the database which is reset
after each test scenario. So enabling a feature doesn't leak into other
scenarios.

Just enabling the feature is less code and more realistic than mocking a
method call.
2022-10-27 15:32:05 +11:00
Maikel Linke
f9246f1917 Remove unused/broken feature toggle helper 2022-10-27 15:25:33 +11:00
Maikel Linke
36c44a5487 Allow FeatureToggleConstraint to run w/o warden
Routing specs and controller specs don't set warden on the request
environment. While we could try to re-implement Warden/Devise logic
here, it's much easier to not rely on the environment to be set.

While I'm usually opposed to changing production code to make testing
easier, it does avoid a lot of complication in this case. And maybe it
would be handy in other circumstances to have a more defensive approach
to checking the logged in user.
2022-10-27 15:07:04 +11:00
Maikel Linke
d1cd1fdefe Update translations 2022-10-27 11:00:42 +11:00
Maikel
df868d88d8 Merge pull request #9883 from filipefurtad0/dependabot_exclude_push_from_build
Adds ignore tag for pull_request dependabot branches
2022-10-27 10:45:04 +11:00
Maikel
da61fdbc2c Merge pull request #9881 from openfoodfoundation/dependabot/bundler/pdf-reader-2.11.0
Bump pdf-reader from 2.10.0 to 2.11.0
2022-10-27 10:34:54 +11:00
dependabot[bot]
a07b72c3c9 Bump aws-sdk-s3 from 1.117.0 to 1.117.1
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.117.0 to 1.117.1.
- [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-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 22:55:37 +00:00
Maikel
54b0554bb4 Merge pull request #9831 from filipefurtad0/fix_flaky_spec_bom_9811
Brings back rspec_retry; Creates helper method for flaky spec #9811
2022-10-27 09:52:43 +11:00
Rachel Arnould
2652bc086a Merge pull request #9755 from cillian/order-cycle-payment-methods
Let people choose which payment methods are available to customers on order cycles
2022-10-26 20:10:34 +02:00
filipefurtad0
f72e040a4d Adds ignore tag for pull_request dependabot branches 2022-10-26 13:58:28 +01:00
dependabot[bot]
1546619718 Bump pdf-reader from 2.10.0 to 2.11.0
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.10.0 to 2.11.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.10.0...v2.11.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-10-26 12:40:42 +00:00
dependabot[bot]
1c17c37915 Merge pull request #9879 from openfoodfoundation/dependabot/bundler/oauth2-1.4.11 2022-10-26 12:39:20 +00:00
dependabot[bot]
063e424bc0 Merge pull request #9878 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.117.0 2022-10-26 12:36:25 +00:00
filipefurtad0
b53faceebb Retries improved but still flaky examples 2022-10-26 13:26:21 +01:00
filipefurtad0
aebf84b53f Brings back rspec-retry gem and configs 2022-10-26 13:26:21 +01:00
dependabot[bot]
9ce1c536e4 Merge pull request #9880 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.17.1 2022-10-26 09:50:48 +00:00
Jean-Baptiste Bellet
edb2645af1 Add a country to test db and modify one spec
Check that businness address changes are ok
Test with another county since only one country and one state couldn't spot the fact that when changing country it needs to change also states selector
2022-10-26 11:21:44 +02:00
Jean-Baptiste Bellet
d797ef2b3a As we are in the Business Address panel, use the business_address attr
Not the address one, which is different

Business address country could be null, so use an empty array
2022-10-26 11:21:44 +02:00
Jean-Baptiste Bellet
d46105ea90 Correct some input styling 2022-10-26 11:21:44 +02:00
Jean-Baptiste Bellet
151e71b4d9 Actually controller is named dependEnt-select 2022-10-26 11:21:44 +02:00
Jean-Baptiste Bellet
b6bc4c66a2 Specify the current value of country 2022-10-26 11:21:44 +02:00
dependabot[bot]
b8b50fa165 Bump rubocop-rails from 2.16.1 to 2.17.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.16.1 to 2.17.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.16.1...v2.17.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 09:06:16 +00:00
dependabot[bot]
4d23113265 Bump oauth2 from 1.4.10 to 1.4.11
Bumps [oauth2](https://gitlab.com/oauth-xx/oauth2) from 1.4.10 to 1.4.11.
- [Release notes](https://gitlab.com/oauth-xx/oauth2/tags)
- [Changelog](https://gitlab.com/oauth-xx/oauth2/blob/main/CHANGELOG.md)
- [Commits](https://gitlab.com/oauth-xx/oauth2/compare/v1.4.10...v1.4.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 09:04:45 +00:00
dependabot[bot]
f909b742ce Bump aws-sdk-s3 from 1.116.0 to 1.117.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.116.0 to 1.117.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-10-26 09:04:18 +00:00
Maikel Linke
6aefc23c35 Allow devs to lazy-load app with right dependency 2022-10-26 14:08:27 +11:00
Maikel Linke
7c562d321d Activate DfcProvider with feature toggle, not prod
We want to test in dev and on staging, too.
2022-10-26 14:08:27 +11:00
Maikel
5a4727138c Merge pull request #9875 from filipefurtad0/fix_flaky_spec_8701
Minor changes to improve flakyness
2022-10-26 14:00:08 +11:00
Maikel
fe05d17078 Merge pull request #9872 from jibees/update-actions/upload-artifact-to-lastest-version
Build: use the latest version of `actions/upload-artifact`
2022-10-26 13:58:48 +11:00
Maikel Linke
9f9d8020c1 Fix URL generation for report without subtype
The URL is generated in the partial and it just needs to know that
there's no subtype.
2022-10-26 11:53:25 +11:00
Maikel Linke
3ebd896c3e Remove outdated ignoring of columns
Those columns have been removed from the database and don't need to be
ignored any more.
2022-10-26 10:42:19 +11:00
filipefurtad0
14955ac8ca Minor changes to improve flakyness 2022-10-25 17:39:10 +01:00
dependabot[bot]
06c6853323 Merge pull request #9856 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.13 2022-10-25 14:08:01 +00:00
dependabot[bot]
4e0b206c7b Merge pull request #9857 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.13 2022-10-25 13:59:39 +00:00
Konrad
3d003a735f Merge pull request #9851 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.116.0
Bump aws-sdk-s3 from 1.114.0 to 1.116.0
2022-10-25 15:52:34 +02:00
Jean-Baptiste Bellet
e16c8661a2 Use the same template even if there is no sub_report 2022-10-25 15:27:43 +02:00
dependabot[bot]
eaa6e9bc18 Bump @storybook/addon-docs from 6.5.12 to 6.5.13
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.12 to 6.5.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.13/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.13/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-10-25 13:20:15 +00:00
dependabot[bot]
91652ba792 Bump @storybook/addon-controls from 6.5.12 to 6.5.13
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.12 to 6.5.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.13/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.13/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-10-25 13:19:28 +00:00
dependabot[bot]
4bf640f0c4 Merge pull request #9866 from openfoodfoundation/dependabot/bundler/rubocop-1.37.1 2022-10-25 13:18:51 +00:00
jibees
cf489e809f Merge pull request #9867 from openfoodfoundation/dependabot/bundler/rswag-specs-2.7.0
Bump rswag-specs from 2.6.0 to 2.7.0
2022-10-25 15:18:18 +02:00
jibees
35bb539271 Merge pull request #9855 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.2.4
Bump @hotwired/turbo from 7.2.2 to 7.2.4
2022-10-25 15:17:25 +02:00
jibees
b3020a5573 Merge pull request #9854 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.3
Bump @floating-ui/dom from 1.0.2 to 1.0.3
2022-10-25 15:17:05 +02:00
jibees
250b9bc3c0 Merge pull request #9853 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.13
Bump @storybook/server from 6.5.12 to 6.5.13
2022-10-25 15:16:30 +02:00
Jean-Baptiste Bellet
e58add6af0 Use the latest version of actions/upload-artifact 2022-10-25 15:00:14 +02:00
filipefurtad0
3447959a06 Adds click_on_select2 helper 2022-10-25 13:32:29 +01:00
Mohamed ABDELLANI
41440af533 test if product's variant is duplicated properly 2022-10-25 11:28:16 +01:00
Mohamed ABDELLANI
826b1e95ef add a product variant. 2022-10-25 11:27:51 +01:00
Mohamed ABDELLANI
6cabbee1a2 rename new_variant double to new_master_variant 2022-10-25 11:27:14 +01:00
Mohamed ABDELLANI
11bc5c775c rename the variant double to master_variant 2022-10-25 11:26:43 +01:00
Mohamed ABDELLANI
788093c7cf implement variant duplication 2022-10-25 11:23:35 +01:00
Mohamed ABDELLANI
f44228eef7 extract variant duplication logic into a separated function 2022-10-25 11:23:35 +01:00
Konrad
62935f65a2 Merge pull request #9849 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.0.2
Bump active_storage_validations from 1.0.0 to 1.0.2
2022-10-25 12:04:50 +02:00
Konrad
e8425c5805 Merge pull request #9792 from vsmay98/6531-remove-user-registrations-controller
Remove spree user registrations controller file
2022-10-25 11:52:34 +02:00
dependabot[bot]
31cde7e06e Bump @hotwired/turbo from 7.2.2 to 7.2.4
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.2.2 to 7.2.4.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.2.2...v7.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:31:08 +00:00
dependabot[bot]
f467efc42b Bump @storybook/server from 6.5.12 to 6.5.13
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.12 to 6.5.13.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.13/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.13/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-10-25 09:30:49 +00:00
dependabot[bot]
faa8888e2a Bump @floating-ui/dom from 1.0.2 to 1.0.3
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.3/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:30:47 +00:00
jibees
84f488917e Merge pull request #9865 from jibees/sort-package.json-file
Sort package.json to avoid conflicts
2022-10-25 11:29:41 +02:00
dependabot[bot]
00c57fa06c Bump rswag-specs from 2.6.0 to 2.7.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.6.0...2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:03:31 +00:00
dependabot[bot]
c4748104a0 Bump rubocop from 1.36.0 to 1.37.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.36.0 to 1.37.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.36.0...v1.37.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 09:02:59 +00:00
Jean-Baptiste Bellet
46bbf1b1ec Sort package.json to avoid conflicts 2022-10-25 10:54:11 +02:00
Konrad
d12e99e363 Merge pull request #9808 from abdellani/sort_items_by_product_name_in_ocstd_report
add sort by product name to order_cycle_supplier_totals_by_distributo…
2022-10-25 10:34:22 +02:00
Jean-Baptiste Bellet
ede38a417f Respect rubocop Metrics/AbcSize by extracting a method 2022-10-25 10:22:35 +02:00
Jean-Baptiste Bellet
23b5e73c97 Weight is computed with unit_value and product variant_unit_scale 2022-10-25 10:22:35 +02:00
Maikel Linke
7081e712e8 Flag style issue on todo list for later
The code needs some bigger refactoring to avoid this style issue.
2022-10-25 10:09:26 +02:00
Nihal Mohammed
5c0f3a2d4b Add weight, height, width, depth fields to pack by customer reports
+ update specs by adding dimensions fields into reports specs
2022-10-25 10:09:26 +02:00
Nihal Mohammed
f8657aaf41 Copy dimensions from variants to line items before validation 2022-10-25 10:09:26 +02:00
Nihal Mohammed
f38661cdf1 Add weight, height, width, depth fields to line items 2022-10-25 10:09:26 +02:00
Maikel
85c8a0ac35 Merge pull request #9852 from openfoodfoundation/dependabot/bundler/rswag-api-2.7.0
Bump rswag-api from 2.6.0 to 2.7.0
2022-10-25 14:33:04 +11:00
Maikel
0e9869c4d3 Merge pull request #9848 from openfoodfoundation/dependabot/bundler/debug-1.6.3
Bump debug from 1.6.2 to 1.6.3
2022-10-25 14:02:17 +11:00
Maikel
a3416bcb80 Merge pull request #9790 from matisnape/update-docker-readme-for-m1-users-#8421
Update docker readme for M1 users [#8421]
2022-10-25 11:12:09 +11:00
Maikel
bf206dc4e6 Merge pull request #9858 from jibees/setup-redis-for-build
Setup redis on build
2022-10-25 11:11:08 +11:00
Maikel
55ef4dfe0d Merge pull request #8809 from Matt-Yorkley/dead-code-variants-check
Remove dead code: Product#variants?
2022-10-25 10:49:01 +11:00
Konrad
3489f08ec5 Format reports as list, even if only one sub-type available 2022-10-25 00:31:00 +02:00
Konrad
4a7ac45dba Merge pull request #9830 from jibees/9821-remove-report_inverse_columns_logic-feature-toggle
Remove `report_inverse_columns_logic` feature toggle
2022-10-25 00:23:31 +02:00
Konrad
df925d6412 Merge pull request #9737 from Laurel16/fix_issue#9559
Translate error messages when creating products
2022-10-24 23:17:32 +02:00
Konrad
84bf38ce4d Merge pull request #9791 from vsmay98/8250-fix-snail-for-all-enterprise-fee
Fix snail issue for all enterprise fees
2022-10-24 21:49:45 +02:00
saunmanoj888
490c5afc59 Mock bigDecimal methods in specs 2022-10-25 00:05:31 +05:30
filipefurtad0
367f77f477 Replaces select2_select helper for find/click 2022-10-24 17:57:10 +01:00
Jean-Baptiste Bellet
892a020bcc Setup redis on build 2022-10-24 17:01:12 +02:00
dependabot[bot]
1f5281ac1a Bump rswag-api from 2.6.0 to 2.7.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.6.0...2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 11:19:45 +00:00
Rachel Arnould
3c9b7a10f4 Merge pull request #9058 from Matt-Yorkley/oidc-redux
Add OIDC authentication for Les Communs
2022-10-24 13:18:36 +02:00
Jean-Baptiste Bellet
e2441cdcf6 Use the report type or subtype as the title 2022-10-24 11:12:22 +02:00
Jean-Baptiste Bellet
6dec80aaaf Links only on right side 2022-10-24 11:12:22 +02:00
Jean-Baptiste Bellet
1c349049d1 Remove report description when they are useless 2022-10-24 11:12:22 +02:00
Jean-Baptiste Bellet
edc667a336 By default, some columns are hidden. 2022-10-24 11:12:22 +02:00
Jean-Baptiste Bellet
02787e668f Remove report_inverse_columns_logic feature toggle
Co-Authored-By: Maikel <maikel@email.org.au>
2022-10-24 11:12:22 +02:00
dependabot[bot]
830a7c8f1d Bump aws-sdk-s3 from 1.114.0 to 1.116.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.114.0 to 1.116.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-10-24 09:03:55 +00:00
dependabot[bot]
cd43bd4522 Bump active_storage_validations from 1.0.0 to 1.0.2
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 1.0.0 to 1.0.2.
- [Release notes](https://github.com/igorkasyanchuk/active_storage_validations/releases)
- [Changelog](https://github.com/igorkasyanchuk/active_storage_validations/blob/master/CHANGES.md)
- [Commits](https://github.com/igorkasyanchuk/active_storage_validations/compare/1.0.0...1.0.2)

---
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-10-24 09:03:07 +00:00
dependabot[bot]
9dbc9f7272 Bump debug from 1.6.2 to 1.6.3
Bumps [debug](https://github.com/ruby/debug) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](https://github.com/ruby/debug/compare/v1.6.2...v1.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 09:02:49 +00:00
Mohamed ABDELLANI
da9a4803ff add it "lists products sorted by name" test 2022-10-24 09:01:42 +01:00
Mohamed ABDELLANI
732ebd8457 fix the expected table size in "generates the report" test 2022-10-24 09:01:42 +01:00
Mohamed ABDELLANI
39e567d386 set line_items_count to 3 2022-10-24 09:01:42 +01:00
Mohamed ABDELLANI
4740c2b0db add sort by product name to order_cycle_supplier_totals_by_distributor report rules 2022-10-24 09:01:42 +01:00
jibees
ee70ab8adb Merge pull request #9847 from mkllnk/stable-orders_and_fulfillment_spec
Expect report rows for same product in random order
2022-10-24 09:57:06 +02:00
Maikel
936a96bd6c Merge pull request #9839 from openfoodfoundation/dependabot/bundler/rswag-ui-2.7.0
Bump rswag-ui from 2.6.0 to 2.7.0
2022-10-24 16:01:04 +11:00
Maikel
b3492981d3 Merge pull request #9832 from openfoodfoundation/dependabot/bundler/nokogiri-1.13.9
Bump nokogiri from 1.13.8 to 1.13.9
2022-10-24 15:58:57 +11:00
Maikel Linke
167ce0e53c Expect report rows in random order
It's not deterministic which variant is shown first and therefore this
spec would fail from time to time.
2022-10-24 15:40:35 +11:00
Maikel
8f47d2b2be Merge pull request #9820 from jibees/update-all-github-action-to-avoid-deprecated
Upgrade deprecated github/actions in our CI
2022-10-24 15:26:54 +11:00
Maikel
e873771f18 Merge pull request #9822 from filipefurtad0/redis_CannotConnectError
Extracts routing outside it block
2022-10-24 13:33:01 +11:00
Maikel
627b8af37b Merge pull request #9828 from mkllnk/authorize-api-key
Prevent users from changing API keys for others
2022-10-24 11:22:35 +11:00
Cillian O'Ruanaidh
eb72ec8e13 An order cycle isn't ready for checkout if a tag rule means no payment/shipping methods are available to the customer 2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
7458dccea6 Call @order_cycles.count instead of #size because TagRuleApplicator doesn't return Relation anymore
In March 2020 this was changed to use :size instead of :count because TagRuleApplicator returned an ActiveRecord::Relation, see:

d2eee1dafd

However in October 2020 TagRuleApplicator was changed to always return an Array so this is no longer needed, see:

7e606471e4
2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
3e24b7ba6b Assign variable across two lines so Rubocop override comment isn't needed in OrderCycleClone
Co-authored-by: Maikel <maikel@email.org.au>
2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
62cd507fb9 Stub Spree::Config.stripe_connect_enabled instead of changing it before and back after tests
It's less code and sometimes there can be issues when config cache values are changed.

Co-authored-by: Maikel <maikel@email.org.au>
2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
beba3c7684 Disable Metrics/ClassLength check for OrderCycleForm 2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
f5bd23b4d8 Remove unused Spree::Order#available_payment_methods method
This was introduced in 47d2f698ef but we are using OrderAvailablePaymentMethods now.
2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
2c14aecf4f Extract a OrderCycleClone service
Before it was giving a Rubocop error, probably not a bad idea anyway.
2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
4e6d64c0a1 Let people choose which payment methods are available to customers on order cycles 2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
5718f9f00c Create :order_cycles_distributor_payment_methods HABTM join table 2022-10-21 17:21:31 +01:00
Cillian O'Ruanaidh
5423c1c02e Resolve conflict in db/schema.rb 2022-10-21 17:21:24 +01:00
saunmanoj888
ee8454bd2c Use js-big-decimal package for calculation 2022-10-21 21:30:00 +05:30
dependabot[bot]
45c23a76ff Bump rswag-ui from 2.6.0 to 2.7.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.6.0...2.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-21 13:24:52 +00:00
Jean-Baptiste Bellet
5a1d9013c6 Update all locales with the latest Transifex translations 2022-10-20 23:12:32 +02:00
jibees
3a68e237de Merge pull request #9772 from mkllnk/revenue-report-for-au
Add more fields to revenue report as used by Aus
2022-10-20 23:10:17 +02:00
Jean-Baptiste Bellet
87ed23211e Use the last version of github/codeql-action/upload-sarif 2022-10-20 17:42:22 +02:00
jibees
48e18b016a Merge pull request #9756 from vsmay98/8249-fix-snail-for-all-shipping-method-fee
Fix snail issue for all shipping method fees
2022-10-20 17:31:24 +02:00
jibees
da851079f4 Merge pull request #9776 from abdellani/product-creation-minor-improvements
Product creation minor improvements
2022-10-20 17:30:47 +02:00
jibees
1d265d19ce Merge pull request #8872 from Matt-Yorkley/bugsnag-data
Update Bugsnag error data
2022-10-20 17:30:14 +02:00
jibees
9e4bd23332 Merge pull request #9738 from AthiraKadampatta/9726-remove-unused-paperclip-columns
Delete unused paperclip columns.
2022-10-20 17:29:44 +02:00
jibees
fdc362cb44 Merge pull request #9806 from mkllnk/feature-constraint
Generalise feature toggle constraint
2022-10-20 17:27:46 +02:00
Vishal Jain
8d3845508c remove check_permissions method 2022-10-20 19:54:23 +05:30
Vishal Jain
952b6039f9 Remove spree user registrations controller file 2022-10-20 19:54:23 +05:30
Jean-Baptiste Bellet
053af8416b Previous setup-ruby action was deprecated. Use ruby/setup-ruby@v1 2022-10-20 16:14:14 +02:00
dependabot[bot]
955b84ae6f Bump nokogiri from 1.13.8 to 1.13.9
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.8 to 1.13.9.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.8...v1.13.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-20 13:45:27 +00:00
jibees
2455ecabde Merge pull request #9758 from openfoodfoundation/dependabot/bundler/activerecord-import-1.4.1
Bump activerecord-import from 1.4.0 to 1.4.1
2022-10-20 15:44:42 +02:00
Konrad
71037022ec Merge pull request #9816 from viniciusueharaweb/9703-product-description-should-have-a-pointer-cursor
Add pointer cursor when hovering a clickable product description
2022-10-20 10:38:46 +02:00
Jean-Baptiste Bellet
7ffd4669be Change node version to use the latest LTS
We probably need to modify our `ofn-install` build to also use the latest LTS
2022-10-20 10:20:09 +02:00
jibees
2b7b83ba37 Merge pull request #9826 from filipefurtad0/fix_flaky_spec_bom_9824
Clarifies contexts, cleans-up spec DRY
2022-10-20 09:55:33 +02:00
Maikel Linke
fc79612f26 Prevent users from changing API keys for others
It was checking for the permission to create a user which everyone can
do. Now it's checking for updating that particular user and doesn't
allow generating new keys for other users any more.

This would have been an inconvenience but not a big security issue
because you can't view the key of another user.
2022-10-20 17:56:46 +11:00
Vishal Jain
de28027623 add system spec 2022-10-20 12:15:22 +05:30
Vishal Jain
755107ec9f Fix snail issue for all enterprise fees 2022-10-20 12:15:21 +05:30
saunmanoj888
b40cd579bc Fix spec failure 2022-10-19 23:18:22 +05:30
saunmanoj888
8e45b758ba Fix unit value UI issue 2022-10-19 22:59:28 +05:30
filipefurtad0
c4de247dd9 Clarifies contexts, cleans-up spec DRY 2022-10-19 16:56:04 +01:00
filipefurtad0
a244b34627 Extracts routing to context (DRY); creates context for separate it block 2022-10-19 11:15:15 +01:00
filipefurtad0
dabe37ebcb Extracts routing outside it block 2022-10-19 11:01:56 +01:00
Jean-Baptiste Bellet
2fcbe437f2 Upgrade "actions/setup-node" to non-deprecated version 2022-10-19 11:31:47 +02:00
Jean-Baptiste Bellet
642938afe0 Upgrade "actions/checkout" to non-deprecated version 2022-10-19 11:28:31 +02:00
jibees
7b96a1fb5b Merge pull request #9815 from mkllnk/bulk-product-spec
Stabilise spec by waiting for JS
2022-10-19 09:50:55 +02:00
Matt-Yorkley
0ca86344d2 Update use of deprecated #add_tab method to #add_metadata 2022-10-19 17:36:53 +11:00
Matt-Yorkley
980f004b83 Update Bugsnag error data 2022-10-19 17:36:52 +11:00
Matt-Yorkley
c0ee72319f Remove dead code: Product#variants?
This only makes sense in the context of Products which only have "master" variants, and we removed that option a while back.

Remove #variants? check from ProductStock concern
2022-10-19 16:30:12 +11:00
Maikel
3d26b76d17 Merge pull request #9814 from filipefurtad0/fix_flaky_spec_bom_9809
Replaces js select2 methods by find/click methods
2022-10-19 14:41:55 +11:00
Vinicius Uehara
7772c01e16 Add pointer cursor when hovering a clickable product description 2022-10-18 23:11:56 -03:00
Maikel Linke
04921aeed4 Stabilise spec by waiting for JS 2022-10-19 09:59:51 +11:00
filipefurtad0
c71c5054e0 Replaces js select2 methods by find/click methods 2022-10-18 21:27:52 +01:00
Filipe
4015413d1d Merge pull request #9813 from filipefurtad0/fix_flaky_spec_bom
Comments out and adds pending on flaky examples
2022-10-18 11:32:50 +01:00
filipefurtad0
b3059bbdbc Comments out and adds pending on flaky examples 2022-10-18 10:28:44 +01:00
Maikel Linke
a35fab5e1f Speed up spec by skipping a page 2022-10-18 14:27:18 +11:00
Maikel Linke
c22f6cb805 Add more fields to revenue report as used by Aus
We currently maintain our own CSV generation script which could be
replaced if we got all this information here.
2022-10-18 12:51:13 +11:00
Maikel Linke
f00aeb006e Allow enterprise users to authorize via OIDC 2022-10-18 11:32:14 +11:00
Matt-Yorkley
66c3ba3bba Remove default omniauth link 2022-10-18 11:32:14 +11:00
Matt-Yorkley
b322df8515 Generate devise links view 2022-10-18 11:32:14 +11:00
Matt-Yorkley
617164684c Configure OIDC 2022-10-18 11:32:14 +11:00
Matt-Yorkley
b36fae1bbb Add migration for omniauth attributes 2022-10-18 11:31:35 +11:00
Matt-Yorkley
3a5f263fb5 Add omniauth / OIDC gems 2022-10-18 11:31:35 +11:00
Filipe
d5c3edc8fa Merge pull request #9749 from drummer83/master
Fix layout of 'Create a new product' button in dashboard overview
2022-10-17 13:45:37 +01:00
Laurel16
ec65e4dcaa Fix: Missing translation in error messages issue#9559
Fix: changing local translation for variant_unit in spree/product en.yml

Fix: add unite_value key to en.yml
2022-10-17 15:32:04 +11:00
Maikel
c83eb5d5dc Merge pull request #9768 from ashwini-seshadri/admin_permissions_granting_permission_to_a_shop_displays_it_in_producers_list_as_if_it_was_a_supplier
Fix for: [Admin][Permissions] Granting permission to a shop displays it in "Producers" list as if it was a supplier #9589
2022-10-17 09:58:03 +11:00
Anna Nowak
9a40329bd7 Update docker readme for m1 users [#8421] 2022-10-15 18:29:51 +02:00
jibees
bf74612892 Merge pull request #9775 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.2.2
Bump tom-select from 2.2.1 to 2.2.2
2022-10-14 09:27:06 +02:00
jibees
eae7d96b30 Merge pull request #9774 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.2.2
Bump @hotwired/turbo from 7.2.0 to 7.2.2
2022-10-14 09:21:36 +02:00
Mohamed ABDELLANI
96c6f58ba2 fix test @/spec/system/admin/products_spec.rb:32 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
6a8c7b15dc fix product category errors message in the form 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
955492bfdd show the error message when the variant unit is not selected 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
0000faab91 render the error message when the unit value is not set 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
e3f157ebdd remove empty option from unit size 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
f8af84d9d4 remove red start from tax category form 2022-10-14 03:26:40 +01:00
Mohamed ABDELLANI
bddbb36813 remove red star from supplier 2022-10-14 03:26:40 +01:00
dependabot[bot]
78b73c988e Bump tom-select from 2.2.1 to 2.2.2
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.2.1...v2.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-13 09:41:37 +00:00
jibees
cd641cc5d6 Merge pull request #9714 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.2.1
Bump tom-select from 2.1.0 to 2.2.1
2022-10-13 11:30:13 +02:00
dependabot[bot]
50555a3fe9 Bump @hotwired/turbo from 7.2.0 to 7.2.2
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.2.0 to 7.2.2.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.2.0...v7.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-13 09:08:24 +00:00
jibees
7c6e220bf7 Merge pull request #9771 from mkllnk/rspec-slow
Add convencience script to test flaky specs
2022-10-13 10:44:00 +02:00
Maikel Linke
3496b57942 Add convencience script to test flaky specs 2022-10-13 16:28:09 +11:00
Maikel Linke
bc805d94d8 Update translations 2022-10-13 16:03:26 +11:00
Ashwini Seshadri
1596649034 Merge branch 'master' into admin_permissions_granting_permission_to_a_shop_displays_it_in_producers_list_as_if_it_was_a_supplier 2022-10-13 06:48:40 +02:00
Maikel Linke
81461684f3 Generalise feature toggle constraint
Now we can re-use it for any feature.
2022-10-13 10:42:20 +11:00
Maikel
d33cdd1327 Merge pull request #9706 from jibees/9625-create-a-component-to-display-hide-columns-for-report
Create a component to display/hide columns for report
2022-10-13 10:05:27 +11:00
jibees
daaff2f7e8 Merge pull request #9764 from mkllnk/simple-oc-spec
Stabilise spec by waiting for JS requests
2022-10-12 10:17:51 +02:00
Jean-Baptiste Bellet
4de0b9ad11 Avoid warning on compilation 2022-10-12 09:28:50 +02:00
Jean-Baptiste Bellet
14a258c661 Attempt: externalize ofn-drop-down-v2 selector
+ add class `redesigned-checkbox` on `input`

Move `input.redesigned-input` definition outside dropdown definition

--> more generic
2022-10-12 09:28:50 +02:00
jibees
3b3f9a7513 Merge pull request #9766 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.4
Bump @babel/preset-env from 7.19.3 to 7.19.4
2022-10-12 09:07:53 +02:00
Maikel
3e1b66fd01 Remove extra blank line from Gemfile 2022-10-12 17:15:12 +11:00
Maikel Linke
9da6f862cd Stabilise pending spec 2022-10-12 16:49:29 +11:00
Maikel Linke
3eb597bff4 Fix specs which accidentally reversed relationships 2022-10-12 16:49:29 +11:00
Maikel Linke
46fde6bd40 Remove now unused scope 2022-10-12 16:48:32 +11:00
Ashwini Seshadri
590a09f069 Fixed the permissions relationship, so the shop displays only suppliers and does not display distributors in producers list
and updated relevant tests
2022-10-12 16:48:31 +11:00
Maikel
1d9fbbf69e Merge pull request #9767 from jibees/fix-flaky-spec
BOM Specs, don't need to wait for UI feedback: only check on page content
2022-10-12 11:52:50 +11:00
Maikel
b378d7655f Merge pull request #9762 from openfoodfoundation/dependabot/bundler/view_component-2.74.1
Bump view_component from 2.74.0 to 2.74.1
2022-10-12 11:24:11 +11:00
Rachel Arnould
617a417dc2 Merge pull request #9506 from binarygit/remove-angular-from-payment-methods
Remove angular from payment methods
2022-10-11 13:13:26 +02:00
Jean-Baptiste Bellet
bfbdb5f44b Don't need to wait for UI feedback: only check on page content
ie. table content
2022-10-11 12:16:25 +02:00
Vishal Jain
e02de2b17d Fix snail issue for all shipping method fees 2022-10-11 15:30:19 +05:30
dependabot[bot]
ae84dfe3cd Bump @babel/preset-env from 7.19.3 to 7.19.4
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.3 to 7.19.4.
- [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.19.4/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-10-11 09:03:45 +00:00
Jean-Baptiste Bellet
8a6874326a selected could be nil if no columns are selected 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
68de510c4e Redesign checkboxes 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
230afd5024 Update multiple_checked_select_component.html.haml 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
41e696282c Don't build inputs, but directly use input checkbox for each option
way simpler this way.
2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
e655d5b188 Remove useless id attribute. Prefer to use data-value directly. 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
7d15baef9d Do not use a variable filter_placeholder but translate it in the view 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
312f2544dd Be sure that option key is a Symbol (it could be a String) 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
157bdd9f3d Add a vertical scrolling 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
b4e041c7e9 Implements the ofn-drop-down-v2 design 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
23e2d28488 Implements the filter options feature 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
0f9ebfe34a Use the MultipleCheckedSelectComponent 2022-10-11 10:05:06 +02:00
Jean-Baptiste Bellet
b7adc5f551 Create the MultipleCheckedComponent
+ Associate the StimulusController to this component
2022-10-11 10:05:06 +02:00
dependabot[bot]
7bb7391634 Bump activerecord-import from 1.4.0 to 1.4.1
Bumps [activerecord-import](https://github.com/zdennis/activerecord-import) from 1.4.0 to 1.4.1.
- [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.4.0...v1.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-11 07:35:27 +00:00
AthiraKadampatta
e5a136801d 9726 Remove attachment_width and attachment_height from spree_asset 2022-10-11 10:26:32 +05:30
AthiraKadampatta
addd2ea9ac #9726 Add migration to remove unused paperclip columns 2022-10-11 10:26:32 +05:30
dependabot[bot]
7b0ce3272a Bump view_component from 2.74.0 to 2.74.1
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.74.0 to 2.74.1.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.74.0...v2.74.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-11 04:19:01 +00:00
Maikel Linke
5bbbe4b67a Stabilise spec by waiting for JS requests
Well, two seconds is just a guess. Ideally the page wouldn't display
until we have everything loaded. But this logic will be replaced when we
chuck out AngularJS.

This version passed over 100 runs with a busy CPU on my machine.
2022-10-11 14:57:59 +11:00
Maikel
4705d306b5 Merge pull request #9730 from AthiraKadampatta/9726-unused-paperclip-columns-ignored-list
Ignore paperclip columns to prepare for deletion
2022-10-11 11:44:42 +11:00
Maikel
2082404c87 Merge pull request #9752 from maniSHarma7575/9603-fix-order-cycle-fees-dropdown
Fixed same enterprise appear several times in the fee dropdown list
2022-10-11 09:41:02 +11:00
Maikel
c9a7230fe2 Merge pull request #9635 from mkllnk/stable-specs
Remove retries from test runs
2022-10-11 09:36:50 +11:00
Jean-Baptiste Bellet
1f329e85bc Also include plugins 2022-10-10 17:15:46 +02:00
AthiraKadampatta
b2c778794d 9726 Remove safe navigation operator and simplify call to attachment file name 2022-10-10 16:52:02 +02:00
AthiraKadampatta
80eef9c302 9726 Add attachment_width and attachment_height to the list of ignored columns for spree images 2022-10-10 16:52:02 +02:00
AthiraKadampatta
f40b569a4a 9726 Use active storage filename instead of attachment_file_name of paperclip 2022-10-10 16:52:02 +02:00
AthiraKadampatta
1f161bee1f Add paperclip columns to ignored columns list for enterprise, enterprise group, terms_of_service_file, spree/image models 2022-10-10 16:52:02 +02:00
Jean-Baptiste Bellet
4140e3d153 Import tom-select file directly
can't use "tom-select" anymore, due to a mis-configuration with babel I guess
2022-10-10 16:10:33 +02:00
Jean-Baptiste Bellet
db70c47a31 Specify IE 11 as a target
Comes from error using tom-select:

```
ERROR in ./node_modules/tom-select/dist/esm/tom-select.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: /Users/jibees/dev/openfoodnetwork/node_modules/tom-select/dist/esm/tom-select.js: unknown Statement of type "ForOfStatement"
```
2022-10-10 16:09:43 +02:00
Manish Sharma
cd71233163 Fixed duplicates enterprises in order cycles 2022-10-10 14:30:58 +05:30
Maikel Linke
6ef0e04c18 Mark currently broken spec as pending
I thought it's better to progress with this PR before we break more
things.
2022-10-10 16:03:18 +11:00
Maikel Linke
87274bccc6 Remove retries from test runs
If a spec is flaky, we need to fix it. Retry is just hiding problems for
a while and is adding to execution time.
2022-10-10 14:09:18 +11:00
dependabot[bot]
981c306977 Bump tom-select from 2.1.0 to 2.2.1
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.1.0...v2.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 03:00:21 +00:00
Maikel
82e38d7b91 Merge pull request #9526 from jibees/6730-use-a-date-range-picker
Admin, List of Orders & Orders Bulk Management pages: use a date range picker
2022-10-10 13:59:37 +11:00
Maikel
5894246474 Merge pull request #9682 from binarygit/picked_up_email
Send picked up emails when orders are picked up
2022-10-10 13:15:24 +11:00
Maikel
058a45f4e5 Merge pull request #9442 from jibees/8904-display-fees-name-instead-of-type-on-invoices
Display fees name instead of type on invoices
2022-10-10 13:15:01 +11:00
Maikel
e5ccee42cc Merge pull request #9725 from vsmay98/9468-hide-all-references-hub-from-producers-profile
[Shopfront] Hide hub with "hide all references" setup in producers profiles
2022-10-10 13:11:49 +11:00
Maikel
38f145549a Merge pull request #9741 from mkllnk/empty-variant-param
Avoid error when sending empty variant attributes in bulk product edit
2022-10-10 11:43:10 +11:00
Maikel
f551bea00b Merge pull request #9731 from mkllnk/features
Add used feature toggles to appear in the admin UI
2022-10-10 11:41:05 +11:00
Jean-Baptiste Bellet
f5ebc797c4 Send change event on flatpickr widget close 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
263b36d1d9 Confirm input changed by pressing enter key 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
ea76615763 Forward focus event on calendar open 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
e076e23064 Do not use ng-change on endDate but instead watch both start and end date 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
a272479483 When selecting date range picker, orders should load 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
6ec3e7ee0c Only send event change on valid range (ie. both start and end date)
+ do not refresh data on start date change but only on end date change
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
ec4d091c2e Remove the or label as it was unecessary
and actually, untranslated
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
eec117e769 Implements daterangepicker for /admin/orders/bulk_management
+ update specs as well
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
eb621cae35 Update spec to be more defensive
Actually, this one fail on master too (when changing month?)
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
73f55ae776 Implements daterangepicker for /admin/orders
+ update specs as well
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
19584ce6e0 flatpickr controller is now ready to be used in range mode 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
8942d3d17b Clear date on custom event flatpickr_clear 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
ddfbcacd83 Include plugins 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
c3a7acf9ad import locale 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
fb0d922d73 Remove datetimepicker directive + default values 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
5c83a3277e Replace datetimepicker by flatpickr stimulus controller 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
c6332ab306 Remove datepicker instance 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
6b7030a6a8 Don't use directive, but the flatpickr stimulusjs controller 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
b1fd6d9541 Create the flatpickr date|datetime controller 2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
d73d6dcdb6 Do not import flatpickr via this require
as now flatpickr is managed by yarn and should be imported when module need it, via import
2022-10-08 16:36:26 +02:00
Jean-Baptiste Bellet
792d6d9569 Add stimulus flatpickr
Update yarn.lock
2022-10-08 16:36:26 +02:00
Maikel Linke
1137e6890b Supply feature mock with default value
Otherwise Rspec complains about receiving another argument which is not
the one we defined here before.
2022-10-08 16:23:17 +02:00
Maikel Linke
52e934ec2b Consistently use our FeatureToggle module
Direct calls to Flipper have the downside that we can't add any new
functionality like storing the feature in the database when used.
2022-10-08 16:23:17 +02:00
Maikel Linke
bc26a3aa07 Add used feature toggles to appear in the admin UI
The admin UI shows only features which were added to the database. We
always had to look up a feature's name add it manually before we could
enable it. Now it will appear in the UI after some code asked if it was
enabled.

This only adds a database query once when the feature doesn't exist yet.
The `feature.exist?` call only performs an in-memory lookup in the
memoizer.
2022-10-08 16:23:17 +02:00
binarygit
01c477f2cb Remove angular from Payment Methods 2022-10-08 14:20:54 +02:00
binarygit
8335594351 Add different subject for picked up email 2022-10-08 12:31:26 +02:00
binarygit
44db511e66 Send a picked up email (rather than shipped email) when orders are picked up by customers 2022-10-08 12:31:26 +02:00
Jean-Baptiste Bellet
8b89c901ef Do not display "Admin and Handling" ie. fees total 2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
7b57f2358c Create a new key instead of modifying the old one
it could lead to issues when key is not updated and we should avoid that kind of issue.
2022-10-08 10:00:57 +02:00
Maikel Linke
b297299838 Simplify test of adjustments 2022-10-08 10:00:57 +02:00
Maikel Linke
52843de1da Test against unique fee name
The adjustment factory calls everything "Shipping" by default. This was
confusing here because we were explicitely looking at a non-shipping
fee.
2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
77e644e3d4 Get adjustment which is not the shipping one 2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
72df2867d4 Remove admin_and_handling merging
+ update specs as well
2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
0cc8349c71 Use fee name for the adjustment label instead of type
+ update specs as well
2022-10-08 10:00:57 +02:00
Maikel Linke
47ac118cf7 Simplify ProductSet by using Rails changes feature
I added a line to this class before and that made it too long. Now I
removed a line again to keep code quality up.
2022-10-08 09:03:38 +02:00
Maikel Linke
95d68b98a9 Spec both cases of removing variants from order cycles
The spec tested only the removal but not he keeping of variants.
I want to change this in the next commit to simplify the class.
2022-10-08 09:03:38 +02:00
Maikel Linke
47a43163d8 Avoid error on empty variant attributes
In 2019 Pau observed an error where an empty attributes hash was passed
to the bulk product update method. He added an automated test but wasn't
able to reproduce the error.

A recent change in logic made the spec fail but rspec-retry hid that
fail because it would succeed on a second try (not sure why). I now
changed the logic to ignore empty attributes properly and avoid an error
trying to create a new variant when no attributes are given.

* f940397781 Pau's spec
* 6f228781d4 Fixing error detection
2022-10-08 09:03:38 +02:00
Konrad
52c6f5a222 Fix layout of 'Create a new product' button in dashboard overview 2022-10-07 12:37:45 +02:00
Vishal Jain
b582b61414 add specs to not include hidden hubs 2022-10-07 11:24:32 +02:00
Vishal Jain
6ead127b5c add not hidden scope to hide hidden hub from producers profile 2022-10-07 11:24:32 +02:00
jibees
22cf05ad94 Merge pull request #9742 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.0.0
Bump active_storage_validations from 0.9.8 to 1.0.0
2022-10-07 09:12:47 +02:00
jibees
a2e68026e5 Merge pull request #9743 from openfoodfoundation/dependabot/bundler/sidekiq-scheduler-4.0.3
Bump sidekiq-scheduler from 4.0.2 to 4.0.3
2022-10-07 09:09:04 +02:00
dependabot[bot]
c9419d3437 Bump sidekiq-scheduler from 4.0.2 to 4.0.3
Bumps [sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) from 4.0.2 to 4.0.3.
- [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/v4.0.2...v4.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-06 09:02:55 +00:00
dependabot[bot]
c1f34bc680 Bump active_storage_validations from 0.9.8 to 1.0.0
Bumps [active_storage_validations](https://github.com/igorkasyanchuk/active_storage_validations) from 0.9.8 to 1.0.0.
- [Release notes](https://github.com/igorkasyanchuk/active_storage_validations/releases)
- [Changelog](https://github.com/igorkasyanchuk/active_storage_validations/blob/master/CHANGES.md)
- [Commits](https://github.com/igorkasyanchuk/active_storage_validations/compare/0.9.8...1.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-06 09:02:40 +00:00
Maikel Linke
a64d146bb1 Update translations 2022-10-06 12:31:39 +11:00
Maikel
a43d31a9d5 Merge pull request #9711 from dacook/translation-cleanup
Translation cleanup
2022-10-06 09:51:28 +11:00
Maikel
db2b381c3f Merge pull request #9718 from mkllnk/style
Use standard ApplicationRecord in task class
2022-10-06 09:42:29 +11:00
Konrad
9f0c0208dd Merge branch 'master' into style 2022-10-05 19:59:10 +02:00
Maikel
8072e97579 Merge pull request #9721 from filipefurtad0/fix_flaky_shopping_spec
Addresses flakyness in shopping_spec.rb
2022-10-05 13:19:23 +11:00
filipefurtad0
977916cb11 Adds 2 sec sleep time on other flaky examples 2022-10-04 20:58:30 +01:00
filipefurtad0
f4edfcefa2 Adds 2 sec sleep time 2022-10-04 20:17:14 +01:00
Rachel Arnould
b078d3e0cc Merge pull request #9719 from mkllnk/secrets-config
Simplify config of secret token
2022-10-04 20:36:03 +02:00
Rachel Arnould
611475c48a Merge pull request #9448 from binarygit/cancel-orders-in-bulk
Cancel Orders in Bulk
2022-10-04 19:48:59 +02:00
Rachel Arnould
21ecec894f Merge pull request #9688 from binarygit/order-cycle-closes-during-checkout
Redirect to shopfront when OC closes during checkout
2022-10-04 19:46:38 +02:00
David Cook
0fc8c719fe Scope Enterprise side menu translations
And removed some now-unused global translations, yay! I searched for these in the codebase, eg with regex:
/\bt[\( ]["':]shop_preferences/
2022-10-04 19:39:29 +02:00
David Cook
4c3e20d25a Scope Enterprise form legend translations 2022-10-04 19:39:29 +02:00
David Cook
13d95ecf1d Scope Enterprise Group side menu translations
With it's own lazy scope, we no longer need to define labels separately.
2022-10-04 19:39:29 +02:00
David Cook
7803e5d4ff Scope Enterprise Group form legend translations
Using lazy-lookup builtin scopes, instead of sharing the global translations, as per our guidelines.
2022-10-04 19:39:29 +02:00
David Cook
2e2ff25ef7 DRY up code
Slightly. If we upgrade to Ruby 3.1 with hash value omission, this would be neater.
If we could set a scope in the controller (https://stackoverflow.com/questions/6137960/rails-i18n-default-scope) it would be even neater.
2022-10-04 19:39:29 +02:00
David Cook
3a61cf05ad Remove unused locale message
I can't find any reference to this in the code. The wiki says maybe it's looked up with a variable, but I don't see how it could be used unless this string is defined in code somewhere (we wouldn't translate data from the database, would we?).
Maybe it's used in a gem? In that case, hopefully CI will pick up the error.
2022-10-04 19:39:29 +02:00
Maikel Linke
ef80c3358d Explain how to easily configure other environments locally 2022-10-04 19:35:40 +02:00
Maikel Linke
57a70455a8 Simplify setting of secret token
We define it in the dotenv files already which has the advantage of
being overridable. I adjusted the dotenv files to have the same value as
was set before, 30 times `x`.
2022-10-04 19:35:40 +02:00
Maikel Linke
885e67a39b Ignore Rails secrets
These files are only used in production but sometimes we want to test
production execution on our dev machines, too.
2022-10-04 19:35:40 +02:00
binarygit
25ae10dbe8 Create bulk orders cancellation feature 2022-10-04 16:57:31 +02:00
filipefurtad0
7b592fd80b Adds assertion after page visit to promote page loading 2022-10-04 12:27:58 +01:00
jibees
4b6aced962 Merge pull request #9732 from openfoodfoundation/dependabot/bundler/test-unit-3.5.5
Bump test-unit from 3.5.3 to 3.5.5
2022-10-04 12:15:55 +02:00
dependabot[bot]
e32ad0b436 Bump test-unit from 3.5.3 to 3.5.5
Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.5.3 to 3.5.5.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](https://github.com/test-unit/test-unit/compare/3.5.3...3.5.5)

---
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-10-04 09:19:10 +00:00
binarygit
930721bea6 Redirect to shop front when OC closes during checkout 2022-10-03 20:51:41 +02:00
filipefurtad0
8e6f828f66 Splits it cases into respective contexts 2022-10-03 19:30:57 +01:00
filipefurtad0
fa05327342 Adds assertions on clearing searches
Asserts on page contents
2022-10-03 19:12:27 +01:00
filipefurtad0
cafa17ec13 Splits test into two assertions 2022-10-03 19:12:27 +01:00
jibees
b3449137e0 Merge pull request #9728 from openfoodfoundation/dependabot/npm_and_yarn/js-big-decimal-1.3.10
Bump js-big-decimal from 1.3.5 to 1.3.10
2022-10-03 14:56:33 +02:00
dependabot[bot]
da6af22d03 Bump js-big-decimal from 1.3.5 to 1.3.10
Bumps [js-big-decimal](https://github.com/royNiladri/js-big-decimal) from 1.3.5 to 1.3.10.
- [Release notes](https://github.com/royNiladri/js-big-decimal/releases)
- [Commits](https://github.com/royNiladri/js-big-decimal/compare/v1.3.5...v1.3.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 09:05:41 +00:00
Jean-Baptiste Bellet
0468d46241 Update all locales with the latest Transifex translations 2022-09-30 16:37:59 +02:00
jibees
0c64720a9e Merge pull request #9710 from mkllnk/9002-customer-association-updates
Associate and update customer records when ordering
2022-09-30 16:36:01 +02:00
Filipe
4b279d28dd Merge pull request #9262 from cillian/order-cycle-shipping-methods
Let people customise which shipping methods are available to customers on order cycles
2022-09-30 14:36:37 +01:00
Cillian O'Ruanaidh
acd4706890 Set closing time correctly in order_cycles/complex_creating_specific_time_spec.rb 2022-09-30 14:22:11 +01:00
Filipe
f7d21406a1 Merge pull request #9702 from ashwini-seshadri/master
Fix for new subscription dialog
2022-09-30 13:32:42 +01:00
Cillian O'Ruanaidh
f9e29f3a78 Fix Metrics/AbcSize violation in order_cycles/complex_creating_specific_time_spec.rb 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
def87485c0 Don't delete schedules on the order_cycles#update action just because the :schedule_ids was not specified in the parameters
Before this schedules were being deleted when the Checkout Options step of editing order cycles was saved because this step wasn't sending the :schedule_ids parameter. It's more awkard for API users if they always need to explicity send the :schedule_ids parameter even if they don't want to add/remove any of the schedules, for example if they just want to update an order cycle name.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
6542b47e72 Adjust order_cycles/complex_creating_specific_time_spec to take into account that DistributorShippingMethods instead of ShippingMethods are connected to OrderCycles now 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
2827e07da6 Define :oc with let so it is available globally to other methods such as :expect_fees_saved 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
23f6901fb4 Adjust order_cycles/simple_spec.rb to take new Checkout Options step into account
Note, this doesn't test checking/unchecking some distributor shipping methods and not others because that is tested in order_cycles/complex_creating_time_specific_spec.rb.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
db92e9d91c Fix error from OrderCycle#distributor_shipping methods return ActiveRecord::Relation sometimes and Array other times
Now it will return ActiveRecord::Relation consistently.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
5207dbf8c6 OrderCycle#distributor_shipping_methods should return all attachable ones by default per distributor, not per all distributors 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
7e40ad39cb Bring back select all checkboxes on order cycle checkout options form. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a53a3259a8 Connect DistributorShippingMethods to OrderCycles instead of Spree::ShippingMethods
Before if a shipping method was shared between multiple distributors it could only be disabled/enabled on that order cycle for all the distributors which have that shipping method e.g. you couldn't select that shipping method for one distributor but disable it for another.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8c483f2eab Change join table in migration from order cycles to distributor shipping methods instead of order cycles to shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
65ee9e1486 Implement new design with shipping and payment methods on different rows instead of same one, the select all checkboxes still need to be added back later
This is the new design from https://github.com/openfoodfoundation/openfoodnetwork/pull/9262#issuecomment-1206673689
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a73b608f8a Remove 'shared' shipping method sections from order cycle checkout options form, any shared shipping methods are to be displayed for each distributor e.g. if they belong to multiple distributors they will be displayed multiple times 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
4b0b4ad991 Revert "Use a more simple layout on the order cycle checkout options form"
This reverts commit 0dddaa6c2b9f1925adca6ff8deac8181691ae119.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
32d16eacd2 Fix Rubocop Metrics/AbcSize and Layout/LineLength errors in complex_creating_specific_time_spec.rb
Not sure if this is correct but it removes the Rubocop violations.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8e47949260 Check 'Select all' checkboxes on page load if all its checkboxes are checked
This means the code to set the initial value in the view template isn't needed.
2022-09-30 13:13:39 +01:00
Maikel Linke
512394862b Wait for input field before filling it
The spec was failing from time to time. I hope that this will fix it.

```
Failures:

  1)
    As an administrator
    I want to create/update complex order cycles with a specific time
 creating an order cycle with full interface
     Failure/Error: fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time'

     Capybara::ElementNotFound:
       Unable to find field "order_cycle_outgoing_exchange_0_pickup_time" that is not disabled

     # ./spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb:138:in `add_distributor_with_fees'
     # ./spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb:66:in `block (2 levels) in <main>'
     # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <main>'
     # -e:1:in `<main>'
```
2022-09-30 13:13:39 +01:00
Maikel Linke
195f1e1237 Make "Select all" translatable 2022-09-30 13:13:39 +01:00
Maikel Linke
26d5ea6cdc Remove unused input name 2022-09-30 13:13:39 +01:00
Maikel Linke
3518d1ba92 Spec "Select all" shipping methods field 2022-09-30 13:13:39 +01:00
Maikel Linke
c5bb2f52e1 Check "Select all" to start with
Reflect the state of the shipping method checkboxes.
2022-09-30 13:13:39 +01:00
Maikel Linke
758030e81a Test with readable labels instead of ids 2022-09-30 13:13:39 +01:00
Maikel Linke
da2ef3fae2 Give order cycle spec some structure 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
87431c188e Use ShippingMethod :frontend method and drop :backend to avoid ClassLength Rubocop error 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
0673f9a5ae Use a more simple layout on the order cycle checkout options form
Before there was a row for each distributor and a 'shared' row for shipping methods which were shared among more than one distributor. This layout displays a single list of shipping methods with the distributor or distributors it belongs to beside it as suggested by @lin-d-hop
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8cb2767f9a The no shipping/payment method warnings on order cycle checkout options looks better left aligned 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
1a70cc0c4c Don't display no shipping/payment method warnings on order cycle checkout options if the distributor has some that are shared with other distributors 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
464a9b95a4 On order cycle checkout options shipping methods shared between distributors should be checked by default too 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
8b59b7a796 Use if exclude instead of if !include in OrderCycleForm
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ad51b41bb3 Use :belongs_to instead of :references in :order_cycles_shipping_methods
Also fix migration class name.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
472bd150bb For consistency with other '<em>' don't strip whitespace.
Although both '%em' and '%em>' are rendering the same markup, perhaps because the tag is on it's own new line.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
af87943fd0 Change 'if !' to 'unless' in OrderCyclesList
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
efb1a326b4 Fix line length in OrderCycleForm spec for Rubocop 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
94b96e18ed Remove OrderCycleForm specs that are no longer necessary
These were added for a previous approach which is no longer used.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
80b7a5d39a Remove OrderCycleShippingMethod model and use a :has_and_belongs_to_many association instead
Before the OrderCycleShippingMethod had a validation which checked the shipping method belonged to the order cycle distributor. Instead of this validation this just ignores shipping methods which don't belong to one of the order cycle's distributors when they are being attached in the OrderCycleForm service. This pattern is already being used in the OrderCycleForm service for ignoring Schedules that the person doesn't own.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
61bbf0714e Remove flag argument anti-pattern from Shop::OrderCyclesList
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
da3eea6005 Fetch shared shipping/payment methods for order cycle checkout options in single query 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
6453bbcc1c Fix :selected_shipping_method_ids param for shared shipping methods. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
541a340dcf If an OrderCycle or Spree::ShippingMethod is destroyed then remove it's associated OrderCycleShippingMethod records too 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
593da4996f A shop won't be shown as open if it doesn't have useable shipping method so these shipping method validations are really necessary 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a3a52a07b7 Build shipping method with a category so it's valid in the test 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ed13ee6cbc Fix association alignment in OrderCycle 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
564e4d802c Don't use :html_safe with payment method name in checkout options in case it contains something malicious
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
747c88fb35 Update the Shop::OrderCyclesList service so it's clearer what kind of order cycles are being fetched
Before the Shop::OrderCyclesList service would return order cycles even if they are not ready for checkout and we had a check before calling the service in BaseController which would return OrderCycle.where('false'). It seems like this check should be part of the service too.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f4a4f7c9ff Remove validations checking order cycle has shipping methods
Instead we will make sure the order cycle is not available on the shopfront if it is doesn't have valid shipping methods. This will preven the issue where if one distributor deletes their shipping method, we don't want to invalidate the order cycle for all other distributors.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
81730f725d Enterprises shouldn't be considered ready for checkout if it only has backend shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
7bd56007bd Don't use :html_safe in case shipping method name contains something malicious in app/views/admin/order_cycles/checkout_options.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
d9de35799d Array difference operator is neater than reject in app/views/admin/order_cycles/checkout_options.html.haml
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
67d4c38550 Rename :preferred_shipping_methods to :selected_shipping_methods on OrderCycle
It's a clearer name because 'preferred' implies there could be other unpreferred shipping methods available as well.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
cc5daf51b1 Expect to be_valid instead of checking presence of specific error spec/models/spree/shipping_method_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f25de984d2 Use .empty? instead of !exists? in app/models/order_cycle_shipping_method.rb
Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9a511e9e94 Rubocop adjustments 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
0671e52a29 Undo changes to tests, now that order cycle returns all shipping methods by default and doesn't explicitly require OrderCycleShippingMethods anymore 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9296686384 Make backend, frontend scopes on Spree::ShippingMethod neater
Co-authored-by: Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
f6c754839b Make OrderCycleShippingMethod inherit from ApplicationRecord 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
fc4f951a1a Only require OrderCycleShippingMethod records if people want to override the default shipping methods
It makes things much simpler if we return all shipping methods by default without needing OrderCycleShippingMethod records to be added to the database.

Co-authored-by: Maikel <maikel@email.org.au>
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
4e0bf75ecf Get tests broken because of new order cycle shipping method validations working again 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a46b77d10c Ensure hack for showing products on a shop with closed order cycles also works if an order cycle has no shipping methods
If a distributor order cycle has no shipping methods it will be invalid. This is a bit confusing because adding a check for :invalid seems like it would be better if it was done in the Shop::OrderCyclesList service but the hack doesn't work if you put it in there, it seems like something needs a refactor.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
5a4bc79c74 Update sample data task so distributor order cycles have shipping methods attached i.e. are valid 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
bff7650b35 Change :available_shipping_methods helper to use new OrderAvailableShippingMethods service. 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
855ec1a708 Add new 'Checkout options' step to the edit order cycle form so people can attach shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
1e817af5aa Validate deleting a shipping method or switching it to backoffice only doesn't invalidate any order cycles 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
48c2e48b24 Update the OrderCycleForm service so it supports attaching shipping methods 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
ca97a7f52d Add :shipping_methods association to OrderCyle and validations 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9a6e8a1113 Add an OrderCycleShippingMethod model to handle attaching shipping methods to order cycles 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
94d71b8dce Remove extra unnecessary :display_on_checkout scope and reuse :frontend scope instead 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
a5daee39e3 Extract out a DISPLAY_ON_OPTIONS constant in Spree::ShippingMethod instead of magic strings 2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
37617f63ea Remove non-functional :backend scope from Spree::ShippingRate
It finds shipping methods where 'display_on != front_end' but :front_end values were removed in a1317be19b/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb so it will always return true.
2022-09-30 13:13:39 +01:00
Cillian O'Ruanaidh
9b5f743fa5 Extract out a OrderCycle#simple? method so it can be used in models 2022-09-30 13:13:39 +01:00
Filipe
e85dd99e04 Merge pull request #9633 from binarygit/add-stimulus-reflex
Add StimulusReflex
2022-09-29 17:11:18 +01:00
binarygit
ebe4a3d6ab Add StimulusReflex 2022-09-29 16:03:45 +02:00
jibees
382f8c38f6 Merge pull request #9712 from jibees/solve-uglifier-error
Remove now unnecessary uglifier gem
2022-09-29 16:02:14 +02:00
Jean-Baptiste Bellet
a024d0e5ac Remove uglifier 2022-09-29 15:24:31 +02:00
Rachel Arnould
f8f778eaa1 Merge pull request #9686 from jibees/9684-fix-search-customer-in-order-creation-for-super-admin
Admin, New Order, Search customer: As a super admin, search for customer within all enterprises
2022-09-29 14:35:18 +02:00
Maikel Linke
8011d85968 Clarify updating only pre-existing customers 2022-09-29 12:06:06 +02:00
Maikel Linke
a7de56460d Further simplify Order by outsourcing to service class 2022-09-29 12:06:06 +02:00
Maikel Linke
1f19642dad Simplify Order by outsourcing to service class
This is work in progress and calling the service will be simplified in a
few commits.
2022-09-29 12:06:06 +02:00
Maikel Linke
33d6454dd3 Simplify with guard clause 2022-09-29 12:06:06 +02:00
Maikel Linke
a0260c4ff7 Move customer update logic to own service file
The Order class is too big already. We can move more code in the next
commits.
2022-09-29 12:06:06 +02:00
Maikel Linke
cec81a3ae6 Clarify condition to create customer record 2022-09-29 12:06:06 +02:00
Maikel Linke
37eac5ed49 Remove dead code branch in customer check
We only try to create a customer when none is present. So the check for
validating the customer always returned false because we didn't have a
customer.
2022-09-29 12:06:06 +02:00
Maikel Linke
b232fa3d0c Deal with conflicting customer entries 2022-09-29 12:06:06 +02:00
Maikel Linke
f6ac02dce5 Update customer's email after user changed it
This may fail if there's already a customer record with the same email
address for the same enterprise. I will fix that in the next commit.
2022-09-29 12:06:06 +02:00
Maikel Linke
9dbba35019 Find customers by user id as well as email
Also fixing up a spec which became brittle due to too much mocking.
2022-09-29 12:06:06 +02:00
Maikel Linke
cf634d8d9b Simplify customer association 2022-09-29 12:06:06 +02:00
Maikel Linke
5fefd3b14b Remove useless customer loading and clarify name
The method `associate_customer` only loads a customer but doesn't
actually associate one. So the deleted line doesn't have any effect.

The intention was to reset the customer after switching shops but the
before_validation logic on the order model takes care of that already.

I'm renaming this private method here for clarity.
2022-09-29 12:06:06 +02:00
Maikel Linke
93da64f466 Spec for duplicate customers after changing email 2022-09-29 12:06:06 +02:00
Maikel Linke
0d1f48ac0d Simplify order-customer logic 2022-09-29 12:06:06 +02:00
Maikel Linke
ccbf20a73b Replace spec of customer's internal logic
Specs should test public methods. Private methods should be able to
change without specs breaking.

The specs were also just mirroring the code and didn't really have any
meaning. So I wrote new ones which are hopefully clearer.

There's actually a case which I don't quite understand. Why don't we
require a customer for a new complete order? It means that we don't have
a customer creating it but then it's added when updating the order.
Seems inconsistent.
2022-09-29 12:06:06 +02:00
jibees
5dc4a859f7 Merge pull request #9717 from openfoodfoundation/dependabot/bundler/view_component-2.74.0
Bump view_component from 2.73.0 to 2.74.0
2022-09-29 10:19:23 +02:00
jibees
9323931a21 Merge pull request #9715 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.3
Bump @babel/preset-env from 7.19.1 to 7.19.3
2022-09-29 09:33:28 +02:00
Maikel Linke
d81037d658 Simplify branching logic in SearchesController 2022-09-29 09:30:21 +02:00
Maikel Linke
12d7db3dd6 More efficient enterprise access check 2022-09-29 09:30:21 +02:00
Jean-Baptiste Bellet
cdf71b419f Search within all enterprises if user is the super admin 2022-09-29 09:30:21 +02:00
dependabot[bot]
6f6b1ce9e6 Bump view_component from 2.73.0 to 2.74.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.73.0 to 2.74.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.73.0...v2.74.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-09-29 07:02:17 +00:00
Maikel
2c2d244c56 Merge pull request #9716 from filipefurtad0/fix_reports_spec
Fixes invert columns logic on reports spec
2022-09-29 17:00:38 +10:00
Maikel Linke
c8cfbbb0b2 Use standard ApplicationRecord in task class
It's best practice to use the ApplicationRecord. But when Rake is
loaded, our application is not loaded yet and the ApplicationRecord
class wasn't available yet. Requiring within the task solves the problem
because Rake loads the Rails environment before executing this task.

I also removed the unused highline loading.
2022-09-29 11:56:10 +10:00
Maikel
c000c0dd5d Merge pull request #9709 from openfoodfoundation/dependabot/bundler/view_component-2.73.0
Bump view_component from 2.72.0 to 2.73.0
2022-09-29 08:23:09 +10:00
Filipe
958c6fe8f3 Merge pull request #9685 from filipefurtad0/remove_js_tracking_code
Removes matomo JS tracking code
2022-09-28 23:15:23 +01:00
Filipe
9cc2d30920 Merge pull request #9642 from mkllnk/9002-customer-association
Delete duplicate customer entries
2022-09-28 17:17:23 +01:00
filipefurtad0
e00a59212c Fixes invert columns logic on reports spec 2022-09-28 11:49:20 +01:00
dependabot[bot]
e783594385 Bump @babel/preset-env from 7.19.1 to 7.19.3
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.1 to 7.19.3.
- [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.19.3/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-09-28 09:03:57 +00:00
Ashwini Seshadri
edee5c693b Changed new subscription dialog to use tom-select from select2
fixed z-index, text-alignment in the dropdown menu to left in new subscription modal, replaced click_link with page.find().click in subscription specs, removed href in subscription index
2022-09-28 10:47:39 +02:00
dependabot[bot]
fea78884e7 Bump view_component from 2.72.0 to 2.73.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.72.0 to 2.73.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.72.0...v2.73.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-09-28 07:23:18 +00:00
jibees
4f290b5bc5 Merge pull request #9707 from filipefurtad0/remove_visible_true_label
Removes "visible: true" from system specs
2022-09-28 09:21:19 +02:00
Maikel
52c38428e8 Merge pull request #9624 from filipefurtad0/add_vcr_to_the_stack
Add VCR to the stack
2022-09-28 10:48:59 +10:00
filipefurtad0
538844a1fb Removes _visible: true_ from system specs 2022-09-27 17:32:25 +01:00
filipefurtad0
4690cb102b Adds sets-up the cassettes correctly and other configs
deletes unecessary files

Reverts helper option to turn VCR off
2022-09-27 07:26:26 +01:00
Maikel Linke
4e33bd2713 Avoid trying to delete address referenced elsewhere 2022-09-27 13:14:51 +10:00
Maikel Linke
286dade66f Don't enforce ApplicationRecord in migrations
We shouldn't use app code in migrations because app code changes while
migrations should always do the same to enable old servers to upgrade.

We have some existing migrations which use ApplicationRecord but I found
that changing them retrospectively breaks them already. So let's leave
them alone.
2022-09-27 13:14:51 +10:00
Maikel Linke
591f901935 Delete duplicate customer entries 2022-09-27 13:14:49 +10:00
Maikel Linke
aec28e0807 Simplify customer model requiring enterprise 2022-09-27 13:14:18 +10:00
Maikel Linke
be31b9a897 Document purpose of customer model 2022-09-27 13:14:18 +10:00
Maikel
6783e7f74c Fix typo 2022-09-27 12:37:08 +10:00
Maikel
19c9eccffe Merge pull request #9704 from openfoodfoundation/dependabot/bundler/geocoder-1.8.1
Bump geocoder from 1.8.0 to 1.8.1
2022-09-27 12:09:12 +10:00
Maikel
561aa0e291 Merge pull request #9701 from sashashura/patch-6
GitHub Workflows security hardening
2022-09-27 11:56:25 +10:00
dependabot[bot]
e45decf14e Bump geocoder from 1.8.0 to 1.8.1
Bumps [geocoder](https://github.com/alexreisner/geocoder) from 1.8.0 to 1.8.1.
- [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.8.0...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 09:32:31 +00:00
jibees
b851aba81a Merge pull request #9699 from filipefurtad0/localization_number_settings
Adds tests to decimal, thousands and localization number settings
2022-09-26 10:57:28 +02:00
jibees
45040ca702 Merge pull request #9696 from openfoodfoundation/dependabot/npm_and_yarn/hotwired/turbo-7.2.0
Bump @hotwired/turbo from 7.1.0 to 7.2.0
2022-09-26 10:56:55 +02:00
jibees
126da75167 Merge pull request #9694 from openfoodfoundation/dependabot/bundler/spring-4.1.0
Bump spring from 4.0.0 to 4.1.0
2022-09-26 10:55:51 +02:00
jibees
71b24ef8b9 Merge pull request #9690 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.7
Bump sidekiq from 6.5.6 to 6.5.7
2022-09-26 10:54:42 +02:00
jibees
4ae93113f0 Merge pull request #9670 from dacook/generate-erd
Script to generate ERD
2022-09-26 10:33:06 +02:00
Alex
8ce82a9ad6 build: harden mapi.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:52:16 +02:00
Alex
bd6bf9315a build: harden linters.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-23 22:51:33 +02:00
filipefurtad0
7b33405530 Replaces translation with actual string
DRY: creates update_and_assert_message
2022-09-23 13:00:39 +01:00
filipefurtad0
6e3c0858c1 Adds decimal and thousands separator test 2022-09-23 12:47:18 +01:00
filipefurtad0
fb8d2827d2 Adds number localization preferences test 2022-09-23 12:03:18 +01:00
dependabot[bot]
ae8d505367 Bump @hotwired/turbo from 7.1.0 to 7.2.0
Bumps [@hotwired/turbo](https://github.com/hotwired/turbo) from 7.1.0 to 7.2.0.
- [Release notes](https://github.com/hotwired/turbo/releases)
- [Commits](https://github.com/hotwired/turbo/compare/v7.1.0...v7.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-23 09:03:43 +00:00
Jean-Baptiste Bellet
cba9779168 Update all locales with the latest Transifex translations 2022-09-22 16:35:32 +02:00
dependabot[bot]
17e9dbc0f7 Bump spring from 4.0.0 to 4.1.0
Bumps [spring](https://github.com/rails/spring) from 4.0.0 to 4.1.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/v4.0.0...v4.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 09:16:42 +00:00
filipefurtad0
e798277cbf Adds real requests with concealed secret key 2022-09-21 12:32:49 +01:00
filipefurtad0
3e97433920 Adds VCR config file into support folder
...with additional options to vcr_setup
2022-09-21 12:32:49 +01:00
filipefurtad0
038b93fdf6 Adds VCR to the stack
...And sets gems in alphabetical order
2022-09-21 12:32:49 +01:00
Rachel Arnould
e98d4af630 Merge pull request #9659 from saunmanoj888/fix-bulk-product-update-unit-value
Allow to change unit value for numbers with a comma separator on bulk product update
2022-09-21 13:04:08 +02:00
dependabot[bot]
79374ce5d7 Bump sidekiq from 6.5.6 to 6.5.7
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.6 to 6.5.7.
- [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.6...v6.5.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-21 09:07:14 +00:00
jibees
e0aa94e6af Merge pull request #9689 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.0.2
Bump @floating-ui/dom from 1.0.1 to 1.0.2
2022-09-21 09:21:46 +02:00
Maikel
a4de128a76 Merge pull request #9674 from filipefurtad0/wicked_pdf_config
Makes wicked-pdf config ENV-dependent
2022-09-21 13:16:41 +10:00
David Cook
96d1616b70 Update for compatibility with macOS (BSD grep)
The --max-count option tells grep to stop reading lines after the first matching line. We're looking for the line AFTER the first matching line.
2022-09-21 12:22:21 +10:00
David Cook
086cde83db Script to easily generate ERD
The generated date is included for reference.
Stored in new 'doc/' directory.
2022-09-21 12:21:49 +10:00
David Cook
4abe677cc6 Add rails-erd gem
Only in development environment.
2022-09-21 12:21:46 +10:00
Maikel
fe2e510fdc Merge pull request #9621 from filipefurtad0/invoice_spec_to_account_for_tax_ordering
Invoice spec to account for tax ordering
2022-09-21 10:14:07 +10:00
dependabot[bot]
ae152fd94f Bump @floating-ui/dom from 1.0.1 to 1.0.2
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.0.2/packages/dom)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-20 09:04:55 +00:00
Maikel
5173ddb7a0 Merge pull request #9675 from filipefurtad0/split_build_consumer_tests
Makes build run all specs; fixes failing specs
2022-09-20 11:20:52 +10:00
Filipe
bd698f5d81 Merge pull request #9683 from filipefurtad0/customer_query_superadmin_spec
Spec reproducing failing customer query, as superadmin
2022-09-19 15:53:07 +01:00
filipefurtad0
136a4df4d9 Removes matomo JS tracking code 2022-09-19 15:26:07 +01:00
filipefurtad0
7e168fad02 Spec reproduing failing customer query, as superadmin 2022-09-19 14:11:13 +01:00
jibees
c574b2d8ba Merge pull request #9634 from binarygit/remove-angular-from-shipping-methods
Remove shipping methods controller
2022-09-19 14:16:07 +02:00
jibees
502abfdfce Merge pull request #9681 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.16.1
Bump rubocop-rails from 2.16.0 to 2.16.1
2022-09-19 14:13:22 +02:00
jibees
c714204877 Merge pull request #9673 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.1
Bump @babel/preset-env from 7.19.0 to 7.19.1
2022-09-19 14:13:08 +02:00
dependabot[bot]
cb84f6671a Bump @babel/preset-env from 7.19.0 to 7.19.1
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.0 to 7.19.1.
- [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.19.1/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-09-19 08:38:38 +00:00
jibees
20c393e4e9 Merge pull request #9680 from openfoodfoundation/dependabot/bundler/shoulda-matchers-5.2.0
Bump shoulda-matchers from 5.1.0 to 5.2.0
2022-09-19 10:38:01 +02:00
jibees
8e3cd4653d Merge pull request #9669 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-docs-6.5.12
Bump @storybook/addon-docs from 6.5.10 to 6.5.12
2022-09-19 10:33:59 +02:00
jibees
b4deb19d8e Merge pull request #9667 from openfoodfoundation/dependabot/npm_and_yarn/storybook/addon-controls-6.5.12
Bump @storybook/addon-controls from 6.5.10 to 6.5.12
2022-09-19 10:33:41 +02:00
dependabot[bot]
e30ebd3671 Bump rubocop-rails from 2.16.0 to 2.16.1
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.16.0...v2.16.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-19 07:58:34 +00:00
dependabot[bot]
b7f8422f30 Bump shoulda-matchers from 5.1.0 to 5.2.0
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.1.0 to 5.2.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.1.0...v5.2.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-09-19 07:56:59 +00:00
dependabot[bot]
b3d628551e Bump @storybook/addon-controls from 6.5.10 to 6.5.12
Bumps [@storybook/addon-controls](https://github.com/storybookjs/storybook/tree/HEAD/addons/controls) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/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-09-19 07:55:08 +00:00
dependabot[bot]
70e39174d2 Bump @storybook/addon-docs from 6.5.10 to 6.5.12
Bumps [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/addons/docs) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/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-09-19 07:54:54 +00:00
jibees
b03cfa163a Merge pull request #9672 from openfoodfoundation/dependabot/bundler/view_component-2.72.0
Bump view_component from 2.71.0 to 2.72.0
2022-09-19 09:54:38 +02:00
jibees
4c32548e83 Merge pull request #9668 from openfoodfoundation/dependabot/npm_and_yarn/storybook/server-6.5.12
Bump @storybook/server from 6.5.10 to 6.5.12
2022-09-19 09:53:47 +02:00
Jean-Baptiste Bellet
7186526dc6 Fix block too long warnings 2022-09-19 09:26:34 +02:00
filipefurtad0
8c8b262ea1 Sets examples pending and dry running with xit 2022-09-16 15:24:51 +01:00
filipefurtad0
6ae741936f Scrolls down the page to enable finding element 2022-09-16 15:24:39 +01:00
Jean-Baptiste Bellet
cf8bab97e8 Fix spec by not raising the error image not found
`GET http://localhost:3000/throbber.gif 404 (Not Found)`

In the meantime, open an issue to remove jquery.jstree from this page: 9677
2022-09-16 11:04:08 +02:00
Jean-Baptiste Bellet
ba2ad4a0c4 Since #9126, replacing Paperclip with ActiveStorage, some methods changed 2022-09-16 10:51:04 +02:00
Jean-Baptiste Bellet
4a8dc37b40 Since #9087, we don't use a boolean but an enum, 'public' or 'hidden' 2022-09-16 10:02:27 +02:00
Jean-Baptiste Bellet
3942c4d808 Fix failing spec: since #9606 we use tom-select 2022-09-16 09:32:34 +02:00
filipefurtad0
ba8162c1d0 Splits consumer specs into two parallel runs 2022-09-15 17:34:01 +01:00
filipefurtad0
bf1fc736b9 Removes _spec.rb ending from admin specs on build.yml 2022-09-15 17:32:48 +01:00
filipefurtad0
bc1ae01eb6 Updates invoice_spec to A3 page size setting
Separates display_as in assertion to prevent line break failures
2022-09-15 14:34:15 +01:00
filipefurtad0
e4cceffd5c Makes wicked-pdf config env dependent 2022-09-15 12:12:47 +01:00
Maikel Linke
887f886110 Update translations 2022-09-15 16:25:33 +10:00
dependabot[bot]
78fa44739f Bump view_component from 2.71.0 to 2.72.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 2.71.0 to 2.72.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v2.71.0...v2.72.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-09-15 06:22:01 +00:00
Maikel
1f00ddeb3b Merge pull request #9654 from openfoodfoundation/dependabot/bundler/rswag-specs-2.6.0
Bump rswag-specs from 2.5.1 to 2.6.0
2022-09-15 16:17:41 +10:00
dependabot[bot]
46c19580bc Bump @storybook/server from 6.5.10 to 6.5.12
Bumps [@storybook/server](https://github.com/storybookjs/storybook/tree/HEAD/app/server) from 6.5.10 to 6.5.12.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.12/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.5.12/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-09-14 09:04:51 +00:00
filipefurtad0
e54acf3ca0 Changes tax parcels into the correct order
This should fail now, adding pending example on next commit

Wraps failing assertions around pending block

Addresses rubocop Style/LineEndConcatenation convention

Removes pending blocks
2022-09-14 08:02:45 +01:00
saunmanoj888
498d003684 Add unit specs for the js changes for unit_value 2022-09-13 23:28:27 +05:30
binarygit
90f4b1328b Remove angular from shipping methods tab in enterprise/edit 2022-09-13 15:20:33 +05:45
dependabot[bot]
0c81ec0202 Bump rswag-specs from 2.5.1 to 2.6.0
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-13 00:44:05 +00:00
Maikel
584430d64b Merge pull request #9655 from openfoodfoundation/dependabot/bundler/rswag-ui-2.6.0
Bump rswag-ui from 2.5.1 to 2.6.0
2022-09-13 10:42:41 +10:00
Maikel
8334923a5c Merge pull request #9653 from openfoodfoundation/dependabot/bundler/rswag-api-2.6.0
Bump rswag-api from 2.5.1 to 2.6.0
2022-09-13 10:42:00 +10:00
Maikel
61784ed174 Merge pull request #9656 from openfoodfoundation/dependabot/bundler/rubocop-rails-2.16.0
Bump rubocop-rails from 2.15.2 to 2.16.0
2022-09-13 10:40:00 +10:00
Maikel
906bfc5ae8 Merge pull request #9657 from openfoodfoundation/dependabot/bundler/rails-6.1.7
Bump rails from 6.1.6.1 to 6.1.7
2022-09-13 10:37:32 +10:00
jibees
5a4b38ec55 Merge pull request #9536 from jibees/9145-Splitcheckout,-add-error-message-when-no-shipping-methods-are-available-to-the-customer
Split Checkout: add error message when no shipping methods are available to the customer
2022-09-12 15:22:11 +02:00
saunmanoj888
6917125173 Allow to change unit value for numbers with a comma separator 2022-09-12 15:55:03 +05:30
dependabot[bot]
65506769ab Bump rails from 6.1.6.1 to 6.1.7
Bumps [rails](https://github.com/rails/rails) from 6.1.6.1 to 6.1.7.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.6.1...v6.1.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:17:01 +00:00
dependabot[bot]
9909e84cb9 Bump rubocop-rails from 2.15.2 to 2.16.0
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.15.2 to 2.16.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.15.2...v2.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:16:36 +00:00
dependabot[bot]
e00ee364ea Bump rswag-ui from 2.5.1 to 2.6.0
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:16:16 +00:00
dependabot[bot]
479c895a59 Bump rswag-api from 2.5.1 to 2.6.0
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.5.1 to 2.6.0.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.5.1...2.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 09:14:43 +00:00
Jean-Baptiste Bellet
86cb86e8b5 Add a flash error where no available shipping methods to the customer
+ update specs as well
2022-09-12 09:42:26 +02:00
Jean-Baptiste Bellet
9dd3a8bc5a Store all distributors shipping methods to one array 2022-09-12 09:42:26 +02:00
Maikel
68256346e7 Merge pull request #9644 from filipefurtad0/fix_flaky_search
Splits tests into existing/non-existing shops
2022-09-12 14:05:49 +10:00
Maikel
44bf63137a Merge pull request #9606 from binarygit/remove-angular-from-address
Remove Angular from Address Tab
2022-09-12 13:49:54 +10:00
Maikel
e9ad573bcd Merge pull request #9641 from mkllnk/prod-schema
Synchronise db schema with (AU) production
2022-09-12 13:40:57 +10:00
filipefurtad0
215f3e97ad Splits tests into existing/non-existing shops
Sets failing tests as pending for issues #9649 and #5467
2022-09-09 13:08:45 +01:00
Jean-Baptiste Bellet
49f78f3706 Update all locales with the latest Transifex translations 2022-09-08 16:40:17 +02:00
jibees
9563dd6c51 Merge pull request #9497 from jibees/9493-fix-issues-around-rounding-in-imperial-metric-system
Avoid floating rounded errors when using imperial or metric system
2022-09-08 16:34:12 +02:00
Rachel Arnould
aa36986d66 Merge pull request #9521 from jibees/create-new-report-revenues-by-hub
Create a new report that shows revenues (incl. or excl. taxes) by hub only available for super-admin
2022-09-08 16:10:14 +02:00
jibees
9843e0e450 Merge pull request #9640 from openfoodfoundation/dependabot/npm_and_yarn/babel/preset-env-7.19.0
Bump @babel/preset-env from 7.18.10 to 7.19.0
2022-09-08 09:07:02 +02:00
Jean-Baptiste Bellet
53978de632 Create a new report that show revenues (incl. or excl. taxes) by hub
+ Create spec
2022-09-08 09:04:44 +02:00
Maikel
d9f5f7995d Merge pull request #9611 from mkllnk/9605-tax-total
Index tax totals correctly for invoice display
2022-09-08 12:04:19 +10:00
Maikel
f201b9fd11 Merge pull request #9631 from mkllnk/9153-tax-recalculation
[Split Checkout] Recalculate tax on summary step
2022-09-08 11:39:44 +10:00
Jean-Baptiste Bellet
d53b2b94b9 When creating new product via /admin/products/new use BigDecimal
to avoid bad rounded multiplication

example here:
700*0.001 = 0.7000000000000001

+ update specs as well
2022-09-07 09:17:46 +02:00
Jean-Baptiste Bellet
4452ad2c51 Use BigDecimal to avoir multiplication/division floating errors
Like 28.35 * 12 / 12 = 28.350000000000005

+ in js, use parseFloat() to format `12.00` as `12`
2022-09-07 09:17:46 +02:00
Jean-Baptiste Bellet
6594419b22 Add js-big-decimal to work with division and multiplication
Use a lib instead of Math.round((value*100)/100)
2022-09-07 09:17:46 +02:00
Maikel Linke
4ba008f31b Synchronise db schema with production
Rails seems to have changed the options in schema.rb at some point to
include more specifics but we didn't record this in our tracked
schema.rb. As a result, production shows changes in that file after
running migrations.

Sometimes I also use production dumps in development, for example to
test migrations. Then the schema is changed for the migration and for
these syntax changes. Synching the schema with migration should
standardise all our setups and and make git diffs clearer.
2022-09-07 16:02:51 +10:00
Maikel
dd2e77a244 Merge pull request #9557 from jibees/9555-update-the-build-env
Update the build env. from ubuntu-18.04 to ubuntu-20.04
2022-09-07 13:43:42 +10:00
dependabot[bot]
be561d1032 Bump @babel/preset-env from 7.18.10 to 7.19.0
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.10 to 7.19.0.
- [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.19.0/packages/babel-preset-env)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-06 09:04:41 +00:00
Jean-Baptiste Bellet
24fc941b4c Update the build env. from ubuntu-18.04 to ubuntu-20.04 2022-09-06 10:28:26 +02:00
Maikel
21054c1a8a Merge pull request #9594 from binarygit/remove-angular-from-primary-details
Remove Angular from Primary Details Tab
2022-09-06 10:17:14 +10:00
Maikel
0778c5f550 Merge pull request #9607 from openfoodfoundation/dependabot/bundler/sidekiq-6.5.6
Bump sidekiq from 6.5.4 to 6.5.6
2022-09-06 10:16:39 +10:00
Maikel Linke
1d04510365 Update totals on summary step 2022-09-05 15:54:33 +10:00
Maikel Linke
6c7a089527 Recalculate tax on summary step 2022-09-05 15:14:08 +10:00
binarygit
abbb61b943 Remove country controller from enterprises/new and Business Details tab 2022-09-05 09:52:27 +05:45
binarygit
36b5cb3b49 Replace country controller with dependent select in address tab 2022-09-05 09:52:27 +05:45
binarygit
0cfe842bd6 Fix typo: dependant to dependent in dependent-select controller 2022-09-05 09:52:27 +05:45
Maikel Linke
eaca953106 Create only required test data for speed
It reduced the execution time by 5% on my machine (2-3 seconds).
2022-09-05 13:42:47 +10:00
Maikel Linke
cc5125f49e Apply related db assertions in tax spec
Somehow the helper methods were testing two different orders even though
each spec is using only one order, the one which is currently being
checked out by the user.

So I brought the code closer into the example to easier see what is
related and tested.

I also changed the assertions for the pending spec but can't really
verify them yet until I have completely working code.
2022-09-05 11:40:47 +10:00
Maikel Linke
3f2b3b88eb Re-use in-memory test objects
And reduce code by referring to objects instead of just ids.
2022-09-05 10:59:15 +10:00
Maikel
7101bacc8c Merge pull request #9620 from openfoodfoundation/dependabot/bundler/rubocop-1.36.0
Bump rubocop from 1.35.1 to 1.36.0
2022-09-05 10:30:05 +10:00
Maikel
d76b274d25 Merge pull request #9617 from openfoodfoundation/dependabot/bundler/view_component-2.71.0
Bump view_component from 2.69.0 to 2.71.0
2022-09-02 16:56:59 +10:00
dependabot[bot]
8d7f39941a Bump view_component from 2.69.0 to 2.71.0
Bumps [view_component](https://viewcomponent.org) from 2.69.0 to 2.71.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-09-02 06:33:40 +00:00
Maikel
95839f88f2 Merge pull request #9623 from mkllnk/fix-storybook
Load storybook only in development
2022-09-02 16:32:19 +10:00
Maikel Linke
728eee6d3f Load storybook after view_component has been loaded automatically 2022-09-02 16:10:19 +10:00
Maikel Linke
7089bd597e Avoid loading view_component engine manually
We load view_component in the application config and it should be
automatic anyway.
2022-09-02 16:08:09 +10:00
Maikel Linke
2aade10aaf Load storybook only in development
The gem is not available in other environments an the app fails to boot.
2022-09-02 16:07:25 +10:00
Maikel
4057df5b93 Merge pull request #9586 from openfoodfoundation/dependabot/bundler/stripe-7.1.0
Bump stripe from 7.0.0 to 7.1.0
2022-09-02 13:34:11 +10:00
Filipe
8270a3f386 Merge pull request #9513 from filipefurtad0/matomo_tag_on_register_page
Add matomo_tag to /register pages
2022-09-01 10:19:54 +01:00
dependabot[bot]
a2aa5f2607 Bump rubocop from 1.35.1 to 1.36.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.35.1 to 1.36.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.35.1...v1.36.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-09-01 09:07:43 +00:00
Maikel Linke
30a9e80024 Update translations 2022-09-01 11:55:03 +10:00
Maikel
612001fc3f Merge pull request #9600 from mkllnk/rubocop
Update rubocop config to avoid deprecation
2022-09-01 11:42:15 +10:00
Maikel
2a93968370 Merge pull request #9599 from mkllnk/load-storybook
Avoid storybook deprecation warning
2022-09-01 11:41:27 +10:00
Maikel
b0a4fcdc26 Merge pull request #9598 from mkllnk/spec-typos
Correct typo in spec which lead to flakiness
2022-09-01 11:39:38 +10:00
Maikel Linke
326b0af35f Sort tax total by percentage on invoice 2022-09-01 11:19:02 +10:00
Maikel Linke
91eaa522cf Simplify tax totals helper 2022-08-31 16:47:04 +10:00
Maikel Linke
2a57dc9766 Index tax totals correctly for invoice display 2022-08-31 16:47:04 +10:00
Maikel Linke
f37b681fac Allow more tax data in the summary
I converted the value to a hash so that we can put all information in
there and we won't need the current hash key as percentage any more.
2022-08-31 16:47:04 +10:00
Maikel Linke
f4466b1aad Spec problem with tax rate summary display 2022-08-31 16:47:04 +10:00
Maikel Linke
33feb7f63f Test for explicit values, not reusing faulty code 2022-08-31 16:47:04 +10:00
binarygit
02e3184945 Replace angular tooltips in Primary Details tab 2022-08-31 11:51:51 +05:45
Maikel
04778c6fa8 Merge pull request #9597 from saunmanoj888/fix-account-setting-headers-alignment
Fix alignment for header Developer settings under Accounts settings
2022-08-31 16:01:41 +10:00
binarygit
8861b6d077 Replace permalinks angular ctrl with stimulus 2022-08-31 10:06:51 +05:45
binarygit
52b1f40acb Replace select2 with tom-select in primary details tab 2022-08-31 10:06:51 +05:45
Filipe
8ace56956b Merge pull request #9560 from binarygit/replace-tooltip
Replace tooltip on Enterprise Settings /contact page
2022-08-30 16:23:09 +01:00
dependabot[bot]
7718f7c0fc Bump sidekiq from 6.5.4 to 6.5.6
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.5.4 to 6.5.6.
- [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.4...v6.5.6)

---
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-30 09:04:24 +00:00
Maikel
b74c368de2 Merge pull request #9602 from filipefurtad0/fix_flaky_invoice_spec
Adds specific tax rates to each type of cost
2022-08-30 09:47:53 +10:00
filipefurtad0
e0a20bf8af Adds specific tax rates to each type of cost 2022-08-29 17:36:39 +01:00
Maikel Linke
17afdb5912 Update rubocop config to avoid deprecation 2022-08-29 15:31:18 +10:00
Maikel Linke
d55a43d4b1 Avoid storybook deprecation warning
Loading the engine directly is deprecated and I followed the current
documentation to load storybook in the app. This avoids a warning:

> DEPRECATION WARNING: This manually engine loading is deprecated and will be removed in v1.0.0. Remove `require "view_component/storybook/engine"`. (called from <top (required)> at config/application.rb:30)
2022-08-29 14:57:14 +10:00
Maikel Linke
bf3da0531e Correct grammar in spec description 2022-08-29 14:43:43 +10:00
Maikel Linke
3a365b6dc6 Remove useless braces 2022-08-29 14:42:11 +10:00
Maikel Linke
ee7dc821ca Correct typo in spec which lead to flakiness
I'm not sure why this spec passed on CI when it was retried but it was
obviously wrong. Correcting that copy&paste error seems to make the spec
pass.
2022-08-29 14:39:43 +10:00
Maikel
07018370e0 Merge pull request #9595 from openfoodfoundation/dependabot/bundler/jwt-2.5.0
Bump jwt from 2.4.1 to 2.5.0
2022-08-29 11:43:27 +10:00
Maikel
bba665e2e1 Merge pull request #9577 from filipefurtad0/invoice-spec
Moves invoice_spec.rb into /system; sets :rack_test as webdriver
2022-08-29 11:34:20 +10:00
saunmanoj888
5e69320ff5 Fix header alignmnet 2022-08-27 15:31:19 +05:30
dependabot[bot]
d0242d28d2 Bump jwt from 2.4.1 to 2.5.0
Bumps [jwt](https://github.com/jwt/ruby-jwt) from 2.4.1 to 2.5.0.
- [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.4.1...v2.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-26 09:04:29 +00:00
Maikel
9dbdcc9181 Merge pull request #9592 from openfoodfoundation/dependabot/bundler/redis-4.8.0
Bump redis from 4.7.1 to 4.8.0
2022-08-25 09:55:45 +10:00
Maikel
7819495d57 Merge pull request #9590 from openfoodfoundation/dependabot/bundler/puma-5.6.5
Bump puma from 5.6.4 to 5.6.5
2022-08-25 09:54:50 +10:00
Maikel
8723520848 Merge pull request #9585 from mkllnk/revert-stripe-update
Restore ability to check out with Stripe while storing a new card
2022-08-25 09:51:59 +10:00
binarygit
b76d9045ce Replace power-tip in enterprises/edit/<name>/contact with floatingUI 2022-08-24 13:31:45 +05:45
Maikel
b42d6cf2ac Merge pull request #9587 from openfoodfoundation/dependabot/bundler/valid_email2-4.0.4
Bump valid_email2 from 4.0.3 to 4.0.4
2022-08-24 16:52:13 +10:00
Maikel
f78e72af0d Merge pull request #9588 from openfoodfoundation/dependabot/bundler/rubocop-1.35.1
Bump rubocop from 1.35.0 to 1.35.1
2022-08-24 16:51:14 +10:00
dependabot[bot]
5e021b76b5 Bump valid_email2 from 4.0.3 to 4.0.4
Bumps [valid_email2](https://github.com/micke/valid_email2) from 4.0.3 to 4.0.4.
- [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.3...v4.0.4)

---
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-08-24 06:50:55 +00:00
Maikel
d03a5458ff Merge pull request #9582 from openfoodfoundation/dependabot/bundler/view_component-2.69.0
Bump view_component from 2.68.0 to 2.69.0
2022-08-24 16:49:45 +10:00
dependabot[bot]
3aef0b4029 Bump stripe from 7.0.0 to 7.1.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v7.0.0...v7.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-24 06:48:28 +00:00
Maikel
cd5a83e814 Merge pull request #9581 from openfoodfoundation/dependabot/bundler/webmock-3.18.1
Bump webmock from 3.17.1 to 3.18.1
2022-08-24 16:47:45 +10:00
dependabot[bot]
a943d2fee6 Bump redis from 4.7.1 to 4.8.0
Bumps [redis](https://github.com/redis/redis-rb) from 4.7.1 to 4.8.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.7.1...v4.8.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-08-24 06:47:28 +00:00
Maikel
b016ebd5b4 Merge pull request #9567 from openfoodfoundation/dependabot/bundler/bullet-7.0.3
Bump bullet from 7.0.2 to 7.0.3
2022-08-24 16:47:07 +10:00
Maikel
314459df92 Merge pull request #9566 from openfoodfoundation/dependabot/bundler/test-prof-1.0.10
Bump test-prof from 1.0.9 to 1.0.10
2022-08-24 16:46:29 +10:00
dependabot[bot]
eb0051c033 Bump puma from 5.6.4 to 5.6.5
Bumps [puma](https://github.com/puma/puma) from 5.6.4 to 5.6.5.
- [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.4...v5.6.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-23 09:04:05 +00:00
dependabot[bot]
ca9a7d255e Bump rubocop from 1.35.0 to 1.35.1
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.35.0 to 1.35.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.35.0...v1.35.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 09:06:17 +00:00
dependabot[bot]
8f42c6fbed Bump view_component from 2.68.0 to 2.69.0
Bumps [view_component](https://viewcomponent.org) from 2.68.0 to 2.69.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-19 09:05:47 +00:00
dependabot[bot]
bb233c5656 Bump webmock from 3.17.1 to 3.18.1
Bumps [webmock](https://github.com/bblimke/webmock) from 3.17.1 to 3.18.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.1...v3.18.1)

---
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-19 09:05:12 +00:00
filipefurtad0
be021f4697 Removes spec/features from the build-run 🎉 2022-08-17 23:25:02 +01:00
filipefurtad0
f47d86c15b Sets cuprite as default; sets rack_test in before/after blocks 2022-08-17 23:25:02 +01:00
Filipe
ae391f8af4 Merge pull request #9414 from Philwi/user-generates-api-key
Let users view and regenerates api key
2022-08-17 21:36:13 +01:00
Filipe
f28c52342c Merge pull request #9532 from jibees/9492-translate-404,-500,-422-errors-pages
Translate 404, 500, 422 errors pages
2022-08-17 21:12:04 +01:00
Filipe
d3f1d4a5f9 Merge pull request #9529 from Philwi/make-the-shop-url-clickable
Make the shop url clickable
2022-08-17 20:47:07 +01:00
Filipe
cedfa35a98 Merge pull request #9341 from jibees/9336-redirect-to-login_path-if-user-is-disabled
Disabled_at logic: redirect to login path if user is disabled
2022-08-17 20:33:57 +01:00
Filipe
c11b7ed268 Merge pull request #9407 from Philwi/handle-for-invalid-referer-for-embedded-page-service
Handle for invalid referer for embedded page service
2022-08-17 18:40:43 +01:00
Filipe
b992daa1d8 Merge pull request #9510 from binarygit/convert-enterprises/edit-page-to-stimulus
Convert enterprises/edit page to stimulus
2022-08-17 18:11:59 +01:00
Filipe
10aa534f52 Merge pull request #9554 from apricot12/9179-Note-on-invoices
Add order note at the end of both invoices following current UI patterns.
2022-08-17 17:41:23 +01:00
Filipe
de990b906d Merge pull request #9563 from aintluks/bulk-coop-report-csv
Disable header row bulk_coop report
2022-08-17 16:43:37 +01:00
Maikel Linke
41ef2a4ea5 Run invoice spec as feature spec 2022-08-17 16:30:57 +10:00
filipefurtad0
077479346e Moves invoice_print_spec into system 2022-08-17 16:21:54 +10:00
binarygit
19c33e4050 Add floating UI 2022-08-17 11:39:13 +05:45
Maikel
1ff3d4a534 Merge pull request #9571 from openfoodfoundation/dependabot/bundler/view_component-2.68.0
Bump view_component from 2.64.0 to 2.68.0
2022-08-17 15:06:46 +10:00
dependabot[bot]
8ae6a36b33 Bump bullet from 7.0.2 to 7.0.3
Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.2 to 7.0.3.
- [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/7.0.2...7.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-17 04:59:40 +00:00
dependabot[bot]
d8687f30cd Bump test-prof from 1.0.9 to 1.0.10
Bumps [test-prof](https://github.com/test-prof/test-prof) from 1.0.9 to 1.0.10.
- [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.9...v1.0.10)

---
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-08-17 04:58:49 +00:00
Maikel
bff2ddb8db Merge pull request #9565 from openfoodfoundation/dependabot/bundler/rubocop-1.35.0
Bump rubocop from 1.33.0 to 1.35.0
2022-08-17 14:56:36 +10:00
Lucas da Costa
2a9db0eea4 Disable header row bulk_coop report 2022-08-16 16:32:19 -03:00
Filipe
5c41022f76 Merge pull request #9165 from filipefurtad0/tax_split_checkout
[Split Checkout] Adds spec to test Tax charges (repoducing issue #9153)
2022-08-16 19:30:32 +01:00
dependabot[bot]
a9dec41cc1 Bump view_component from 2.64.0 to 2.68.0
Bumps [view_component](https://viewcomponent.org) from 2.64.0 to 2.68.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-16 09:04:18 +00:00
Maikel
918cbb8d92 Merge pull request #9570 from mkllnk/bundle-lock
Clean up Gemfile.lock after manual change
2022-08-16 16:16:19 +10:00
Maikel Linke
7cc7de7a5f Clean up Gemfile.lock
It was manually edited before which introduced a couple inconsistencies.
I'm fixing this up here by running `bundle` and restoring the bundler
version.
2022-08-16 16:10:30 +10:00
Maikel Linke
56d8d1eaf7 Scope helper methods to relevant test cases
Global methods are usually not a good idea.
2022-08-15 17:34:21 +01:00
dependabot[bot]
b57685e9d5 Bump rubocop from 1.33.0 to 1.35.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.33.0 to 1.35.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.33.0...v1.35.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-15 07:36:07 +00:00
Maikel
a3fa4a0d3e Merge pull request #9543 from filipefurtad0/remove_selenium_webdriver
Removes selenium-webdriver and webdriver gems; updates spec_helper
2022-08-15 17:34:46 +10:00
Maikel Linke
d86aeaa22a Remove unnecessary after-spec code 2022-08-15 16:51:53 +10:00
filipefurtad0
97f18d7b86 Changes names from helpers to prevent leak between specs 2022-08-15 16:13:37 +10:00
filipefurtad0
bded15a869 Updates spec for inclusive; adds pending related to epic 7540 2022-08-15 16:13:37 +10:00
filipefurtad0
fff5927cdf Changes pick-up into delivery shipping method
On line 62 we set the dependency on the shipping address to calculate taxes. Therefore, we might be better off mocking a delivery-shipping method instead of a pick-up shipping method and assuring the customers shipping address is used for this accordingly.
2022-08-15 16:13:37 +10:00
filipefurtad0
f9881b9af5 Removes if blocks from assert_db_
Initianlly, I thought it would be agood idea to have both setups - for included and added tax - in the same file. Hence, the private section would need to cover all cases. The PR has now two separate files, each one for the two tax types, so it seems unecessary to have these if blocks there. I think it is more readable this way.
2022-08-15 16:13:37 +10:00
filipefurtad0
79182a2d32 Removes test on 9131; moves test on 9153 into respective context 2022-08-15 16:13:37 +10:00
Jean-Baptiste Bellet
77eec6e6f3 Check step params and redirect if step is inconsistent to order state 2022-08-15 16:13:37 +10:00
filipefurtad0
a6e3f43344 Adds bug reproducing steps 2022-08-15 16:13:36 +10:00
filipefurtad0
f525a9f5da Adds inclusive tax-spec 2022-08-15 16:13:36 +10:00
filipefurtad0
2427bfa6ea Spec tax charging on legacy and split checkout 2022-08-15 16:13:36 +10:00
Maikel Linke
7eea4fdd1c Adds zone_with_state_member to zone factory
And make zone factories more flexible.
2022-08-15 16:13:36 +10:00
Filipe
dde4bd39b2 Merge pull request #9351 from vsmay98/9338-redirect-disabled-user-to-homepage
Redirect to homepage with flash error when disabled user trying to access any page
2022-08-12 13:52:19 +01:00
Maikel Linke
091c271237 Spec API key changes more precisely 2022-08-12 15:44:59 +10:00
Philipp Winkler
141a2a507d Make shop url clickable 2022-08-11 22:14:51 +02:00
filipefurtad0
232088f3a2 Adds the tag matomo code to the darkswarm template 2022-08-11 15:40:15 +01:00
filipefurtad0
66b9679a7c Adds matomo_tag to /register pages template 2022-08-11 14:07:02 +01:00
filipefurtad0
42753d85c7 Creates new file for matomo tag code 2022-08-11 14:07:02 +01:00
filipefurtad0
3eca13e2bc Renames general tracking code file; updates darkswarm 2022-08-11 14:07:02 +01:00
filipefurtad0
1fd09617cb Changes cookies_spec from feature to system spec 2022-08-11 10:44:22 +01:00
filipefurtad0
e5eb74f077 Updates spec_helper 2022-08-11 10:44:22 +01:00
Jean-Baptiste Bellet
f474947d2d Do not remove 500.html file since it is used by nxginx
in case of critical problems when application cannot respond
2022-08-11 11:41:39 +02:00
filipefurtad0
d1b90193a4 Removes selenium-webdriver & webdrivers gems 2022-08-11 10:34:24 +01:00
Nihal Mohammed
53ee5c32eb Add order note at the end of both invoices following current UI patterns
Add translation for note title in invoice

Update invoice spec to also test for order note
2022-08-10 23:02:13 +05:30
binarygit
79ba223e12 Delete angular code for side_menu 2022-08-10 15:14:15 +05:45
binarygit
27552c99b8 Render enterprise groups #edit and #new page using stimulus 2022-08-10 15:14:09 +05:45
binarygit
6b56a8df0a Display/hide side-menu items when values in primary details change 2022-08-10 15:11:53 +05:45
binarygit
e18a242b90 Render admin/enterprises/<name>/edit page using stimulus 2022-08-10 15:08:59 +05:45
Jean-Baptiste Bellet
60a5bf682b Handle errors page through controller ErrorsController 2022-08-08 15:36:46 +02:00
Jean-Baptiste Bellet
47c07831c1 Create an ErrorsController that handle errors thrown application 2022-08-08 15:36:23 +02:00
Philipp Winkler
bf53a02270 Add api key toggle view checkbox 2022-08-07 09:48:49 +02:00
Philipp Winkler
6291e3c587 Handle invalid referer for embedded page service 2022-07-11 22:07:00 +02:00
Vishal Jain
3143cc9d92 skip disabled user check for session controller 2022-07-05 11:35:11 +05:30
Vishal Jain
84b711e130 redirect disabled user to homepage 2022-06-24 18:09:15 +05:30
Jean-Baptiste Bellet
4007b17b1e Redirect to login path also if user is disabled
+ update spec as well
2022-06-22 15:51:11 +02:00
466 changed files with 14133 additions and 5713 deletions

View File

@@ -1 +1,2 @@
defaults
IE 11

View File

@@ -1,7 +1,11 @@
# ENV vars for the development environment
# Override locally with `.env.development.local`
#
# You may also want to use this when testing other environments locally:
#
# cp .env.development .env.local
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

View File

@@ -1,6 +1,11 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
STRIPE_SECRET_TEST_API_KEY="bogus_key"
STRIPE_CUSTOMER="bogus_customer"
SITE_URL="test.host"
OPENID_APP_ID="test-provider"
OPENID_APP_SECRET="12345"

View File

@@ -1,7 +1,7 @@
---
name: Release task
about: Track the process of a new release
title: 'Release v'
title: Release v
labels: ''
assignees: ''
@@ -18,7 +18,7 @@ assignees: ''
- [ ] [Find build] of the release commit and copy it below.
- [ ] Move this issue to Test Ready.
- [ ] Notify testers.
- [ ] Notify `@testers` in [#testing].
- [ ] Test build: <!-- paste build link here, e.g. https://semaphore...builds/1234 -->
## Finish on Tuesday
@@ -44,5 +44,6 @@ The full process is described at https://github.com/openfoodfoundation/openfoodn
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A%23%23+User+facing+changes+:eyes:%0A%0A%0A%0A%23%23+Technical+changes+:wrench:%0A%0A
[releases]: https://github.com/openfoodfoundation/openfoodnetwork/releases
[#instance-managers]: https://app.slack.com/client/T02G54U79/CG7NJ966B
[#testing]: https://openfoodnetwork.slack.com/app_redirect?channel=C02TZ6X00
[Find build]: https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master
[#global-community]: https://app.slack.com/client/T02G54U79/C59ADD8F2

View File

@@ -1,6 +1,6 @@
#### What? Why?
Closes # <!-- Insert issue number here. -->
- Closes # <!-- Insert issue number here. -->
<!-- Explain why this change is needed and the solution you propose.
Provide context for others to understand it. -->

View File

@@ -23,11 +23,11 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
# Customize the ruby version depending on your needs
- name: Setup Ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
@@ -45,6 +45,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: output.sarif.json

View File

@@ -3,21 +3,22 @@ name: Build
on:
workflow_dispatch:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
env:
DISABLE_KNAPSACK: true
DISABLE_KNAPSACK_PRO: false
TIMEZONE: UTC
COVERAGE: true
RSPEC_RETRY_RETRY_COUNT: 3
RAILS_ENV: test
permissions:
contents: read
jobs:
rspec:
runs-on: ubuntu-18.04
knapsack_rspec_controllers:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
@@ -32,30 +33,31 @@ jobs:
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
matrix:
specs:
- "spec/controllers"
- "spec/models"
- "spec/features/admin/[a-o0-9]*_spec.rb"
- "spec/lib"
- "spec/migrations"
- "spec/serializers"
- "spec/system/admin/[a-o0-9]*_spec.rb"
- "spec/system/admin/[p-z]*_spec.rb"
- "spec/system/consumer"
- "engines/*/spec"
fail-fast: false
matrix:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [8]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '14.15.5'
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
@@ -66,19 +68,321 @@ jobs:
bundle exec rake db:schema:load
- name: Run tests
run: bundle exec rspec --profile -- ${{ matrix.specs }}
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 864ef557d85ea8e603e086c0387d5154
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
# if you use Knapsack Pro Queue Mode you must set below env variable
# to be able to retry CI build and run previously recorded tests
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
# RSpec split test files by test examples feature - it's optional
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/controllers/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:rspec
knapsack_rspec_models:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
fail-fast: false
matrix:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [7]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
# if you use Knapsack Pro Queue Mode you must set below env variable
# to be able to retry CI build and run previously recorded tests
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
# RSpec split test files by test examples feature - it's optional
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:rspec
knapsack_rspec_system:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
fail-fast: false
matrix:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [10]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ff2456e64c9f2aa5157eb0daf711d3c3
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
# if you use Knapsack Pro Queue Mode you must set below env variable
# to be able to retry CI build and run previously recorded tests
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true
# RSpec split test files by test examples feature - it's optional
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:queue:rspec
- name: Archive failed tests screenshots
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: failed-tests-screenshots
path: tmp/capybara/screenshots/*.png
retention-days: 7
if-no-files-found: ignore
test-the-rest:
runs-on: ubuntu-18.04
knapsack_rspec_engines:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
fail-fast: false
matrix:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [5]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4]
steps:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: d6ea7ceb766404ccd016c19aa2c81b1c
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
# if you use Knapsack Pro Queue Mode you must set below env variable
# to be able to retry CI build and run previously recorded tests
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
# RSpec split test files by test examples feature - it's optional
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/serializers/**/*_spec.rb,engines/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:rspec
- name: Archive failed tests screenshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: failed-tests-screenshots
path: tmp/capybara/screenshots/*.png
retention-days: 7
if-no-files-found: ignore
knapsack_rspec_test_the_rest:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
fail-fast: false
matrix:
# [n] - where the n is a number of parallel jobs you want to run your tests on.
# Use a higher number if you have slow tests to split them between more parallel jobs.
# Remember to update the value of the `ci_node_index` below to (0..n-1).
ci_node_total: [5]
# Indexes for parallel jobs (starting from zero).
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
ci_node_index: [0, 1, 2, 3, 4]
steps:
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
env:
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_PRO_LOG_LEVEL: info
# if you use Knapsack Pro Queue Mode you must set below env variable
# to be able to retry CI build and run previously recorded tests
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
# RSpec split test files by test examples feature - it's optional
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**/*_spec.rb,spec/models/**/*_spec.rb,spec/controllers/**/*_spec.rb,spec/serializers/**/*_spec.rb,spec/lib/**/*_spec.rb,spec/migrations/**/*_spec.rb,spec/system/**/*_spec.rb}"
run: |
bundle exec rake knapsack_pro:rspec
non_knapsack_jest_karma:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
@@ -93,16 +397,21 @@ jobs:
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: 6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '14.15.5'
node-version: 16
- name: Install JS dependencies
run: yarn install --frozen-lockfile
@@ -111,12 +420,8 @@ jobs:
run: |
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run JS tests
run: bundle exec rake karma:run
- name: Run jest tests
run: yarn jest
- name: Run all other tests
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations,system"]

View File

@@ -1,5 +1,7 @@
name: Linters
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rubocop:
name: runner / rubocop
@@ -21,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:

View File

@@ -1,13 +1,18 @@
name: 'Mayhem for API'
on: workflow_dispatch
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test:
permissions:
contents: read # to fetch code (actions/checkout)
security-events: write # to upload SARIF results (github/codeql-action/upload-sarif)
if: ${{ github.repository_owner == 'openfoodfoundation' }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: docker/build
- run: docker-compose up --detach
- run: until curl -f -s http://localhost:3000; do echo "waiting for api server"; sleep 1; done
@@ -34,13 +39,13 @@ jobs:
# Archive HTML report
- name: Archive Mayhem for API report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: mapi-report
path: mapi.html
# Upload SARIF file (only available on public repos or github enterprise)
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: mapi.sarif

3
.gitignore vendored
View File

@@ -57,3 +57,6 @@ coverage
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/config/credentials.yml.enc
/config/master.key

View File

@@ -1,6 +1,8 @@
# Basically, ignore everythings expect app/webpacker/controllers/*.js and app/webpacker/packs/*.js
*.css
*.scss
# Except v2
!/app/webpacker/css/admin/v2/**/*.scss
*.md
*.yml
*.yaml

View File

@@ -23,7 +23,7 @@ Metrics:
Enabled: true
Metrics/BlockLength:
IgnoredMethods: [
AllowedMethods: [
"class_eval",
"collection",
"context",
@@ -41,8 +41,14 @@ Metrics/BlockLength:
"resources",
"scenario",
"shared_examples",
"xdescribe",
]
Rails/ApplicationRecord:
Exclude:
# Migrations should not contain application code:
- "db/migrate/*.rb"
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"

View File

@@ -1,13 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400`
# on 2022-03-29 16:07:39 UTC using RuboCop version 1.22.2.
# on 2022-08-29 05:26:26 UTC using RuboCop version 1.35.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Cop supports --auto-correct.
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
@@ -25,20 +25,13 @@ Gemspec/RequiredRubyVersion:
- 'engines/web/web.gemspec'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Layout/ClosingParenthesisIndentation:
Exclude:
- 'lib/reporting/queries/joins.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'spec/lib/reports/report_loader_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
@@ -47,15 +40,15 @@ Layout/EmptyLinesAroundBlockBody:
- 'spec/system/admin/order_cycles/list_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'spec/system/admin/enterprises_spec.rb'
# Offense count: 856
# Cop supports --auto-correct.
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 862
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
@@ -68,7 +61,6 @@ Layout/LineLength:
- 'app/controllers/admin/subscriptions_controller.rb'
- 'app/controllers/api/v0/order_cycles_controller.rb'
- 'app/controllers/payment_gateways/paypal_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/user_confirmations_controller.rb'
- 'app/helpers/angular_form_builder.rb'
@@ -85,7 +77,6 @@ Layout/LineLength:
- 'app/models/concerns/variant_stock.rb'
- 'app/models/customer.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/product_import/spreadsheet_entry.rb'
- 'app/models/product_import/unit_converter.rb'
@@ -111,23 +102,15 @@ Layout/LineLength:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'engines/order_management/spec/services/order_management/order/updater_spec.rb'
- 'engines/web/app/helpers/web/cookies_policy_helper.rb'
- 'engines/web/spec/features/consumer/cookies_spec.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/enterprise_fee_applicator.rb'
- 'lib/open_food_network/enterprise_fee_calculator.rb'
- 'lib/open_food_network/enterprise_issue_validator.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/open_food_network/scope_variants_for_search.rb'
- 'lib/reporting/line_items.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/reporting/reports/orders_and_fulfillment/distributor_totals_by_supplier_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/products_and_inventory/lettuce_share_report.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/spree/localized_number.rb'
- 'lib/tasks/data.rake'
@@ -145,12 +128,10 @@ Layout/LineLength:
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
- 'spec/controllers/api/v0/base_controller_spec.rb'
- 'spec/controllers/api/v0/enterprises_controller_spec.rb'
- 'spec/controllers/api/v0/exchange_products_controller_spec.rb'
- 'spec/controllers/api/v0/logos_controller_spec.rb'
- 'spec/controllers/api/v0/order_cycles_controller_spec.rb'
- 'spec/controllers/api/v0/orders_controller_spec.rb'
- 'spec/controllers/api/v0/product_images_controller_spec.rb'
- 'spec/controllers/api/v0/products_controller_spec.rb'
- 'spec/controllers/api/v0/promo_images_controller_spec.rb'
- 'spec/controllers/api/v0/terms_and_conditions_controller_spec.rb'
@@ -164,7 +145,6 @@ Layout/LineLength:
- 'spec/controllers/spree/admin/orders/invoices_spec.rb'
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
- 'spec/controllers/spree/admin/reports_controller_spec.rb'
- 'spec/controllers/spree/admin/variants_controller_spec.rb'
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
- 'spec/controllers/spree/orders_controller_spec.rb'
@@ -187,13 +167,9 @@ Layout/LineLength:
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
- 'spec/lib/reports/customers_report_spec.rb'
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
- 'spec/lib/reports/order_grouper_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
- 'spec/lib/reports/packing/packing_report_spec.rb'
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/lib/reports/xero_invoices_report_spec.rb'
- 'spec/lib/stripe/authorize_response_patcher_spec.rb'
- 'spec/mailers/order_mailer_spec.rb'
- 'spec/mailers/producer_mailer_spec.rb'
- 'spec/mailers/subscription_mailer_spec.rb'
@@ -201,7 +177,6 @@ Layout/LineLength:
- 'spec/models/concerns/calculated_adjustments_spec.rb'
- 'spec/models/concerns/order_shipment_spec.rb'
- 'spec/models/concerns/product_stock_spec.rb'
- 'spec/models/enterprise_group_spec.rb'
- 'spec/models/enterprise_relationship_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/models/exchange_spec.rb'
@@ -227,7 +202,6 @@ Layout/LineLength:
- 'spec/models/tag_rule/filter_payment_methods_spec.rb'
- 'spec/models/tag_rule/filter_products_spec.rb'
- 'spec/models/tag_rule/filter_shipping_methods_spec.rb'
- 'spec/models/terms_of_service_file_spec.rb'
- 'spec/models/variant_override_spec.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
@@ -287,6 +261,7 @@ Layout/LineLength:
- 'spec/system/admin/variant_overrides_spec.rb'
- 'spec/system/consumer/authentication_spec.rb'
- 'spec/system/consumer/caching/shops_caching_spec.rb'
- 'spec/system/consumer/cookies_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/checkout_auth_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
@@ -300,35 +275,20 @@ Layout/LineLength:
- 'spec/views/spree/admin/payment_methods/index.html.haml_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/MultilineBlockLayout:
Exclude:
- 'spec/lib/reports/report_renderer_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'lib/reporting/queries/joins.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Layout/MultilineMethodCallIndentation:
Exclude:
- 'lib/reporting/reports/customers/customers_report.rb'
# Offense count: 20
# Cop supports --auto-correct.
# Offense count: 22
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
- 'spec/system/admin/enterprises_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/shipping_methods_spec.rb'
- 'spec/system/flatpickr_spec.rb'
@@ -357,6 +317,7 @@ Lint/DuplicateMethods:
- 'lib/discourse/single_sign_on.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/DuplicateRequire:
Exclude:
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
@@ -378,9 +339,8 @@ Lint/IneffectiveAccessModifier:
Exclude:
- 'app/models/spree/user.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
Lint/RedundantSafeNavigation:
@@ -388,6 +348,7 @@ Lint/RedundantSafeNavigation:
- 'app/models/spree/payment.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!, in?
Lint/SafeNavigationChain:
@@ -396,22 +357,21 @@ Lint/SafeNavigationChain:
- 'app/models/spree/stock/availability_validator.rb'
# Offense count: 2
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/reporting/queries/query_interface.rb'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: AllowComments.
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
Exclude:
- 'app/controllers/spree/user_registrations_controller.rb'
- 'app/models/spree/gateway.rb'
# Offense count: 38
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
# Offense count: 28
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -433,20 +393,14 @@ Metrics/AbcSize:
- 'app/models/spree/return_authorization.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/customers/customers_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/orders_and_distributors/orders_and_distributors_report.rb'
- 'lib/reporting/reports/packing/customer.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/tasks/enterprises.rake'
- 'spec/services/order_checkout_restart_spec.rb'
# Offense count: 43
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
# Offense count: 42
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
- 'app/models/spree/order/checkout.rb'
@@ -474,7 +428,6 @@ Metrics/BlockLength:
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/swagger_helper.rb'
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
# Offense count: 1
@@ -483,7 +436,7 @@ Metrics/BlockNesting:
Exclude:
- 'app/models/spree/payment/processing.rb'
# Offense count: 50
# Offense count: 45
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
@@ -502,7 +455,6 @@ Metrics/ClassLength:
- 'app/controllers/spree/admin/payment_methods_controller.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/controllers/spree/admin/users_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/models/enterprise.rb'
@@ -526,19 +478,17 @@ Metrics/ClassLength:
- 'app/serializers/api/enterprise_shopfront_serializer.rb'
- 'app/services/cart_service.rb'
- 'app/services/order_syncer.rb'
- 'app/services/order_cycle_form.rb'
- 'engines/order_management/app/services/order_management/order/updater.rb'
- 'lib/open_food_network/enterprise_fee_calculator.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/permissions.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/open_food_network/permissions.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
# Offense count: 39
# Configuration parameters: IgnoredMethods, Max.
# Offense count: 35
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -565,18 +515,14 @@ Metrics/CyclomaticComplexity:
- 'app/models/spree/zone.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/enterprise_issue_validator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/customers/customers_report.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/spree/core/controller_helpers/respond_with.rb'
- 'lib/spree/localized_number.rb'
- 'spec/models/product_importer_spec.rb'
# Offense count: 32
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
# Offense count: 26
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/MethodLength:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -593,15 +539,12 @@ Metrics/MethodLength:
- 'app/models/spree/preferences/preferable_class_methods.rb'
- 'lib/discourse/single_sign_on.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/tasks/sample_data/product_factory.rb'
# Offense count: 54
# Offense count: 51
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
@@ -641,9 +584,6 @@ Metrics/ModuleLength:
- 'spec/lib/reports/customers_report_spec.rb'
- 'spec/lib/reports/enterprise_fee_summary/authorizer_spec.rb'
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
- 'spec/lib/reports/order_grouper_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/customer_totals_report_spec.rb'
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
- 'spec/models/spree/adjustment_spec.rb'
@@ -670,8 +610,8 @@ Metrics/ParameterLists:
- 'spec/support/controller_requests_helper.rb'
- 'spec/system/admin/reports_spec.rb'
# Offense count: 7
# Configuration parameters: IgnoredMethods, Max.
# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
Metrics/PerceivedComplexity:
Exclude:
- 'app/controllers/spree/admin/taxons_controller.rb'
@@ -679,10 +619,8 @@ Metrics/PerceivedComplexity:
- 'app/models/enterprise_relationship.rb'
- 'app/models/spree/ability.rb'
- 'app/models/spree/order/checkout.rb'
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
- 'lib/reporting/reports/payments/payments_report.rb'
# Offense count: 9
# Offense count: 8
Naming/AccessorMethodName:
Exclude:
- 'app/controllers/spree/admin/taxonomies_controller.rb'
@@ -716,8 +654,8 @@ Naming/MethodParameterName:
Exclude:
- 'app/services/process_payment_intent.rb'
# Offense count: 30
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
# Offense count: 28
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
@@ -725,7 +663,6 @@ Naming/VariableNumber:
- 'app/controllers/spree/orders_controller.rb'
- 'app/models/content_configuration.rb'
- 'app/models/preference_sections/main_links_section.rb'
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 'spec/controllers/spree/admin/search_controller_spec.rb'
- 'spec/factories/stock_location_factory.rb'
@@ -741,13 +678,13 @@ Rails/ActiveRecordOverride:
- 'app/models/spree/product.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationController:
Exclude:
- 'engines/dfc_provider/app/controllers/dfc_provider/api/base_controller.rb'
# Offense count: 6
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationJob:
Exclude:
- 'app/jobs/bulk_invoice_job.rb'
@@ -758,19 +695,13 @@ Rails/ApplicationJob:
- 'app/jobs/subscription_placement_job.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/spree/base_mailer.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationRecord:
Exclude:
- 'lib/tasks/data/remove_transient_data.rb'
# Offense count: 5
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
Rails/Blank:
Exclude:
@@ -796,7 +727,7 @@ Rails/FilePath:
- 'spec/models/content_configuration_spec.rb'
- 'spec/support/downloads_helper.rb'
# Offense count: 11
# Offense count: 12
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
@@ -804,6 +735,7 @@ Rails/HasAndBelongsToMany:
- 'app/models/concerns/payment_method_distributors.rb'
- 'app/models/enterprise.rb'
- 'app/models/enterprise_group.rb'
- 'app/models/order_cycle.rb'
- 'app/models/spree/line_item.rb'
- 'app/models/spree/option_value.rb'
- 'app/models/spree/role.rb'
@@ -812,7 +744,7 @@ Rails/HasAndBelongsToMany:
- 'app/models/spree/variant.rb'
- 'app/models/spree/zone.rb'
# Offense count: 47
# Offense count: 45
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
@@ -838,9 +770,8 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/spree/taxonomy.rb'
- 'app/models/spree/user.rb'
- 'app/models/spree/variant.rb'
- 'app/models/subscription.rb'
# Offense count: 59
# Offense count: 62
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
@@ -881,7 +812,7 @@ Rails/InverseOf:
# Offense count: 38
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/admin/enterprise_groups_controller.rb'
@@ -904,10 +835,9 @@ Rails/LexicallyScopedActionFilter:
- 'app/controllers/spree/admin/zones_controller.rb'
- 'app/controllers/spree/users_controller.rb'
# Offense count: 19
# Offense count: 18
Rails/OutputSafety:
Exclude:
- 'app/controllers/spree/admin/reports_controller.rb'
- 'app/helpers/angular_form_helper.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/reports_helper.rb'
@@ -922,7 +852,7 @@ Rails/OutputSafety:
- 'spec/system/admin/order_print_ticket_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RelativeDateConstant:
Exclude:
- 'lib/tasks/data/remove_transient_data.rb'
@@ -936,7 +866,7 @@ Rails/SkipsModelValidations:
- 'spec/models/spree/line_item_spec.rb'
# Offense count: 5
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Rails/TimeZone:
@@ -971,20 +901,20 @@ Security/Open:
- 'app/services/image_importer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Style/BlockComments:
Exclude:
- 'spec/system/admin/tag_rules_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnConstant.
Style/CaseEquality:
Exclude:
- 'spec/models/spree/payment_spec.rb'
# Offense count: 3
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CaseLikeIf:
Exclude:
- 'app/controllers/admin/order_cycles_controller.rb'
@@ -992,7 +922,7 @@ Style/CaseLikeIf:
- 'app/models/spree/payment/processing.rb'
# Offense count: 25
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
@@ -1027,13 +957,14 @@ Style/ClassVars:
- 'lib/spree/core/delegate_belongs_to.rb'
# Offense count: 2
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns, IgnoredMethods.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
@@ -1041,7 +972,7 @@ Style/FrozenStringLiteralComment:
- '.simplecov'
# Offense count: 6
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:
Exclude:
- 'lib/tasks/data.rake'
@@ -1050,8 +981,8 @@ Style/GlobalStdStream:
- 'lib/tasks/subscriptions/debug.rake'
- 'lib/tasks/subscriptions/test.rake'
# Offense count: 39
# Configuration parameters: MinBodyLength.
# Offense count: 40
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
@@ -1085,8 +1016,8 @@ Style/HashLikeCase:
- 'app/models/enterprise.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'spec/system/flatpickr_spec.rb'
@@ -1098,22 +1029,8 @@ Style/MissingRespondToMissing:
- 'app/models/spree/gateway.rb'
- 'app/models/spree/preferences/configuration.rb'
# Offense count: 1
Style/MixinUsage:
Exclude:
- 'lib/reporting/reports/orders_and_fulfillment/orders_and_fulfillment_report.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/reporting/report_template.rb'
- 'lib/reporting/reports/packing/base.rb'
# Offense count: 22
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Style/NestedModifier:
Exclude:
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
@@ -1127,7 +1044,7 @@ Style/NestedModifier:
- 'spec/system/admin/payments_stripe_spec.rb'
- 'spec/system/admin/reports_spec.rb'
# Offense count: 26
# Offense count: 17
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
@@ -1139,7 +1056,6 @@ Style/OptionalBooleanParameter:
- 'app/models/enterprise_relationship.rb'
- 'app/models/product_import/entry_processor.rb'
- 'app/models/spree/order_contents.rb'
- 'app/models/spree/preferences/file_configuration.rb'
- 'app/models/spree/shipment.rb'
- 'engines/order_management/app/services/order_management/stock/estimator.rb'
- 'lib/spree/core/controller_helpers/order.rb'
@@ -1147,7 +1063,7 @@ Style/OptionalBooleanParameter:
- 'spec/support/request/web_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
@@ -1155,13 +1071,13 @@ Style/PreferredHashMethods:
- 'app/controllers/api/v0/shipments_controller.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
# Offense count: 205
# Offense count: 209
Style/Send:
Exclude:
- 'app/controllers/split_checkout_controller.rb'
@@ -1195,17 +1111,16 @@ Style/Send:
- 'spec/services/cart_service_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/services/variant_units/option_value_namer_spec.rb'
- 'spec/spec_helper.rb'
- 'spec/support/localized_number_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SingleArgumentDig:
Exclude:
- 'app/services/checkout/form_data_adapter.rb'
# Offense count: 4
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'app/helpers/spree/admin/navigation_helper.rb'
@@ -1213,8 +1128,8 @@ Style/SlicingWithRange:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
- 'lib/discourse/single_sign_on.rb'
# Offense count: 28
# Cop supports --auto-correct.
# Offense count: 29
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:

View File

@@ -1,7 +1,7 @@
[main]
host = https://www.transifex.com
[open-food-network.enyml]
[o:open-food-foundation:p:open-food-network:r:enyml]
file_filter = config/locales/<lang>.yml
source_lang = en
type = YML

View File

@@ -68,6 +68,8 @@ To login as the default user, use:
email: ofn@example.com
password: ofn123
Seee [Locale and sample data] about loading data.
### Testing
@@ -81,7 +83,7 @@ Then the main application tests can be run with:
The tests of all custom engines can be run with:
bundle exec rake ofn:specs:engines:rspec
bundle exec rspec ./engines
Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop.
@@ -129,3 +131,4 @@ If these commands succeed, you should be able to [continue the setup process](#g
[rubocop]: https://rubocop.readthedocs.io/en/latest/
[karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma
[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU
[Locale and sample data]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Locale-and-sample-data

26
Gemfile
View File

@@ -69,6 +69,10 @@ gem 'pagy', '~> 5.1'
gem 'rswag-api'
gem 'rswag-ui'
gem 'gitlab-omniauth-openid-connect', require: 'omniauth_openid_connect'
gem 'openid_connect', '~> 1.3'
gem 'omniauth-rails_csrf_protection'
gem 'angularjs-rails', '1.8.0'
gem 'bugsnag'
gem 'haml'
@@ -97,7 +101,8 @@ gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem "cable_ready", "5.0.0.pre3"
gem "cable_ready", "5.0.0.pre9"
gem "stimulus_reflex", "3.5.0.pre9"
gem 'combine_pdf'
gem 'wicked_pdf'
@@ -115,8 +120,6 @@ gem 'coffee-rails', '~> 5.0.0'
gem 'mini_racer', '0.4.0'
gem 'uglifier', '>= 1.0.3'
gem 'angular_rails_csrf'
gem 'jquery-rails', '4.4.0'
@@ -131,7 +134,9 @@ gem 'flipper'
gem 'flipper-active_record'
gem 'flipper-ui'
gem "view_component", require: "view_component/engine"
gem "view_component"
gem 'mini_portile2', '~> 2.8'
group :production, :staging do
gem 'ddtrace'
@@ -147,15 +152,13 @@ group :test, :development do
gem "factory_bot_rails", '6.2.0', require: false
gem 'fuubar', '~> 2.5.1'
gem 'json_spec', '~> 1.1.4'
gem 'knapsack'
gem 'knapsack_pro'
gem 'letter_opener', '>= 1.4.1'
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry'
gem 'rspec-retry', require: false
gem 'rswag-specs'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
gem 'webdrivers'
gem 'debug', '>= 1.0.0'
end
@@ -163,14 +166,15 @@ group :test do
gem 'pdf-reader'
gem 'rails-controller-testing'
gem 'simplecov', require: false
gem 'test-prof'
gem 'webmock'
gem 'vcr', require: false
gem 'webmock', require: false
# See spec/spec_helper.rb for instructions
# gem 'perftools.rb'
end
group :development do
gem 'debugger-linecache'
gem 'rails-erd'
gem 'foreman'
gem 'listen'
gem 'pry', '~> 0.13.0'
@@ -180,7 +184,7 @@ group :development do
gem 'spring-commands-rspec'
gem 'web-console'
gem "view_component_storybook", require: "view_component/storybook/engine"
gem "view_component_storybook"
gem 'rack-mini-profiler', '< 3.0.0'
end

View File

@@ -51,67 +51,67 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
actioncable (6.1.7)
actionpack (= 6.1.7)
activesupport (= 6.1.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
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)
actionmailbox (6.1.7)
actionpack (= 6.1.7)
activejob (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
mail (>= 2.7.1)
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)
actionmailer (6.1.7)
actionpack (= 6.1.7)
actionview (= 6.1.7)
activejob (= 6.1.7)
activesupport (= 6.1.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.6.1)
actionview (= 6.1.6.1)
activesupport (= 6.1.6.1)
actionpack (6.1.7)
actionview (= 6.1.7)
activesupport (= 6.1.7)
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.6.1)
actionpack (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
actiontext (6.1.7)
actionpack (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
nokogiri (>= 1.8.5)
actionview (6.1.6.1)
activesupport (= 6.1.6.1)
actionview (6.1.7)
activesupport (= 6.1.7)
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.8)
active_storage_validations (1.0.3)
activejob (>= 5.2.0)
activemodel (>= 5.2.0)
activestorage (>= 5.2.0)
activesupport (>= 5.2.0)
activejob (6.1.6.1)
activesupport (= 6.1.6.1)
activejob (6.1.7)
activesupport (= 6.1.7)
globalid (>= 0.3.6)
activemerchant (1.123.0)
activesupport (>= 4.2)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
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)
activemodel (6.1.7)
activesupport (= 6.1.7)
activerecord (6.1.7)
activemodel (= 6.1.7)
activesupport (= 6.1.7)
activerecord-import (1.4.1)
activerecord (>= 4.2)
activerecord-postgresql-adapter (0.0.1)
pg
@@ -121,14 +121,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
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)
activestorage (6.1.7)
actionpack (= 6.1.7)
activejob (= 6.1.7)
activerecord (= 6.1.7)
activesupport (= 6.1.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.6.1)
activesupport (6.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -138,8 +138,9 @@ GEM
activerecord (>= 5.0, < 6.2)
acts_as_list (1.0.4)
activerecord (>= 4.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
afm (0.2.2)
angular-rails-templates (1.2.0)
railties (>= 5.0, < 7.1)
@@ -153,43 +154,47 @@ GEM
arel-helpers (2.14.0)
activerecord (>= 3.1.0, < 8)
ast (2.4.2)
attr_required (1.0.1)
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.601.0)
aws-sdk-core (3.131.2)
aws-partitions (1.669.0)
aws-sdk-core (3.168.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.57.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (1.60.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-s3 (1.117.2)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.0)
aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2)
axlsx_styler (1.1.0)
activesupport (>= 3.1)
caxlsx (>= 2.0.2)
bcrypt (3.1.18)
bigdecimal (3.0.2)
bindata (2.4.12)
bindex (0.8.1)
bootsnap (1.13.0)
bootsnap (1.15.0)
msgpack (~> 1.2)
bugsnag (6.24.2)
bugsnag (6.25.0)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (7.0.2)
bullet (7.0.4)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cable_ready (5.0.0.pre3)
rails (>= 5.2)
cable_ready (5.0.0.pre9)
actioncable (>= 5.2)
actionpack (>= 5.2)
actionview (>= 5.2)
activerecord (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
thread-local (>= 1.1.0)
cancancan (1.15.0)
capybara (3.37.1)
capybara (3.38.0)
addressable
matrix
mini_mime (>= 0.1.3)
@@ -198,14 +203,13 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
caxlsx (3.1.1)
caxlsx (3.3.0)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
childprocess (4.1.0)
choice (0.2.0)
chronic (0.10.2)
cliver (0.3.2)
coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
@@ -218,15 +222,15 @@ GEM
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
connection_pool (2.3.0)
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.11.0)
addressable
cuprite (0.13)
capybara (>= 2.1, < 4)
ferrum (~> 0.11.0)
cuprite (0.14.3)
capybara (~> 3.0)
ferrum (~> 0.13.0)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.0)
@@ -237,8 +241,8 @@ GEM
debase-ruby_core_source (= 0.10.12)
msgpack
debase-ruby_core_source (0.10.12)
debug (1.6.2)
irb (>= 1.3.6)
debug (1.7.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
debugger-linecache (1.2.0)
devise (4.8.1)
@@ -254,13 +258,12 @@ GEM
devise-token_authenticatable (1.1.0)
devise (>= 4.0.0, < 5.0.0)
diff-lcs (1.5.0)
digest (3.1.0)
digest (3.1.1)
docile (1.4.0)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
dry-inflector (0.2.1)
erubi (1.11.0)
et-orbi (1.2.7)
tzinfo
@@ -271,14 +274,16 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faraday (2.3.0)
faraday-net_http (~> 2.0)
faraday (2.6.0)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.3)
ferrum (0.11)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.1)
ferrum (0.13)
addressable (~> 2.5)
cliver (~> 0.3)
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (>= 0.6, < 0.8)
ffaker (2.21.0)
ffi (1.15.5)
@@ -308,13 +313,17 @@ GEM
nokogiri (>= 1.5.11, < 2.0.0)
foreman (0.87.2)
formatador (0.2.5)
fugit (1.5.3)
fugit (1.7.1)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.8.0)
geocoder (1.8.1)
gitlab-omniauth-openid-connect (0.10.0)
addressable (~> 2.7)
omniauth (>= 1.9, < 3)
openid_connect (~> 1.2)
globalid (1.0.0)
activesupport (>= 5.0)
gmaps4rails (2.1.2)
@@ -326,9 +335,11 @@ GEM
tilt
hashdiff (1.0.1)
hashery (2.1.2)
hashie (5.0.0)
highline (2.0.3)
hiredis (0.6.3)
htmlentities (4.3.4)
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
@@ -340,25 +351,31 @@ GEM
activerecord (>= 3.0)
io-console (0.5.11)
ipaddress (0.8.3)
irb (1.4.1)
irb (1.5.1)
reline (>= 0.3.0)
jmespath (1.6.1)
jmespath (1.6.2)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.1)
railties (>= 3.2.16)
json (2.6.2)
json-schema (2.8.1)
addressable (>= 2.4)
json (2.6.3)
json-jwt (1.16.0)
activesupport (>= 4.2)
aes_key_wrap
bindata
faraday (~> 2.0)
faraday-follow_redirects
json-schema (3.0.0)
addressable (>= 2.8)
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.4.1)
knapsack (4.0.0)
jwt (2.5.0)
knapsack_pro (3.5.0)
rake
launchy (2.5.0)
addressable (~> 2.7)
@@ -368,7 +385,7 @@ GEM
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.18.0)
loofah (2.19.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -387,24 +404,46 @@ GEM
mini_portile2 (2.8.0)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.16.2)
minitest (5.16.3)
monetize (1.12.0)
money (~> 6.12)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.5.4)
msgpack (1.6.0)
multi_json (1.15.0)
multi_xml (0.6.0)
net-protocol (0.1.3)
timeout
net-smtp (0.3.2)
net-protocol
nio4r (2.5.8)
nokogiri (1.13.8)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oauth2 (1.4.10)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
rack (>= 1.2, < 4)
omniauth (2.1.0)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
openid_connect (1.4.2)
activemodel
attr_required (>= 1.0.0)
json-jwt (>= 1.15.0)
net-smtp
rack-oauth2 (~> 1.21)
swd (~> 1.3)
tzinfo
validate_email
validate_url
webfinger (~> 1.2)
orm_adapter (0.5.0)
pagy (5.10.1)
activesupport
@@ -412,16 +451,16 @@ GEM
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.22.1)
paranoia (2.6.0)
paranoia (2.6.1)
activerecord (>= 5.1, < 7.1)
parser (3.1.2.0)
parser (3.1.3.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.10.0)
pdf-reader (2.11.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
@@ -432,14 +471,20 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.7)
puma (5.6.4)
public_suffix (5.0.0)
puma (5.6.5)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.0)
racc (1.6.1)
rack (2.2.4)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-oauth2 (1.21.3)
activesupport
attr_required
httpclient
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (2.1.0)
rack
rack-proxy (0.7.0)
@@ -450,20 +495,20 @@ GEM
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)
rails (6.1.7)
actioncable (= 6.1.7)
actionmailbox (= 6.1.7)
actionmailer (= 6.1.7)
actionpack (= 6.1.7)
actiontext (= 6.1.7)
actionview (= 6.1.7)
activejob (= 6.1.7)
activemodel (= 6.1.7)
activerecord (= 6.1.7)
activestorage (= 6.1.7)
activesupport (= 6.1.7)
bundler (>= 1.15.0)
railties (= 6.1.6.1)
railties (= 6.1.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -472,15 +517,20 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-erd (1.7.2)
activerecord (>= 4.2)
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rails-i18n (7.0.5)
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
rails_safe_tasks (1.0.0)
railties (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
railties (6.1.7)
actionpack (= 6.1.7)
activesupport (= 6.1.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
@@ -494,8 +544,8 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.7.1)
regexp_parser (2.5.0)
redis (4.8.0)
regexp_parser (2.6.1)
reline (0.3.1)
io-console (~> 0.5)
request_store (1.5.0)
@@ -510,9 +560,8 @@ GEM
roadie-rails (3.0.0)
railties (>= 5.1, < 7.1)
roadie (~> 5.0)
rodf (1.1.1)
rodf (1.2.0)
builder (>= 3.0)
dry-inflector (~> 0.1)
rubyzip (>= 1.0)
roo (2.9.0)
nokogiri (~> 1)
@@ -540,38 +589,41 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.3)
rswag-api (2.5.1)
rswag-api (2.8.0)
railties (>= 3.1, < 7.1)
rswag-specs (2.5.1)
rswag-specs (2.8.0)
activesupport (>= 3.1, < 7.1)
json-schema (~> 2.2)
json-schema (>= 2.2, < 4.0)
railties (>= 3.1, < 7.1)
rswag-ui (2.5.1)
rspec-core (>= 2.14)
rswag-ui (2.8.0)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.33.0)
rubocop (1.40.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
rubocop-ast (>= 1.23.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.19.1)
rubocop-ast (1.24.0)
parser (>= 3.1.1.0)
rubocop-rails (2.15.2)
rubocop-rails (2.17.3)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop (>= 1.33.0, < 2.0)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5)
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (3.8.1)
rufus-scheduler (3.8.2)
fugit (~> 1.1, >= 1.1.6)
sass (3.4.25)
sass-rails (5.0.8)
@@ -581,22 +633,17 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sd_notify (0.1.1)
selenium-webdriver (4.3.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shoulda-matchers (5.1.0)
shoulda-matchers (5.2.0)
activesupport (>= 5.2.0)
sidekiq (6.5.4)
connection_pool (>= 2.2.2)
sidekiq (6.5.8)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0)
sidekiq-scheduler (4.0.2)
redis (>= 4.5.0, < 5)
sidekiq-scheduler (4.0.3)
redis (>= 4.2.0)
rufus-scheduler (~> 3.2)
sidekiq (>= 4)
sidekiq (>= 4, < 7)
tilt (>= 1.4.0)
simplecov (0.21.2)
docile (~> 1.1)
@@ -604,11 +651,10 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spreadsheet_architect (4.2.0)
axlsx_styler (>= 1.0.0, < 2)
caxlsx (>= 2.0.2, < 4)
spreadsheet_architect (5.0.0)
caxlsx (>= 3.3.0, < 4)
rodf (>= 1.0.0, < 2)
spring (4.0.0)
spring (4.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
@@ -625,27 +671,46 @@ GEM
state_machines-activerecord (0.8.0)
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
stimulus_reflex (3.5.0.pre9)
actioncable (>= 5.2)
actionpack (>= 5.2)
actionview (>= 5.2)
activesupport (>= 5.2)
cable_ready (>= 5.0.0.pre9)
nokogiri
rack
railties (>= 5.2)
redis
stringex (2.8.5)
stripe (7.0.0)
stripe (8.0.0)
swd (1.3.0)
activesupport (>= 3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
temple (0.8.2)
test-prof (1.0.9)
test-unit (3.5.3)
test-unit (3.5.5)
power_assert
thor (1.2.1)
thread-local (1.1.0)
tilt (2.0.11)
timecop (0.9.5)
timecop (0.9.6)
timeout (0.3.0)
ttfunk (1.7.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.2.0)
unicode-display_width (2.3.0)
uniform_notifier (1.16.0)
valid_email2 (4.0.3)
valid_email2 (4.0.4)
activemodel (>= 3.2)
mail (~> 2.5)
view_component (2.64.0)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
vcr (6.1.0)
view_component (2.78.0)
activesupport (>= 5.0.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
@@ -658,11 +723,10 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.17.1)
webfinger (1.2.0)
activesupport
httpclient (>= 2.4)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@@ -671,7 +735,7 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket (1.2.9)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -679,11 +743,11 @@ GEM
chronic (>= 0.6.3)
wicked_pdf (2.6.3)
activesupport
wkhtmltopdf-binary (0.12.6.5)
wkhtmltopdf-binary (0.12.6.6)
xml-simple (1.1.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.0)
zeitwerk (2.6.6)
PLATFORMS
ruby
@@ -709,7 +773,7 @@ DEPENDENCIES
bootsnap
bugsnag
bullet
cable_ready (= 5.0.0.pre3)
cable_ready (= 5.0.0.pre9)
cancancan (~> 1.15.0)
capybara
catalog!
@@ -737,6 +801,7 @@ DEPENDENCIES
foreman
fuubar (~> 2.5.1)
geocoder
gitlab-omniauth-openid-connect
gmaps4rails
good_migrations
haml
@@ -752,15 +817,18 @@ DEPENDENCIES
json_spec (~> 1.1.4)
jsonapi-serializer
jwt (~> 2.3)
knapsack
knapsack_pro
letter_opener (>= 1.4.1)
listen
mime-types
mimemagic (> 0.3.5)
mini_portile2 (~> 2.8)
mini_racer (= 0.4.0)
monetize (~> 1.11)
oauth2 (~> 1.4.7)
ofn-qz!
omniauth-rails_csrf_protection
openid_connect (~> 1.3)
order_management!
pagy (~> 5.1)
paper_trail (~> 12.1.0)
@@ -776,6 +844,7 @@ DEPENDENCIES
rack-timeout
rails (>= 6.1.4)
rails-controller-testing
rails-erd
rails-i18n
rails_safe_tasks (~> 1.0)
ransack (= 2.4.2)
@@ -794,7 +863,6 @@ DEPENDENCIES
rubocop-rails
sd_notify
select2-rails!
selenium-webdriver
shoulda-matchers
sidekiq
sidekiq-scheduler
@@ -803,18 +871,17 @@ DEPENDENCIES
spring
spring-commands-rspec
state_machines-activerecord
stimulus_reflex (= 3.5.0.pre9)
stringex (~> 2.8.5)
stripe
test-prof
test-unit (~> 3.5)
timecop
uglifier (>= 1.0.3)
valid_email2
vcr
view_component
view_component_storybook
web!
web-console
webdrivers
webmock
webpacker (~> 5)
whenever

View File

@@ -35,7 +35,13 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/orgs/openfoodfoundation/projects/1) for some good first issues, both on manual and automated testing (RSpec/Capybara).
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
We use [KnapsackPro](https://knapsackpro.com/) for optimal parallelisation of our automated tests. KnapsackPro offers unlimited plans for non-commercial open source projects, like ours - a big thanks to them!
![image](https://user-images.githubusercontent.com/49817236/201330047-e64147a7-d91c-4c10-bd4d-ca519d8fe945.png)
## Licence

View File

@@ -8,6 +8,3 @@ require_relative 'config/application'
Openfoodnetwork::Application.load_tasks
if !ENV['DISABLE_KNAPSACK'] && defined?(Knapsack)
Knapsack.load_tasks
end

View File

@@ -22,24 +22,6 @@
//= require angular-rails-templates
//= require lodash.underscore.js
// datetimepicker (fil, nb)
//= require flatpickr/dist/flatpickr.min
//= require flatpickr/dist/l10n/ar
//= require flatpickr/dist/l10n/cat
//= require flatpickr/dist/l10n/cy
//= require flatpickr/dist/l10n/de
//= require flatpickr/dist/l10n/es
//= require flatpickr/dist/l10n/fr
//= require flatpickr/dist/l10n/it
//= require flatpickr/dist/l10n/nl
//= require flatpickr/dist/l10n/pl
//= require flatpickr/dist/l10n/pt
//= require flatpickr/dist/l10n/ru
//= require flatpickr/dist/l10n/sv
//= require flatpickr/dist/l10n/tr
//= require shortcut-buttons-flatpickr/dist/shortcut-buttons-flatpickr.min
//= require flatpickr/dist/plugins/labelPlugin/labelPlugin
// spree
//= require admin/spree/spree
//= require admin/spree/spree-select2
@@ -105,6 +87,8 @@
//= require moment/locale/tr.js
//= require moment/locale/pl.js
//= require js-big-decimal/dist/web/js-big-decimal.min.js
// foundation
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js

View File

@@ -256,12 +256,13 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.packVariant = (product, variant) ->
if variant.hasOwnProperty("unit_value_with_description")
match = variant.unit_value_with_description.match(/^([\d\.]+(?= |$)|)( |)(.*)$/)
match = variant.unit_value_with_description.match(/^([\d\.\,]+(?= |$)|)( |)(.*)$/)
if match
product = BulkProducts.find product.id
variant.unit_value = parseFloat(match[1])
variant.unit_value = parseFloat(match[1].replace(",", "."))
variant.unit_value = null if isNaN(variant.unit_value)
variant.unit_value *= product.variant_unit_scale if variant.unit_value && product.variant_unit_scale
if variant.unit_value && product.variant_unit_scale
variant.unit_value = parseFloat(window.bigDecimal.multiply(variant.unit_value, product.variant_unit_scale, 2))
variant.unit_description = match[3]
$scope.incrementLimit = ->

View File

@@ -39,9 +39,9 @@ angular.module("ofn.admin").directive "ofnDisplayAs", (OptionValueNamer) ->
# get relevant variant properties
variant = scope.$eval(attrs.ofnDisplayAs) # Like this so we can switch between 'master' and 'variant'
if variant.unit_value_with_description?
match = variant.unit_value_with_description.match(/^([\d\.]+(?= |$)|)( |)(.*)$/)
match = variant.unit_value_with_description.match(/^([\d\.\,]+(?= |$)|)( |)(.*)$/)
if match
unit_value = parseFloat(match[1])
unit_value = parseFloat(match[1].replace(",", "."))
unit_value = null if isNaN(unit_value)
unit_value *= variant_unit_scale if unit_value && variant_unit_scale
unit_description = match[3]

View File

@@ -1,15 +0,0 @@
angular.module("admin.enterprise_groups")
.controller "sideMenuCtrl", ($scope, SideMenu) ->
$scope.menu = SideMenu
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-user" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'contact', label: t('admin_enterprise_groups_contact'), icon_class: "icon-phone" }
{ name: 'web', label: t('admin_enterprise_groups_web'), icon_class: "icon-globe" }
]
$scope.select(0)

View File

@@ -1,20 +0,0 @@
# Used in enterprise new and edit forms to reset the state when the country is changed
angular.module("admin.enterprises").controller 'countryCtrl', ($scope, $timeout, availableCountries) ->
$scope.address_type = "address"
$scope.countries = availableCountries
$scope.countriesById = $scope.countries.reduce (obj, country) ->
obj[country.id] = country
obj
, {}
$timeout ->
$scope.$watch 'Enterprise.' + $scope.address_type + '.country_id', (newID, oldID) ->
$scope.clearState() unless $scope.addressStateMatchesCountry()
$scope.clearState = ->
$scope.Enterprise[$scope.address_type].state_id = null
$scope.addressStateMatchesCountry = ->
$scope.countriesById[$scope.Enterprise[$scope.address_type].country_id].states.some (state) ->
state.id == $scope.Enterprise[$scope.address_type].state_id

View File

@@ -1,9 +1,7 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage, RequestMonitor) ->
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, SideMenu, StatusMessage, RequestMonitor) ->
$scope.Enterprise = enterprise
$scope.Enterprises = Enterprises
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear
$scope.menu = SideMenu
$scope.newManager = { id: null, email: (t('add_manager')) }

View File

@@ -1,27 +0,0 @@
angular.module("admin.enterprises")
.controller "permalinkCtrl", ($scope, PermalinkChecker) ->
# locals
initialPermalink = $scope.Enterprise.permalink
pendingRequest = null
# variables on $scope
$scope.availablility = ""
$scope.checking = false
$scope.$watch "Enterprise.permalink", (newValue, oldValue) ->
if newValue == initialPermalink
$scope.availability = ""
return
$scope.checking = true
pendingRequest = PermalinkChecker.check(newValue)
pendingRequest.then (data) ->
if data.permalink == initialPermalink
$scope.availability = ""
else
$scope.availability = data.available
$scope.Enterprise.permalink = data.permalink
$scope.checking = false
, (data) ->
# Do nothing (this is hopefully an aborted request)

View File

@@ -1,49 +0,0 @@
angular.module("admin.enterprises")
.controller "sideMenuCtrl", ($scope, $parse, enterprise, SideMenu, enterprisePermissions) ->
$scope.Enterprise = enterprise
$scope.menu = SideMenu
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-home" }
{ name: 'address', label: t('address'), icon_class: "icon-map-marker" }
{ name: 'contact', label: t('contact'), icon_class: "icon-phone" }
{ name: 'social', label: t('social'), icon_class: "icon-twitter" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'business_details', label: t('business_details'), icon_class: "icon-briefcase" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'properties', label: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
{ name: 'shipping_methods', label: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: 'payment_methods', label: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: 'enterprise_fees', label: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: 'enterprise_permissions', label: t('enterprise_permissions'), icon_class: "icon-plug" }
{ name: 'inventory_settings', label: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
{ name: 'tag_rules', label: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
{ name: 'shop_preferences', label: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
]
SideMenu.init()
$scope.showItem = (item) ->
if item.show?
$parse(item.show)($scope)
else
true
$scope.showProperties = ->
!!$scope.Enterprise.is_primary_producer
$scope.showShippingMethods = ->
enterprisePermissions.can_manage_shipping_methods && $scope.Enterprise.sells != "none"
$scope.showPaymentMethods = ->
enterprisePermissions.can_manage_payment_methods && $scope.Enterprise.sells != "none"
$scope.showEnterpriseFees = ->
enterprisePermissions.can_manage_enterprise_fees && ($scope.Enterprise.sells != "none" || $scope.Enterprise.is_primary_producer)
$scope.enterpriseIsShop = ->
$scope.Enterprise.sells != "none"
$scope.menu.redirect_function('enterprise_permissions', '/admin/enterprise_relationships')

View File

@@ -1,20 +0,0 @@
angular.module("admin.enterprises")
.factory "EnterprisePaymentMethods", (enterprise, PaymentMethods) ->
new class EnterprisePaymentMethods
paymentMethods: PaymentMethods.all
constructor: ->
for payment_method in @paymentMethods
payment_method.selected = payment_method.id in enterprise.payment_method_ids
displayColor: ->
if @paymentMethods.length > 0 && @selectedCount() > 0
"blue"
else
"red"
selectedCount: ->
@paymentMethods.reduce (count, payment_method) ->
count++ if payment_method.selected
count
, 0

View File

@@ -1,20 +0,0 @@
angular.module("admin.enterprises")
.factory "EnterpriseShippingMethods", (enterprise, ShippingMethods) ->
new class EnterpriseShippingMethods
shippingMethods: ShippingMethods.all
constructor: ->
for shipping_method in @shippingMethods
shipping_method.selected = shipping_method.id in enterprise.shipping_method_ids
displayColor: ->
if @shippingMethods.length > 0 && @selectedCount() > 0
"blue"
else
"red"
selectedCount: ->
@shippingMethods.reduce (count, shipping_method) ->
count++ if shipping_method.selected
count
, 0

View File

@@ -5,6 +5,8 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.confirmDelete = true
$scope.startDate = moment().startOf('day').subtract(7, 'days').format('YYYY-MM-DD')
$scope.endDate = moment().startOf('day').format('YYYY-MM-DD')
$scope.previousDates = { startDate: $scope.startDate, endDate: $scope.endDate }
$scope.datesChangedOnCancelEvent = false
$scope.bulkActions = [ { name: t("admin.orders.bulk_management.actions_delete"), callback: 'deleteLineItems' } ]
$scope.selectedUnitsProduct = {}
$scope.selectedUnitsVariant = {}
@@ -25,6 +27,28 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.resetFilters()
$scope.refreshData()
$scope.$watchCollection "[startDate, endDate]", (newValues, oldValues) ->
if newValues != oldValues && !$scope.datesChangedOnCancelEvent
state = $scope.refreshData()
if (state == "cancel")
$scope.datesChangedOnCancelEvent = true
$scope.cancelDateChange()
$scope.cancelDateChange = ->
# Reset the date filters to the previous values
$scope.startDate = $scope.previousDates.startDate
$scope.endDate = $scope.previousDates.endDate
# throw a flatpickr:change event to change the date back in the datepicker
event = new CustomEvent('flatpickr:change', {
detail: {
startDate: $scope.previousDates.startDate,
endDate: $scope.previousDates.endDate
}
})
window.dispatchEvent(event)
$timeout ->
$scope.datesChangedOnCancelEvent = false
$scope.refreshData = ->
unless !$scope.orderCycleFilter? || $scope.orderCycleFilter == ''
$scope.setOrderCycleDateRange()
@@ -34,6 +58,8 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
return unless moment($scope.formattedStartDate).isValid() and moment($scope.formattedEndDate).isValid()
return "cancel" unless $scope.confirmRefresh()
$scope.loadOrders()
$scope.loadLineItems()
@@ -41,6 +67,11 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
$scope.loadAssociatedData()
$scope.dereferenceLoadedData()
$timeout ->
# update the previous dates with the current ones since loading was successful
$scope.previousDates.startDate = $scope.startDate
$scope.previousDates.endDate = $scope.endDate
$scope.setOrderCycleDateRange = ->
start_date = OrderCycles.byID[$scope.orderCycleFilter].orders_open_at

View File

@@ -18,7 +18,8 @@ angular.module('admin.orderCycles')
OrderCycle.exchangeDirection(exchange)
$scope.enterprisesWithFees = ->
$scope.enterprises[id] for id in [OrderCycle.participatingEnterpriseIds()..., [OrderCycle.order_cycle.coordinator_id]...] when $scope.enterpriseFeesForEnterprise(id).length > 0
ids = [OrderCycle.participatingEnterpriseIds()..., [OrderCycle.order_cycle.coordinator_id]...]
$scope.enterprises[id] for id in Array.from(new Set(ids)) when $scope.enterpriseFeesForEnterprise(id).length > 0
$scope.removeExchange = ($event, exchange) ->
$event.preventDefault()

View File

@@ -1,21 +1,4 @@
angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.enterprises'])
.directive 'datetimepicker', ($timeout, $parse) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
fp = flatpickr(element, Object.assign({},
window.FLATPICKR_DATETIME_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
instance.input.dispatchEvent(new Event('focus', { bubbles: true }));
}));
fp.minuteElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setMinutes(e.target.value), true)
fp.hourElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setHours(e.target.value), true)
.directive 'ofnOnChange', ->
(scope, element, attrs) ->
element.bind 'change', ->

View File

@@ -93,9 +93,9 @@ angular.module('admin.orderCycles').factory 'OrderCycle', ($resource, $window, $
variant_ids
participatingEnterpriseIds: ->
suppliers = (exchange.enterprise_id for exchange in this.order_cycle.incoming_exchanges)
distributors = (exchange.enterprise_id for exchange in this.order_cycle.outgoing_exchanges)
jQuery.unique(suppliers.concat(distributors)).sort()
suppliers = (parseInt(exchange.enterprise_id) for exchange in this.order_cycle.incoming_exchanges)
distributors = (parseInt(exchange.enterprise_id) for exchange in this.order_cycle.outgoing_exchanges)
Array.from(new Set([suppliers..., distributors...]))
exchangesByDirection: (direction) ->
if direction == 'incoming'

View File

@@ -0,0 +1,14 @@
angular.module("admin.orders").controller "bulkCancelCtrl", ($scope, $http, $timeout) ->
$scope.cancelOrder = (orderIds, sendEmailCancellation, restock_items) ->
$http(
method: 'post'
url: "/admin/orders/bulk_cancel?order_ids=#{orderIds}&send_cancellation_email=#{sendEmailCancellation}&restock_items=#{restock_items}" ).then(->
window.location.reload()
)
$scope.cancelSelectedOrders = ->
ofnCancelOrderAlert((confirm, sendEmailCancellation, restock_items) ->
if confirm
$scope.cancelOrder $scope.selected_orders, sendEmailCancellation, restock_items
)

View File

@@ -29,6 +29,8 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
$scope.q = {
completed_at_not_null: true
}
e = new CustomEvent("flatpickr_clear");
window.dispatchEvent(e)
$scope.clearFilters = () ->
KeyValueMapStore.clearKeyValueMap()

View File

@@ -1,3 +0,0 @@
angular.module("admin.paymentMethods").controller "paymentMethodsCtrl", ($scope, PaymentMethods) ->
$scope.findPaymentMethodByID = (id) ->
$scope.PaymentMethod = PaymentMethods.byID[id]

View File

@@ -32,11 +32,11 @@ angular.module("admin.products")
if match
$scope.product.master.unit_value = PriceParser.parse(match[1])
$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_value = window.bigDecimal.multiply($scope.product.master.unit_value, $scope.product.variant_unit_scale, 2) 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
value = window.bigDecimal.divide(value, $scope.product.variant_unit_scale, 2) 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 = ->

View File

@@ -23,10 +23,10 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
$scope.updateValue = ->
unit_value_human = angular.element('#unit_value_human').val()
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
$scope.unit_value = bigDecimal.multiply(PriceParser.parse(unit_value_human), $scope.scale, 2)
variant_unit_value = angular.element('#variant_unit_value').val()
$scope.unit_value_human = variant_unit_value / $scope.scale
$scope.unit_value_human = parseFloat(bigDecimal.divide(variant_unit_value, $scope.scale, 2))
$timeout -> $scope.processUnitPrice()
$timeout -> $scope.updateValue()

View File

@@ -65,7 +65,8 @@ angular.module("ofn.admin").factory "BulkProducts", (ProductResource, dataFetche
variantUnitValue: (product, variant) ->
if variant.unit_value?
if product.variant_unit_scale
@divideAsInteger variant.unit_value, product.variant_unit_scale
variant_unit_value = @divideAsInteger variant.unit_value, product.variant_unit_scale
parseFloat(window.bigDecimal.round(variant_unit_value, 2))
else
variant.unit_value
else

View File

@@ -1,3 +0,0 @@
angular.module("admin.shippingMethods").controller "shippingMethodsCtrl", ($scope, ShippingMethods) ->
$scope.findShippingMethodByID = (id) ->
$scope.ShippingMethod = ShippingMethods.byID[id]

View File

@@ -1,29 +0,0 @@
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($rootScope, $compile, $window, $templateCache, DialogDefaults, shops) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
scope.submitted = false
scope.shops = shops
scope.shop_id = null
scope.newSubscription = ->
scope.new_subscription_form.$setPristine()
scope.submitted = true
if scope.shop_id?
$window.location.href = "/admin/subscriptions/new?subscription[shop_id]=#{scope.shop_id}"
return
# Compile modal template
template = $compile($templateCache.get('admin/new_subscription_dialog.html'))(scope)
# Set Dialog options
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
if shops.length == 1
scope.shop_id = shops[0].id
scope.newSubscription()
else
template.dialog('open')
$rootScope.$evalAsync()

View File

@@ -1,70 +1,4 @@
$(document).ready(function() {
var onClickButtons = function(index, fp) {
var date;
// Memorize index used for the 'Close' button
// (currently it has index of 1)
var closeButtonIndex = 1;
switch (index) {
case 0:
date = new Date();
break;
case closeButtonIndex:
fp.close();
break;
}
// Set the date unless clicked button was the 'Close' one
if (index != closeButtonIndex) {
fp.setDate(date, true);
}
}
window.FLATPICKR_DATE_DEFAULT = {
altInput: true,
altFormat: Spree.translations.flatpickr_date_format,
dateFormat: "Y-m-d",
locale: I18n.base_locale,
plugins: [
ShortcutButtonsPlugin({
button: [
{
label: Spree.translations.today
},
{
label: Spree.translations.close
}
],
label: "or",
onClick: onClickButtons
}),
labelPlugin({})
]
}
window.FLATPICKR_DATETIME_DEFAULT = Object.assign(
{},
window.FLATPICKR_DATE_DEFAULT,
{
altInput: true,
altFormat: Spree.translations.flatpickr_datetime_format,
dateFormat: "Y-m-d H:i",
enableTime: true,
time_24hr: true,
plugins: [
ShortcutButtonsPlugin({
button: [
{
label: Spree.translations.now
},
{
label: Spree.translations.close
}
],
label: "or",
onClick: onClickButtons
}),
labelPlugin({})
]
}
);
flatpickr(".datetimepicker", window.FLATPICKR_DATETIME_DEFAULT);
$('a.close').click(function(event){
event.preventDefault();
$(this).parent().slideUp(250);

View File

@@ -1,14 +0,0 @@
angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
flapickrInstance = flatpickr(element, Object.assign(
{},
$window.FLATPICKR_DATE_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
}
));
ngModel.$render = () ->
newValue = ngModel.$viewValue;
flapickrInstance?.setDate(newValue)

View File

@@ -1,14 +0,0 @@
#new-subscription-dialog
.text-normal.margin-bottom-30.text-center
= t('js.admin.subscriptions.new.please_select_a_shop')
%form{ name: 'new_subscription_form', novalidate: true, ng: { submit: "newSubscription()" }}
.text-center.margin-bottom-30
%input.ofn-select2.fullwidth#new_subscription_shop_id{ ng: { model: 'shop_id' }, required: true, name: 'shop_id', data: 'shops' }
%div{ ng: { show: "submitted && new_subscription_form.$pristine" } }
.error{ ng: { show: "new_subscription_form.shop_id.$error.required" } }
= t('js.admin.subscriptions.new.please_select_a_shop')
.text-center
%input.button.red.icon-plus{ type: 'submit', value: t('continue') }

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end

View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :session_id, :current_user
def connect
# initializes Warden after a cold start, in case you're visitor #1
env["warden"].authenticated?
# the problem with only using session is that users often login on multiple devices
self.current_user = env["warden"].user
# the problem with only using user is that sometimes you might want to use SR before you login
self.session_id = request.session.id
# and so, we recommend using both
# this assumes that you want to enable SR for unauthenticated users
reject_unauthorized_connection unless current_user || session_id
# if you want to disable SR for unauthenticated users,
# comment out the line above and uncomment the line below
# reject_unauthorized_connection unless current_user
end
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
class MultipleCheckedSelectComponent < ViewComponent::Base
def initialize(name:, options:, selected:)
@name = name
@options = options.map { |option| [option[0], option[1].to_sym] }
@selected = selected.nil? ? [] : selected.map(&:to_sym)
end
end

View File

@@ -0,0 +1,13 @@
.ofn-drop-down.ofn-drop-down-v2{ data: { controller: "multiple-checked-select" } }
%div.ofn-drop-down-label{ "data-multiple-checked-select-target": "button" }
%span{class: "label"}= t('admin.columns')
%span{ class: "icon-caret-down", "data-multiple-checked-select-target": "caret" }
%div.menu{ class: "hidden", "data-multiple-checked-select-target": "options" }
%div.filter
%input{ type: "text", "data-multiple-checked-select-target": "filter", placeholder: I18n.t('components.multiple_checked_select.filter_placeholder') }
%hr
%div.menu_items
- @options.each do |option|
%label.menu_item{ "data-multiple-checked-select-target": "option", "data-value": option[1], "data-label": option[0] }
%input.redesigned-input{ type: "checkbox", checked: @selected.include?(option[1]), name: "#{@name}[]", value: option[1] }
= option[0]

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
require "open_food_network/feature_toggle"
class FeatureToggleConstraint
def initialize(feature_name)
@feature = feature_name
end
def matches?(request)
OpenFoodNetwork::FeatureToggle.enabled?(@feature, current_user(request))
end
def current_user(request)
request.env['warden']&.user
end
end

View File

@@ -1,11 +0,0 @@
# frozen_string_literal: true
class SplitCheckoutConstraint
def matches?(request)
OpenFoodNetwork::FeatureToggle.enabled? :split_checkout, current_user(request)
end
def current_user(request)
request.env['warden'].user
end
end

View File

@@ -116,21 +116,7 @@ module Admin
# Fetches tags for all customers of the enterprise and returns a hash indexed by customer_id
def customer_tags_by_id
customer_tags = ::ActsAsTaggableOn::Tag.
joins(:taggings).
includes(:taggings).
where(taggings:
{ taggable_type: 'Customer',
taggable_id: Customer.of(managed_enterprise_id),
context: 'tags' })
customer_tags.each_with_object({}) do |tag, indexed_hash|
tag.taggings.each do |tagging|
customer_id = tagging.taggable_id
indexed_hash[customer_id] ||= []
indexed_hash[customer_id] << tag.name
end
end
BatchTaggableTagsQuery.call(Customer.of(managed_enterprise_id))
end
end
end

View File

@@ -6,6 +6,7 @@ module Admin
class EnterpriseFeesController < Admin::ResourceController
before_action :load_enterprise_fee_set, only: :index
before_action :load_data
before_action :check_enterprise_fee_input, only: [:bulk_update]
def index
@include_calculators = params[:include_calculators].present?
@@ -35,13 +36,6 @@ module Admin
end
def bulk_update
@flat_percent_value = enterprise_fee_bulk_params.dig('collection_attributes', '0', 'calculator_attributes', 'preferred_flat_percent')
unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
end
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
if @enterprise_fee_set.save
@@ -105,5 +99,25 @@ module Admin
]
)
end
def check_enterprise_fee_input
enterprise_fee_bulk_params['collection_attributes'].each do |_, fee_row|
enterprise_fees = fee_row['calculator_attributes']&.slice(
:preferred_flat_percent, :preferred_amount,
:preferred_first_item, :preferred_additional_item,
:preferred_minimal_amount, :preferred_normal_amount,
:preferred_discount_amount, :preferred_per_unit
)
next unless enterprise_fees
enterprise_fees.each do |_, enterprise_amount|
unless enterprise_amount.nil? || Float(enterprise_amount, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
end
end
end
end
end
end

View File

@@ -7,6 +7,7 @@ require 'open_food_network/order_cycle_permissions'
module Admin
class EnterprisesController < Admin::ResourceController
include GeocodeEnterpriseAddress
include CablecarResponses
# These need to run before #load_resource so that @object is initialised with sanitised values
prepend_before_action :override_owner, only: :create
@@ -44,7 +45,12 @@ module Admin
def edit
@object = Enterprise.where(permalink: params[:id]).
includes(users: [:ship_address, :bill_address]).first
super
if params[:stimulus]
@enterprise.is_primary_producer = params[:is_primary_producer]
@enterprise.sells = params[:enterprise_sells]
render operations: cable_car.morph("#side_menu", partial("admin/shared/side_menu"))
.morph("#permalink", partial("admin/enterprises/form/permalink"))
end
end
def welcome

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
module Admin
class OidcSettingsController < Spree::Admin::BaseController
def index; end
end
end

View File

@@ -2,10 +2,10 @@
module Admin
class OrderCyclesController < Admin::ResourceController
include OrderCyclesHelper
include ::OrderCyclesHelper
include PaperTrailLogging
prepend_before_action :set_order_cycle_id, only: [:incoming, :outgoing]
prepend_before_action :set_order_cycle_id, only: [:incoming, :outgoing, :checkout_options]
before_action :load_data_for_index, only: :index
before_action :require_coordinator, only: :new
before_action :remove_protected_attrs, only: [:update]
@@ -67,10 +67,12 @@ module Admin
update_nil_subscription_line_items_price_estimate(@order_cycle)
respond_to do |format|
flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1'
format.html { redirect_back(fallback_location: root_path) }
format.html { redirect_to_after_update_path }
format.json { render json: { success: true } }
end
else
elsif request.format.html?
render :checkout_options
elsif request.format.json?
render json: { errors: @order_cycle.errors.full_messages }, status: :unprocessable_entity
end
end
@@ -190,6 +192,16 @@ module Admin
end
end
def redirect_to_after_update_path
if params[:context] == "checkout_options" && params[:save]
redirect_to main_app.admin_order_cycle_checkout_options_path(@order_cycle)
elsif params[:context] == "checkout_options" && params[:save_and_back_to_list]
redirect_to main_app.admin_order_cycles_path
else
redirect_back(fallback_location: root_path)
end
end
def require_coordinator
@order_cycle.coordinator =
permitted_coordinating_enterprises_for(@order_cycle).find_by(id: params[:coordinator_id])

View File

@@ -43,18 +43,12 @@ module Admin
@report_type = report_type
@report_subtypes = report_subtypes
@report_subtype = report_subtype
# 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
@report_title = if report_subtype
report_subtype_title
else
I18n.t(:name, scope: [:admin, :reports, @report_type])
end
@rendering_options = rendering_options
@data = Reporting::FrontendData.new(spree_current_user)
end
end

View File

@@ -162,25 +162,20 @@ module Admin
[:index]
end
def managed_enterprise_id
Enterprise.managed_by(spree_current_user).select('enterprises.id').
find_by(id: params[:enterprise_id])
end
def subscription_params
@subscription_params ||= PermittedAttributes::Subscription.new(params).call.
to_h.with_indifferent_access
end
def payment_method_tags_by_id
payment_method_tags = ::ActsAsTaggableOn::Tag.
joins(:taggings).
includes(:taggings).
where(taggings: { taggable_type: "Spree::PaymentMethod",
taggable_id: Spree::PaymentMethod.from(Enterprise.managed_by(spree_current_user).
select('enterprises.id').find_by(id: params[:enterprise_id])),
context: 'tags' })
payment_method_tags.each_with_object({}) do |tag, hash|
payment_method_id = tag.taggings.first.taggable_id
hash[payment_method_id] ||= []
hash[payment_method_id] << tag.name
end
@payment_method_tags_by_id ||= BatchTaggableTagsQuery.call(
Spree::PaymentMethod.from(managed_enterprise_id)
)
end
end
end

View File

@@ -40,7 +40,7 @@ module Api
end
def restrict_feature
not_found unless Flipper.enabled?(:api_v1, @current_api_user)
not_found unless OpenFoodNetwork::FeatureToggle.enabled?(:api_v1, @current_api_user)
end
def current_ability

View File

@@ -165,8 +165,9 @@ class ApplicationController < ActionController::Base
return unless current_spree_user.disabled
flash[:success] = nil
flash.now[:error] = I18n.t("devise.failure.disabled")
flash[:error] = I18n.t("devise.failure.disabled")
sign_out current_spree_user
redirect_to main_app.root_path
end
end

View File

@@ -16,23 +16,14 @@ class BaseController < ApplicationController
private
def set_order_cycles
unless @distributor.ready_for_checkout?
@order_cycles = OrderCycle.where('false')
return
end
@order_cycles = Shop::OrderCyclesList.new(@distributor, current_customer).call
@order_cycles = Shop::OrderCyclesList.ready_for_checkout_for(@distributor, current_customer)
set_order_cycle
end
# Default to the only order cycle if there's only one
#
# Here we need to use @order_cycles.size not @order_cycles.count
# because OrderCyclesList returns a modified ActiveRecord::Relation
# and these modifications are not seen if it is reloaded with count
def set_order_cycle
return if @order_cycles.size != 1
return if @order_cycles.count != 1
current_order(true).set_order_cycle! @order_cycles.first
end

View File

@@ -50,7 +50,9 @@ module OrderCompletion
end
def order_invalid!
Bugsnag.notify("Notice: invalid order loaded during checkout", order: @order)
Bugsnag.notify("Notice: invalid order loaded during checkout") do |payload|
payload.add_metadata :order, @order
end
flash[:error] = t('checkout.order_not_loaded')
redirect_to main_app.shop_path
@@ -81,7 +83,9 @@ module OrderCompletion
end
def processing_failed(error = RuntimeError.new(order_processing_error))
Bugsnag.notify(error, order: @order)
Bugsnag.notify(error) do |payload|
payload.add_metadata :order, @order
end
flash[:error] = order_processing_error if flash.blank?
Checkout::PostCheckoutActions.new(@order).failure
end

View File

@@ -21,12 +21,17 @@ module OrderStockCheck
def check_order_cycle_expiry
return unless current_order_cycle&.closed?
Bugsnag.notify("Notice: order cycle closed during checkout completion", order: current_order)
Bugsnag.notify("Notice: order cycle closed during checkout completion") do |payload|
payload.add_metadata :order, current_order
end
current_order.empty!
current_order.set_order_cycle! nil
flash[:info] = I18n.t('order_cycle_closed')
redirect_to main_app.shop_path
respond_to do |format|
format.json { render json: { path: main_app.shop_path }, status: :see_other }
format.html { redirect_to main_app.shop_path, status: :see_other }
end
end
private
@@ -36,7 +41,7 @@ module OrderStockCheck
end
def reset_order_to_cart
return if Flipper.enabled? :split_checkout, spree_current_user
return if OpenFoodNetwork::FeatureToggle.enabled? :split_checkout, spree_current_user
OrderCheckoutRestart.new(@order).call
end

View File

@@ -39,6 +39,10 @@ module ReportsActions
params[:report_subtype] || report_subtypes_codes.first
end
def report_subtype_title
report_subtypes.select { |_name, key| key.to_sym == report_subtype.to_sym }.first[0]
end
def ransack_params
raw_params[:q]
end
@@ -58,4 +62,37 @@ module ReportsActions
def i18n_scope
'admin.reports'
end
def rendering_options
@rendering_options ||= ReportRenderingOptions.where(
user: spree_current_user,
report_type: report_type,
report_subtype: report_subtype
).first_or_create do |report_rendering_options|
report_rendering_options.options = {
fields_to_show: if request.get?
@report.columns.keys -
@report.fields_to_hide
else
params[:fields_to_show]
end,
display_summary_row: request.get?,
display_header_row: false
}
end
update_rendering_options
@rendering_options
end
def update_rendering_options
return unless request.post?
@rendering_options.update(
options: {
fields_to_show: params[:fields_to_show],
display_summary_row: params[:display_summary_row].present?,
display_header_row: params[:display_header_row].present?
}
)
end
end

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
class ErrorsController < ApplicationController
layout "errors"
def not_found
render status: :not_found
end
def internal_server_error
render status: :internal_server_error
end
def unprocessable_entity
render status: :unprocessable_entity
end
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def openid_connect
spree_current_user.link_from_omniauth(request.env["omniauth.auth"])
redirect_to admin_oidc_settings_path
end
def failure
error_message = request.env["omniauth.error"].to_s
flash[:error] = t("devise.oidc.failure", error: error_message)
super
end
end

View File

@@ -21,6 +21,10 @@ class SplitCheckoutController < ::BaseController
def edit
redirect_to_step_based_on_order unless params[:step]
check_step if params[:step]
recalculate_tax if params[:step] == "summary"
flash_error_when_no_shipping_method_available if available_shipping_methods.none?
end
def update
@@ -45,6 +49,10 @@ class SplitCheckoutController < ::BaseController
private
def flash_error_when_no_shipping_method_available
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
end
def clear_invalid_payments
@order.payments.with_state(:invalid).delete_all
end
@@ -145,4 +153,18 @@ class SplitCheckoutController < ::BaseController
end
redirect_to_step_based_on_order
end
def check_step
case @order.state
when "cart", "address", "delivery"
redirect_to checkout_step_path(:details) unless params[:step] == "details"
when "payment"
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
end
end
def recalculate_tax
@order.create_tax_charge!
@order.update_order!
end
end

View File

@@ -67,6 +67,18 @@ module Spree
load_spree_api_key
end
def bulk_cancel
order_ids = params[:order_ids].split(',')
Spree::Order.where(id: order_ids).find_each do |order|
order.send_cancellation_email = params[:send_cancellation_email] != "false"
order.restock_items = params.fetch(:restock_items, "true") == "true"
order.cancel
end
flash[:success] = Spree.t(:order_updated)
end
def fire
event = params[:e]
@order.send_cancellation_email = params[:send_cancellation_email] != "false"

View File

@@ -227,10 +227,10 @@ module Spree
def notify_bugsnag(error, product, variant)
Bugsnag.notify(error) do |report|
report.add_tab(:product, product.attributes)
report.add_tab(:product_error, product.errors.first) unless product.valid?
report.add_tab(:variant, variant.attributes)
report.add_tab(:variant_error, variant.errors.first) unless variant.valid?
report.add_metadata(:product, product.attributes)
report.add_metadata(:product_error, product.errors.first) unless product.valid?
report.add_metadata(:variant, variant.attributes)
report.add_metadata(:variant_error, variant.errors.first) unless variant.valid?
end
end

View File

@@ -18,19 +18,28 @@ module Spree
end
def customers
@customers = []
if spree_current_user.enterprises.pluck(:id).include? search_params[:distributor_id].to_i
@customers = Customer.
ransack(m: 'or', email_start: search_params[:q], first_name_start: search_params[:q],
last_name_start: search_params[:q]).
result.
where(enterprise_id: search_params[:distributor_id].to_i)
end
render json: @customers, each_serializer: ::Api::Admin::CustomerSerializer
render json: load_customers, each_serializer: ::Api::Admin::CustomerSerializer
end
private
def load_customers
return [] unless valid_enterprise_given?
Customer.ransack(
m: 'or', email_start: search_params[:q],
first_name_start: search_params[:q], last_name_start: search_params[:q]
).result.where(enterprise_id: search_params[:distributor_id].to_i)
end
def valid_enterprise_given?
return true if spree_current_user.admin?
spree_current_user.enterprises.where(
id: search_params[:distributor_id].to_i
).present?
end
def ransack_hash
{
m: 'or',

View File

@@ -95,11 +95,20 @@ module Spree
end
def check_shipping_fee_input
shipping_amount = permitted_resource_params.dig('calculator_attributes', 'preferred_amount')
shipping_fees = permitted_resource_params['calculator_attributes']&.slice(
:preferred_flat_percent, :preferred_amount,
:preferred_first_item, :preferred_additional_item,
:preferred_minimal_amount, :preferred_normal_amount,
:preferred_discount_amount, :preferred_per_unit
)
unless shipping_amount.nil? || Float(shipping_amount, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to location_after_save
return unless shipping_fees
shipping_fees.each do |_, shipping_amount|
unless shipping_amount.nil? || Float(shipping_amount, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to location_after_save
end
end
end
end

View File

@@ -48,30 +48,11 @@ module Spree
@user.spree_roles = roles.reject(&:blank?).collect{ |r| Spree::Role.find(r) }
end
message = if new_email_unconfirmed?
Spree.t(:email_updated)
else
Spree.t(:account_updated)
end
flash.now[:success] = message
flash.now[:success] = update_message
end
render :edit
end
def generate_api_key
if @user.generate_spree_api_key!
flash[:success] = t('spree.api.key_generated')
end
redirect_to spree.edit_admin_user_path(@user)
end
def clear_api_key
if @user.clear_spree_api_key!
flash[:success] = t('spree.api.key_cleared')
end
redirect_to spree.edit_admin_user_path(@user)
end
protected
def collection
@@ -100,6 +81,16 @@ module Spree
private
def update_message
return Spree.t(:show_api_key_view_toggled) if @user.show_api_key_view_previously_changed?
if new_email_unconfirmed?
Spree.t(:email_updated)
else
Spree.t(:account_updated)
end
end
# handling raise from Admin::ResourceController#destroy
def user_destroy_with_orders_error
render status: :forbidden, text: Spree.t(:error_user_destroy_with_orders)
@@ -137,7 +128,9 @@ module Spree
end
def user_params
::PermittedAttributes::User.new(params).call([:enterprise_limit])
::PermittedAttributes::User.new(params).call(
%i[enterprise_limit show_api_key_view]
)
end
end
end

View File

@@ -0,0 +1,57 @@
# frozen_string_literal: true
module Spree
class ApiKeysController < ::BaseController
include Spree::Core::ControllerHelpers
include I18nHelper
prepend_before_action :load_object
def create
@user.generate_api_key
if @user.save
flash[:success] = t('spree.api.key_generated')
end
redirect_to redirect_path
end
def destroy
@user.spree_api_key = nil
if @user.save
flash[:success] = t('spree.api.key_cleared')
end
redirect_to redirect_path
end
private
def load_object
@user ||= find_user
if @user
authorize! :update, @user
else
redirect_to main_app.login_path
end
end
def find_user
Spree::User.find_by(id: params[:id]) || spree_current_user
end
def redirect_path
if request.referer.blank? || request.referer.include?(spree.account_path)
developer_settings_path
else
request.referer
end
end
def developer_settings_path
"#{spree.account_path}#/developer_settings"
end
end
end

View File

@@ -6,7 +6,6 @@ module Spree
include Rails.application.routes.url_helpers
include CablecarResponses
layout 'darkswarm'
rescue_from ActiveRecord::RecordNotFound, with: :render_404

View File

@@ -1,48 +0,0 @@
# frozen_string_literal: true
require "spree/core/controller_helpers/auth"
require "spree/core/controller_helpers/common"
require "spree/core/controller_helpers/order"
module Spree
class UserRegistrationsController < Devise::RegistrationsController
helper 'spree/base'
include Spree::Core::ControllerHelpers::Auth
include Spree::Core::ControllerHelpers::Common
include Spree::Core::ControllerHelpers::Order
before_action :check_permissions, only: [:edit, :update]
skip_before_action :require_no_authentication
# GET /resource/edit
def edit
super
end
# PUT /resource
def update
super
end
# DELETE /resource
def destroy
super
end
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
def cancel
super
end
protected
def check_permissions
authorize!(:create, resource)
end
end
end

View File

@@ -16,6 +16,7 @@ module Spree
prepend_before_action :handle_unconfirmed_email
before_action :set_checkout_redirect, only: :create
after_action :ensure_valid_locale_persisted, only: :create
skip_before_action :check_disabled_user
def create
authenticate_spree_user!

View File

@@ -78,7 +78,7 @@ module Spree
def load_object
@user ||= spree_current_user
if @user
if @user && !@user.disabled
authorize! params[:action].to_sym, @user
else
redirect_to main_app.login_path

View File

@@ -1,13 +1,23 @@
# frozen_string_literal: true
require 'open_food_network/error_logger'
require "spree/core/controller_helpers/auth"
require "spree/core/controller_helpers/common"
require "spree/core/controller_helpers/order"
class UserRegistrationsController < Spree::UserRegistrationsController
class UserRegistrationsController < Devise::RegistrationsController
I18N_SCOPE = 'devise.user_registrations.spree_user'
before_action :set_checkout_redirect, only: :create
helper 'spree/base'
include Spree::Core::ControllerHelpers::Auth
include Spree::Core::ControllerHelpers::Common
include Spree::Core::ControllerHelpers::Order
include I18nHelper
skip_before_action :require_no_authentication
before_action :set_checkout_redirect, only: :create
before_action :set_locale
# POST /resource/sign_up

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module Admin
module EnterpriseGroupsHelper
def enterprise_group_side_menu_items
[
{ name: 'primary_details', icon_class: "icon-user", selected: "selected" },
{ name: 'users', icon_class: "icon-user" },
{ name: 'about', icon_class: "icon-pencil" },
{ name: 'images', icon_class: "icon-picture" },
{ name: 'contact', icon_class: "icon-phone" },
{ name: 'web', icon_class: "icon-globe" },
]
end
end
end

View File

@@ -13,5 +13,34 @@ module Admin
def select_only_item(producers)
producers.size == 1 ? producers.first.id : nil
end
def enterprise_side_menu_items(enterprise)
is_shop = enterprise.sells != "none"
show_properties = !!enterprise.is_primary_producer
show_shipping_methods = can?(:manage_shipping_methods, enterprise) && is_shop
show_payment_methods = can?(:manage_payment_methods, enterprise) && is_shop
show_enterprise_fees = can?(:manage_enterprise_fees,
enterprise) && (is_shop || enterprise.is_primary_producer)
[
{ name: 'primary_details', icon_class: "icon-home", show: true, selected: 'selected' },
{ name: 'address', icon_class: "icon-map-marker", show: true },
{ name: 'contact', icon_class: "icon-phone", show: true },
{ name: 'social', icon_class: "icon-twitter", show: true },
{ name: 'about', icon_class: "icon-pencil", show: true, form_name: "about_us" },
{ name: 'business_details', icon_class: "icon-briefcase", show: true },
{ name: 'images', icon_class: "icon-picture", show: true },
{ name: 'properties', icon_class: "icon-tags", show: show_properties },
{ name: 'shipping_methods', icon_class: "icon-truck", show: show_shipping_methods },
{ name: 'payment_methods', icon_class: "icon-money", show: show_payment_methods },
{ name: 'enterprise_fees', icon_class: "icon-tasks", show: show_enterprise_fees },
{ name: 'enterprise_permissions', icon_class: "icon-plug", show: true,
href: admin_enterprise_relationships_path },
{ name: 'inventory_settings', icon_class: "icon-list-ol", show: is_shop },
{ name: 'tag_rules', icon_class: "icon-random", show: is_shop },
{ name: 'shop_preferences', icon_class: "icon-shopping-cart", show: is_shop },
{ name: 'users', icon_class: "icon-user", show: true }
]
end
end
end

View File

@@ -32,25 +32,9 @@ module CheckoutHelper
}
end
enterprise_fee_adjustments = adjustments.select { |a|
a.originator_type == 'EnterpriseFee' && a.adjustable_type != 'Spree::LineItem'
}
adjustments.reject! { |a|
a.originator_type == 'EnterpriseFee' && a.adjustable_type != 'Spree::LineItem'
}
unless exclude.include? :admin_and_handling
adjustments << Spree::Adjustment.new(
label: I18n.t(:orders_form_admin), amount: enterprise_fee_adjustments.sum(&:amount)
)
end
adjustments
end
def display_line_item_fees_total_for(order)
Spree::Money.new order.adjustments.enterprise_fee.sum(:amount), currency: order.currency
end
def checkout_line_item_fees(order)
order.line_item_adjustments.enterprise_fee
end
@@ -70,10 +54,13 @@ module CheckoutHelper
def display_checkout_taxes_hash(order)
totals = OrderTaxAdjustmentsFetcher.new(order).totals
totals.each_with_object({}) do |(tax_rate, tax_amount), hash|
hash[number_to_percentage(tax_rate.amount * 100, precision: 1)] =
Spree::Money.new tax_amount, currency: order.currency
end
totals.map do |tax_rate, tax_amount|
{
amount: Spree::Money.new(tax_amount, currency: order.currency),
percentage: number_to_percentage(tax_rate.amount * 100, precision: 1),
rate_amount: tax_rate.amount,
}
end.sort_by { |tax| tax[:rate_amount] }
end
def display_line_item_tax_rates(line_item)

View File

@@ -1,7 +1,5 @@
# frozen_string_literal: true
require 'open_food_network/available_payment_method_filter'
module EnterprisesHelper
def current_distributor
@current_distributor ||= current_order(false)&.distributor
@@ -14,30 +12,11 @@ module EnterprisesHelper
end
def available_shipping_methods
return [] if current_distributor.blank?
shipping_methods = current_distributor.shipping_methods.display_on_checkout.to_a
applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor,
"FilterShippingMethods", current_customer&.tag_list)
applicator.filter!(shipping_methods)
shipping_methods.uniq
OrderAvailableShippingMethods.new(current_order, current_customer).to_a
end
def available_payment_methods
return [] if current_distributor.blank?
payment_methods = current_distributor.payment_methods.available(:both).to_a
filter = OpenFoodNetwork::AvailablePaymentMethodFilter.new
filter.filter!(payment_methods)
applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor,
"FilterPaymentMethods", current_customer&.tag_list)
applicator.filter!(payment_methods)
payment_methods
OrderAvailablePaymentMethods.new(current_order, current_customer).to_a
end
def managed_enterprises

View File

@@ -56,10 +56,6 @@ module OrderCyclesHelper
@simple_index ||= !OpenFoodNetwork::Permissions.new(spree_current_user).can_manage_complex_order_cycles?
end
def order_cycles_simple_form
@order_cycles_simple_form ||= @order_cycle.coordinator.sells == 'own'
end
def pickup_time(order_cycle = current_order_cycle)
order_cycle.exchanges.to_enterprises(current_distributor).outgoing.first.pickup_time
end

View File

@@ -34,6 +34,7 @@ module Spree
link = link_to_with_icon(options[:icon], titleized_label, destination_url)
css_classes << 'tab-with-icon'
else
titleized_label = raw("<span class='text'>#{titleized_label}</span>")
link = link_to(titleized_label, destination_url)
end

View File

@@ -55,7 +55,9 @@ class SubscriptionConfirmJob < ActiveJob::Base
if order.errors.any?
send_failed_payment_email(order)
else
Bugsnag.notify(e, order: order)
Bugsnag.notify(e) do |payload|
payload.add_metadata :order, order
end
send_failed_payment_email(order, e.message)
end
end
@@ -106,6 +108,9 @@ class SubscriptionConfirmJob < ActiveJob::Base
record_and_log_error(:failed_payment, order, error_message)
SubscriptionMailer.failed_payment_email(order).deliver_now
rescue StandardError => e
Bugsnag.notify(e, order: order, error_message: error_message)
Bugsnag.notify(e) do |payload|
payload.add_metadata :order, order
payload.add_metadata :error_message, error_message
end
end
end

View File

@@ -2,16 +2,18 @@
module Spree
class ShipmentMailer < BaseMailer
def shipped_email(shipment, resend = false)
def shipped_email(shipment, delivery:)
@shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment)
subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '') + base_subject
@delivery = delivery
subject = base_subject
mail(to: @shipment.order.email, from: from_address, subject: subject)
end
private
def base_subject
"#{@shipment.order.distributor.name} #{default_i18n_subject} ##{@shipment.order.number}"
default_subject = !@delivery ? t('.picked_up_subject') : default_i18n_subject
"#{@shipment.order.distributor.name} #{default_subject} ##{@shipment.order.number}"
end
end
end

View File

@@ -9,9 +9,9 @@ module PaymentMethodDistributors
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :distributors, join_table: 'distributors_payment_methods',
class_name: 'Enterprise',
foreign_key: 'payment_method_id',
association_foreign_key: 'distributor_id'
has_many :distributor_payment_methods, dependent: :destroy
has_many :distributors, through: :distributor_payment_methods,
class_name: 'Enterprise',
foreign_key: 'distributor_id'
end
end

View File

@@ -6,20 +6,12 @@ module ProductStock
extend ActiveSupport::Concern
def on_demand
if variants?
raise 'Cannot determine product on_demand value of product with multiple variants' if variants.size > 1
raise 'Cannot determine product on_demand value of product with multiple variants' if variants.size > 1
variants.first.on_demand
else
master.on_demand
end
variants.first.on_demand
end
def on_hand
if variants?
variants.map(&:on_hand).reduce(:+)
else
master.on_hand
end
variants.map(&:on_hand).reduce(:+)
end
end

View File

@@ -1,5 +1,12 @@
# frozen_string_literal: true
# A customer record is created the first time a person orders from a shop.
#
# It's a relationship between a user and an enterprise but for guest orders it
# can also be between an email address and an enterprise.
#
# The main purpose is tagging of customers to access private shops, receive
# discounts et cetera. A customer record is also needed for subscriptions.
class Customer < ApplicationRecord
include SetUnusedAddressFields
@@ -7,7 +14,7 @@ class Customer < ApplicationRecord
searchable_attributes :first_name, :last_name, :email, :code
belongs_to :enterprise
belongs_to :enterprise, optional: false
belongs_to :user, class_name: "Spree::User"
has_many :orders, class_name: "Spree::Order"
before_destroy :update_orders_and_delete_canceled_subscriptions
@@ -26,7 +33,6 @@ class Customer < ApplicationRecord
validates :code, uniqueness: { scope: :enterprise_id, allow_nil: true }
validates :email, presence: true, 'valid_email_2/email': true,
uniqueness: { scope: :enterprise_id, message: I18n.t('validation_msg_is_associated_with_an_exising_customer') }
validates :enterprise, presence: true
scope :of, ->(enterprise) { where(enterprise_id: enterprise) }

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class DistributorPaymentMethod < ApplicationRecord
self.table_name = "distributors_payment_methods"
belongs_to :payment_method, class_name: "Spree::PaymentMethod", touch: true
belongs_to :distributor, class_name: "Enterprise", touch: true
end

View File

@@ -6,9 +6,9 @@ class Enterprise < ApplicationRecord
# The next Rails version will have named variants but we need to store them
# ourselves for now.
LOGO_SIZES = {
thumb: { resize_to_limit: [100, 100] },
small: { resize_to_limit: [180, 180] },
medium: { resize_to_limit: [300, 300] },
thumb: { gravity: "Center", resize: "100x100^", crop: '100x100+0+0' },
small: { gravity: "Center", resize: "180x180^", crop: '180x180+0+0' },
medium: { gravity: "Center", resize: "300x300^", crop: '300x300+0+0' },
}.freeze
PROMO_IMAGE_SIZES = {
thumb: { resize_to_limit: [100, 100] },
@@ -56,10 +56,9 @@ class Enterprise < ApplicationRecord
has_many :users, through: :enterprise_roles
belongs_to :owner, class_name: 'Spree::User',
inverse_of: :owned_enterprises
has_and_belongs_to_many :payment_methods, join_table: 'distributors_payment_methods',
class_name: 'Spree::PaymentMethod',
foreign_key: 'distributor_id'
has_many :distributor_payment_methods, foreign_key: :distributor_id
has_many :distributor_shipping_methods, foreign_key: :distributor_id
has_many :payment_methods, through: :distributor_payment_methods
has_many :shipping_methods, through: :distributor_shipping_methods
has_many :customers
has_many :inventory_items
@@ -120,6 +119,7 @@ class Enterprise < ApplicationRecord
joins(:shipping_methods).
joins(:payment_methods).
merge(Spree::PaymentMethod.available).
merge(Spree::ShippingMethod.frontend).
select('DISTINCT enterprises.*')
}
scope :not_ready_for_checkout, lambda {
@@ -196,15 +196,14 @@ class Enterprise < ApplicationRecord
joins(:enterprise_roles).where('enterprise_roles.user_id = ?', user.id)
end
}
scope :relatives_of_one_union_others, lambda { |one, others|
scope :parents_of_one_union_others, lambda { |one, others|
where("
enterprises.id IN
(SELECT child_id FROM enterprise_relationships WHERE enterprise_relationships.parent_id=?)
OR enterprises.id IN
(SELECT parent_id FROM enterprise_relationships WHERE enterprise_relationships.child_id=?)
OR enterprises.id IN
(?)
", one, one, others)
", one, others)
}
def business_address_empty?(attributes)
@@ -259,9 +258,9 @@ class Enterprise < ApplicationRecord
", id, id)
end
def plus_relatives_and_oc_producers(order_cycles)
def plus_parents_and_order_cycle_producers(order_cycles)
oc_producer_ids = Exchange.in_order_cycle(order_cycles).incoming.pluck :sender_id
Enterprise.not_hidden.is_primary_producer.relatives_of_one_union_others(id, oc_producer_ids | [id])
Enterprise.not_hidden.is_primary_producer.parents_of_one_union_others(id, oc_producer_ids | [id])
end
def relatives_including_self
@@ -387,7 +386,7 @@ class Enterprise < ApplicationRecord
end
def ready_for_checkout?
shipping_methods.any? && payment_methods.available.any?
shipping_methods.frontend.any? && payment_methods.available.any?(&:configured?)
end
def self.find_available_permalink(test_permalink)

View File

@@ -22,9 +22,14 @@ class OrderCycle < ApplicationRecord
has_many :suppliers, -> { distinct }, source: :sender, through: :cached_incoming_exchanges
has_many :distributors, -> { distinct }, source: :receiver, through: :cached_outgoing_exchanges
has_many :order_cycle_schedules
has_many :schedules, through: :order_cycle_schedules
has_and_belongs_to_many :selected_distributor_payment_methods,
class_name: 'DistributorPaymentMethod',
join_table: 'order_cycles_distributor_payment_methods'
has_and_belongs_to_many :selected_distributor_shipping_methods,
class_name: 'DistributorShippingMethod',
join_table: 'order_cycles_distributor_shipping_methods'
has_paper_trail meta: { custom_data: proc { |order_cycle| order_cycle.schedule_ids.to_s } }
attr_accessor :incoming_exchanges, :outgoing_exchanges
@@ -150,19 +155,20 @@ class OrderCycle < ApplicationRecord
]
end
def attachable_distributor_payment_methods
DistributorPaymentMethod.joins(:payment_method).
merge(Spree::PaymentMethod.available).
where("distributor_id IN (?)", distributor_ids)
end
def attachable_distributor_shipping_methods
DistributorShippingMethod.joins(:shipping_method).
merge(Spree::ShippingMethod.frontend).
where("distributor_id IN (?)", distributor_ids)
end
def clone!
oc = dup
oc.name = I18n.t("models.order_cycle.cloned_order_cycle_name", order_cycle: oc.name)
oc.orders_open_at = oc.orders_close_at = oc.mails_sent = oc.processed_at = nil
oc.coordinator_fee_ids = coordinator_fee_ids
# rubocop:disable Layout/LineLength
oc.preferred_product_selection_from_coordinator_inventory_only = preferred_product_selection_from_coordinator_inventory_only
# rubocop:enable Layout/LineLength
oc.schedule_ids = schedule_ids
oc.save!
exchanges.each { |e| e.clone!(oc) }
sync_subscriptions
oc.reload
OrderCycleClone.new(self).create
end
def variants
@@ -274,6 +280,34 @@ class OrderCycle < ApplicationRecord
items.each { |li| scoper.scope(li.variant) }
end
def distributor_payment_methods
if simple? || selected_distributor_payment_methods.none?
attachable_distributor_payment_methods
else
attachable_distributor_payment_methods.where(
"distributors_payment_methods.id IN (?) OR distributor_id NOT IN (?)",
selected_distributor_payment_methods.map(&:id),
selected_distributor_payment_methods.map(&:distributor_id)
)
end
end
def distributor_shipping_methods
if simple? || selected_distributor_shipping_methods.none?
attachable_distributor_shipping_methods
else
attachable_distributor_shipping_methods.where(
"distributors_shipping_methods.id IN (?) OR distributor_id NOT IN (?)",
selected_distributor_shipping_methods.map(&:id),
selected_distributor_shipping_methods.map(&:distributor_id)
)
end
end
def simple?
coordinator.sells == 'own'
end
private
def opening?

View File

@@ -299,7 +299,7 @@ module ProductImport
entry.public_send("#{type}_category_id=", index[category])
else
mark_as_invalid(entry, attribute: "#{type}_category",
error: I18n.t('admin.product_import.model.not_found'))
error: I18n.t('admin.product_import.model.category_not_found'))
end
end

View File

@@ -68,7 +68,7 @@ module ProductImport
def invalid_attributes
invalid_attrs = {}
errors = @product_validations ? self.errors.messages.merge(@product_validations.messages) : self.errors.messages
errors = @product_validations ? @product_validations.messages.merge(self.errors.messages) : self.errors.messages
errors.each do |attr, message|
invalid_attrs[attr.to_s] = "#{attr.to_s.capitalize} #{message.first}"
end

View File

@@ -54,7 +54,7 @@ module ProductImport
end
def assign_weight_or_volume_attributes
units = @attrs['units'].to_f
units = @attrs['units'].to_d
unit_type = @attrs['unit_type'].to_s.downcase
return unless valid_unit_type? unit_type

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
class ReportRenderingOptions < ApplicationRecord
belongs_to :user, class_name: "Spree::User"
serialize :options, Hash
end

View File

@@ -99,7 +99,7 @@ module Spree
item.order.changes_allowed?
end
can [:cancel], Spree::Order do |order|
can [:cancel, :bulk_cancel], Spree::Order do |order|
order.user == user
end
@@ -177,6 +177,8 @@ module Spree
end
can [:admin, :create], :manager_invitation
can [:admin, :index], :oidc_setting
end
def add_product_management_abilities(user)
@@ -243,7 +245,9 @@ module Spree
end
def add_order_cycle_management_abilities(user)
can [:admin, :index, :read, :edit, :update, :incoming, :outgoing], OrderCycle do |order_cycle|
can [
:admin, :index, :read, :edit, :update, :incoming, :outgoing, :checkout_options
], OrderCycle do |order_cycle|
OrderCycle.visible_by(user).include? order_cycle
end
can [:admin, :index, :create], Schedule

View File

@@ -29,12 +29,7 @@ module Spree
delegate :name, to: :state, prefix: true, allow_nil: true
def self.default
country = begin
DefaultCountry.country
rescue StandardError
Spree::Country.first
end
new(country: country)
new(country: DefaultCountry.country)
end
def full_name

View File

@@ -6,6 +6,12 @@ module Spree
validates :name, :iso_name, presence: true
def self.cached_find_by(attrs)
Rails.cache.fetch("countries/#{attrs.hash}", expires_in: 1.hour) do
find_by(attrs)
end
end
def <=>(other)
name <=> other.name
end

View File

@@ -28,6 +28,7 @@ module Spree
before_validation :adjust_quantity
before_validation :copy_price
before_validation :copy_tax_category
before_validation :copy_dimensions
validates :variant, presence: true
validates :quantity, numericality: {
@@ -122,6 +123,15 @@ module Spree
self.tax_category = variant.product.tax_category
end
def copy_dimensions
return unless variant
self.weight ||= computed_weight_from_variant
self.height ||= variant.height
self.width ||= variant.width
self.depth ||= variant.depth
end
def amount
price * quantity
end
@@ -226,6 +236,14 @@ module Spree
private
def computed_weight_from_variant
if variant.product.variant_unit == "weight"
variant.unit_value / variant.product.variant_unit_scale
else
variant.weight
end
end
def update_inventory
return unless changed?

View File

@@ -25,7 +25,7 @@ module Spree
order.payment_required?
}
go_to_state :confirmation, if: ->(order) {
Flipper.enabled? :split_checkout, order.created_by
OpenFoodNetwork::FeatureToggle.enabled? :split_checkout, order.created_by
}
go_to_state :complete
end
@@ -311,7 +311,7 @@ module Spree
# Creates new tax charges if there are any applicable rates. If prices already
# include taxes then price adjustments are created instead.
def create_tax_charge!
return if state.in?(["cart", "address", "delivery"]) && Flipper.enabled?(:split_checkout)
return if state.in?(["cart", "address", "delivery"]) && OpenFoodNetwork::FeatureToggle.enabled?(:split_checkout)
clear_legacy_taxes!
@@ -376,10 +376,6 @@ module Spree
payment_state == 'paid' || payment_state == 'credit_owed'
end
def available_payment_methods
@available_payment_methods ||= PaymentMethod.available(:both)
end
# "Checkout" is the initial state and, for card payments, "pending" is the state after auth
# These are both valid states to process the payment
def pending_payments
@@ -540,9 +536,9 @@ module Spree
# And the shipping fee is already up-to-date when this error occurs.
# https://github.com/openfoodfoundation/openfoodnetwork/issues/3924
Bugsnag.notify(e) do |report|
report.add_tab(:order, attributes)
report.add_tab(:shipment, shipment.attributes)
report.add_tab(:shipment_in_db, Spree::Shipment.find_by(id: shipment.id).attributes)
report.add_metadata(:order, attributes)
report.add_metadata(:shipment, shipment.attributes)
report.add_metadata(:shipment_in_db, Spree::Shipment.find_by(id: shipment.id).attributes)
end
end
@@ -704,43 +700,12 @@ module Spree
end
def require_customer?
return false if new_record? || state == 'cart'
true
end
def customer_is_valid?
return true unless require_customer?
customer.present? && customer.enterprise_id == distributor_id && customer.email == email_for_customer
end
def email_for_customer
(user&.email || email)&.downcase
end
def associate_customer
return customer if customer.present?
Customer.of(distributor).find_by(email: email_for_customer)
end
def create_customer
return if customer_is_valid?
Customer.create(
enterprise: distributor,
email: email_for_customer,
user: user,
first_name: bill_address&.first_name.to_s,
last_name: bill_address&.last_name.to_s,
bill_address: bill_address&.clone,
ship_address: ship_address&.clone
)
persisted? && state != "cart"
end
def ensure_customer
self.customer = associate_customer || create_customer
self.customer ||= CustomerSyncer.find_and_update_customer(self)
self.customer ||= CustomerSyncer.create_customer(self) if require_customer?
end
def update_adjustment!(adjustment)

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