Skip to content

Commit

Permalink
Alphabet sort for usage applications cards
Browse files Browse the repository at this point in the history
  • Loading branch information
nkokla committed Dec 6, 2023
1 parent 100806c commit e6453db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/donnees-nationales/usages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import ButtonLink from '@/components/button-link'

import appsDataSource from '@/data/partners/usecases-ban.json'

const sortByKey = key => (a, b) => ((a[key] < b[key]) && -1) || ((a[key] > b[key]) && 1) || 0

const appsData = appsDataSource.map(
appData => Object.fromEntries(
Object
Expand Down Expand Up @@ -47,7 +49,7 @@ function BaseUsages() {
(tagsApplication && tagsApplication.split(', ').some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase())))
)
)
), [categorieFilter, statutFilter, typeFilter, searchTerm])
).sort(sortByKey('nomApplication')), [categorieFilter, statutFilter, typeFilter, searchTerm])

const title = 'Liste des usages de la BAN'
const description = 'Fichiers nationaux contenant les adresses du territoire.'
Expand Down

0 comments on commit e6453db

Please sign in to comment.