datafoodconsortium / dfc-prototype-V2

MIT License
2 stars 0 forks source link

[IMPORT PAGE] If OFFacts is selected add 2 fields #70

Closed RachL closed 4 years ago

RachL commented 4 years ago

Description When importing data from OFFacts, we need to be able to enter the brand and the packager code of the producer.

Best would be to improve the producer profile, but for now we are going to display only those field on the import page.

These fields are mandatory. An error message should be displayed below if trying to import without brand or packager code: Ce champ est obligatoire.

Acceptance Tests

  1. Log in
  2. Go to the page x-import-catalog
  3. Select Open Food Facts
  4. See that the two fields are appearing
  5. Adding a brand and packager code and importing works correctly
  6. If one of the two fields is missing a message is shown in red.

Mockups image

simonLouvet commented 4 years ago

@RachL L'API que j'ai créé sur le bus prend indéferement le brands ou le packager-code. Je n'ai donc ajouté qu'un champ que OFF est choisi comme source. la gestion des champ d’option à rajouter à l'url sont configuré dans la config pour pouvoir être modifié sans coder image

{
      "name": "Open Food Fact",
      "url": "https://grappe.io/data/api/5e3d67de8d4440002a74d390-OFF-DFC-Producer",
      "version":"1.2",
      "options":[
        {
          "label":"Brands / Packager-Code",
          "param":"producer",
          "info":"si vous disposez de produit referencés sur Open FoodFact, vous devriez avoir la marque ('brands') ou votre code emaballeur/estampille sanitaire ('packager-code') de renseigné sur ces produits."
        }
      ]
    }
RachL commented 4 years ago

ok!