Skip to content

Commit

Permalink
Merge branch 'openfoodfacts:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurtanuki authored Jan 7, 2022
2 parents 241785b + f1045c4 commit edd46be
Show file tree
Hide file tree
Showing 147 changed files with 5,329 additions and 3,165 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
STORE_JKS_DECRYPTKEY: ${{ secrets.STORE_JKS_DECRYPTKEY }}

- name: Setup Flutter
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2.0.3
with:
channel: 'stable'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dartdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
uses: actions/checkout@v2

- name: "Setup Flutter"
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2.0.3
with:
channel: 'stable'

- name: Run Dartdoc
run: pub global activate dartdoc && dartdoc

- name: Deploy API documentation to Github Pages
uses: JamesIves/github-pages-deploy-action@4.1.9
uses: JamesIves/github-pages-deploy-action@4.2.0
with:
BRANCH: gh-pages
FOLDER: packages/smooth_app/doc/api/
2 changes: 1 addition & 1 deletion .github/workflows/ios-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
java-version: "12.x"

- name: Setup Flutter
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2.0.3
with:
channel: 'stable'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:

steps:
- uses: actions/[email protected]
if: ${{ github.repository_owner == 'openfoodfacts' }}
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

# Setup flutter
- name: "Setup Flutter"
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2.0.3
with:
channel: 'stable'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

# Setup flutter
- name: "Setup Flutter"
uses: subosito/flutter-action@v1
uses: subosito/flutter-action@v2.0.3
with:
channel: 'stable'

Expand Down
5 changes: 0 additions & 5 deletions packages/smooth_app/assets/data/important.svg

This file was deleted.

6 changes: 0 additions & 6 deletions packages/smooth_app/assets/data/mandatory.svg

This file was deleted.

25 changes: 19 additions & 6 deletions packages/smooth_app/lib/helpers/user_management_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UserManagementHelper {
await put(user);
}

return rightCredentials && await _checkCredentialsInStorage();
return rightCredentials && await credentialsInStorage();
}

/// Puts the [User] in the preferences
Expand All @@ -41,9 +41,22 @@ class UserManagementHelper {
await _putUser(user);
}

/// Checks if the saved credentials are still valid
/// and mounts credentials for use in queries
static Future<bool> checkAndReMountCredentials() async {
/// Mounts stored credentials
static Future<void> mountCredentials() async {
final String? userId = await DaoSecuredString.get(_USER_ID);
final String? password = await DaoSecuredString.get(_PASSWORD);

if (userId == null || password == null) {
return;
}

final User user = User(userId: userId, password: password);

OpenFoodAPIConfiguration.globalUser = user;
}

/// Checks if the saved credentials are still correct
static Future<bool> validateCredentials() async {
final String? userId = await DaoSecuredString.get(_USER_ID);
final String? password = await DaoSecuredString.get(_PASSWORD);

Expand Down Expand Up @@ -72,7 +85,7 @@ class UserManagementHelper {
OpenFoodAPIConfiguration.globalUser = null;
DaoSecuredString.remove(key: _USER_ID);
DaoSecuredString.remove(key: _PASSWORD);
final bool contains = await _checkCredentialsInStorage();
final bool contains = await credentialsInStorage();
return !contains;
}

Expand All @@ -89,7 +102,7 @@ class UserManagementHelper {
}

/// Checks if some credentials exist in storage
static Future<bool> _checkCredentialsInStorage() async {
static Future<bool> credentialsInStorage() async {
final bool userId = await DaoSecuredString.contains(key: _USER_ID);
final bool password = await DaoSecuredString.contains(key: _PASSWORD);

Expand Down
64 changes: 41 additions & 23 deletions packages/smooth_app/lib/l10n/app_aa.arb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,24 @@
"@offUtility": {
"description": "Description of what a user can use Open Food Facts for."
},
"productDataUtility": "See the food data relevant to your preferences.",
"@productDataUtility": {
"description": "Description of what a user can use the product data for."
},
"healthCardUtility": "Choose foods that are good for you.",
"@healthCardUtility": {
"description": "Description of what a user can use the health data in a product for."
},
"ecoCardUtility": "Choose foods that are good for the planet.",
"@ecoCardUtility": {
"description": "Description of what a user can use the Eco data in a product for."
},
"@user_management": {},
"sign_in_text": "Sign in to your Open Food Facts account to save your contributions",
"incorrect_credentials": "Incorrect user name or password.",
"incorrect_credentials": "Incorrect username or password.",
"login": "Login",
"@login": {
"description": "Text field hint: unified name for either username or email address"
"description": "Text field hint: unified name for either username or e-mail address"
},
"create_account": "Create account",
"@create_account": {
Expand All @@ -75,44 +87,44 @@
"password": "Password",
"forgot_password": "Forgot password",
"@forgot_password": {
"description": "Button label: Opens a page where a password reset email can be requested"
"description": "Button label: Opens a page where a password reset e-mail can be requested"
},
"reset_password": "Reset password",
"@reset_password": {
"description": "Forgot password page title"
},
"reset_password_explanation_text": "If you have forgotten your password, fill-in your username or e-mail address to receive instructions for resetting your password. Please also check your spam folder.",
"username_or_email": "Username or e-mail address",
"reset_password_explanation_text": "In case of a forgotten password, enter your username or e-mail address to receive instructions for a password reset. Also, remember to check the Spam folder.",
"username_or_email": "Username or e-mail",
"@username_or_email": {
"description": "Text field hint for password reset"
},
"reset_password_done": "An email with a link to reset your password has been sent to the e-mail address associated with your account. Also check your spam",
"reset_password_done": "An e-mail with a link to reset your password has been sent to the e-mail address associated with your account. Also check your spam",
"send_reset_password_mail": "Change password",
"@send_reset_password_mail": {
"description": "Button label: Submit the password reset email request"
"description": "Button label: Submit the password reset e-mail request"
},
"enter_some_text": "Please enter some text",
"@enter_some_text": {
"description": "Error when text field is empty"
"description": "Error when a required text field is empty"
},
"sign_up_page_title": "Sign Up",
"@sign_up_page_title": {
"description": "On top of the Sign Up page"
"description": "Header"
},
"sign_up_page_action_button": "Sign Up",
"@sign_up_page_action_button": {
"description": "Bottom action button"
"description": "Button for signing up"
},
"sign_up_page_action_doing_it": "Signing up...",
"@sign_up_page_action_doing_it": {
"description": "Dialog during the actual signing up process"
"description": "Progress indicator dialog during the actual signing up process"
},
"sign_up_page_action_ok": "Congratulations! Your account has just been created.",
"sign_up_page_display_name_hint": "Display Name",
"sign_up_page_display_name_error_empty": "Please enter the display name you want to use",
"sign_up_page_email_hint": "E-mail",
"sign_up_page_email_error_empty": "Please enter the e-mail",
"sign_up_page_email_error_invalid": "Please enter a valid email",
"sign_up_page_email_error_empty": "Please enter your e-mail",
"sign_up_page_email_error_invalid": "Please enter a valid e-mail",
"sign_up_page_username_hint": "Username",
"sign_up_page_username_error_empty": "Please enter a username",
"sign_up_page_username_error_invalid": "Please enter a valid username",
Expand All @@ -122,13 +134,19 @@
"sign_up_page_password_error_invalid": "Please enter a valid password (at least 6 characters)",
"sign_up_page_confirm_password_hint": "Confirm Password",
"sign_up_page_confirm_password_error_empty": "Please confirm the password",
"sign_up_page_confirm_password_error_invalid": "The passwords should be identical",
"sign_up_page_confirm_password_error_invalid": "The passwords have to be identical",
"sign_up_page_agree_url": "https://world-en.openfoodfacts.org/terms-of-use",
"sign_up_page_agree_error_invalid": "You have to agree if you'd like to get an account. Note that you can still use the app and contribute anonymously.",
"@sign_up_page_agree_url": {
"description": "Please insert the right url here. Go to the openfoodfacts homepage, switch to your country and then on the bottom left footer is Terms of use from which the url should be taken"
},
"sign_up_page_agree_error_invalid": "When creating an account, agreeing to the Terms of Use is mandatory, however, anonymous contributions can still be made through the app",
"@sign_up_page_agree_error_invalid": {
"description": "Error message: You have to agree to the terms-of-use (A checkbox to do so is above this error message)"
},
"sign_up_page_producer_checkbox": "I am a food producer",
"sign_up_page_producer_hint": "Producer/brand",
"sign_up_page_producer_error_empty": "Please enter a producer or a brand name",
"sign_up_page_subscribe_checkbox": "I'd like to subscribe to the Open Food Facts newsletter (Note: You can unsubscribe from it at all time)",
"sign_up_page_subscribe_checkbox": "I'd like to subscribe to the Open Food Facts newsletter (You can unsubscribe from it at all time)",
"@Settings": {},
"settingsTitle": "Settings",
"@settingsTitle": {
Expand Down Expand Up @@ -158,7 +176,7 @@
"@termsOfUse": {},
"about_this_app": "About this app",
"@about_this_app": {
"description": "Button label: Opens a popo up window which shows informations about this app"
"description": "Button label: Opens a pop up window which shows information about the app"
},
"@About this app section": {},
"contribute": "Contribute",
Expand Down Expand Up @@ -322,35 +340,35 @@
"@Product Addition": {},
"added_product_thanks": "Thank you for adding this product!",
"@added_product_thanks": {},
"product_improvement_add_category": "Add a category to compute the Nutri-Score.",
"product_improvement_add_category": "Add a category to calculate the Nutri-Score.",
"@product_improvement_add_category": {
"description": "Message for ProductImprovement.ADD_CATEGORY"
},
"product_improvement_add_nutrition_facts": "Add nutrition facts to compute the Nutri-Score.",
"product_improvement_add_nutrition_facts": "Add nutrition facts to calculate the Nutri-Score.",
"@product_improvement_add_nutrition_facts": {
"description": "Message for ProductImprovement.ADD_NUTRITION_FACTS"
},
"product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to compute the Nutri-Score.",
"product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to calculate the Nutri-Score.",
"@product_improvement_add_nutrition_facts_and_category": {
"description": "Message for ProductImprovement.ADD_NUTRITION_FACTS_AND_CATEGORY"
},
"product_improvement_categories_but_no_nutriscore": "We could not compute an Nutri-Score for this product. It might be that the category is an exception. If you believe this is an error, contact us.",
"product_improvement_categories_but_no_nutriscore": "The Nutri-Score for this product can't be calculated, which may be due to e.g. a non-standard category. If this is considered an error, please contact us.",
"@product_improvement_categories_but_no_nutriscore": {
"description": "Message for ProductImprovement.CATEGORIES_BUT_NO_NUTRISCORE"
},
"product_improvement_obsolete_nutrition_image": "The nutrition image is obsolete: please refresh it.",
"@product_improvement_obsolete_nutrition_image": {
"description": "Message for ProductImprovement.OBSOLETE_NUTRITION_IMAGE"
},
"product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take them into a photo (ingredient list and/or any geographic claim or edit the product so that they can be taken into account. If it is not clear, you can contact the food producer.",
"product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take a photo of them (ingredient list and/or any geographic claim or edit the product) so that they can be taken into account.",
"@product_improvement_origins_to_be_completed": {
"description": "Message for ProductImprovement.ORIGINS_TO_BE_COMPLETED"
},
"country_chooser_label": "Please choose a country",
"@country_chooser_label": {
"description": "Label shown above a selector where the user can select their country"
},
"country_selection_explanation": "Some environment features depend on your location",
"country_selection_explanation": "Some environmental features are location-specific",
"@country_label": {
"description": "Explanation as to why users should select their country."
},
Expand Down
Loading

0 comments on commit edd46be

Please sign in to comment.