https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41608

--- Comment #83 from Arthur Suzuki <[email protected]> ---
Created attachment 208921
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208921&action=edit
Bug 41608: (QA follow-up) Display single limits combined with AND and make the
AND/OR facet flows compatible

The active filters summary above the search results grouped all the
limits of a same facet in a single group, displayed with the OR
operator, whatever the operator actually used by the query. When
MultiChoiceFacets is enabled, clicking a facet label applies a single
limit, combined with AND: clicking "Centerville" then "Fairview" in the
"Holding libraries" facet produces limit=holdingbranch:CPL and
limit=holdingbranch:FPL, an AND query, but the summary displayed
"Holding libraries: Centerville [x] OR Fairview [x]". The summary now
mirrors the logic of the query itself: the multi-choice (mc-) limits of
a same facet are combined with OR in a single group, while the single
limits and the different facets are combined with AND, each single
limit in its own group.

Mixing the two facet flows also broke the search limits in both
directions:

- applying multi-choice (OR) facets turned the single limits (AND) of
  the displayed facets into multi-choice limits: clicking "Centerville"
  then "Fairview" (limit=holdingbranch:CPL&limit=holdingbranch:FPL, an
  AND query), then checking two authors and clicking "Apply" produced
  (au:Becket or au:Dahl) and (holdingbranch:CPL or holdingbranch:FPL)
  instead of (au:Becket or au:Dahl) and holdingbranch:CPL and
  holdingbranch:FPL

- clicking a facet label dropped every multi-choice (OR) limit: the
  facet links were built without the mc- limits, so the selected OR's
  were removed as soon as a label was clicked

The "Apply" form submission now keeps the existing limits of the
displayed facets whose checkbox is still checked, with their original
operator: a single (AND) limit is not turned into a multi-choice (OR)
limit, and unchecking a facet still removes its limit. The facet links
are now built with the complete list of limits: clicking a facet label
applies a single limit (AND) without dropping the multi-choice (OR)
limits. The limit_cgi_no_mc template variable is no longer needed and
is removed.

Test plan:
- enable MultiChoiceFacets
- search for "complete", click the "Centerville" facet label, then the
  "Fairview" one: the URL carries limit=holdingbranch:CPL and
  limit=holdingbranch:FPL (AND), and the active filters summary
  displays "Holding libraries: Centerville [x] AND Holding libraries:
  Fairview [x]"
- check two values of a same facet (e.g. two authors) and click "Apply":
  the authors are combined with OR and the holding libraries stay
  combined with AND: (au:Becket or au:Dahl) and holdingbranch:CPL and
  holdingbranch:FPL, and the summary displays the authors combined with
  OR and each holding library in its own group, combined with AND
- conversely, check two authors and click "Apply", then click the
  "Centerville" and "Fairview" facet labels: the multi-choice limits
  are kept and each holding library is added as a single (AND) limit
- unchecking a facet and clicking "Apply" removes its limit only
- each active filter can be removed with its own [x] link, the "Clear
  all" link removes all the filters at once
- the multi-choice limits survive a round trip through the regenerated
  query links, whatever quoting they carry
- run t/cypress/integration/Search/MultiChoiceFacets_spec.ts with Cypress
- repeat on the OPAC

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to