Giter Club home page Giter Club logo

Comments (1)

monsieurtanuki avatar monsieurtanuki commented on June 27, 2024

@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 mandatory
    • TitleElement: only title is mandatory
  • knowledge_panel_element.dart:
    • KnowledgePanelTextElement: only html is mandatory
    • KnowledgePanelImageElement: only url is mandatory
    • KnowledgePanelPanelGroupElement: only panel_ids is mandatory
    • KnowledgePanelPanelIdElement: only panel_id is mandatory
    • KnowledgePanelTableCell: only text is mandatory
    • KnowledgePanelTableRowElement: only values is mandatory
    • KnowledgePanelTableColumn: only text is mandatory
    • KnowledgePanelWorldMapElement: only pointers is mandatory
    • KnowledgePanelGeoPointer: nothing is mandatory
    • KnowledgePanelLatLng: both lat and lng are mandatory
    • KnowledgePanelTableElement: id, columns and rows are mandatory
    • KnowledgePanelActionElement: both html and actions are mandatory
    • KnowledgePanelElement: only element_type is mandatory

from openfoodfacts-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.