Skip to content
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

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

leonkenneth
Copy link
Contributor

@leonkenneth leonkenneth commented Feb 5, 2025

Capture d’écran 2025-02-05 à 17 20 51
Capture d’écran 2025-02-05 à 17 20 58
Capture d’écran 2025-02-05 à 17 21 13

Capture d’écran 2025-02-11 à 10 39 17 Capture d’écran 2025-02-11 à 10 39 09

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
batid-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 9:39am

Copy link

github-actions bot commented Feb 5, 2025

Résultats des tests E2E Playwright

passed  17 passed
skipped  1 skipped

Details

stats  18 tests across 4 suites
duration  18.6 seconds
commit  83139d4

Skipped tests

firefox › map-page.spec.ts › Carte › doit contenir les éléments nécessaires

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
@bbaret
Copy link
Collaborator

bbaret commented Feb 11, 2025

Qu'est-ce que ça donne sur téléphone ?

@leonkenneth
Copy link
Contributor Author

Qu'est-ce que ça donne sur téléphone ?

Pas génial effectivement. Je vais faire une repasse de responsive

Comment on lines +81 to +94
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;
Copy link
Collaborator

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.

@leonkenneth
Copy link
Contributor Author

J'ai màj le CSS du responsive. J'ai mis des screenshots supplémentaires de ce que ça donne dans la PR

@leonkenneth leonkenneth merged commit d2c514b into main Feb 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants