Compare commits

...

134 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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]
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
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
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
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
53 changed files with 988 additions and 129 deletions

View File

@@ -8,7 +8,7 @@ on:
pull_request:
env:
DISABLE_KNAPSACK: true
DISABLE_KNAPSACK_PRO: false
TIMEZONE: UTC
COVERAGE: true
RAILS_ENV: test
@@ -17,7 +17,7 @@ permissions:
contents: read
jobs:
rspec:
knapsack_rspec_controllers:
runs-on: ubuntu-20.04
services:
postgres:
@@ -33,19 +33,15 @@ jobs:
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
matrix:
specs:
- "spec/controllers"
- "spec/models"
- "spec/lib"
- "spec/migrations"
- "spec/serializers"
- "spec/system/admin/[a-o0-9]*"
- "spec/system/admin/[p-z]*"
- "spec/system/consumer/[a-o0-9]*"
- "spec/system/consumer/[p-z]*"
- "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@v3
@@ -72,7 +68,161 @@ 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()
@@ -83,7 +233,155 @@ jobs:
retention-days: 7
if-no-files-found: ignore
test-the-rest:
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:
@@ -122,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 rspec --exclude-pattern "./models/**/*_spec.rb, ./controllers/**/*_spec.rb, ./serializers/**/*_spec.rb, ./lib/**/*_spec.rb, ./migrations/**/*_spec.rb, ./system/**/*_spec.rb"

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

@@ -136,6 +136,8 @@ gem 'flipper-ui'
gem "view_component"
gem 'mini_portile2', '~> 2.8'
group :production, :staging do
gem 'ddtrace'
gem 'rack-timeout'
@@ -150,7 +152,7 @@ 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', require: false
gem 'knapsack_pro'
gem 'letter_opener', '>= 1.4.1'
gem 'rspec-rails', ">= 3.5.2"
gem 'rspec-retry', require: false

View File

@@ -158,16 +158,16 @@ GEM
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.651.0)
aws-sdk-core (3.166.0)
aws-partitions (1.669.0)
aws-sdk-core (3.168.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.59.0)
aws-sdk-kms (1.60.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.117.1)
aws-sdk-s3 (1.117.2)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
@@ -177,12 +177,12 @@ GEM
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)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (7.0.3)
bullet (7.0.4)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cable_ready (5.0.0.pre9)
@@ -353,7 +353,7 @@ GEM
ipaddress (0.8.3)
irb (1.4.2)
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)
@@ -375,7 +375,7 @@ GEM
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.5.0)
knapsack (4.0.0)
knapsack_pro (3.4.2)
rake
launchy (2.5.0)
addressable (~> 2.7)
@@ -409,7 +409,7 @@ GEM
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)
@@ -545,7 +545,7 @@ GEM
ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.8.0)
regexp_parser (2.6.0)
regexp_parser (2.6.1)
reline (0.3.1)
io-console (~> 0.5)
request_store (1.5.0)
@@ -589,14 +589,14 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.3)
rswag-api (2.7.0)
rswag-api (2.8.0)
railties (>= 3.1, < 7.1)
rswag-specs (2.8.0)
activesupport (>= 3.1, < 7.1)
json-schema (>= 2.2, < 4.0)
railties (>= 3.1, < 7.1)
rspec-core (>= 2.14)
rswag-ui (2.7.0)
rswag-ui (2.8.0)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.39.0)
@@ -611,7 +611,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
rubocop-rails (2.17.2)
rubocop-rails (2.17.3)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
@@ -682,7 +682,7 @@ GEM
railties (>= 5.2)
redis
stringex (2.8.5)
stripe (7.1.0)
stripe (8.0.0)
swd (1.3.0)
activesupport (>= 3)
attr_required (>= 0.0.5)
@@ -694,7 +694,7 @@ GEM
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)
@@ -711,7 +711,7 @@ GEM
activemodel (>= 3.0.0)
public_suffix
vcr (6.1.0)
view_component (2.76.0)
view_component (2.78.0)
activesupport (>= 5.0.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
@@ -744,7 +744,7 @@ 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)
@@ -818,11 +818,12 @@ 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)

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

@@ -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

@@ -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] },

View File

@@ -102,7 +102,6 @@
= af.label :latitude, t(:latitude)
\/
= af.label :longitude, t(:longitude)
%span.required *
%div{'ofn-with-tip' => t('latitude_longitude_tip')}
%a= t('admin.whats_this')
.four.columns

View File

@@ -41,7 +41,6 @@
= af.label :latitude, t(:latitude)
\/
= af.label :longitude, t(:longitude)
%span.required *
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('latitude_longitude_tip')}
.four.columns
= af.text_field :latitude, { placeholder: t(:latitude_placeholder) }

View File

@@ -4,7 +4,8 @@
%br
100 x 100 pixels
.omega.eight.columns
%img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.medium }}', if: 'Enterprise.logo' } }
%img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.thumb }}', if: 'Enterprise.logo' } }
%br
= f.file_field :logo
%a.button.red{ href: '', ng: {click: 'removeLogo()', if: 'Enterprise.logo'} }
= t('.remove_logo')

View File

@@ -4,7 +4,7 @@
.row.date-range-filter
.alpha.two.columns= label_tag nil, t(:date_range)
.omega.fourteen.columns
= f.text_field "#{field}_gt", :class => 'datetimepicker datepicker-from', :placeholder => t(:start), data: { controller: "flatpickr", "flatpickr-enable-time-value": true }
= f.text_field "#{field}_gt", :class => 'datetimepicker datepicker-from', :placeholder => t(:start), data: { controller: "flatpickr", "flatpickr-enable-time-value": true, "flatpickr-default-date-value": "startOfDay" }
%span.range-divider
%i.icon-arrow-right
= f.text_field "#{field}_lt", :class => 'datetimepicker datepicker-to', :placeholder => t(:stop), data: { controller: "flatpickr", "flatpickr-enable-time-value": true }
= f.text_field "#{field}_lt", :class => 'datetimepicker datepicker-to', :placeholder => t(:stop), data: { controller: "flatpickr", "flatpickr-enable-time-value": true, "flatpickr-default-date-value": "endOfDay" }

View File

@@ -1 +1,5 @@
= render 'admin/reports/date_range_form', f: f
.row
.alpha.two.columns= label_tag nil, t(:report_hubs)
.omega.fourteen.columns= f.collection_select(:distributor_id_in, @data.orders_distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true})

View File

@@ -2,7 +2,7 @@
%a{"ng-click" => "triggerProductModal()"}
%span.product-thumb__bulk-label{"ng-if" => "::product.group_buy"}
= t(".bulk")
%img{"ng-src" => "{{::product.primaryImageOrMissing}}", loading: "lazy"}
%img{"ng-src" => "{{::product.primaryImageOrMissing}}"}
.summary
.summary-header

View File

@@ -54,6 +54,6 @@
.actions.filter-actions
%a.button.icon-search{'ng-click' => 'fetchResults()'}
= t(:filter_results)
%a.button{'ng-click' => 'clearFilters()', "id": "clear_filters_button"}
%a.button{'ng-click' => 'clearFilters()', "id": "clear_filters_button", "class": ("secondary" if feature?(:admin_style_v2, spree_current_user)) }
= t(:clear_filters)

View File

@@ -95,17 +95,17 @@
%td.align-center
%span{'ng-bind-html' => 'order.display_total'}
%td.actions
%div.row-loading-icons
%div{ng: {show: 'rowStatus[order.id] == "loading"', cloak: true}, style: "width: 30px; height: 30px;"}
= render partial: "components/spinner"
%i.success.icon-ok-sign{ng: {show: 'rowStatus[order.id] == "success"'} }
%i.error.icon-remove-sign.with-tip{ng: {show: 'rowStatus[order.id] == "error"'}, 'ofn-with-tip' => t('.order_not_updated')}
%a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')}
%div{'ng-if' => 'order.ready_to_ship'}
%button.icon-road.icon_link.with-tip.no-text{'ng-click' => 'shipOrder(order)', rel: 'nofollow', 'ofn-with-tip' => t('.ship')}
%div{'ng-if' => 'order.ready_to_capture'}
%button.icon-capture.icon_link.no-text{'ng-click' => 'capturePayment(order)', rel: 'nofollow', 'ofn-with-tip' => t('.capture')}
.flex
%div.row-loading-icons
%div{ng: {show: 'rowStatus[order.id] == "loading"', cloak: true}, style: "width: 30px; height: 30px;"}
= render partial: "components/spinner"
%i.success.icon-ok-sign{ng: {show: 'rowStatus[order.id] == "success"'} }
%i.error.icon-remove-sign.with-tip{ng: {show: 'rowStatus[order.id] == "error"'}, 'ofn-with-tip' => t('.order_not_updated')}
%a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')}
%div{'ng-if' => 'order.ready_to_ship'}
%button.icon-road.icon_link.with-tip.no-text{'ng-click' => 'shipOrder(order)', rel: 'nofollow', 'ofn-with-tip' => t('.ship')}
%div{'ng-if' => 'order.ready_to_capture'}
%button.icon-capture.icon_link.no-text{'ng-click' => 'capturePayment(order)', rel: 'nofollow', 'ofn-with-tip' => t('.capture')}
.sixteen.columns.alpha#loading{ 'ng-show' => 'RequestMonitor.loading' }
= render partial: "components/admin_spinner"
%h1

View File

@@ -10,7 +10,7 @@
= t(controller.controller_name, :default => controller.controller_name.titleize)
= " - OFN #{t(:administration)}"
%link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}
%link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,700&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}
= stylesheet_pack_tag 'admin-styles', media: "screen, print"
= render "layouts/bugsnag_js"

View File

@@ -3,7 +3,7 @@
%head{"data-hook" => "admin_inside_head"}
= render :partial => 'spree/admin/shared/head'
%body.admin
%body.admin{ "class": ("admin-v2" if feature?(:admin_style_v2, spree_current_user)) }
- if content_for?(:main_ng_app_name)
- if content_for?(:main_ng_ctrl_name)
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe, "ng-controller" => yield(:main_ng_ctrl_name).strip.html_safe }

View File

@@ -1,21 +1,31 @@
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["reportType", "checkbox", "label"]
static targets = ["reportType", "checkbox", "label"];
handleSelectChange() {
this.reportTypeTarget.value == "csv" ? this.disableField() : this.enableField()
this.reportTypeTarget.value == "csv"
? this.disableField()
: this.enableField();
}
disableField() {
this.checkboxTarget.checked = false;
this.checkboxTarget.disabled = true;
this.labelTarget.classList.add("disabled");
if (this.hasCheckboxTarget) {
this.checkboxTarget.checked = false;
this.checkboxTarget.disabled = true;
}
if (this.hasLabelTarget) {
this.labelTarget.classList.add("disabled");
}
}
enableField() {
this.checkboxTarget.checked = true;
this.checkboxTarget.disabled = false;
this.labelTarget.classList.remove("disabled");
if (this.hasCheckboxTarget) {
this.checkboxTarget.checked = true;
this.checkboxTarget.disabled = false;
}
if (this.hasLabelTarget) {
this.labelTarget.classList.remove("disabled");
}
}
}

View File

@@ -17,7 +17,10 @@ import ShortcutButtonsPlugin from "shortcut-buttons-flatpickr";
import labelPlugin from "flatpickr/dist/plugins/labelPlugin/labelPlugin";
export default class extends Flatpickr {
static values = { enableTime: Boolean, mode: String };
/*
* defaultDate (optional): "startOfDay" | "endOfDay"
*/
static values = { enableTime: Boolean, mode: String, defaultDate: String };
static targets = ["start", "end"];
locales = {
ar: ar,
@@ -60,6 +63,9 @@ export default class extends Flatpickr {
open() {
this.fp.element.dispatchEvent(new Event("focus"));
if (!this.fp.selectedDates.length) {
this.setDefaultDateValue();
}
}
onChangeEvent(e) {
if (
@@ -136,4 +142,16 @@ export default class extends Flatpickr {
break;
}
};
setDefaultDateValue() {
if (this.defaultDateValue === "startOfDay") {
this.fp.setDate(moment().startOf("day").format());
} else if (this.defaultDateValue === "endOfDay") {
/*
* We use "startOf('day')" of tomorrow in order to not lose
* the records between [23:59:00 ~ 23:59:59] of today
*/
this.fp.setDate(moment().add(1, "days").startOf("day").format());
}
}
}

View File

@@ -120,3 +120,5 @@
@import "components/tom_select";
@import 'app/components/help_modal_component/help_modal_component';
@import "v2/main.scss";

View File

@@ -78,7 +78,6 @@ nav.menu {
text-transform: uppercase;
position: relative;
text-align: center;
font-weight: 600;
i {
display: inline;

View File

@@ -0,0 +1,66 @@
/* Overide buttons.scss app/webpacker/css/admin/components/buttons.scss */
@mixin backgroundAndBorder($color) {
background-color: $color;
border: 2px solid $color;
}
input[type="submit"],
select[type="submit"],
.select2-container-multi [type="submit"].select2-choices,
input[type="button"],
select[type="button"],
.select2-container-multi [type="button"].select2-choices,
button,
.button,
.actions a:not([class*="icon-"]),
.admin__section-header .ofn-drop-down // Same behavior as the button
{
&.disabled,
&[disabled] {
@include backgroundAndBorder($v2-light-grey);
}
&:not(.disabled):not([disabled]):not(.secondary) {
// Change the color of the button only if it's not disabled
@include backgroundAndBorder($v2-blue-light);
&:hover {
@include backgroundAndBorder($v2-blue);
box-shadow: $v2-box-shadow;
}
}
&.secondary {
background-color: $white;
border: 2px solid $v2-blue-light;
color: $v2-blue-light;
&:hover {
background-color: $v2-blue-lightest;
color: $v2-blue;
box-shadow: $v2-box-shadow;
}
}
&.active {
@include backgroundAndBorder($v2-blue);
}
}
#table-filter .actions {
/* used to draw a line on the right and left of the actions buttons
We can then remove the dropshadow on the buttons */
&:before,
&:after {
background-color: $v2-light-grey; // same color as the border of the fieldset. see forms.scss
height: 1px;
content: attr(data-initials);
flex-grow: 1; // make the line as long as it can
}
}
#table-filter fieldset:has(.actions) {
// do not apply border to filter actions as it's drawn by the #table-filter .actions before and after pseudo elements
border-bottom: 0;
}

View File

@@ -0,0 +1,9 @@
/* Overide app/webpacker/css/admin/components/progress.scss file */
#progress {
background-color: $v2-blue;
}
#loading {
color: $v2-blue;
}

View File

@@ -0,0 +1,73 @@
/* Overide tables.scss app/webpacker/css/admin/components/tables.scss */
table thead th {
background-color: $v2-medium-light-grey;
border: none;
color: $v2-blue;
text-transform: capitalize;
font-size: 13px;
a {
border: none;
color: $v2-blue;
}
}
table tbody tr {
&:first-child th,
&:first-child td {
border-top: none; // Don't show the top border of the first row
}
td:not(:first-child) {
border-left: none; // Only show left border on the first cells, as it indicates the order state by its color
}
td {
border-bottom: none; // By default, do not show the border of the cells
border-right: none;
border-top: none;
border-bottom: 2px solid $v2-medium-light-grey;
&.actions {
border-bottom: 2px solid $v2-medium-light-grey !important; // needs to be important because of already defined with important
}
> .flex {
display: flex;
column-gap: 10px;
}
}
&.even,
&.odd {
td {
background-color: transparent; // Do not use odd and even colors for background
}
}
}
table th.actions,
table td.actions {
// Special for icons in the actions column
[class*="icon-"].no-text {
border: 2px solid $v2-blue-light;
background-color: $v2-blue-lightest;
&:hover {
border-color: $v2-blue;
background-color: $v2-blue-light;
box-shadow: $v2-box-shadow;
&:before {
color: white;
}
}
}
}
table#listing_orders td {
// When the table is the listing of orders, we need to increase the height of the cells
padding: 20px 0;
&.actions {
padding-left: 20px;
}
}

View File

@@ -0,0 +1,13 @@
@import "variables.scss";
@import "shared/typography.scss";
body.admin.admin-v2 {
@import "navigation.scss";
@import "plugins/select2.scss";
@import "plugins/powertip.scss";
@import "plugins/flatpickr-customization.scss";
@import "shared/forms.scss";
@import "components/buttons.scss";
@import "components/tables.scss";
@import "components/progress.scss";
}

View File

@@ -0,0 +1,62 @@
#header {
#login-nav {
li {
color: $v2-medium-dark-grey;
i {
@include v2-link-color();
}
}
}
}
#admin-menu {
background-color: $v2-orange;
li a span.text {
font-weight: 700;
}
li.tab-with-icon a:before {
display: none;
}
li a:hover,
li.selected a {
background-color: $v2-orange-light;
span {
text-shadow: 1px 1px 9px $v2-orange;
}
&:after {
display: none;
}
}
}
#sub-menu {
background-color: $v2-orange-light;
li a {
font-size: 100%;
}
li a:hover,
li.selected a {
text-shadow: 1px 1px 9px $v2-orange;
background-color: lighten($v2-orange-light, 7%);
&:after {
display: none;
}
}
}
.admin__section-header {
background-color: transparent;
border-bottom: none;
h1.js-admin-page-title {
color: $v2-medium-dark-grey;
}
}

View File

@@ -0,0 +1,46 @@
/* Override flatpickr styles: app/webpacker/css/admin/plugins/flatpickr-customization.scss */
.flatpickr-calendar {
&.arrowTop::after {
border-bottom-color: $v2-blue-light;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
background: $v2-blue-light;
color: white;
input {
color: white;
}
}
.flatpickr-weekdays {
background: $v2-blue-light;
.flatpickr-weekday {
background: $v2-blue-light;
color: white;
}
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
background: $v2-blue-light;
border-color: $v2-blue-light;
}
}

View File

@@ -0,0 +1,31 @@
/* Overide file powertip.scss app/webpacker/css/admin/v2/plugins/powertip.scss */
#powerTip {
background-color: $v2-blue;
&.n:before,
&.ne:before,
&.nw:before {
border-top-color: $v2-blue;
}
&.e:before {
border-right-color: $v2-blue;
}
&.s:before,
&.se:before,
&.sw:before {
border-bottom-color: $v2-blue;
}
&.w:before {
border-left-color: $v2-blue;
}
&.ne:before,
&.se:before {
border-right-color: $v2-blue;
}
&.nw:before,
&.sw:before {
border-right-color: $v2-blue;
}
}

View File

@@ -0,0 +1,70 @@
/* Override select2 styles app/webpacker/css/admin/plugins/select2.scss */
.select2-container {
.select2-choice {
background-color: transparent;
border: 1px solid $v2-light-grey !important;
color: $v2-medium-grey !important;
padding-left: 5px;
font-size: 13px;
padding-top: 3px;
.select2-arrow {
color: $v2-medium-grey;
}
}
&.select2-container-active,
&:hover {
.select2-choice {
background-color: transparent !important;
border-color: $v2-medium-grey !important;
}
}
&.select2-dropdown-open.select2-container-active {
&:not(.select2-drop-above) {
.select2-choice {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
&.select2-drop-above .select.select2-choice {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
}
.select2-container-multi {
.select2-choices {
border-color: $v2-medium-grey !important;
.select2-search-choice {
background-color: $v2-blue-light;
}
}
}
.select2-drop {
border-color: $v2-medium-grey;
}
.select2-search {
color: $v2-medium-grey;
}
.select2-results {
margin-right: 0;
li {
.select2-result-label {
color: $v2-medium-grey;
}
&.select2-highlighted {
background-color: $v2-blue;
}
&.select2-no-results,
&.select2-searching {
color: $v2-medium-grey;
}
}
}

View File

@@ -0,0 +1,55 @@
/* Overide forms.scss app/webpacker/css/admin/shared/forms.scss */
input[type="text"],
.select2-container-multi .select2-choices,
.select2-search input,
.select2-search select,
select,
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime"],
input[type="time"],
input[type="number"],
textarea,
fieldset {
// Change the color of all inputs
color: $v2-medium-grey;
border-color: $v2-light-grey !important;
&:focus {
border-color: $v2-medium-grey;
}
}
fieldset label {
color: $v2-medium-grey;
}
fieldset legend {
color: $v2-blue;
}
input[type="checkbox"],
input[type="radio"] {
accent-color: $v2-blue;
}
fieldset .filter-actions {
button,
.button,
input[type="submit"] {
box-shadow: none;
width: 200px; // adjust at the same size in order to center them. Not ideal but works for now.
&:first-of-type {
margin-right: 0; // don't see any reason to have a margin right on the first button as it's managed by the flexbox
}
&:hover {
box-shadow: $v2-box-shadow;
}
}
}

View File

@@ -0,0 +1,18 @@
// Overide app/webpacker/css/admin/shared/typography.scss
@mixin v2-link-color() {
color: $v2-blue;
border-color: $v2-blue;
&:hover {
color: $v2-blue-dark;
border-color: $v2-blue-dark;
}
}
body.admin.admin-v2 {
color: $v2-body-grey;
a:not(.button) {
@include v2-link-color();
}
}

View File

@@ -0,0 +1,23 @@
// Should finally replace (or at least complete) the file /admin/globale/variables.scss
$v2-orange: #f27052;
$v2-orange-light: #f5947d;
$v2-orange-lighter: #f8b7a8;
$v2-orange-lightest: #fcdbd4;
$v2-dark-grey: #333333;
$v2-medium-dark-grey: #444444;
$v2-body-grey: #666666;
$v2-medium-grey: #717171;
$v2-medium-light-grey: #e6e6e6;
$v2-light-grey: #e7e7e7;
$v2-blue: #017a9a;
$v2-blue-dark: #005e7a;
$v2-blue-light: #0096ad;
$v2-blue-lightest: #e6f7fa; // Could be used as a background color for the action icons
$v2-green: #019854;
$v2-green-light: #01cb70;
$v2-box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); // Default box shadow for actions stuff

13
bin/knapsack_pro_rspec Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC" = "" ]; then
KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=disabled-for-fork \
KNAPSACK_PRO_MAX_REQUEST_RETRIES=0 \
bundle exec rake knapsack_pro:rspec # use Regular Mode here always
else
# Regular Mode
bundle exec rake knapsack_pro:rspec
# or you can use Queue Mode instead of Regular Mode if you like
# bundle exec rake knapsack_pro:queue:rspec
fi

View File

@@ -155,15 +155,17 @@ module Openfoodnetwork
initializer "ofn.reports" do |app|
module ::Reporting; end
loader = Zeitwerk::Loader.new
loader.push_dir("#{Rails.root}/lib/reporting", namespace: ::Reporting)
loader.enable_reloading
loader.setup
loader.eager_load
Rails.application.reloader.to_prepare do
loader = Zeitwerk::Loader.new
loader.push_dir("#{Rails.root}/lib/reporting", namespace: ::Reporting)
loader.enable_reloading
loader.setup
loader.eager_load
if Rails.env.development?
require 'listen'
Listen.to("lib/reporting") { loader.reload }.start
if Rails.env.development?
require 'listen'
Listen.to("lib/reporting") { loader.reload }.start
end
end
end
@@ -247,5 +249,7 @@ module Openfoodnetwork
config.active_storage.variable_content_types += ["image/svg+xml"]
config.exceptions_app = self.routes
config.autoloader = :zeitwerk
end
end

View File

@@ -627,6 +627,7 @@ de_DE:
conditional_blank: Darf nicht leer sein, wenn das Feld 'unit_type' leer ist.
no_product: Es konnten keine passenden Produkte in der Datenbank gefunden werden.
not_found: Konnte nicht in der Datenbank gefunden werden.
category_not_found: stimmt nicht mit den verfügbaren Kategorien überein. Diese finden Sie auf der Seite zum Produktimport. Überprüfen Sie zusätzlich Ihre Angaben auf Tippfehler.
not_updatable: Kann über den Produktimport nicht auf bestehende Produkte aktualisiert werden.
blank: darf nicht leer sein
products_no_permission: Sie sind nicht berechtigt, Produkte dieses Unternehmens zu verwalten.

View File

@@ -30,6 +30,7 @@ en_CA:
shipping_category_id: "Shipping Category"
variant_unit: "Variant Unit"
variant_unit_name: "Variant Unit Name"
unit_value: "Unit value"
spree/credit_card:
base: "Credit Card"
number: "Number"
@@ -626,6 +627,7 @@ en_CA:
conditional_blank: can't be blank if unit_type is blank
no_product: did not match any products in the database
not_found: not found in database
category_not_found: doesn't match allowed categories. See the correct categories to choose from on the product import page, or check that there's no misspelling.
not_updatable: cannot be updated on existing products via product import
blank: can't be blank
products_no_permission: you do not have permission to manage products for this enterprise
@@ -882,7 +884,7 @@ en_CA:
name: Name
name_placeholder: eg. Professor Plum's Biodynamic Truffles
groups: Groups
groups_tip: Select any markets or groups that you are a member of. This will help customers find your enterprise.
groups_tip: Select any markets, networks or groups that you are a member of. This will help customers find your enterprise.
groups_placeholder: Start typing to search available markets or groups...
primary_producer: Primary Producer?
primary_producer_tip: Select 'Producer' if you are a primary producer, grower, maker or designer
@@ -1579,7 +1581,7 @@ en_CA:
menu_2_url: "/map"
menu_3_title: "Producers"
menu_3_url: "/producers"
menu_4_title: "Markets"
menu_4_title: "Networks"
menu_4_url: "/groups"
menu_5_title: "About"
menu_5_url: "https://about.openfoodnetwork.ca"
@@ -1641,7 +1643,7 @@ en_CA:
label_map: "Map"
label_producer: "Producer"
label_producers: "Producers"
label_groups: "Markets"
label_groups: "Networks"
label_about: "About"
label_blog: "Blog"
label_support: "Support"
@@ -1980,7 +1982,7 @@ en_CA:
shopping_tabs_about: "About"
shopping_tabs_producers: "Producers"
shopping_tabs_contact: "Contact"
shopping_tabs_groups: "Markets"
shopping_tabs_groups: "Networks"
shopping_contact_address: "Address"
shopping_contact_web: "Contact"
shopping_contact_social: "Follow"
@@ -2045,14 +2047,14 @@ en_CA:
components_profiles_show: "Show profiles"
components_filters_nofilters: "No filters"
components_filters_clearfilters: "Clear all filters"
groups_title: Markets
groups_headline: 'Markets / Regions '
groups_text: "Markets are collectives of producers, hubs and distributors who share something in common like location, farmers market or philosophy. This makes your shopping experience easier. So explore our groups and have the curating done for you."
groups_title: Networks
groups_headline: 'Networks / Regions '
groups_text: "Networks are collectives of producers, hubs and distributors who share something in common like location, farmers market or philosophy. This makes your shopping experience easier. So explore our networks and have the curating done for you."
groups_search: "Search name or keyword"
groups_no_groups: "No groups found"
groups_about: "About Us"
groups_producers: "Our vendors"
groups_hubs: "Go Shopping!"
groups_producers: "Members"
groups_hubs: "Go Shopping"
groups_contact_web: Contact
groups_contact_social: Follow
groups_contact_address: Address

View File

@@ -627,6 +627,7 @@ en_FR:
conditional_blank: can't be blank if unit_type is blank
no_product: did not match any products in the database
not_found: not found in database
category_not_found: doesn't match allowed categories. See the correct categories to choose from on the product import page, or check that there's no misspelling.
not_updatable: cannot be updated on existing products via product import
blank: can't be blank
products_no_permission: you do not have permission to manage products for this enterprise

View File

@@ -627,6 +627,7 @@ fr:
conditional_blank: ne peut pas être vide si unit_type est vide
no_product: n'a pu être associé à aucun produit existant dans la base de données
not_found: non trouvé dans le base de données
category_not_found: n'est pas conforme aux catégories utilisées. Merci de modifier les catégories en utilisant celles listées sur la page d'import ou vérifier qu'il n'y ait pas de faute de frappe ou d'espace à fin du mot.
not_updatable: ne peut pas être mis à jour pour des produits existants via la fonctionnalité d'import de fichier produits
blank: Champ obligatoire
products_no_permission: vous n'avez pas l'autorisation de gérer les produits de cette entreprise
@@ -1805,7 +1806,7 @@ fr:
label: Ville
placeholder: ex. Metz
state_id:
label: Statut
label: Département
zipcode:
label: Code postal
placeholder: ex. 57000
@@ -3026,7 +3027,7 @@ fr:
inventory_tagged_bottom: "sont:"
new_tag_rule_dialog:
select_rule_type: "Choisir le type de règle:"
add_rule: "Ajouter une règle"
add_rule: "Valider"
enterprise_fees:
inherit_from_product: "Hériter du produit"
orders:

View File

@@ -30,6 +30,7 @@ fr_CA:
shipping_category_id: "Condition de transport"
variant_unit: "Unité"
variant_unit_name: "Unité de la variante"
unit_value: "Nb unités"
spree/credit_card:
base: "Carte de crédit"
number: "N° commande"
@@ -627,6 +628,7 @@ fr_CA:
conditional_blank: Champ obligatoire si le type d'unité est vide
no_product: 'aucun produit trouvé '
not_found: n'a pas été trouvé dans la base de donnée
category_not_found: n'est pas conforme aux catégories utilisées. Merci de modifier les catégories en utilisant celles listées sur la page d'import ou vérifier qu'il n'y ait pas de faute de frappe ou d'espace à fin du mot.
not_updatable: ne peut pas être mis à jour pour des produits existants via la fonctionnalité d'import de fichier produits
blank: Champ obligatoire
products_no_permission: vous n'avez pas les droits requis pour gérer les produits de cette entreprise

View File

@@ -628,6 +628,7 @@ ru:
conditional_blank: не может быть пустым, если unit_type пуст
no_product: не найдено ни одного товара в базе данных
not_found: не найден в базе данных
category_not_found: не соответствует разрешенным категориям. Посмотрите, какие категории выбрать на странице импорта продуктов, или проверьте, нет ли орфографических ошибок.
not_updatable: невозможно обновить существующие товары с помощью импорта товаров
blank: не может быть пустым
products_no_permission: у Вас нет разрешения на управление товарами этого предприятия
@@ -1990,7 +1991,7 @@ ru:
shopping_contact_social: "Следовать"
shopping_groups_part_of: "часть:"
shopping_producers_of_hub: "%{hub} производители:"
enterprises_next_closing: "Закрытие заказа через"
enterprises_next_closing: "Закрытие заказа"
enterprises_currently_open: "Заказы открыты"
enterprises_ready_for: "Готов к"
enterprises_choose: "Выберите, когда вы хотите свой заказ:"

View File

@@ -13,7 +13,6 @@
ActiveRecord::Schema.define(version: 2022_10_07_105052) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "plpgsql"
create_table "active_storage_attachments", force: :cascade do |t|

View File

@@ -43,6 +43,10 @@ module Reporting
proc { |line_items| line_items.first.variant.full_name }
end
def variant_sku
proc { |line_items| line_items.first.variant.sku }
end
def supplier_name
proc { |line_items| line_items.first.variant.product.supplier.name }
end

View File

@@ -12,7 +12,8 @@ module Reporting
quantity: proc { |line_items| line_items.sum(&:quantity) },
total_units: proc { |line_items| total_units(line_items) },
curr_cost_per_unit: proc { |line_items| line_items.first.price },
total_cost: proc { |line_items| line_items.sum(&:amount) }
total_cost: proc { |line_items| line_items.sum(&:amount) },
sku: variant_sku
}
end
@@ -41,6 +42,10 @@ module Reporting
[e.variant_id, e.price]
}.values
end
def default_params
super.merge({ fields_to_hide: ["sku"] })
end
end
end
end

View File

@@ -24,12 +24,15 @@ Shoulda::Matchers.configure do |config|
end
end
require 'knapsack_pro'
KnapsackPro::Adapters::RSpecAdapter.bind
# Allow connections to selenium whilst raising errors when connecting to external sites
require 'webmock/rspec'
WebMock.enable!
WebMock.disable_net_connect!(
allow_localhost: true,
allow: 'chromedriver.storage.googleapis.com'
allow: ['chromedriver.storage.googleapis.com', 'api.knapsackpro.com']
)
# Requires supporting ruby files with custom matchers and macros, etc,

View File

@@ -25,6 +25,7 @@ module Reporting
context 'with completed order' do
let(:bill_address) { create(:address) }
let(:distributor) { create(:distributor_enterprise) }
let(:distributor1) { create(:distributor_enterprise) }
let(:product) { create(:product) }
let(:shipping_method) { create(:shipping_method) }
let(:shipping_instructions) { 'pick up on thursday please!' }
@@ -82,6 +83,26 @@ module Reporting
table = subject.table_rows
expect(table.size).to eq 2
end
context "filtering by distributor" do
it do
create(:line_item_with_shipment, order: order)
report1 = Base.new(create(:admin_user), {})
table = report1.table_rows
expect(table.size).to eq 2
report2 = Base.new(create(:admin_user),
{ q: { distributor_id_in: [distributor.id] } })
table2 = report2.table_rows
expect(table2.size).to eq 2
report3 = Base.new(create(:admin_user),
{ q: { distributor_id_in: [distributor1.id] } })
table3 = report3.table_rows
expect(table3.size).to eq 0
end
end
end
end
end

View File

@@ -18,6 +18,10 @@ module Reporting
OrderCycleSupplierTotals.new(current_user, params)
end
let(:table_headers) do
report.table_headers
end
let(:report_table) do
report.table_rows
end
@@ -31,6 +35,15 @@ module Reporting
supplier_name_field = report_table.first[0]
expect(supplier_name_field).to eq supplier.name
end
it "includes sku column" do
variant_sku = order.line_items.first.variant.sku
last_column_title = table_headers.last
first_row_last_column_value = report_table.first.last
expect(last_column_title).to eq "SKU"
expect(first_row_last_column_value).to eq variant_sku
end
end
end
end

View File

@@ -88,8 +88,8 @@ describe Spree::Payment do
before do
allow(payment).to receive(:record_response)
allow(card).to receive(:has_payment_profile?).and_return(true)
payment.stub(:update_order)
payment.stub(:create_payment_profile)
allow(payment).to receive(:update_order).and_return(true)
allow(payment).to receive(:create_payment_profile).and_return(true)
end
context "#process!" do

View File

@@ -5,14 +5,6 @@ require 'base_spec_helper'
require 'database_cleaner'
require 'view_component/test_helpers'
# This spec_helper.rb is being used by the custom engines in engines/. The engines are not set up to
# use Knapsack, and this provides the option to disable it when running the tests in CI services.
unless ENV['DISABLE_KNAPSACK']
require 'knapsack'
Knapsack.tracker.config(enable_time_offset_warning: false) unless ENV['CI']
Knapsack::Adapters::RSpecAdapter.bind
end
Capybara.javascript_driver = :chrome
Capybara.default_max_wait_time = 30
Capybara.disable_animation = true

View File

@@ -32,5 +32,6 @@ module AuthenticationHelper
def expect_logged_in
# Ensure page has been reloaded after submitting login form
expect(page).to_not have_selector ".menu #login-link"
expect(page).to_not have_content "Login"
end
end

View File

@@ -9,4 +9,5 @@ VCR.configure do |config|
config.configure_rspec_metadata!
config.filter_sensitive_data('<HIDDEN_KEY>') { ENV['STRIPE_SECRET_TEST_API_KEY'] }
config.filter_sensitive_data('<HIDDEN_CUSTOMER>') { ENV['STRIPE_CUSTOMER'] }
config.ignore_hosts('localhost', '127.0.0.1', '0.0.0.0', 'api.knapsackpro.com')
end

View File

@@ -5,7 +5,7 @@ require 'system_helper'
describe '
As an administrator
I want to create/update complex order cycles with a specific time
', js: true do
' do
include AdminHelper
include AuthenticationHelper
include WebHelper
@@ -49,7 +49,7 @@ describe '
payment_method_ii.update!(name: "Cash")
end
it "creating an order cycle with full interface", js: true do
it "creating an order cycle with full interface", retry: 3 do
## CREATE
login_as_admin_and_visit admin_order_cycles_path
click_link 'New Order Cycle'

View File

@@ -16,7 +16,7 @@ module CupriteHelpers
# Use our `Capybara.save_path` to store screenshots with other capybara artifacts
# (Rails screenshots path is not configurable https://github.com/rails/rails/blob/49baf092439fc74fc3377b12e3334c3dd9d0752f/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L79)
def absolute_image_path
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name}.png")
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name.parameterize}.png")
end
# Make failure screenshots compatible with multi-session setup.

View File

@@ -1679,9 +1679,9 @@
integrity sha512-Skfy0YS3NJ5nV9us0uuPN0HDk1Q4edljaOhRBJGDWs9EBa7ZVMYBHRFlhLvvmwEoaIM9BlH6QJFn9/uZg0bACg==
"@floating-ui/dom@^1.0.1":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.6.tgz#e42393ec381a4fe96673fbcee137a95e86c93ebc"
integrity sha512-kt/tg1oip9OAH1xjCTcx1OpcUpu9rjDw3GKJ/rEhUqhO7QyJWfrHU0DpLTNsH67+JyFL5Kv9X1utsXwKFVtyEQ==
version "1.0.7"
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.7.tgz#9e8e6615ce03e5ebc6a4ae879640a199a366f86d"
integrity sha512-6RsqvCYe0AYWtsGvuWqCm7mZytnXAZCjWtsWu1Kg8dI3INvj/DbKlDsZO+mKSaQdPT12uxIW9W2dAWJkPx4Y5g==
dependencies:
"@floating-ui/core" "^1.0.2"
@@ -1690,10 +1690,10 @@
resolved "https://registry.yarnpkg.com/@hotwired/stimulus-webpack-helpers/-/stimulus-webpack-helpers-1.0.1.tgz#4cd74487adeca576c9865ac2b9fe5cb20cef16dd"
integrity sha512-wa/zupVG0eWxRYJjC1IiPBdt3Lruv0RqGN+/DTMmUWUyMAEB27KXmVY6a8YpUVTM7QwVuaLNGW4EqDgrS2upXQ==
"@hotwired/stimulus@>= 3.0", "@hotwired/stimulus@^3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.1.1.tgz#652f08a8e1d5edcb407340e58818fcff463b5848"
integrity sha512-e0JpzIaYLsRRXevRDVs0yevabiCvieIWWCwh7VqVXjXM5AOHdjb7AjaKIj34zYFmY1N6HIRRfk915WVMYlHnDA==
"@hotwired/stimulus@>= 3.0", "@hotwired/stimulus@^3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.1.tgz#e3de23623b0c52c247aba4cd5d530d257008676b"
integrity sha512-HGlzDcf9vv/EQrMJ5ZG6VWNs8Z/xMN+1o2OhV1gKiSG6CqZt5MCBB1gRg5ILiN3U0jEAxuDTNPRfBcnZBDmupQ==
"@hotwired/turbo@^7.1.0":
version "7.2.4"
@@ -3758,9 +3758,9 @@ bail@^1.0.0:
integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
base64-js@^1.0.2:
version "1.5.1"
@@ -4574,7 +4574,7 @@ compression@^1.7.4:
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
concat-stream@^1.5.0:
version "1.6.2"
@@ -8693,9 +8693,9 @@ minimalistic-crypto-utils@^1.0.1:
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
@@ -11597,11 +11597,11 @@ stimulus-flatpickr@^1.4.0:
integrity sha512-rcC/c9+E+f5W2kOjaaLShtf3i+p95ACqt+oGzSAgeuZh2YeIN8gW4EWO7h0STBLzSVPl6BjIfPWP7upMPavIVQ==
stimulus@^3.0.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/stimulus/-/stimulus-3.1.1.tgz#ef37aafce32c24d91b8fe496855436d096c6cb44"
integrity sha512-eFOPFB6tJXJ6wFpUVjpi0/tYSiY4LPwdZa/1S6bzhhEt5cSIfmtndrHpaUo76uElpWnfmEEOB4ezMXtGnG9HBQ==
version "3.2.1"
resolved "https://registry.yarnpkg.com/stimulus/-/stimulus-3.2.1.tgz#bf049a4379ed4ff7475515acce1f0b6fa15a0187"
integrity sha512-EhpuHnTwtkWrE5m7tQxLBLsi1aE6xJ/9MbB88aKXZSquIC4pCueKJ2AGaF5gq+/BzP7+xvYaVYA0j1dIUuBsgA==
dependencies:
"@hotwired/stimulus" "^3.1.1"
"@hotwired/stimulus" "^3.2.1"
"@hotwired/stimulus-webpack-helpers" "^1.0.0"
stimulus_reflex@3.5.0-pre9: