Skip to content

Commit

Permalink
Relabel geospatial and advanced search accordion menus
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jazairi committed Apr 30, 2024
1 parent eac446a commit e8c6a61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 0 additions & 6 deletions app/javascript/search_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function disableAdvanced() {
field => field.value = ''
);
advanced_label.classList = 'closed';
advanced_label.innerText = 'Advanced search';
};

function enableAdvanced() {
Expand All @@ -22,7 +21,6 @@ function enableAdvanced() {
keyword_field.setAttribute('placeholder', 'Keyword anywhere');
}
advanced_label.classList = 'open';
advanced_label.innerText = 'Close advanced search';
};

function disableGeobox() {
Expand All @@ -40,7 +38,6 @@ function disableGeobox() {
field.setAttribute('aria-required', false);
});
geobox_label.classList = 'closed';
geobox_label.innerText = 'Geospatial bounding box search';
};

function enableGeobox() {
Expand All @@ -58,7 +55,6 @@ function enableGeobox() {
field.setAttribute('aria-required', true);
});
geobox_label.classList = 'open';
geobox_label.innerText = 'Close bounding box search';
};

function disableGeodistance() {
Expand All @@ -76,7 +72,6 @@ function disableGeodistance() {
field.setAttribute('aria-required', false);
});
geodistance_label.classList = 'closed';
geodistance_label.innerText = 'Geospatial distance search';
};

function enableGeodistance() {
Expand All @@ -94,7 +89,6 @@ function enableGeodistance() {
field.setAttribute('aria-required', true);
});
geodistance_label.classList = 'open';
geodistance_label.innerText = 'Close distance search';
};


Expand Down
5 changes: 1 addition & 4 deletions app/views/search/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ 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

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
Expand All @@ -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
Expand Down

0 comments on commit e8c6a61

Please sign in to comment.