diff --git a/src/main/webapp/public/competition.js b/src/main/webapp/public/competition.js
index 53ddd7b..c8e7352 100644
--- a/src/main/webapp/public/competition.js
+++ b/src/main/webapp/public/competition.js
@@ -46,7 +46,7 @@ function homePage() {
let content = document.createElement('div');
content.innerHTML = `
- - Par poule
+ - Par catégorie
- Par combattant
- Par club
- Tous les combattants
@@ -258,7 +258,7 @@ function poulePage(location) {
rootDiv.innerHTML = header + backButton;
const content = document.createElement('div');
content.style.marginTop = '1em';
- content.innerHTML = 'Recherche par poule
';
+ content.innerHTML = 'Recherche par catégorie
';
const dataContainer = document.createElement('div');
dataContainer.id = 'data-container';
@@ -334,8 +334,8 @@ function poulePage(location) {
.then(poule => {
const select = document.createElement('select');
select.setAttribute('id', poule.id);
- select.innerHTML = ``;
- for (const pouleKey of Object.keys(poule).sort()) {
+ select.innerHTML = ``;
+ for (const pouleKey of Object.keys(poule).sort((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()))) {
select.innerHTML += ``;
}
select.addEventListener('change', e => {
@@ -356,7 +356,7 @@ function poulePage(location) {
loadPoule();
}
})
- .catch(() => rootDiv.append(new Text("Erreur de chargement des poules")))
+ .catch(() => rootDiv.append(new Text("Erreur de chargement des catégories")))
.finally(() => stopLoading(loading));
rfFonction = () => {
diff --git a/src/main/webapp/src/pages/result/ResultView.jsx b/src/main/webapp/src/pages/result/ResultView.jsx
index 7f06393..c17c07e 100644
--- a/src/main/webapp/src/pages/result/ResultView.jsx
+++ b/src/main/webapp/src/pages/result/ResultView.jsx
@@ -150,14 +150,15 @@ function CategoryList({uuid}) {
useEffect(() => {
if (data && Object.keys(data).length > 0)
- setCatId(data[Object.keys(data).sort()[0]])
+ setCatId(data[Object.keys(data).sort((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()))[0]])
}, [data]);
return <>
{data ?
Catégorie
: error
@@ -224,14 +225,15 @@ function ClubList({uuid}) {
useEffect(() => {
if (data && Object.keys(data).length > 0)
- setClubId(data[Object.keys(data).sort()[0]])
+ setClubId(data[Object.keys(data).sort((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()))[0]])
}, [data]);
return <>
{data ?
Club
: error
@@ -310,14 +312,15 @@ function CombList({uuid}) {
useEffect(() => {
if (data && Object.keys(data).length > 0)
- setCombId(data[Object.keys(data).sort()[0]])
+ setCombId(data[Object.keys(data).sort((a, b) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()))[0]])
}, [data]);
return <>
{data ?
Combattant
: error