139 Commits

Author SHA1 Message Date
c6077dce33 feat: 5099 - new dev mode item to refresh all the products from the server (#5100)
Impacted files:
* `dao_product.dart`: new method `clearAllLanguages`
* `pubspec.lock`: wtf
* `user_preferences_dev_mode.dart`: added a "Refresh all products from server (cf. Nutriscore v2)" item
2024-04-08 13:08:47 +02:00
f98bce1977 feat: 4941 - refresh products when switching app language (#5016)
New file:
* `background_task_language_refresh.dart`: Background task about downloading products to translate.

Impacted files:
* `background_task_manager.dart`: minor refactoring
* `dao_product.dart`: new method `getTopProductsToTranslate`
* `local_database.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring
* `operation_type.dart`: new operation type `languageRefresh`
* `product_refresher.dart`: minor refactoring
* `up_to_date_mixin.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
* `user_preferences_language_selector.dart`: now calling new task `BackgroundTaskLanguageRefresh` when changing language
2024-02-24 11:08:58 +01:00
4d9c7fc48c feat: 4996 - reordering product languages (#5025)
New file:
* `language_priority.dart`: Helper around the language priority.

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `dao_string_list.dart`: now storing the latest languages used locally in the app
* `edit_ocr_page.dart`: minor refactoring
* `language_selector.dart`: now showing app and product languages as first languages
* `multilingual_helper.dart`: minor refactoring
2024-02-04 14:44:24 +01:00
1807968706 feat: 4947 - added local "last access" timestamp for products (#4969)
New file:
* `dao_product_last_access.dart`: Table that stores the local last access timestamp for a product.

Impacted files:
* `local_database.dart`: new version of the database, because of the new "product last access" table
* `new_product_page.dart`: added a call to refresh the product "last access" timestamp
* `offline_data_page.dart`: added a call to delete the product "last access" timestamps
* `product_model.dart`: added a call to refresh the product "last access" timestamp
* `pubspec.lock`: wtf
2024-01-25 18:46:31 +01:00
e0b3111596 feat: 4947 - added "download language" to product table (#4951)
Deleted file:
* `dao_product_migration.dart`

Impacted files:
* `background_task_download_products.dart`: added language parameter
* `dao_hive_product.dart`: removed dead code
* `dao_product.dart`: added table column language `lc`
* `local_database.dart`: upgraded the database version
* `onboarding_data_product.dart`: added language parameter
* `product_list_page.dart`: added language parameter
* `product_refresher.dart`: added language parameter
* `query_product_list_supplier.dart`: added language parameter
2024-01-07 18:33:32 +01:00
0a5b18ddcf fix: 4807 - putting back a useless hive table, just in case (#4821)
* fix: 4807 - putting back a useless hive table, just in case

* fix: 4807
2023-11-19 19:30:29 +01:00
4ab2150a60 chore: old TODOs (#4758)
Deleted files:
* `dao_hive_product.dart`: we don't store products in hive since 18 months ago
* `dao_unzipped_product.dart`: we don't store products as unzipped since 18 months ago

Impacted files:
* `background_task_hunger_games.dart`: impacted by off-dart new features
* `background_task_image.dart`: impacted by off-dart new features
* `crop_page.dart`: impacted by off-dart new features
* `local_database.dart`: removed hive and unzipped products
2023-11-04 13:56:58 +01:00
3f2b7a7a2a User lists: bring Share / View on web / Clear actions to the Modal sheet (#4400) 2023-07-30 09:48:12 +02:00
d9e49dfc14 fix: 4301 - new "up-to-date" provider for product list (#4321)
New files:
* `up_to_date_interest.dart`: Management of the interest for a key.
* `up_to_date_product_list_mixin.dart`: Provides the most up-to-date local product list data for a StatefulWidget.
* `up_to_date_product_list_provider.dart`: Provider that reflects the latest barcode lists on ProductLists.

Impacted files:
* `dao_product_list.dart`: made public method `getKey`; refreshes the provider
* `local_database.dart`: added a new `UpToDateProductListProvider`
* `product_list_page.dart`: now extends `UpToDateProductListMixin
* `up_to_date_product_provider.dart`: refactored using a `UpToDateInterest`
* `user_preferences_account.dart`: removed redundant access to product list page
2023-07-16 23:11:48 +02:00
aa734347de feat: 4041 - now displaying user lists in "List" nav tab (#4298) 2023-07-13 16:20:24 +02:00
25264c9f22 fix: 4222 - top barcode task refactoring (#4226)
Impacted files:
* `app_en.arb`: added a label for "server timeout"
* `background_task_top_barcodes.dart`: now explicitly using page number parameter, as server data is not 100% reliable
* `dao_work_barcode.dart`: minor refactoring
* `offline_tasks_page.dart`: detected a typical "server timeout" error message and replaced it with a more user-friendly message
2023-06-25 17:48:27 +02:00
95c3a675a9 fix: 4066 - top n product download split in smaller robust parts (#4166)
* fix: 4066 - top n product download split in smaller robust parts

New files:
* `background_offline_barcodes.dart`: Background subtask about pre-downloading top n barcodes.
* `background_offline_products.dart`: Background subtask about downloading products.
* `dao_work_barcode.dart`: Work table that contains barcodes.

Impacted files:
* `background_task_offline.dart`: now we clean the new `DaoWorkBarcode` and we just call the new `BackgroundtaskOfflineBarcodes`
* `local_database.dart`: upgraded to version 3, with the new `DaoWorkBarcode`.
* `operation_type.dart: added the new 2 background tasks.

TODO
* `backgrount_task_manager.dart`: make it possible to actually chain tasks with immediate execution

* Penultimate step before un-drafting

New files:
* `background_task_paged.dart`: Abstract background task with paged actions.
* `background_task_progressing.dart`: Abstract background task with work in progress actions.

Impacted files:
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_hunger_games.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_refresh_later.dart`: minor refactoring
* `background_task_unselect.dart`: minor refactoring
* `background_task_upload.dart`: minor refactoring
* `dao_work_barcode.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `local_database.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring; displays progress percentage
* `operation_type.dart`: moved file; minor refactoring for progress percentage
* `product_image_gallery_view.dart`: minor refactoring
* `up_to_date_changes.dart`: minor refactoring

Later:
* `background_task.dart`
* `background_task_download_products.dart`
* `background_task_full_refresh.dart`
* `background_task_manager.dart`
* `background_task_offline.dart`
* `background_task_top_barcodes.dart`
* `offline_data_page.dart`

* Final commit for main features.

Impacted files:
* `app_en.arb`: added a label for topN download with parameter
* `background_task.dart`: added a bool getter for immediate exec of the next task; minor refactoring
* `background_task_download_products.dart`: now as a _progressing_ background task, reused for top N, with KP and without KP
* `background_task_full_refresh.dart`: now as a _paged_ background task, that opens two progressing download tasks (one with KP, one without KP)
* `background_task_manager.dart`: now working as singleton; added a special case for immediate exec of the next task
* `background_task_offline.dart`: now as a _progressing_ background task
* `background_task_top_barcodes.dart`: now as a _progressing_ background task
* `dao_work_barcodes.dart`: fixed the bulk insert and delete for more than 1K products (actually, 1K SQL parameters)
* `offline_data_page.dart`: now using topN and pageSize parameters
* `offline_tasks_page.dart`: added a "work" label for the tasks
* `operation_type.dart`: now embeds the "work" in the task id

* Update packages/smooth_app/lib/background/background_task_download_products.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/background/background_task_download_products.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/background/background_task_progressing.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/background/background_task_progressing.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* fix: 4066 - localization

---------

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2023-06-21 14:11:57 +02:00
6e72ff0991 fix: 3595 - transient file refactoring and fixes (#3939)
New file:
* `background_task_upload.dart`: Background task about generic file upload.

Impacted files:
* `abstract_background_task.dart`: added a `recover` abstract method
* `background_task_crop.dart`: now extends new class `BackgroundTaskUpload`
* `background_task_image.dart`: now extends new class `BackgroundTaskUpload`
* `background_task_manager.dart`: now calls `recover`for each task at run time; minor fix about "internet error"
* `background_task_unselect.dart`: minor refactoring; minor fix removing the transient file
* `crop_page.dart`: minor refactoring
* `edit_ingredients_page.dart`: minor refactoring
* `image_upload_card.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `smooth_product_image.dart`: minor refactoring
* `transient_file.dart`: refactored as a "real" class, not a static one
2023-05-13 10:12:52 +02:00
a8366fd49f feat: 3897 - no language selector for gallery, only for swipeable page (#3924)
* feat: 3897 - no language selector for gallery, only for swipeable page

Main changes:
* `app_en.arb`: added 2 translations ("no image" / "no image for that language")
* `app_fr.arb`: added 2 translations ("no image" / "no image for that language")
* `nutrition_page_loaded.dart`: removed an implicit `language` parameter
* `product_cards_helper.dart`: refactoring
* `product_image_gallery_view.dart`: removed the language selector
* `product_image_swipeable_view.dart`: removed the language parameter; now we always start with the app language
* `product_image_viewer.dart`: now always displays the (non) image for the specified language, with additional labels; added explicit `language` parameters
* `transient_file.dart`: new method `getImageLanguages`

Added explicit `language` parameters for:
* `add_new_product_page.dart`: added an explicit `language` parameter
* `background_task_crop.dart`: added an explicit `language` parameter
* `background_task_image.dart`: added an explicit `language` parameter
* `background_task_unselect.dart`: added an explicit `language` parameter
* `edit_ingredients_page.dart`: added an explicit `language` parameter
* `edit_new_packagings.dart`: added an explicit `language` parameter
* `image_crop_page.dart`: added an explicit `language` parameter
* `image_upload_card.dart`: added an explicit `language` parameter
* `new_crop_page.dart`: added an explicit `language` parameter
* `product_image_local_button.dart`: added an explicit `language` parameter
* `product_image_server_button.dart`: added an explicit `language` parameter
* `uploaded_image_gallery.dart`: added an explicit `language` parameter

* feat: 3897 - slightly related refactoring around ImageFieldSmoothieExtension

* feat: 3897 - minor fix for TEST env
2023-04-30 18:34:35 +02:00
9679de7fda feat: 3897 - now we display localized images (#3900)
Impacted files:
* `background_task_crop.dart`: added language to transient file key
* `background_task_image.dart`: added language to transient file key
* `background_task_unselect.dart`: unrelated removal of not used fields
* `edit_ingredients_page.dart`: now we display localized images
* `image_upload_card.dart`: added language to transient file key
* `ocr_widget.dart`: added language to transient file key
* `product_cards_helper.dart`: now returns a localized image; refactored; new method `getLocalizedProductImageUrl`
* `product_image_carousel.dart`: now we display localized images
* `product_image_gallery_view.dart`: now we display localized images
* `product_image_swipeable_view.dart`: now we display localized images
* `product_image_viewer.dart`: now we display localized images
* `product_query.dart`: unrelated removal of not used field
* `product_refresher.dart`: unrelated minor refactoring
* `smooth_product_image.dart`: now we display localized images
* `transient_file.dart`: added language to transient file key
* `up_to_date_changes.dart`: unrelated removal of not used fields
2023-04-24 18:58:32 +02:00
e5e6eab087 feat: 3565 - badge on bottom bar about background tasks and access to list (#3567)
* feat: 3565 - badge on bottom bar about background tasks and access to list

Impacted files:
* `app_en.arb`: added 9 labels related to background tasks
* `background_task_manager.dart`: added an error/status for each task; removed the concept of "blocked" task manager
* `offline_tasks_page.dart`: localized and added error labels
* `page_manager.dart`: added a badge on bottom bar about pending background tasks
* `pubspec.lock`: wtf
* `pubspec.yaml`: added a dependency to `badges`
* `user_preferences_dev_mode.dart`: removed the access to the pending background task page
* `user_preferences_page.dart`: added a direct access to the pending background task page

* feat: 3565 - badge on bottom bar about background tasks and access to list

New file:
* `background_task_badge.dart`: Badge about pending background tasks.

Impacted files:
* `app_en.arb`: added 1 label about subtitle, edited the label about title
* `page_manager.dart`: now using new class `BackgroundTaskBadge`
* `user_preferences_page.dart`: added a subtitle and a badge for background tasks

* feat: 3565 - refreshed goldens test

* feat: 3565 - golden tests

Impacted files:
* `background_task_badge.dart`: refactored
* `background_task_manager.dart`: refactored
* `dao_string_list.dart`: added comments
* `local_database.dart`: added a method to be mocked
* `local_database_mock.dart`: overrode a method
* `offline_tasks_page.dart`: refactored
* `user_preferences_page-dark.png`: goldens
* `user_preferences_page-light.png`: goldens
* `user_preferences_page_test.dart`: added a reference to `LocalDatabase`

* feat: 3565 - golden tests

Impacted files:
* `background_task_badge.dart`: refactored
* `background_task_manager.dart`: refactored
* `dao_string_list.dart`: added comments
* `local_database.dart`: added a method to be mocked
* `local_database_mock.dart`: overrode a method
* `offline_tasks_page.dart`: refactored
* `user_preferences_page-dark.png`: goldens
* `user_preferences_page-light.png`: goldens
* `user_preferences_page_test.dart`: added a reference to `LocalDatabase`
2023-01-11 17:18:57 +01:00
8835f864ec fix: 3533 - added a "stamp" to background tasks, to identify similar tasks (#3548)
* fix: 3533 - added a "stamp" to background tasks, to identify similar tasks

Impacted files:
* `abstract_background_task.dart`: added a stamp; minor refactoring
* `add_basic_details_page.dart`: implemented the background stamp
* `add_other_details_page.dart`: implemented the background stamp
* `background_task_details.dart`: new `enum BackgroundTaskDetailsStamp`; added the background stamp
* `background_task_image.dart`: added the background stamp
* `background_task_manager.dart`: refactored the run queue; stops when there's not internet connection
* `background_task_refresh_later.dart`: added the background stamp
* `edit_ingredients_page.dart`: added the background stamp
* `edit_new_packagings.dart`: implemented the background stamp
* `local_database.dart`: unrelated removal of deprecated comment
* `main.dart`: slightly related fix of #3522, because we used to run background tasks before the language was set
* `nutrition_page_loaded.dart`: implemented the background stamp
* `ocr_helper.dart`: added a background stamp
* `ocr_ingredients_helper.dart`: implemented the background stamp
* `ocr_packaging_helper.dart`: implemented the background stamp
* `simple_input_page.dart`: added the background stamp; now we split the updates in as many minimum parts as possible
* `simple_input_page_helpers.dart`: added and implemented background stamps; unrelated fix (when the widget is not displayed, the data should be considered as "not changed")

* fix: 3533 - added a 5 second delay between runs

Impacted files:
* `background_task_details.dart`: more verbose tags for stamps
* `background_task_image.dart`: added language to stamp
* `background_task_manager.dart`: added a 5 second minimum delay between runs; added temporary debug prints
* `edit_product_page.dart`: added a task refresh
* `product_image_gallery_view.dart`: added a task refresh
2023-01-09 16:24:04 +01:00
1190474c9b fix: 3533 - using a not temporary directory for images to be uploaded (#3539)
Impacted files:
* `background_task_image.dart`: explicitly deleting the file at the end of the task.
* `new_crop_page.dart`: changed the directory to a "not temporary" one
* `transient_file.dart`: finally only dealing with removing transient files, not the actual OS file
2023-01-06 14:44:11 +01:00
7e861f569e refactor: upgrade to off-dart 2.0.0 (#3495)
Impacted files:
* `paged_to_be_completed_product_query.dart`: renamed `State` as `ProductState`
* `paged_user_product_query.dart`: created local `UserSearchType` instead of deprecated off-dart `UserProductSearchType`; used `ProductSearchQueryConfiguration` instead of deprecated `UserProductSearchQueryConfiguration`
* `product_query.dart`: now that we use fully v3, we don't need the temporary field list for user-related queries with v2
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgrade to off-dart 2.0.0
* `user_preferences_account.dart`: now using new local class `UserSearchType`
* and reduced all off-dart imports to a single `import 'package:openfoodfacts/openfoodfacts.dart';`
2023-01-02 16:10:52 +01:00
1cce8cce07 feat: Add all scanned products to list (#3401)
* feat: Add all scanned products to list

* Code review

* refactoring from product_list_user_dialog_helper

* Update all_user_product_list_page.dart

* Correct use of pop'ed bools

* Now showing if all products are included

* Await + rename

* Remove loading dialog

* Update product_list_user_dialog_helper.dart

* Update dao_product_list.dart
2022-12-22 12:46:20 +01:00
5304614c99 feat: 3263 - new BackgroundTaskManager that always works (#3339)
Deleted file:
* `background_task_helper.dart`

New files:
* `background_task_manager.dart`: Management of background tasks: single thread, block, restart, display.
* `dao_instant_string.dart`: Where we store strings that need INSTANT access (= not lazy, no await).

Impacted fles:
* `abstract_background_task.dart`: refactored
* `background_task_details.dart`: refactored around the changes in `AbstractBackgroundTask`
* `background_task_image.dart`: refactored around the changes in `AbstractBackgroundTask`
* `dao_string_list.dart`: refactoring around now managing several lists; removed unnecessary `await` for a non-lazy dao
* `local_database.dart`: added the new class `DaoInstantString`; relaunch the background task manager at every refresh
* `main.dart`: minor refactoring
* `new_crop_page.dart`: unrelated bug fix
* `offline_tasks_page.dart`: refactored around the new `BackgroundTaskManager`
* `operation_type.dart`: added helper methods
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_viewer.dart`: unrelated bug fix - the product was not refreshed, and so wasn't the image even after a successful download
* `pubspec.lock`: wtf
* `pubspec.yaml`: removed `flutter_task_manager`
* `search_history_view.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `search_page.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `up_to_date_changes.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
2022-11-25 17:31:25 +01:00
fba2851809 fix: 3018 - instant upload of images (#3329)
New files:
* `ocr_widget.dart`: Widget dedicated to OCR, with 3 actions: upload image, extract data, save. Used to be in `edit_ingredients_page.dart`
* `transient_file.dart`: Helper class about transient files (= not fully uploaded yet).

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `add_new_product_page.dart`: refactored around the class image repository
* `app_en.arb`: added 1 label when OCR fails
* `app_fr.arb`: added 1 label when OCR fails
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: immediate execution with just one try
* `confirm_and_upload_picture.dart`: minor refactoring with new private class `_OutlinedButton`
* `edit_ingredients_page.dart`: moved `OcrWidget` code to dedicated new dart file; fixed the extract button - that cannot be reached if the image is not uploaded yet
* `image_crop_page.dart`: refactored with more explicit method names
* `image_upload_card.dart`: refactored with `TransientFile`
* `new_product_page.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_gallery_view.dart`: refactored with new method `confirmAndUploadNewPicture` and new class `TransientFile`
* `product_image_viewer.dart`: refactored with new class `TransientFile`
* `question_card.dart`: minor refactoring
* `smooth_product_image.dart`: refactored with new class `TransientFile`
2022-11-19 14:45:50 +01:00
316272e2f7 fix: #3018 - minor step for background tasks (#3302)
New file:
* `dao_transient_operation.dart`: Transient operation: a minimalist product with a key.

Impacted files:
* `barcode_product_query.dart`: minor refactoring
* `local_database.dart`: added reference to new class `DaoTransientOperation`
* `Podfile.lock`: wtf
* `product_refresher.dart`: minor refactoring
* `pubspec.lock`: wtf
2022-11-10 22:55:15 +01:00
222eb6e69e fix: #3018 - UpToDateProductProvider now field of LocalDatabase (#3220)
Impacted files:
* `add_basic_details_page.dart`: got rid of `UpToDateProductProvider`
* `add_new_product_page.dart`: got rid of `UpToDateProductProvider`
* `edit_ingredients_page.dart`: got rid of `UpToDateProductProvider`
* `edit_product_page.dart`: got rid of `UpToDateProductProvider`
* `knowledge_panel_page.dart`: got rid of `UpToDateProductProvider`
* `local_database.dart`: added an `UpToDateProductProvider` field
* `main.dart`: got rid of `UpToDateProductProvider`
* `new_product_page.dart`: got rid of `UpToDateProductProvider`
* `nutrition_page_loaded.dart`: got rid of `UpToDateProductProvider`
* `personalized_ranking_model.dart`: got rid of `UpToDateProductProvider`
* `personalized_ranking_page.dart`: got rid of `UpToDateProductProvider`
* `Podfile.lock`: wtf
* `product_image_gallery_view.dart`: got rid of `UpToDateProductProvider`
* `product_list_item_simple.dart`: got rid of `UpToDateProductProvider`
* `product_list_page.dart`: got rid of `UpToDateProductProvider`
* `product_refresher.dart`: got rid of `UpToDateProductProvider`
* `simple_input_page.dart`: got rid of `UpToDateProductProvider`
* `summary_card.dart`: got rid of `UpToDateProductProvider`
* `up_to_date_product_provider.dart`: not a provider anymore; using `LocalDatabase` instead
2022-10-27 09:32:59 +02:00
d2f8077812 feat: menu to manage offline data (#2971)
* initial page build

* functions to calculate size and total number of products
and also deleting products from db

* helper functions added

* removed unnessary comment

* variable rename and comment add

* code refactor

* better comments

* translations added

* function rename

* minor fixes

* better comments style
2022-09-10 15:27:21 +02:00
d922511a32 feat: #2785 - async access to dao product list (#2788)
Impacted files:
* `all_user_product_list_page.dart`: split in a not-loaded / loaded version; computes each user list length with a `FutureBuilder
* `continuous_scan_model.dart`: minor refactoring
* `dao_product_list.dart`: switch from "box" to "lazyBox" in order to cleanly make all methods `async`
* `new_product_page.dart`: now loading lists with `FutureBuilder`
* `paged_product_query.dart`: replaced deprecated methods
* `paged_to_be_completed_product_query.dart`: replaced deprecated methods
* `product_list_import_export.dart`: replaced deprecated methods
* `product_list_page.dart`: minor refactoring; replaced deprecated methods
* `product_list_supplier.dart`: minor refactoring
* `product_list_user_dialog_helper.dart`: now explicitly calling `notifyListeners` as `setState` won't be enough because of pre-loaded data
* `pubspec.lock`: generated
* `pubspec.yaml`: upgrade to `openfoodfacts: ^1.24.0`
* `query_product_list_supplier.dart`: minor refactoring
2022-08-16 18:48:36 +02:00
115722b613 feat: #2396 - better memory management - load products only when needed (#2609)
Deleted files:
* `scan_page_helper.dart`: refactored as there was only a single small method there, with a lousy "ignore" management.
* `smooth_main_button.dart`: old redundant button that did not fit the latest UI

New files:
* `personalized_ranking_model.dart`: Model that computes the scores and sorts the barcodes accordingly.
* `product_model.dart`: Model for product database get and refresh.
* `scan_product_card_loader.dart`: Display of product for the scan page, after async load from local database.
* `tmp_matched_product_v2.dart`: to be merged into off-dart

Impacted files:
* `app_en.arb`: added a label for "refresh_with_new_preferences"
* `app_fr.arb`: added a label for "refresh_with_new_preferences"
* `continuous_scan_model.dart`: now we don't store Product and we let the product cards get the product from the local db if and only if needed
* `dao_product.dart`: minor refactoring
* `dao_product_list.dart`: now we don't deal with products anymore, just barcodes.
* `group_query_filter_view.dart`: removed deprecated `SmoothMainButton`
* `partial_product_list.dart`: now we don't deal with products anymore, just barcodes.
* `personalized_ranking_page.dart`: now uses new class `PersonalizedRankingModel` for better refresh and async product load; now using appropriate button with localized label; fixed dismiss action
* `product_list.dart`: now we don't deal with products anymore, just barcodes.
* `product_list_import_export.dart`: refactored
* `product_list_item_simple.dart`: now we `async`ly load the product from the local database, and keep it refreshed for every change; now based on new class `ProductModel`; added sentry error calls; typo fix
* `product_list_page.dart`: now we don't store Product and we let the product cards get the product from the local db if and only if needed
* `product_preferences.dart`: new method `getCompactView` used to know if something changed.
* `product_query_model.dart`: now we include the "category" process in the model, and we don't store products.
* `product_query_page.dart`: removed useless and inactive sliver effect and `Hero`; refactored
* `product_query_page_helper.dart`: removed bug generating `Hero`
* `scan_header.dart`: refactored from `scan_page_helper.dart` being removed and slightly modified
* `search_page.dart`: removed bug generating `Hero`
* `smooth_product_carousel.dart`: now we async'ly load product from local database, and don't store them in memory.
* `summary_card.dart`: removed bug generating `Hero`
* `up_to_date_product_provider.dart`: added timestamps for new method `needsRefresh`
* `user_preferences_account.dart`: removed bug generating `Hero`
2022-07-25 08:12:04 +02:00
7ab7c1584a feat: #2447 - gzipped product column - 6 times smaller database! (#2527)
New files:
* `dao_product_migration.dart`: Helpers around product data migration.
* `dao_unzipped_product.dart`: used to be `DaoProduct` - the old not zipped version; fixed `getAll` for big lists

Impacted files:
* `dao_hive_product.dart`: minor refactoring as `DaoProductMigrationSource`
* `dao_product.dart`: new table with zipped BLOB column as product and last update timestamp
* `local_database.dart`: now it's version 2 of sql database (new zipped product table); migration from old unzipped to new zipped product table; refactored around `DaoProductMigration`
2022-07-07 16:54:15 +02:00
9e253a774f feat: #2339 - added language and country to query product list keys (#2465)
What:
* added language and country to query product list keys
* that means that if I run a query for "pizza", not only the results will be different depending on the language and country (that was already the case), but the results will be cached accordingly - if I change language or country, I will see the cached results for those new language/country, not the results of the same query but with different language/country
* we needed that improvement in order to display correctly the "world" results; that was the first step
* also moved all the "query" classes to a specific folder
* fun fact: there are more "pizza"s in France than in Italy

Impacted files:
* `abstract_onboarding_data.dart`: minor refactoring
* `barcode_product_query.dart`: moved; minor refactoring
* `category_product_query.dart`: moved; added language and country to product list key
* `continuous_scan_model.dart`: minor refactoring
* `country_selector.dart`: minor refactoring
* `database_product_list_supplier.dart`: minor refactoring
* `keywords_product_query.dart`: moved; added language and country to product list key
* `main.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `nutrition_page_loaded.dart`: minor refactoring
* `ocr_helper.dart`: minor refactoring
* `onboarding_data_product.dart`: minor refactoring
* `ordered_nutrients_cache.dart`: minor refactoring
* `paged_product_query.dart`: moved; added language and country to product list key; refactored around `getProducts`
* `paged_search_product_query.dart`: moved; refactored
* `paged_to_be_completed_product_query.dart`: moved; added language and country to product list key; refactored
* `paged_user_product_query.dart`: moved; added language to product list key; refactored
* `picture_capture_helper.dart`: minor refactoring
* `product_dialog_helper.dart`: minor refactoring
* `product_list.dart`: added optional language and country to constructor parameters
* `product_list_import_export.dart`: minor refactoring
* `product_list_page.dart`: minor refactoring
* `product_list_supplier.dart`: minor refactoring
* `product_query.dart`: moved; not an interface anymore
* `product_query_model.dart`: minor refactoring
* `product_query_page_helper.dart`: minor refactoring
* `product_refresher.dart`: minor refactoring
* `query_product_list_supplier.dart`: minor refactoring
* `robotoff_insight_helper.dart`: minor refactoring
* `robotoff_questions_query.dart`: moved; minor refactoring
* `search_page.dart`: minor refactoring
* `simple_input_page_helpers.dart`: minor refactoring
* `summary_card.dart`: minor refactoring
* `user_preferences_account.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
2022-07-02 15:44:56 +02:00
061fa6ede4 fix: #2362 history not refreshing (#2393)
* fix: #2362 history not refreshing

* fix:#2362 refactoring codereview

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-06-30 21:15:48 +02:00
587e943eb6 feat: #2425 - added "all products to be completed" item (in user page) (#2441)
New files:
* `paged_to_be_completed_product_query.dart`: Back-end paged query for all "to-be-completed" products.
* `tmp_to_be_completed_query_configuration.dart`: Query Configuration for all to-be-completed products.

Deleted files:
* `contributor_product_query.dart`
* `informer_product_query.dart`
* `photographer_product_query.dart`
* `to_be_completed_product_query.dart`

Impacted files
* `app_en.arb`: 1 label slightly modified, 1 added label.
* `app_fr.arb`: 1 label slightly modified, 1 added label.
* `paged_user_product_query.dart`: refactored around `UserProductSearchQueryConfiguration`.
* `product_list.dart`: added a new list - all products to be completed (not just the user's).
* `product_list_page.dart`: refactored.
* `product_query_page_helper.dart`: refactored.
* `user_preferences_account.dart`: added an item for "all to-be-completed"; refactored.
2022-06-30 18:36:35 +02:00
c1664d67b7 feat: #2248 - user agent distinction between scan and barcode search (#2408)
Impacted files:
* `barcode_product_query.dart`: new parameter `isScanned` to distinguish scan and barcode search via the user agent comment field
* `continuous_scan_model.dart`: "this IS a scan"
* `product_dialog_helper.dart`: "this is NOT a scan"
* `product_query.dart`: new method to set the user agent comment field
2022-06-28 09:17:34 +02:00
2c0a31ff9c feat: #1070 - OCR for packaging (#2383)
New files:
* `ocr_helper.dart`: OCR Helper, to be implemented for ingredients and packaging for instance.
* `ocr_ingredients_helper.dart`: OCR Helper for ingredients.
* `ocr_packaging_helper.dart`: OCR Helper for packaging.
* `tmp_ocr_packaging_result.dart`: to be moved to off-dart.

Impacted files:
* `app_en.arb`: added 6 labels for packaging OCR.
* `edit_ingredients_page.dart`: refactored around new class `OcrHelper`.
* `edit_product_page.dart`: added access to edit OCR packaging; refactored.
* `knowledge_panels_builder.dart`: refactored.
* `product_query.dart`: added packaging fields to the product fields we get from the server.
2022-06-25 23:07:54 +02:00
0f94837966 fix: #1700 - nutrients - refactored "save" action as in SimpleInputPage (#2338)
Impacted files:
* `app_en.arb`: removed 2 labels not used anymore
* `nutrition_container.dart`: added "no nutrition data"
* `nutrition_page_loaded.dart`: refactored the "save" action as in `SimpleInputPage`; added "no nutrition data"; just trying - remove the status bar recoloring; added a save/cancel bottom bar; fixed a bug in `_isEdited`
* `product_query.dart`: added field "no nutrition data"
2022-06-24 12:58:42 +02:00
399996770c feat: #2169 - added emb codes and countries (#2363)
* feat: #2169 - added emb codes and countries

Impacted files:
* `app_en.arb`: added emb codes and countries translations
* `app_fr.arb`: added emb codes and countries translations
* `edit_product_page.dart`: added emb codes and countries editors
* `Podfile.lock`: wtf
* `product_query.dart`: added emb codes and countries product fields
* `product_refresher.dart`: now using language and country parameters for `saveProduct`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded versions of off-dart and sentry
* `simple_input_page.dart`: added an optional explanation field
* `simple_input_page_helpers.dart`: added emb codes and countries helpers; added an optional explanation field; refactored

* Update packages/smooth_app/lib/l10n/app_en.arb

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/l10n/app_en.arb

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/l10n/app_en.arb

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/l10n/app_en.arb

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2022-06-23 15:33:27 +02:00
97d36bc71c feat: Logs service (+ email attachment) (#2303)
* Logs service (+ email attachment)

* Fix flutter format warning

* Reformat code

* Remove fimber_io dependency to have our own implementations instead

* Add close:true to email dialog

* Add SENDTO query to AndroidManifest

* Remove useless comment
2022-06-23 15:14:28 +02:00
5715cf7171 fix: #1427 scanning invalid code (#2336)
* fix: #1427 scan invalid code

* fix: #1427 fix presubmit test
2022-06-22 15:56:19 +02:00
e467ff964b feat: #2315 - added smoothie fields to user queries and localized (#2332)
Impacted files:
* `app_en.arb`: added a title for each of the 4 user queries
* `app_fr.arb`: added a title for each of the 4 user queries
* `paged_user_product_query.dart`: added smoothie fields to user queries
* `product_list_page.dart`: refactored
* `product_query_page_helper.dart`: refactored by removing useless code
* `user_preferences_account.dart`: refactored and translated
2022-06-20 22:09:49 +02:00
f9d4dc81b9 feat: #2315 - added 4 user-related searches in the profile screen (#2321)
New files:
* `contributor_product_query.dart`: User Product Search, in "contributor" mode.
* `informer_product_query.dart`: User Product Search, in "informer" mode.
* `paged_search_product_query.dart`: Back-end paged queries around search.
* `paged_user_product_query.dart`: Back-end paged queries around User.
* `photographer_product_query.dart`: User Product Search, in "photographer" mode.
* `to_be_completed_product_query.dart`: User Product Search, in "to be completed" mode.

Impacted files:
* `category_product_query.dart`: refactored with new class `PagedSearchProductQuery`
* `keywords_product_query.dart`: refactored with new class `PagedSearchProductQuery`
* `paged_product_query.dart`: now limited to page management
* `product_list.dart`: added `enum`s and constructors around user queries
* `product_list_page.dart`: added cases for the new 4 product list types
* `product_query_page_helper.dart`: added cases for the new 4 product list types
* `user_preferences_account.dart`
2022-06-19 20:35:12 +02:00
38f206f4b8 fix: comment about a deprecated file, to be removed when old enough (#2293)
Impacted file:
* `dao_hive_product.dart`
2022-06-16 13:35:57 +02:00
1662685825 feat: #2280 - DaoProduct's just migrated to sqflite (#2289)
New files:
* `abstract_sql_dao.dart`: DAO abstraction for SQL.
* `bulk_deletable.dart`: Interface for bulk database deletes.
* `bulk_insertable.dart`: Interface for bulk database inserts.
* `bulk_manager.dart`: Manager for bulk database inserts and deletes.
* `dao_hive_product.dart`: moved code from the previous `hive` version of `DaoProduct`, renamed here `DaoHiveProduct`

Impacted files:
* `dao_product.dart`: `sqflite` version of `DaoProduct`, that is from now on the only one to be used
* `local_database.dart`: added `sqflite` and its one table so far, also named `DaoProduct` in order to minimize the changes everywhere else (the old `DaoProduct` being renamed `DaoHiveProduct`); migrated the product data from `hive` to `sqflite`
* `Podfile.lock`: wtf
* `pubspec.lock`: wtf
* `data_importer/pubspec.yaml`: updated the `sqflite` dependency to the same as in `smooth_app`
* `smooth_app/pubspec.yaml`: added a dependency to `sqflite`
2022-06-16 07:09:09 +02:00
ca0a0f7f1a feat: #2204 - new "please sign in" message when the product is about to be edited (#2224)
Impacted files:
* `app_en.arb`: new translation for the "please sign in" message
* `app_fr.arb`: new translation for the "please sign in" message
* `edit_product_page.dart`: added calls to new `checkIfLoggedIn` method
* `product_query.dart`: added method `isLoggedIn`
* `product_refresher.dart`: added method `checkIfLoggedIn` and called it in `saveAndRefresh`
2022-06-08 20:23:20 +02:00
efe7f8d938 feat: #2169 - new simple input page for "Stores" (#2195)
New files:
* `simple_input_page.dart`: Simple input page: we have a list of labels, we add, we remove, we save.
* `simple_input_page_helpers.dart`: Helpers for Simple Input Page.

Impacted files:
* `category_picker_page.dart`: refactored
* `edit_ingredients_page.dart`: refactored
* `edit_product_page.dart`: added an "edit store" button; refactored
* `nutrition_page_loaded.dart`: refactored
* `product_query.dart`: added fields for stores
* `product_refresher.dart`: now we return the saved and refreshed product instead of a mere bool
2022-06-07 10:39:55 +02:00
2c24f9bde0 fix: #2147 - now using new product field comparedToCategory (#2154)
Impacted files:
* `product_query.dart`: now retrieving new product field `COMPARED_TO_CATEGORY`
* `pubspec.lock`: wtf
* `pubspec.dart`: now using version `1.18.0` of `openfoodfacts`, that includes new product field `comparedToCategory`
* `summary_card.dart`: now uses the new product field `comparedToCategory`
2022-06-04 19:08:08 +02:00
7242bedd43 fix: Matomo refactor (#2019)
* fix: Just a little reorder

* Matomo don't need context

* Update analytics_helper.dart

* Update product_query.dart
2022-05-27 11:15:10 +02:00
c3b44aced2 fix: Flutter 3.0 fixes (#1814)
* fix: Flutter 3.0 fixes

* Workflows

* Update gradle

* Automated fixes

* Manual async gap fixes

* Fix merge conflict reverts

* Format

* qr_code_scanner fixes
2022-05-12 16:07:22 +02:00
c43ad920ed feat: #1501 - refactored user preferences files into a dedicated folders (#1812) 2022-05-11 08:22:34 +02:00
342c5f18dc feat: #1501 - split of the preference page into detailed pages (#1797)
Deleted files:
* `faq_handle_view.dart`
* `list_helper.dart`
* `smooth_list_tile.dart`
* `social_handle_view.dart`
* `user_contribution_view.dart`

New files:
* `abstract_collapsible_user_preferences.dart`: Abstraction of a collapsed/expanded display for the preference pages.
* `all_user_product_list_page.dart`: Page that lists all user product lists.
* `user_preferences_connect.dart`: Display of "Connect" for the preferences page.
* `user_preferences_contribute.dart`: Display of "Contribute" for the preferences page.
* `user_preferences_faq.dart`: Display of "FAQ" for the preferences page.
* `user_preferences_list_tile.dart`: Custom `ListTile` for preferences.

Impacted files:
* `abstract_user_preferences.dart`: refactoring around the fact that now we display pages instead of collapsible List<Widget>
* `continuous_scan_model.dart`: refactored around `DaoProductList` being seldom `async`
* `dao_product_list.dart`: new method `getLength`; refactored with less `async` methods
* `new_product_page.dart`: refactored around `DaoProductList` being seldom `async`
* `preferences_page.dart`: minor refactoring
* `product_list_import_export.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_page.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_user_dialog_helper.dart`: new "delete list?" dialog; refactored around `DaoProductList` being seldom `async`
* `query_product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `user_preferences_attribute_group.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
* `user_preferences_food.dart`: minor refactoring
* `user_preferences_page.dart`: now we use the same `StatefulWidget` for a root page with only headers and detailed pages with bodies; added item "Lists"; created 3 new "top paragraphs" extracted from "settings".
* `user_preferences_page-blue-dark.dart`: impacted by new page design
* `user_preferences_page-blue-light.dart`: impacted by new page design
* `user_preferences_page-brown-dark.dart`: impacted by new page design
* `user_preferences_page-brown-light.dart`: impacted by new page design
* `user_preferences_page-green-dark.dart`: impacted by new page design
* `user_preferences_page-green-light.dart`: impacted by new page design
* `user_preferences_profile.dart`: minor refactoring
* `user_preferences_settings.dart`: minor refactoring
2022-05-10 20:53:34 +02:00
6cd8008f12 fix: #1786 - safe write access to barcode lists (#1792)
Impacted file:
* `dao_product_list.dart`: safe write access to barcode lists

Fixes SMOOTHIE-V2
2022-05-09 17:34:40 +02:00
bb89eb5ffa feat: knowledgePanels are now loaded with the other product fields (#1691)
Deleted file:
* `knowledge_panels_query.dart`

Impacted files:
* `new_product_page.dart`: simplified as knowledge panels are now already in product
* `product_query.dart`: added `ProductField.KNOWLEDGE_PANELS` to default fields
2022-04-28 22:46:52 +02:00