openfoodnetwork icon indicating copy to clipboard operation
openfoodnetwork copied to clipboard

Producers: Certifications filter (add 'All Certifications' option on API)

Open kirstenalarsen opened this issue 11 months ago • 18 comments

@JbPasquier comment on Slack

It seems that there are no relation between https://api.regenerative.org.au/webhook/regen/assurance?id=recllpzAo2WyaVvGz and https://api.regenerative.org.au/webhook/regen/certification?id=Organic So I have no way to filter those certifications. Maybe you can replace ofn:Certification_status with an ofn:certification with a value like this {"@id": "https://api.regenerative.org.au/webhook/regen/certification?id=Organic"} ?

@mkllnk thinks there may be a missing attribute, working on this today

kirstenalarsen avatar Mar 06 '24 22:03 kirstenalarsen

I think you are suggesting in Slack that there are potentially two problems here: one is the same as the Supporting Evidence filter (i.e. in the framework at your end) and the other could be related to data. Can you tell us any more about your hunch with data - is there anything @maikel can investigate or this is really with you?

kirstenalarsen avatar Mar 06 '24 22:03 kirstenalarsen

@mkllnk already fixed the issue with the datas. Maybe there are something more but for now it's all on Startin'blox end.

JbPasquier avatar Mar 06 '24 22:03 JbPasquier

Great, thanks

kirstenalarsen avatar Mar 06 '24 22:03 kirstenalarsen

Fixed!

JbPasquier avatar Mar 12 '24 10:03 JbPasquier

Hurray!! Getting there!

Image

Couple of comments [] This needs to be multi-select, as per #20 [] How hard would it be to have an 'all Certified' option? (this could be a @mkllnk question) - this would then work the same as the 'Certified' option under 'Ecological Outcomes -> Supporting Evidence'

kirstenalarsen avatar Mar 13 '24 03:03 kirstenalarsen

For reference.

How hard would it be to have an 'all Certified' option? - this would then work the same as the 'Certified' option under 'https://github.com/openfoodfoundation/sib-discovery-components/issues/21

https://github.com/openfoodfoundation/sib-discovery-components/issues/21#issuecomment-1997333279

JbPasquier avatar Mar 14 '24 12:03 JbPasquier

@mkllnk can you please implement an 'all Certifications' option on the API so that it can appear on the filter

kirstenalarsen avatar Mar 21 '24 00:03 kirstenalarsen

it should be shown at the top of the list

mariocarabotta avatar Apr 03 '24 00:04 mariocarabotta

Added 'all Certifications' option in the API. I believe it's for @JbPasquier to fix the filtering now.

rioug avatar Apr 16 '24 05:04 rioug

What needs to be fixed?

JbPasquier avatar Apr 16 '24 09:04 JbPasquier

not sure if it requires @rioug or @JbPasquier, apologies.

the option in the dropdown is now coming through BUT it doesn't filter as it should (doesn't show any producer)

Screenshot 2024-04-17 at 9 14 16

you can test it here https://regenerative.org.au/directory/

mariocarabotta avatar Apr 17 '24 00:04 mariocarabotta

Is this back to @mkllnk or @JbPasquier ?

kirstenalarsen avatar Apr 17 '24 01:04 kirstenalarsen

When 'All Certifications' is selected, it should show every Producer that has a certification (any one of them)

On Wed, 17 Apr 2024 at 10:18, mariocarabotta @.***> wrote:

not sure if it requires @rioug https://github.com/rioug or @JbPasquier https://github.com/JbPasquier, apologies.

the option in the dropdown is now coming through BUT it doesn't filter as it should (doesn't show any producer)

Screenshot.2024-04-17.at.9.14.16.png (view on web) https://github.com/openfoodfoundation/openfoodnetwork/assets/6696729/99a149c7-e57f-44ab-ae98-a471b23f8486

you can test it here https://regenerative.org.au/directory/

— Reply to this email directly, view it on GitHub https://github.com/openfoodfoundation/openfoodnetwork/issues/12239#issuecomment-2060105208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWGXSD2YSY725BD2DXNMXDY5W5TZAVCNFSM6AAAAABEJ4S3WCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQGEYDKMRQHA . You are receiving this because you authored the thread.Message ID: @.***>

kirstenalarsen avatar Apr 17 '24 01:04 kirstenalarsen

@JbPasquier If am not mistaken the filtering is handled by the component, so the filtering should to be fixed as explained above :

When 'All Certifications' is selected, it should show every Producer that has a certification (any one of them)

rioug avatar Apr 17 '24 02:04 rioug

The filtering is data-driven. If your producer datas does not include this entry on their certifications, then it'll not be filtered.

JbPasquier avatar Apr 17 '24 09:04 JbPasquier

I'm not sure how we proceed here. Right now we have a filter by certain certification types. We added a special "All Certifications" option to the list and we would like it to show all producers that have any certification.

@JbPasquier, you are suggesting to add data to the producers. We could do that. So any producer which has a certification would get one additional certification of the type "All Certifications". The problem with this is that it would also appear in other parts of the directory as an actual certification, but it's just a dummy entry for the filter.

Two possible solutions:

  • We add that All Certifications certification to producers and the component needs to hide this special one from the details pages. This is work for you and me.
  • We somehow make that one option special to become an any filter. It does sound reasonable to me for a filter component to support an "any" and a "nothing" option, corresponding to "show me enterprises with at least on certification from the options list" and "show me enterprises with no certifications from the options list". I'm mentioning the no option just for completeness, we don't actually need. That would be work for you. Scope is a bit grey because the original spec was a multi-select which needs new endpoints. That brings me to the next solution:
  • We implement an endpoint for this filtering. Then you could easily do a multi-select and since we do the filtering on our side, we can have any option we like, right?

mkllnk avatar Apr 19 '24 01:04 mkllnk

it has been decided that we are NOT going to show the All Certification option for the 6th May launch. We will address this more comprehensively together with a few other updates to filters.

@rioug to remove the filter option and push this back to Design / Planning / Estimate

mariocarabotta avatar Apr 23 '24 02:04 mariocarabotta

Done.

rioug avatar Apr 23 '24 03:04 rioug