Skip to content

Commit 6c73477

Browse files
authored
Merge pull request #1943 from OpenConext/feature/update-js
fix(theme): replace jshint with eslint to resolve minimatch vulnerability
2 parents 3af180c + 88f8537 commit 6c73477

25 files changed

Lines changed: 444 additions & 148 deletions

theme/.jshintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

theme/base/javascripts/consent/addTooltipAndModalAriaHandlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const addTooltipAndModalAriaHandlers = (elementSelectors
1515
const forValue = element.getAttribute('for');
1616
const alert = document.querySelector(`[data-for="${forValue}"]`);
1717

18-
if (!!alert) {
18+
if (alert) {
1919
element.addEventListener('click', () => {
2020
changeAriaHiddenValue(alert);
2121
});

theme/base/javascripts/consent/keyboardBehaviour.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ export const consentKeyboardBehaviour = () => {
3838
case TAB:
3939
classList.forEach(className => {
4040
switch (className) {
41-
case 'tooltip__value':
41+
case 'tooltip__value': {
4242
const dataFor = getData(e.target, 'for');
4343
document.querySelector(`[for=${dataFor}]`).focus();
4444
break;
45+
}
4546
}
4647
});
4748
break;

theme/base/javascripts/consent/switchConsentSection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const switchConsentSection = (e) => {
55
const nokSection = document.querySelector(nokSectionSelector);
66
const contentSection = document.querySelector(contentSectionSelector);
77

8-
if (!!e) {
8+
if (e) {
99
e.preventDefault();
1010
}
1111

theme/base/javascripts/handlers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const addAccessibilitySupport = () => {
4949
};
5050

5151
export const consentNokHandler = (e) => {
52-
if (!!e) {
52+
if (e) {
5353
e.preventDefault();
5454
}
5555
const nokSection = document.querySelector(nokSectionSelector);
@@ -61,7 +61,7 @@ export const consentNokHandler = (e) => {
6161
};
6262
export const backButtonHandler = () => {
6363
return (e) => {
64-
if (!!e) {
64+
if (e) {
6565
e.preventDefault();
6666
}
6767
const nokSection = document.querySelector(nokSectionSelector);

theme/base/javascripts/wayf/deleteDisable/deleteIdp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function announceDeletedIdp(title) {
5353
function moveFocus(index) {
5454
const nextAccount = document.querySelector(`${selectedIdpsLiSelector}[data-index="${(index + 1)}"] ${idpDeleteDisabledSelector}`);
5555

56-
if (!!nextAccount) {
56+
if (nextAccount) {
5757
nextAccount.focus();
5858
return;
5959
}

theme/base/javascripts/wayf/idpFocus/checkHover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {isHoverOnArrowItem} from './isHoverOnArrowItem';
1010
export function checkHover(e) {
1111
const focusedElement = document.activeElement;
1212

13-
if (!!focusedElement) {
13+
if (focusedElement) {
1414
const focusOnArrowItem = isFocusOnArrowItem(focusedElement);
1515
if (focusOnArrowItem) {
1616
return false;

theme/base/javascripts/wayf/idpFocus/focusOnNextIdp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const focusOnNextIdp = () => {
88
nextSibling = nextSibling.nextElementSibling;
99
}
1010

11-
if (!!nextSibling) {
11+
if (nextSibling) {
1212
focusAndSmoothScroll(nextSibling.firstElementChild);
1313
}
1414
};

theme/base/javascripts/wayf/idpFocus/focusOnPreviousIdp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const focusOnPreviousIdp = () => {
88
previousSibling = previousSibling.previousElementSibling;
99
}
1010

11-
if (!!previousSibling) {
11+
if (previousSibling) {
1212
focusAndSmoothScroll(previousSibling.firstElementChild);
1313
}
1414
};

theme/base/javascripts/wayf/idpFocus/isHoverOnArrowItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const isHoverOnArrowItem = (element) => {
1919
}
2020

2121
const closestElement = element.closest(`.${className}`);
22-
if (!!closestElement) {
22+
if (closestElement) {
2323
return closestElement;
2424
}
2525
}

0 commit comments

Comments
 (0)