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

Producer Details Page - Order supporting evidence by evidence start date #70

Open mariocarabotta opened 2 weeks ago

mariocarabotta commented 2 weeks ago

3 new fields have been added to the Airtable base - assurances:

They have also already been added to Miniextensions as well.

We want the supporting evidence list in the producer details page to be ordered by start date, and this range of dates to be displayed in the frontend.

Certifications are also listed at the bottom of the list. For now we are not going to make changes to this type of information (except a minor UI update).

Sorting logic

Date range string logic

Data available Format
Doesn't have start date don't display anything
Has start date, no end date, Present evidence=yes Jan 2023 - Present
Has start date, no end date Jan 2023
Has start date, has end date Jan 2023 - Oct 2023

UI changes

Example below

Image

mkllnk commented 2 weeks ago

I added the sorting to the evidence view in Airtable. Looking at Amida's test enterprise, which is the only one with test data so far, it seems to do the right thing and list the newer one first.