From 167efc6bceeffe5feb291e2ff8874b8b6e7b9f7f Mon Sep 17 00:00:00 2001 From: Alejandro Tejada Date: Wed, 19 Jul 2023 14:44:43 -0400 Subject: [PATCH] B131913 (#2951) * fix: BUG 131913 submit form when changing filter date and populate input value --- www/assets/js/history-loggedin.js | 9 ++++++++- www/resources/views/pages/testhistory.blade.php | 2 +- www/testlog.php | 7 ++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/www/assets/js/history-loggedin.js b/www/assets/js/history-loggedin.js index 7f50e911a5..a5180c8114 100644 --- a/www/assets/js/history-loggedin.js +++ b/www/assets/js/history-loggedin.js @@ -32,12 +32,19 @@ function handleDaySelector() { const daySelector = document.querySelector("select[name=days]"); + const filter = document.getElementById('filter'); + daySelector.addEventListener("change", (e) => { const days = e.target.value; const protocol = window.location.protocol; const hostname = window.location.hostname; - const redirectUri = protocol + "//" + hostname + "/testlog/" + days + "/"; + if (filter.value) { + document.querySelector('form[name=filterLog]').submit(); + return; + } + + const redirectUri = protocol + "//" + hostname + "/testlog/" + days + "/"; window.location = redirectUri; }); } diff --git a/www/resources/views/pages/testhistory.blade.php b/www/resources/views/pages/testhistory.blade.php index 77bf3920a9..1eb3c6546a 100644 --- a/www/resources/views/pages/testhistory.blade.php +++ b/www/resources/views/pages/testhistory.blade.php @@ -16,7 +16,7 @@
- + @if ($is_logged_in)