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

feat: 893 - 4 new fields for user #903

Merged
merged 8 commits into from
Jul 7, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now when we log in we get 4 fields:
    • preferredLanguage
    • country
    • isModerator
    • isAdmin
  • And we don't get the "email" field anymore.
  • @stephanegigandet Still a problem on the server side: we get country as en:france, which is not very easy to convert, whereas fr would be perfect

Fixes bug(s)

Impacted files

  • login_status.dart: added 4 fields and deprecated "email"
  • open_food_api_client.dart: upgraded the max length of user name (60) and user id (40)
  • user_management_test_prod.dart: tested the new 4 login status fields
  • user_management_test_test_env.dart: tested the new 4 login status fields and remove a test on "email"

Impacted files:
* `login_status.dart`: added 4 fields and deprecated "email"
* `open_food_api_client.dart`: upgraded the max length of user name (60) and user id (40)
* `user_management_test_prod.dart`: tested the new 4 login status fields
* `user_management_test_test_env.dart`: tested the new 4 login status fields and remove a test on "email"
@stephanegigandet
Copy link
Contributor

@monsieurtanuki PR to add a cc field: openfoodfacts/openfoodfacts-server#10152 ("world" can also be a value)

alexgarel pushed a commit to openfoodfacts/openfoodfacts-server that referenced this pull request Apr 19, 2024
add cc field requested by @monsieurtanuki in openfoodfacts/openfoodfacts-dart#903 
note that cc can also be "world"

also removed some fields if their value is undef or empty
@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet I've just PR'ed the use of json field 'cc' instead of 'country'.

As mentioned in openfoodfacts/openfoodfacts-server#10152 (comment), so far I couldn't test it successfully in PROD as the field doesn't seem to be available.

Besides, I'm not 100% sure it would be very clean to add a fake country called 'world'.
Wouldn't null instead of 'world' still work? For the record that is what is happening right now, as we cannot decode 'world' as a country and decode it as null.

john-gom pushed a commit to openfoodfacts/openfoodfacts-server that referenced this pull request May 24, 2024
add cc field requested by @monsieurtanuki in openfoodfacts/openfoodfacts-dart#903 
note that cc can also be "world"

also removed some fields if their value is undef or empty
@monsieurtanuki
Copy link
Contributor Author

Thank you @stephanegigandet: I've just tested in PROD and the cc field is now populated.

@monsieurtanuki
Copy link
Contributor Author

ping

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.

The dart side is looking fine 💯

@monsieurtanuki monsieurtanuki merged commit a7e195b into openfoodfacts:master Jul 7, 2024
2 of 3 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @M123-dev for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add support for the upcoming user info API
4 participants