Merge pull request 'Correction bug ref competences' (#836) from lehmann/ScoDoc-Front:Title-EDT into master

Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/836
This commit is contained in:
Emmanuel Viennet 2023-12-30 11:41:29 +01:00
commit 7da8793d29

View File

@ -66,10 +66,7 @@ class ref_competences extends HTMLElement {
let divCompetence = document.createElement("div"); let divCompetence = document.createElement("div");
divCompetence.innerText = `${competence} ${niveauCle.niveau}`; divCompetence.innerText = `${competence} ${niveauCle.niveau}`;
divCompetence.style.gridRowStart = annee; divCompetence.style.gridRowStart = annee;
divCompetence.style.gridColumnStart = competence.replaceAll( divCompetence.style.gridColumnStart = competence.replaceAll(" ","_").replaceAll("'", "_");
" ",
"_"
);
divCompetence.className = "comp" + numComp; divCompetence.className = "comp" + numComp;
divCompetence.dataset.competence = `${competence} ${niveauCle.niveau}`; divCompetence.dataset.competence = `${competence} ${niveauCle.niveau}`;
divCompetence.addEventListener("click", (event) => { divCompetence.addEventListener("click", (event) => {
@ -88,9 +85,9 @@ class ref_competences extends HTMLElement {
let gridTemplate = ""; let gridTemplate = "";
Object.keys(this.data.competences).forEach((competence) => { Object.keys(this.data.competences).forEach((competence) => {
if (competencesBucket.indexOf(competence) == -1) { if (competencesBucket.indexOf(competence) == -1) {
gridTemplate += `[${competence.replaceAll(" ", "_")}] 0`; gridTemplate += `[${competence.replaceAll(" ", "_").replaceAll("'", "_")}] 0`;
} else { } else {
gridTemplate += `[${competence.replaceAll(" ", "_")}] 1fr`; gridTemplate += `[${competence.replaceAll(" ", "_").replaceAll("'", "_")}] 1fr`;
} }
}); });
this.shadow.querySelector(".competences").style.gridTemplateColumns = this.shadow.querySelector(".competences").style.gridTemplateColumns =