openfoodfoundation / sib-discovery-components

Development and application of Startin'Blox Discovery components, initial use in Discover Regenerative www.regenerative.org.au
1 stars 0 forks source link

Supporting evidence - Documents and external link not visible #30

Closed mariocarabotta closed 1 month ago

mariocarabotta commented 1 month ago

This is happening in the Producer details page.

Documents for download and / or external links that should be shown as links in the supporting evidence, are not shown. Examples of some certifications with attachments are available for The Regenerative Farm DR Example profile. Data has been added recently, might take a while for it to update.

CURRENT Image

EXPECTED Image

JbPasquier commented 1 month ago

I don't have access to those datas.

Related: https://github.com/openfoodfoundation/openfoodnetwork/issues/12237#issuecomment-1997343090

mkllnk commented 1 month ago

@mariocarabotta I can see in the data that multiple attachments can be present. Is there an upper limit? How should that be displayed?

mkllnk commented 1 month ago

@JbPasquier Is it still true that you can't handle arrays? So if we have a list of attachments then I need to provide another endpoint?

It would be great if we could find ways to reduce the number of requests and consolidate some of the data.

mkllnk commented 1 month ago

Until those questions above are answered I added the attachment URL and ofn:link for more information. The example above with new data:

[
  {
    "ofn:Creation_date": "2024-03-28",
    "ofn:Title": "Test with attachment and link",
    "ofn:Classification": {
      "@id": "https://n8n.openfoodnetwork.org.uk/webhook/regen/assurance/classifications?id=recz1gzaj0KSI5pXU",
      "@type": "ldp:Container",
      "ldp:contains": [
        {
          "@id": "https://n8n.openfoodnetwork.org.uk/webhook/regen/assurance/classification?id=Ecological%20-%20Biodiversity"
        }
      ]
    },
    "ofn:Description": "something interesting to say",
    "ofn:Link": "https://www.mariocarabotta.com/",
    "ofn:Service_provider": [
      "recpZlMWH9qB14sKB"
    ],
    "ofn:Documentation_permissions": "Publicly available",
    "ofn:service_provider_label": "ANU Sustainable Farms",
    "ofn:service_provider_uri": "https://www.sustainablefarms.org.au/",
    "ofn:attachment_uri": "https://v5.airtableusercontent.com/v3/u/27/27/1712109600000/l1YooxTP-Zy9jkfUkHy7dQ/5Rmz_K_rHAiuuvgLfczgxjpXCPby2kq6dIb0CV52mAKNAZa90kdWSDOLcv7p4ib-pIfbXJUyx-ZxsoW2nBli6Lt97VxctU5alYa0tf_slItXrtuRt40qbwayHkTnjxP1NL_60PbCHYliS_IF3nQDAg/vTeZ_fqng4KtQWLBAcnFiTvY_g52nWmpH53HtH_B-18",
    "ofn:hasCertificationStatus": {
      "@id": "https://n8n.openfoodnetwork.org.uk/webhook/regen/certification?id=undefined"
    },
    "@type": "ofn:supporting_evidence",
    "@id": "https://n8n.openfoodnetwork.org.uk/webhook/regen/assurance?id=recz1gzaj0KSI5pXU",
    "@context": "https://discover.openfoodnetwork.org.au/context.json"
  }
]
mariocarabotta commented 1 month ago

let's limit to one attachment. I'll update miniextension and remove multiple attachments from existing supporting evidence

mariocarabotta commented 1 month ago

found 3 real assurances with multiple attachments. 2, 207, 217.full list here I have copied over the original documents in Google Drive.

n.2 Pukawidgee is currently not eligible. Removed second document (@kirstenalarsen FYI)

n.207 Created and uploaded image that includes both files. Removed original photos

n.217 Created and uploaded image that includes both files. Removed original photos

I have updated Miniextensions, from now on it restricts to only one file, so you should always receive just one in the response

JbPasquier commented 1 month ago

Thanks, I'm on it.

JbPasquier commented 1 month ago

Done.

You may have some issue in your datas, like this one (Bundarra Farming for Good):

image

ofn:Documentation_permissions is Available on request but this producer have an attached document.

mariocarabotta commented 1 month ago

sorry JB, this is not working as expected. Fields on the left and right are not related to each other.

Field on the left Can be either publicly available or available on request ("ofn:Documentation_permissions"). If publicly available, show a button saying Download documentation (which downloads the attachment - "ofn:attachment_uri"). If available on request, just show a label that says "Documentation available on request to the producer", no attachment to download.

Field on the right Optional URL ("ofn:Link"). If available, show "Read more" external link, otherwise don't show anything.

JbPasquier commented 1 month ago

Thank you! Much clearer. Done.

image

Should I remove the original icon for "Documentation available on request to the producer" or maybe add it to "Download documentation"?

mariocarabotta commented 1 month ago

let's add it to Download documentation, on the right. thank you!