aleene / FoodViewer

An app to view and edit Open Food Fact products
Apache License 2.0
10 stars 5 forks source link

Simple search #538

Closed aleene closed 7 years ago

aleene commented 7 years ago

The advanced search does not implement all search possibilities (barcode, multilingual, palm oil stuff, nutrition score levels, roles (photographer, informer, contributor), last edit date, entry date). Some are however supported in the basic search. Implement this as well and warn for incompatibilities.

aleene commented 7 years ago

Compatability check might be required before the user adds a search element. If it is not compatable, the user can be alerted "Adding this search element to your search invalidates a previously defined search element (abort or continue?)". Upon adding the search element the incompatible one is removed. Create a single addSearch( element: SearchComponent, value: Any) function. And an isAddable( element: SearchComponent) function. In SearchTemplate I can add a flag to indicate whether the search has become unique, ie can be searched in basic- or advanced-mode only. Any new addition must then be checked. Otherwise no check is needed.

aleene commented 7 years ago

Added the simple search url creation to OFF and the selector. Added a calculated type variable to SearchTemplate, which checks the search variables to seen if we have a simple or advanced query. Add isHidden to cell tags.

aleene commented 7 years ago

Barcode needs a barcode type selector (EAN-8, UPC-12, EAN-13), which is used to pad the barcode.

If the user has set a barcode allow him to set the length. Add a padded() to BarcodeType. Add check for numbers only the textField.

aleene commented 7 years ago

Hide or disable incompatible search options in simple search. So the user can see what he loses.

aleene commented 7 years ago

If advanced disable barcode, entry date, edit date.

aleene commented 7 years ago

Seems all done. (Except palm oil and partial dates and multilingual