generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove overall section from list filter
- Loading branch information
1 parent
6e0b249
commit a0de034
Showing
3 changed files
with
15 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
* [email protected] | ||
*/ | ||
|
||
import { sectionsForListItemsForAllTenants } from '../../scripts/tenants.js'; | ||
|
||
/** | ||
* Get filter value for element | ||
* | ||
|
@@ -23,7 +25,9 @@ function getFilterValuesForElement(element, filterField) { | |
} else { | ||
value = element.getAttribute(`data-${filterField}`)?.toString(); | ||
} | ||
return value?.split(',') || []; | ||
const values = value?.split(',').map((item) => item.trim()) || []; | ||
return values.filter((item) => !sectionsForListItemsForAllTenants.map((gs) => gs.toLowerCase()) | ||
.includes(item.toLowerCase())); | ||
} | ||
|
||
/** | ||
|
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