Comments (1)
@teolemon Part of it probably concerns Smoothie and not directly off-dart.
Do you have examples of products with "unexpected" KPs?
Regarding your suggestions...
Handle HTML links in HTML content so that we can demo the SignalConso DGCCRF integration on Wednesday
Probably in Smoothie, but as far as I can see in the code (smooth_html_widget.dart
) we already open links (used in KP text card, action card and table card). I've just tested and it does work (e.g. on a "informations missing about the ingredient origins" KP, click on the "producer" link)
Make the HTML attribute optional for the ACTION element (for now we added an empty HTML attribute to avoid the bug)
Easy fix, to be coded on off-dart (make the field optional) and in Smoothie (don't display the html if null
).
Add a new button element that accepts an URL as a parameter (in coordination with @stephanegigandet )
Could be done easily, in off-dart then Smoothie.
Make as many things optional as possible. Kill knowledge panel if they crash, but keep the rest of the JSON alive in the view.
The thing is that we need a proper JSON structure for toJson
/fromJson
operations.
The easiest fix about that would be to store KPs as a simple String, to be decoded with kindness, and not as a JSON.
Try to be granular in crashes (eg not showing invalid ones, showing others)
I had a look at the KP mandatory fields, but they are not that many of them. Would the world be a much better place just making the rare mandatory fields as optional?
knowledge_panel.dart
:KnowledgePanel
: nothing is mandatoryTitleElement
: onlytitle
is mandatory
knowledge_panel_element.dart
:KnowledgePanelTextElement
: onlyhtml
is mandatoryKnowledgePanelImageElement
: onlyurl
is mandatoryKnowledgePanelPanelGroupElement
: onlypanel_ids
is mandatoryKnowledgePanelPanelIdElement
: onlypanel_id
is mandatoryKnowledgePanelTableCell
: onlytext
is mandatoryKnowledgePanelTableRowElement
: onlyvalues
is mandatoryKnowledgePanelTableColumn
: onlytext
is mandatoryKnowledgePanelWorldMapElement
: onlypointers
is mandatoryKnowledgePanelGeoPointer
: nothing is mandatoryKnowledgePanelLatLng
: bothlat
andlng
are mandatoryKnowledgePanelTableElement
:id
,columns
androws
are mandatoryKnowledgePanelActionElement
: bothhtml
andactions
are mandatoryKnowledgePanelElement
: onlyelement_type
is mandatory
from openfoodfacts-dart.
Related Issues (20)
- Get a localized list of countries HOT 4
- Add field "uploaded timestamp" for "raw" images
- Add support for the upcoming user info API HOT 4
- Add "expiration_date" product field
- Add "% DV" and "IU" as unit
- Know when to suggest "% DV" and "IU" as unit
- Allow to change host for product search HOT 7
- Nutrients should accept a String HOT 5
- Unit tests failing because of the "new" cookie
- Support field KnowledgePanelImageElement.link_url
- Currency for country table
- Why are we still referencing v0 ? HOT 3
- Add missing ADDITIVES_TAGS_IN_LANGUAGES and ALLERGENS_TAGS_IN_LANGUAGES HOT 2
- Missing suggestions with autocomplete (= `Häagen-Dazs` case) HOT 2
- Prices/Location: add countrycode field. HOT 1
- Flutter Web and the User Agent HOT 1
- Respect rate-limits during integration tests HOT 4
- Price proof: link a date, location & currency HOT 9
- Sending null from the SDK?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfoodfacts-dart.