Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 3663 - packaging number of units and weight as nums #3676

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

monsieurtanuki
Copy link
Contributor

New files:

  • simple_input_number_field.dart: Simple input text field, for numbers.
  • simple_input_text_field.dart: Simple input text field, with autocompletion. Used to be in simple_input_widget.dart

Impacted files:

  • edit_new_packagings.dart: minor refactoring
  • edit_new_packagings_component.dart: now we use a numeric keyboard for number of units and weight
  • edit_new_packagings_helper.dart: now we format and parse number of units as int? and weight as double?
  • nutrition_page_loaded.dart: minor refactoring
  • simple_input_widget.dart: refactored code to new file simple_input_text_field.dart

What

  • Now we switch to numeric keyboards for 2 packaging numeric fields (number of units and weight).
  • We also format and parse their values according to the query locale.
  • We still don't return a message or return null if we cannot parse, but it's far more unlikely.

Screenshot

number of units weight in grams
Capture d’écran 2023-02-06 à 13 23 52 Capture d’écran 2023-02-06 à 13 22 42

Fixes bug(s)

New files:
* `simple_input_number_field.dart`: Simple input text field, for numbers.
* `simple_input_text_field.dart`: Simple input text field, with autocompletion. Used to be in `simple_input_widget.dart`

Impacted files:
* `edit_new_packagings.dart`: minor refactoring
* `edit_new_packagings_component.dart`: now we use a numeric keyboard for number of units and weight
* `edit_new_packagings_helper.dart`: now we format and parse number of units as int? and weight as double?
* `nutrition_page_loaded.dart`: minor refactoring
* `simple_input_widget.dart`: refactored code to new file `simple_input_text_field.dart`
@codecov-commenter
Copy link

Codecov Report

Merging #3676 (419dd00) into develop (c9935da) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           develop   #3676      +/-   ##
==========================================
- Coverage     9.42%   9.38%   -0.05%     
==========================================
  Files          269     271       +2     
  Lines        13611   13675      +64     
==========================================
  Hits          1283    1283              
- Misses       12328   12392      +64     
Impacted Files Coverage Δ
...oth_app/lib/pages/product/edit_new_packagings.dart 0.00% <0.00%> (ø)
...b/pages/product/edit_new_packagings_component.dart 0.00% <0.00%> (ø)
.../lib/pages/product/edit_new_packagings_helper.dart 0.00% <0.00%> (ø)
...h_app/lib/pages/product/nutrition_page_loaded.dart 0.00% <0.00%> (ø)
...p/lib/pages/product/simple_input_number_field.dart 0.00% <0.00%> (ø)
...app/lib/pages/product/simple_input_text_field.dart 0.00% <0.00%> (ø)
...oth_app/lib/pages/product/simple_input_widget.dart 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@stephanegigandet
Copy link
Contributor

Thank you @monsieurtanuki !

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, thanks @monsieurtanuki

@monsieurtanuki
Copy link
Contributor Author

Thank you @M123-dev for the review!

@monsieurtanuki monsieurtanuki merged commit b46362e into openfoodfacts:develop Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packagings weights not recorded if using a comma (6,5) or a unit (e.g. 6.9 g) is included (mobile)
4 participants