-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List attributes in database page #215
Conversation
leonkenneth
commented
Feb 5, 2025
•
edited
Loading
edited


The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Résultats des tests E2E PlaywrightDetails
Skipped testsfirefox › map-page.spec.ts › Carte › doit contenir les éléments nécessaires |
0085e0c
to
70a09eb
Compare
Be resilient to API issues for homepage and tools page Remove databases YAML and logos, as they are in the backend now Proper search and highlighting are in another PR
1d4f256
to
67c49b2
Compare
Qu'est-ce que ça donne sur téléphone ? |
Pas génial effectivement. Je vais faire une repasse de responsive |
const relevantAttributesPerDatabase: { [key: number]: Attribute[] } = {}; | ||
|
||
const databasesMatchingQuery = databases.filter((database) => { | ||
if (search.length == 0) return true; | ||
|
||
relevantAttributesPerDatabase[database.id] = database.attributes.filter( | ||
(attribute) => | ||
attribute.description.toLowerCase().includes(search.toLowerCase()), | ||
); | ||
return relevantAttributesPerDatabase[database.id].length > 0; | ||
}); | ||
|
||
const displayedDatabases = | ||
databasesMatchingQuery.length > 0 ? databasesMatchingQuery : databases; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pas obligatoire ici mais en bonne pratique pour les perfs: quand tu as des variables calculées, tu peux utiliser un useMemo
pour éviter de recalculer le tout lors du rerender qui peut arriver assez fréquemment.
J'ai màj le CSS du responsive. J'ai mis des screenshots supplémentaires de ce que ça donne dans la PR |