From ede36877b4640276e8d5b9ed6bfeb2d6263f369d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20J=C3=BCrgen=20Falk?= Date: Wed, 28 Aug 2024 15:19:32 +0200 Subject: [PATCH] [TASK] Make search in file module case-insensitive The JavaScript-Based search in the file module is case sensitive. This is unusual for searches. Both the searched value as well as the searchable data are now transformed toLowerCase before comparison. Possible improvements are: - Applying that transformation in Fluid, trading having it to do every request server-side vs. not having to do it on the client for every search. - Implementing some kind of fuzzy search-logic. --- Resources/Public/JavaScript/BackendModule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Public/JavaScript/BackendModule.js b/Resources/Public/JavaScript/BackendModule.js index 778cf45b8..35d41c6a7 100644 --- a/Resources/Public/JavaScript/BackendModule.js +++ b/Resources/Public/JavaScript/BackendModule.js @@ -167,12 +167,12 @@ define([ const searchForm = document.querySelector('.js-form-search'); if (searchForm) { new DebounceEvent('input', function (event) { - const searchValue = event.target.value; + const searchValue = event.target.value.toLowerCase(); const elements = document.querySelectorAll('.in2publish-stagelisting__item'); (Array.from(elements)).forEach(function (item) { if (searchValue !== '') { - const searchable = item.getAttribute('data-searchable'); + const searchable = item.getAttribute('data-searchable').toLowerCase(); if (!searchable.includes(searchValue)) { item.classList.add('d-none');