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
feat: #233 - new class OpenFoodFactsCountry, clearer than "cc" #292
feat: #233 - new class OpenFoodFactsCountry, clearer than "cc" #292
Conversation
…n "cc" New file: * `CountryHelper.dart`: country enums and their ISO-2-codes Impacted files: * `AbstractQueryConfiguration.dart`: deprecated `String? cc` in favor of `OpenFoodFactsCountry? country` * `api_getTaxonomy_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyAdditives_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyAllergens_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyCategories_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyCountries_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyIngredients_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyLabels_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `api_getTaxonomyLanguages_test.dart`: now using `OpenFoodAPIConfiguration.globalCountry` * `OpenFoodAPIConfiguration.dart`: deprecated `String? globalCC` in favor of `OpenFoodFactsCountry? globalCountry` * `openfoodfacts.dart`: minor refactoring * `ProductListQueryConfiguration.dart`: added parameter `OpenFoodFactsCountry? country` * `ProductQueryConfigurations.dart`: added parameter `OpenFoodFactsCountry? country` * `ProductSearchQueryConfiguration.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyAdditive.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyAllergen.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyCategory.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyCountry.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyIngredient.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyLabel.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyLanguage.dart`: added parameter `OpenFoodFactsCountry? country` * `TaxonomyQueryConfiguration.dart`: deprecated `String? cc` in favor of `OpenFoodFactsCountry? country`
What I read from the code yet looks good, but what about deprecating all the other cc fields keeping them long term clutters the source code. Also with "replace all" it shouldn't take that much time |
Impacted files: * `api_getProduct_test.dart`: not using deprecated parameter `lc` anymore * `ProductListQueryConfiguration.dart`: deprecated parameters `lc` and `cc` * `ProductQueryConfigurations.dart`: deprecated parameters `lc` and `cc` * `ProductSearchQueryConfiguration.dart`: deprecated parameters `lc` and `cc` * `TaxonomyAdditive.dart`: deprecated parameter cc` * `TaxonomyAllergen.dart`: deprecated parameter cc` * `TaxonomyCategory.dart`: deprecated parameter cc` * `TaxonomyCountry.dart`: deprecated parameter cc` * `TaxonomyIngredient.dart`: deprecated parameter cc` * `TaxonomyLabel.dart`: deprecated parameter cc` * `TaxonomyLanguage.dart`: deprecated parameter cc`
@M123-dev That's similar to what happened with languages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks. Consider removing the code comments in CountryHelper.dart
. The enum values are self explanatory, e.g.
...
/// Congo
CONGO,
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, I wasn't quite paying attention there. Maybe reviewing pull request after schoolwork is done would help. I thought we would pass cc to each function in OpenFoodAPIClient
.
Anyway the code looks great, thanks for this enormous PR
@peterwvj The point of those comments is not to be very interesting, it's just that each enum is supposed to be commented, if not the pub.dev score may go down. |
Yes of course we can merge. On Wednesday the automated release didn't worked because we had to publish once to extract the authentication credentials since this is a reasonable PR for a own release its fits perfectly. |
New file:
CountryHelper.dart
: country enums and their ISO-2-codesImpacted files:
AbstractQueryConfiguration.dart
: deprecatedString? cc
in favor ofOpenFoodFactsCountry? country
api_getTaxonomy_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyAdditives_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyAllergens_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyCategories_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyCountries_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyIngredients_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyLabels_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
api_getTaxonomyLanguages_test.dart
: now usingOpenFoodAPIConfiguration.globalCountry
OpenFoodAPIConfiguration.dart
: deprecatedString? globalCC
in favor ofOpenFoodFactsCountry? globalCountry
openfoodfacts.dart
: minor refactoringProductListQueryConfiguration.dart
: added parameterOpenFoodFactsCountry? country
ProductQueryConfigurations.dart
: added parameterOpenFoodFactsCountry? country
ProductSearchQueryConfiguration.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyAdditive.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyAllergen.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyCategory.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyCountry.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyIngredient.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyLabel.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyLanguage.dart
: added parameterOpenFoodFactsCountry? country
TaxonomyQueryConfiguration.dart
: deprecatedString? cc
in favor ofOpenFoodFactsCountry? country