David Cook
f034e46aed
Fix label
...
Strangely, the spec passed when run locally, but not in CI. It's a curious case of the wrong letter case.
2023-11-28 10:44:34 +11:00
David Cook
994dd606b9
Refactor: remove dead code
...
I was mistakenly thinking that you can define variables in beforeEach, but it turns out these are not used.
Rather, Jest was automatically creating variables for the elements according to their IDs. How convenient!
2023-11-28 10:44:34 +11:00
David Cook
bc6a83017b
Update spec
...
Ok that was an afterthought, but better late than never.
2023-11-28 10:44:34 +11:00
David Cook
373743f96d
Simplify event handlers
...
The new 'input' event is for this exact use case.
2023-11-28 10:44:34 +11:00
David Cook
88fe8dcbe0
Show changes on popout button
2023-11-28 10:44:34 +11:00
David Cook
5e96368c85
Count changed checkboxes
2023-11-28 10:44:34 +11:00
David Cook
69f160ff95
Toggle input disabled when on demand checked
...
This introduces a new 'toggle' controller, and we already had three\! So I created a generic interface that could be extended to potentially support all of them. I propose we try to reduce them all into the one controller, but won't go down the rabbit-hole just yet..
I have an idea on how to re-arrange and make it more contained, by assigning the controller only to the checkbox, and defining targets with aria-controls="", but chose to stick with Stimulus conventions for now.
2023-11-28 10:44:34 +11:00
David Cook
9bc1e873d3
Display summary of the popout values
...
I couldn't think of a simpler way to hardcode it, so now we have a clever generic method :)
We can assume that hidden elements will stay hidden, but we need to check each time if an element is disabled or not.
2023-11-28 10:44:34 +11:00
David Cook
888e0b976b
Refactor spec
...
Shoulda done this at the start.
2023-11-28 10:44:34 +11:00
David Cook
b6045655ee
Hide popout when checkbox is checked
2023-11-28 10:44:34 +11:00
David Cook
78d2ddb9b7
Close popout when focus outside
...
I'm starting to think that these stimulus tests are worthless. The environment is not the same as a browser, which creates extra work to deal with the inconsistencies. And it means we're not testing real world behaviour.
So these are just unit tests, but they take extra effort to put together due to the inter-relatedness with the DOM. Hmm.
2023-11-28 10:44:34 +11:00
David Cook
4560e3728c
Show popout on click or down key
...
It looks like a select drop-down, so it can behave like one too.
2023-11-28 10:44:34 +11:00
David Cook
735b5789cc
[wip] Style on-hand button
...
Had to update the form controller a little bit to handle buttons.
But arrow not showwing on focus.
Getting some weird SCSS behaviour here.. maybe I'm trying to be too clever.
2023-11-28 10:44:34 +11:00
David Cook
d218565834
Style stock popout
2023-11-28 10:44:34 +11:00
David Cook
d9570cdf32
Update v3 checkbox style
...
This doesn't _quite_ match the design, but would require a big CSS hack to customise it further, so I thought let's start with this.
2023-11-28 10:44:34 +11:00
David Cook
b7ac1f2696
Move specific style rule to where it belongs
...
Also fixed it to line up properly. There's probably a better way to line it up but that's no my concern right now..
2023-11-28 10:44:34 +11:00
David Cook
eccfe96a5b
Use form hash structure
...
The array format is generally fine, but to properly support checkboxes, we need this format with hash keys.
https://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions
2023-11-28 10:44:34 +11:00
David Cook
55cd8a6773
Add on_demand field
...
But 'Array parameters do not play well with the check_box helper.'
...
2023-11-28 10:43:10 +11:00
David Cook
7aefa834bf
Add on_hand input
2023-11-28 10:43:10 +11:00
David Cook
4d22123e02
Remove stock level from product row
...
It creates the false impression we can handle agregated stock.
2023-11-28 10:43:10 +11:00
Gaetan Craig-Riou
4b070f8447
Merge pull request #11848 from dacook/vertical_ellipsis_menu_component
...
Vertical ellipsis menu component
2023-11-27 10:21:09 +11:00
Maikel
d067f1329f
Merge pull request #11856 from duleorlovic/add_hi_and_mr_locale
...
Add hi and mr locale using tx pull -l hi
2023-11-27 09:18:03 +11:00
Dusan Orlovic
fc42330383
Add hi and mr locale using tx pull -l hi
2023-11-26 08:35:50 +01:00
Filipe
92686c97d6
Merge pull request #11853 from dacook/check_pdf_file_bulk_invoice_print2
...
Spec refactor
2023-11-24 10:14:53 +00:00
David Cook
e53960bae7
Disable Rails/OutputSafety for specs
...
This cop is to protect against user input. There's no user input (or users) in specs.
2023-11-24 16:35:45 +11:00
David Cook
d989b8ad2f
Remove unnecessary partial
...
Yay, now it's compact enough to fit in the table partial.
(Although we should probably try to reduce that one down one day..)
2023-11-24 16:28:00 +11:00
David Cook
968a224da6
Move vertical ellipsis menu to a ViewComponent
...
Javascript hasn't been moved in, as we don't seem to be set up for that yet.
We could make it smarter, and pass in an array of parameters to build the links (as in _order_links.html.haml). But why make it complicated if we don't need to?
2023-11-24 16:23:18 +11:00
David Cook
2bd2bea7b7
Remove need for class
...
Generally, I would say that style rules should have a BEM-style class name, but in this case it's terribly convenient to support a tags directly.
2023-11-24 16:14:28 +11:00
Maikel Linke
f2f63eb416
Update all locales with the latest Transifex translations
v4.4.21
2023-11-24 14:23:46 +11:00
Maikel Linke
777060ea6b
Remove old script
...
We use Github to draft releases these days.
2023-11-24 14:22:42 +11:00
David Cook
3bfe0f86f2
Merge pull request #11852 from filipefurtad0/fix_display_inventory_warning_spec
...
Fix display inventory warning spec
2023-11-24 13:46:41 +11:00
David Cook
358470f801
Merge pull request #11849 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.139.0
...
chore(deps): bump aws-sdk-s3 from 1.138.0 to 1.139.0
2023-11-24 13:29:41 +11:00
David Cook
eecca8ee96
Refactor: match url with regexp
...
And remove unnecessary button click.
2023-11-24 12:41:02 +11:00
Gaetan Craig-Riou
f10c35dc32
Merge pull request #11850 from openfoodfoundation/dependabot/bundler/spring-4.1.3
...
chore(deps-dev): bump spring from 4.1.2 to 4.1.3
2023-11-24 12:31:29 +11:00
Gaetan Craig-Riou
8b5e543ba5
Merge pull request #11836 from filipefurtad0/check_pdf_file_bulk_invoice_print
...
Extends bulk print invoice spec to assert on file contents
2023-11-24 11:42:49 +11:00
David Cook
907d559eef
Merge pull request #11847 from mkllnk/spec-opt
...
Avoid precompiling assets unnecessarily
2023-11-24 09:16:50 +11:00
filipefurtad0
0390d52f18
Adds test to reproduce issue #11851
2023-11-23 19:49:34 +00:00
filipefurtad0
8b5d5b3626
Changes inventory setting for order cycle coordinator
...
...instead of supplier; Inventory is a feature which is relevant for shops/hubs.
2023-11-23 17:27:09 +00:00
dependabot[bot]
103f5d1dcb
chore(deps-dev): bump spring from 4.1.2 to 4.1.3
...
Bumps [spring](https://github.com/rails/spring ) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/rails/spring/releases )
- [Changelog](https://github.com/rails/spring/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rails/spring/compare/v4.1.2...v4.1.3 )
---
updated-dependencies:
- dependency-name: spring
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-11-23 10:09:38 +00:00
dependabot[bot]
bafbcd1e1e
chore(deps): bump aws-sdk-s3 from 1.138.0 to 1.139.0
...
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby ) from 1.138.0 to 1.139.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases )
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md )
- [Commits](https://github.com/aws/aws-sdk-ruby/commits )
---
updated-dependencies:
- dependency-name: aws-sdk-s3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-11-23 10:01:00 +00:00
Maikel Linke
3586497c56
Precompile assets only when needed
2023-11-23 17:23:47 +11:00
David Cook
c6fc139f62
Always generate components in subfolders
...
Currently all our view components are in subfolders, so we probably want to keep it that way.
2023-11-23 17:04:09 +11:00
Maikel Linke
37feefce37
Avoid precompiling assets unnecessary
...
We had two calls to precompile assets, one for all specs and then a
second one just for system specs. The one for system specs is better
because it checks for the webpack dev server before compiling assets. So
let's use just that one.
2023-11-23 17:00:44 +11:00
Maikel Linke
6431b94aba
Remove unnecessary condition in spec helper
...
This helper file is only loaded when system specs are loaded. So we
don't need to check for the absence of system specs because this file
wouldn't be loaded if there were not system specs to be run.
2023-11-23 16:59:30 +11:00
Maikel
bb0684bd23
Merge pull request #11818 from mkllnk/dfc-vocabularies
2023-11-23 10:06:38 +11:00
Maikel
ee4dd0666c
Merge pull request #11840 from openfoodfoundation/dependabot/bundler/active_storage_validations-1.1.3
...
chore(deps): bump active_storage_validations from 1.1.2 to 1.1.3
2023-11-23 09:29:50 +11:00
Maikel
f8fc44ea72
Merge pull request #11844 from filipefurtad0/fix_blacklist_whitelist_deprecation_warning
...
[System specs, CI] Fixes blacklist/whitelist deprecation warning
2023-11-23 08:48:48 +11:00
Maikel
1e635673c0
Merge pull request #11842 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.138.0
...
chore(deps): bump aws-sdk-s3 from 1.137.0 to 1.138.0
2023-11-23 08:47:49 +11:00
Maikel
bf95a655af
Merge pull request #11841 from openfoodfoundation/dependabot/bundler/rspec-rails-6.1.0
...
chore(deps-dev): bump rspec-rails from 6.0.3 to 6.1.0
2023-11-23 08:47:13 +11:00
Maikel
3f76a4c68e
Merge pull request #11839 from openfoodfoundation/dependabot/bundler/faraday-2.7.12
...
chore(deps): bump faraday from 2.7.11 to 2.7.12
2023-11-23 08:42:51 +11:00