From e8c6a6119c303abb279280adc2b7f1017dd9482c Mon Sep 17 00:00:00 2001 From: jazairi <16103405+jazairi@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:12:33 -0400 Subject: [PATCH] Relabel geospatial and advanced search accordion menus Why these changes are being introduced: The change in label for these accordions when open (e.g., 'Advanced search' to 'Close advanced search') is unnecessary and confused some usability test participants. The 'Advanced search' menu was also unused without prompting in usuability testing. UXWS has suggested relabeling it for clarity. Relevant ticket(s): * [GDT-301](https://mitlibraries.atlassian.net/browse/GDT-301) How this addresses that need: This relabels the accordion menus as suggested by UXWS. Side effects of this change: None. --- app/javascript/search_form.js | 6 ------ app/views/search/_form.html.erb | 5 +---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/javascript/search_form.js b/app/javascript/search_form.js index 2521876f..431e9ef7 100644 --- a/app/javascript/search_form.js +++ b/app/javascript/search_form.js @@ -10,7 +10,6 @@ function disableAdvanced() { field => field.value = '' ); advanced_label.classList = 'closed'; - advanced_label.innerText = 'Advanced search'; }; function enableAdvanced() { @@ -22,7 +21,6 @@ function enableAdvanced() { keyword_field.setAttribute('placeholder', 'Keyword anywhere'); } advanced_label.classList = 'open'; - advanced_label.innerText = 'Close advanced search'; }; function disableGeobox() { @@ -40,7 +38,6 @@ function disableGeobox() { field.setAttribute('aria-required', false); }); geobox_label.classList = 'closed'; - geobox_label.innerText = 'Geospatial bounding box search'; }; function enableGeobox() { @@ -58,7 +55,6 @@ function enableGeobox() { field.setAttribute('aria-required', true); }); geobox_label.classList = 'open'; - geobox_label.innerText = 'Close bounding box search'; }; function disableGeodistance() { @@ -76,7 +72,6 @@ function disableGeodistance() { field.setAttribute('aria-required', false); }); geodistance_label.classList = 'closed'; - geodistance_label.innerText = 'Geospatial distance search'; }; function enableGeodistance() { @@ -94,7 +89,6 @@ function enableGeodistance() { field.setAttribute('aria-required', true); }); geodistance_label.classList = 'open'; - geodistance_label.innerText = 'Close distance search'; }; diff --git a/app/views/search/_form.html.erb b/app/views/search/_form.html.erb index cfc2f8c4..e0162441 100644 --- a/app/views/search/_form.html.erb +++ b/app/views/search/_form.html.erb @@ -6,11 +6,10 @@ if params[:q] end # Initial form setup is determined by the advanced parameter. Thereafter it is altered by javascript. -advanced_label = "Advanced search" +advanced_label = "Search by title, author, etc." advanced_label_class = "closed" search_required = true if params[:advanced] == "true" - advanced_label = "Close advanced search" advanced_label_class = "open" search_required = false end @@ -18,7 +17,6 @@ end geobox_label = "Geospatial bounding box search" geobox_label_class = "closed" if params[:geobox] == "true" - geobox_label = "Close bounding box search" geobox_label_class = "open" geobox_required = true search_required = false @@ -27,7 +25,6 @@ end geodistance_label = "Geospatial distance search" geodistance_label_class = "closed" if params[:geodistance] == "true" - geodistance_label = "Close distance search" geodistance_label_class = "open" geodistance_required = true search_required = false