-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prior to this change the search in IE11 did not function properly This change fixes the search. Turns out querySelectorAll behaviour in IE11 is weird. So additional checks and balances were added to detect when/if IE acts up. [Issue discovered as part of fixing tickets for the latest feedback round](https://wiki.surfnet.nl/display/coininfra/Bevindingen+nav+tests+door+supportteam)
- Loading branch information
Koen Cornelis
authored
Feb 4, 2021
1 parent
48b4744
commit e962df4
Showing
23 changed files
with
186 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
import {idpSelector, unconnectedIdpClass} from '../../selectors'; | ||
import {idpSelector, remainingIdpLiSelector, unconnectedIdpClass} from '../../selectors'; | ||
import {nodeListToArray} from '../../utility/nodeListToArray'; | ||
|
||
export const sortArrayList = (idpArray, sortFunction) => { | ||
const withAccess = idpArray.filter(node => !node.querySelector(idpSelector).classList.contains(unconnectedIdpClass)); | ||
export const sortArrayList = (passedIdpArray, sortFunction) => { | ||
let idpArray = passedIdpArray; | ||
let withAccess; | ||
let noAccess; | ||
try { | ||
withAccess = getWithAccess(idpArray); | ||
noAccess = getNoAccess(idpArray); | ||
} catch (e) { | ||
idpArray = nodeListToArray(document.querySelectorAll(remainingIdpLiSelector)); | ||
withAccess = idpArray.filter(node => !node.querySelector(idpSelector).classList.contains(unconnectedIdpClass)); | ||
noAccess = getNoAccess(idpArray); | ||
} | ||
|
||
const noAccess = idpArray.filter(node => node.querySelector(idpSelector).classList.contains(unconnectedIdpClass)); | ||
withAccess.sort(sortFunction); | ||
noAccess.sort(sortFunction); | ||
if (withAccess) { | ||
withAccess.sort(sortFunction); | ||
} | ||
|
||
if (noAccess) { | ||
noAccess.sort(sortFunction); | ||
} | ||
|
||
return [...withAccess, ...noAccess]; | ||
}; | ||
|
||
function getWithAccess(idpArray) { | ||
return idpArray.filter(node => !node.classList.contains('idpItem--noAccess')); | ||
} | ||
|
||
function getNoAccess(idpArray) { | ||
return idpArray.filter(node => node.classList.contains('idpItem--noAccess')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.