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

🐛 fix(header): correctif erreur itérable null [DS-3747] #893

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/component/header/script/header/header-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class HeaderLinks extends api.core.Instance {
const toolsHtml = this.toolsLinks.innerHTML.replace(/ +/g, ' ');
const menuHtml = this.menuLinks.innerHTML.replace(/ +/g, ' ');
// Pour éviter de dupliquer des id, on ajoute un suffixe aux id et aria-controls duppliqués.
let toolsHtmlIdList = toolsHtml.match(/id="(.*?)"/gm);
if (toolsHtmlIdList) {
// on a besoin d'échapper les backslash dans la chaine de caractère
// eslint-disable-next-line no-useless-escape
toolsHtmlIdList = toolsHtmlIdList.map(element => element.replace('id=\"', '').replace('\"', ''));
}
let toolsHtmlIdList = toolsHtml.match(/id="(.*?)"/gm) || [];

// on a besoin d'échapper les backslash dans la chaine de caractère
// eslint-disable-next-line no-useless-escape
toolsHtmlIdList = toolsHtmlIdList.map(element => element.replace('id=\"', '').replace('\"', ''));

const toolsHtmlAriaControlList = toolsHtml.match(/aria-controls="(.*?)"/gm);
let toolsHtmlDuplicateId = toolsHtml.replace(/id="(.*?)"/gm, 'id="$1' + copySuffix + '"');
if (toolsHtmlAriaControlList) {
Expand Down