Work to be done: 1) Add a button to save a given search after it is performed. 2) Add a table and administrative area to add searches manually, allowing the description and "Display in OPAC?" to be saved and edited. 3) Add these saved searches to the advanced search and results pages in the OPAC and staff side. Use case: Librarian searches for materials by certain collection codes which define and age range (Early readers, picture books, etc.) they save this search Patron searching for 'Vampires' gets many results They can add the 'saved search' to their current search to retrieve only relevant records Patron finds books for small children about vampires
Created attachment 133263 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 133264 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 133265 [details] [review] Bug 17170: Update schema for boolean
Created attachment 133266 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 133267 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 133268 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 133269 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 133270 [details] [review] Bug 17170: Unit tests
A user with manage_search_filters permission can create filters from the search results page and can open admin-home.pl, but does not get a link to the search filters page. A superlibrarian does get the intended link.
Created attachment 133361 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Something off about how saved filters are getting parsed here. We're ANDing where we should OR. I created a filter limiting to item types Book (BK) and Music (MU). If I search for "Street" and then apply my filter, I get no results. 'street' with limit(s): '(itype:("BK")) AND (itype:("MU"))' If I clicked to edit my filter from the admin page and then search for "street" from that page, I get 4 results. 'street' with limit(s): 'itype:(("BK") OR ("MU"))' If I just construct an advanced search for "street" limited to book and music I get 4 results. '(street*)' with limit(s): 'itype:(("BK") OR ("MU"))'.
Created attachment 133376 [details] [review] Bug 17170: (follow-up) Correct handling of limits in ES This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure is more complex, so we handle the pieces individually Additionally I add more tests to cover other cases
Created attachment 137027 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 137028 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 137029 [details] [review] Bug 17170: Update schema for boolean
Created attachment 137030 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 137031 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 137032 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 137033 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 137034 [details] [review] Bug 17170: Unit tests
Created attachment 137035 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 137036 [details] [review] Bug 17170: (follow-up) Correct handling of limits in ES This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure is more complex, so we handle the pieces individually Additionally I add more tests to cover other cases
Created attachment 137186 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 137187 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 137188 [details] [review] Bug 17170: Update schema for boolean
Created attachment 137189 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 137190 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 137191 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 137192 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 137193 [details] [review] Bug 17170: Unit tests
Created attachment 137194 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 137195 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com>
Hi Nick, this sounds really ineresting! Could you please rebase? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 17170: (follow-up) Correct handling of limits in ES error: sha1 information is lacking or useless (C4/Search.pm). error: could not build fake ancestor Patch failed at 0001 Bug 17170: (follow-up) Correct handling of limits in ES hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-17170-follow-up-Correct-handling-of-limits-in--3qL2M9.patch
Created attachment 137808 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 137809 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 137810 [details] [review] Bug 17170: Update schema for boolean
Created attachment 137811 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 137812 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 137813 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 137814 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 137815 [details] [review] Bug 17170: Unit tests
Created attachment 137816 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 137817 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com>
Created attachment 138505 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 138506 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 138507 [details] [review] Bug 17170: Update schema for boolean
Created attachment 138508 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 138509 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 138510 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 138511 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 138512 [details] [review] Bug 17170: Unit tests
Created attachment 138513 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 138514 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com>
Sorry for being too late again :( Can you please rebase? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 17170: DB Updates Applying: Bug 17170: DO NOT PUSH - Schema Updates Applying: Bug 17170: Update schema for boolean Applying: Bug 17170: Add API route for SearchFilters Applying: Bug 17170: Add search filters to staff and opac interfaces Applying: Bug 17170: Handle search filters in query builders error: sha1 information is lacking or useless (C4/Search.pm). error: could not build fake ancestor Patch failed at 0001 Bug 17170: Handle search filters in query builders
Created attachment 139948 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 139949 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 139950 [details] [review] Bug 17170: Update schema for boolean
Created attachment 139951 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 139952 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 139953 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 139954 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 139955 [details] [review] Bug 17170: Unit tests
Created attachment 139956 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 139957 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com>
Sorry to repeat history here :( Too late again. Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 17170: DB Updates Applying: Bug 17170: DO NOT PUSH - Schema Updates Applying: Bug 17170: Update schema for boolean Applying: Bug 17170: Add API route for SearchFilters Applying: Bug 17170: Add search filters to staff and opac interfaces Applying: Bug 17170: Handle search filters in query builders Applying: Bug 17170: Add admin page for filters and ability to edit/save existing filters Applying: Bug 17170: Unit tests Applying: Bug 17170: (follow-up) Display search filters admin links when apprropriate error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc). error: could not build fake ancestor Patch failed at 0001 Bug 17170: (follow-up) Display search filters admin links when apprropriate hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-17170-follow-up-Display-search-filters-admin-l-O7ZVwo.patch
Created attachment 141228 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature
Created attachment 141229 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates
Created attachment 141230 [details] [review] Bug 17170: Update schema for boolean
Created attachment 141231 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests
Created attachment 141232 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets
Created attachment 141233 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings
Created attachment 141234 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page
Created attachment 141235 [details] [review] Bug 17170: Unit tests
Created attachment 141236 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate
Created attachment 141237 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com>
Created attachment 141316 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141317 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141318 [details] [review] Bug 17170: Update schema for boolean Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141319 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141320 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141321 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141322 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141323 [details] [review] Bug 17170: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141324 [details] [review] Bug 17170: (follow-up) Display search filters admin links when apprropriate Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141325 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Signed-off-by: Michal Urban <michalurban177@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141326 [details] [review] Bug 17170: (QA follow-up) Remove re-introduced file We reintroduced the definitions api spec file with this patch.. it's not required. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141327 [details] [review] Bug 17170: (QA follow-up) Relocate 'Save' Another minor rebase issue I believe.. relocate the 'Save search as filter' link back up to sit next to 'Edit this search'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141328 [details] [review] Bug 17170: (QA follow-up) Improve model structure This feature is awesome, but it's modals all feel a bit off.. this is an improvement to one of them, but far from perfect. I opt to work with Owen to create a guideline (and template) for modals going forward and let this patchset go in as is. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
The core code here works well.. though we managed to slip parts of it into master already in bug 30528.. oops. Anyway.. QA wise I'm actually pretty happy it all works as designed and doesn't introduce any regressions... but there GUI elements so far are pretty ugly and strangely formed.. I started working through some of them, but as the final patch says, I think we may be better of pushing this as is and then working Owen and I working togeter to create some nice templates and a guideline for modal based forms going forward.. and then use this feature to apply/test our idea's on their own bug. As such.. Passing QA
Nick, just to let you know: I am back, but Martin was faster! ;)
Created attachment 141348 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141349 [details] [review] Bug 17170: DO NOT PUSH - Schema Updates Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141350 [details] [review] Bug 17170: Update schema for boolean Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141351 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141352 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141353 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141354 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141355 [details] [review] Bug 17170: Unit tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141356 [details] [review] Bug 17170: (follow-up) Display search filters admin links when appropriate Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141357 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Michal Urban <michalurban177@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141358 [details] [review] Bug 17170: (QA follow-up) Remove re-introduced file We reintroduced the definitions api spec file with this patch.. it's not required. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141359 [details] [review] Bug 17170: (QA follow-up) Relocate 'Save' Another minor rebase issue I believe.. relocate the 'Save search as filter' link back up to sit next to 'Edit this search'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141360 [details] [review] Bug 17170: (QA follow-up) Improve model structure This feature is awesome, but it's modals all feel a bit off.. this is an improvement to one of them, but far from perfect. I opt to work with Owen to create a guideline (and template) for modals going forward and let this patchset go in as is. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141422 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141423 [details] [review] Bug 17170: DBIC schema Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141424 [details] [review] Bug 17170: Update schema for boolean Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141425 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141426 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141427 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141428 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141429 [details] [review] Bug 17170: Unit tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141430 [details] [review] Bug 17170: (follow-up) Display search filters admin links when appropriate Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141431 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Michal Urban <michalurban177@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141432 [details] [review] Bug 17170: (QA follow-up) Remove re-introduced file We reintroduced the definitions api spec file with this patch.. it's not required. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141433 [details] [review] Bug 17170: (QA follow-up) Relocate 'Save' Another minor rebase issue I believe.. relocate the 'Save search as filter' link back up to sit next to 'Edit this search'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141434 [details] [review] Bug 17170: (QA follow-up) Improve model structure This feature is awesome, but it's modals all feel a bit off.. this is an improvement to one of them, but far from perfect. I opt to work with Owen to create a guideline (and template) for modals going forward and let this patchset go in as is. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141435 [details] [review] Bug 17170: Minor fixes Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141436 [details] [review] Bug 17170: (QA follow-up) DB changes Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141437 [details] [review] Bug 17170: (QA follow-up) Spec cleanup This patch removes not required (for now) query parameters as we can query using q= on those. They can be added back eventually, if needed. Attributes now match the database as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141438 [details] [review] Bug 17170: (QA follow-up) Escape things, make them translatable Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141461 [details] [review] Bug 17170: Follow-up for bug 25375 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 141462 [details] [review] Bug 17170: (follow-up) Use x instead of X Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142365 [details] [review] Bug 17170: DB Updates This patch adds the new table, permission, and a syspref to enable the feature Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142367 [details] [review] Bug 17170: DBIC schema Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142368 [details] [review] Bug 17170: Update schema for boolean Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142369 [details] [review] Bug 17170: Add API route for SearchFilters This adds the API routes and tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142370 [details] [review] Bug 17170: Add search filters to staff and opac interfaces This patch displays the filters on the results pages with the facets Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142371 [details] [review] Bug 17170: Handle search filters in query builders This patch updates the query building code to expand filters when searching and pass them back as part of the cgi and descriptive search strings Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142372 [details] [review] Bug 17170: Add admin page for filters and ability to edit/save existing filters This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the resuilts page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142373 [details] [review] Bug 17170: Unit tests Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142374 [details] [review] Bug 17170: (follow-up) Display search filters admin links when appropriate Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142375 [details] [review] Bug 17170: Add the ability to create 'saved searches' for use as filters when searching the catalog This patch alters the code in the ES QueryBuilder. Reflecting how things are handled in build_query_compat we clean the query, but not the limits. In Zebra we simply recursivly call buildQuery, but the ES query structure This patchset adds a new ability to save searches on the staff client, and display them in the results page on staff or opac as a new filter. New filters can be added from the results page after a search, and there is an admin page for updating deleting and renaming filters There is a new permission to control management of these filters New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter Due to bug 30528 testing in ES is recommended To test: 1 - Apply patches and update database and restart all 2 - Enable new system preference 'SavedSearchFilters' 3 - As superlibrarian perform a search in staff client, something broad like 'a' 4 - Note new 'Save search as filter' link on results page 5 - Click it, save search as new filter, check 'Staff client' visibility 6 - Perform another search 7 - Note the filter now appears above facets 8 - Click to it filter results 9 - Note results are limited by the new filter, and it is checked in the facets 10 - Confirm click the [x] removes the filter 11 - Go to administration->search filters 12 - Confirm the filter appears 13 - Edit and mark as OPAC visible 14 - Test OPAC to ensure it shows and can be applied/removed 15 - Copy URL with filter applied 16 - In adminsitration mark filter as not visible on staff or opac 17 - Confirm link above still works 18 - Create a new staff with catalogue and search filters permission 19 - Ensure they can access/save filters 20 - Remove filter permission and ensure they cannot 21 - Disable system preference 22 - Confirm links to search filters page are removed from admin home and admin sidebar 23 - Confirm filters do not appear on results and cannot be created 24 - Enable pref 25 - Create a filter 26 - From search filters page, click 'Edit search' 27 - Confirm you are taken to advanced search page letting you know which filter you are editing 28 - Confirm you can change searhc options and save 29 - Confirm you can perform the search from this page Sponsored-by: Sponsored by: Round Rock Public Library [https://www.roundrocktexas.gov/departments/library/] Signed-off-by: Michal Urban <michalurban177@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142376 [details] [review] Bug 17170: (QA follow-up) Remove re-introduced file We reintroduced the definitions api spec file with this patch.. it's not required. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142377 [details] [review] Bug 17170: (QA follow-up) Relocate 'Save' Another minor rebase issue I believe.. relocate the 'Save search as filter' link back up to sit next to 'Edit this search'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142378 [details] [review] Bug 17170: (QA follow-up) Improve model structure This feature is awesome, but it's modals all feel a bit off.. this is an improvement to one of them, but far from perfect. I opt to work with Owen to create a guideline (and template) for modals going forward and let this patchset go in as is. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142379 [details] [review] Bug 17170: Minor fixes Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142380 [details] [review] Bug 17170: (QA follow-up) DB changes Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142381 [details] [review] Bug 17170: (QA follow-up) Spec cleanup This patch removes not required (for now) query parameters as we can query using q= on those. They can be added back eventually, if needed. Attributes now match the database as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142382 [details] [review] Bug 17170: (QA follow-up) Escape things, make them translatable Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142383 [details] [review] Bug 17170: (follow-up) adjust tests for bug 25375 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142384 [details] [review] Bug 17170: (follow-up) Use x instead of X Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142385 [details] [review] Bug 17170: (follow-up) Adjust for RM follow-ups Use direct DB names when saving/loading Don't escape boolean values as strings
Pushed to master for 22.11. Nice work everyone, thanks!
Dropdown empty in modal: https://snipboard.io/Nnab3I.jpg
You can save a search even if not displayed at OPAC or staff, is that expected?
A filter that is not displayed at the OPAC can still be used if you modify the id in the URL.
(In reply to Jonathan Druart from comment #145) > You can save a search even if not displayed at OPAC or staff, is that > expected? Yes, noted in feature: New filters can be added that are not displayed along with facets, this allows for building custom links using these filters to keep URLs shorter
(In reply to Jonathan Druart from comment #146) > A filter that is not displayed at the OPAC can still be used if you modify > the id in the URL. You could perform the search yourself anyways, I do not think it reveals any data
Created attachment 142494 [details] [review] Bug 17170: (QA follow-up) Adjust t/Koha/Auth/Permissions.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 142498 [details] [review] Bug 17170: (follow-up) Hide existing filters section if no filters exist
I added some stuff to the manual. Hopefully I didn't get it completely wrong. I admit I didn't quite understand the use case for the URL thing, so I didn't add that in. But if someone has a specific example, feel free to add it in, or tell me and I'll add it.
(In reply to Caroline Cyr La Rose from comment #151) > I added some stuff to the manual. Hopefully I didn't get it completely > wrong. I admit I didn't quite understand the use case for the URL thing, so > I didn't add that in. But if someone has a specific example, feel free to > add it in, or tell me and I'll add it. Do you mean the part about keeping URLs shorter?
(In reply to Katrin Fischer from comment #152) > (In reply to Caroline Cyr La Rose from comment #151) > > I added some stuff to the manual. Hopefully I didn't get it completely > > wrong. I admit I didn't quite understand the use case for the URL thing, so > > I didn't add that in. But if someone has a specific example, feel free to > > add it in, or tell me and I'll add it. > > Do you mean the part about keeping URLs shorter? It's really just kind of a convenience, so you could create a 'New books search' and save it, but not select to display it as a filter, but then you could add a link: <a href="http://localhost:8080/cgi-bin/koha/opac-search.pl?limit=search_filter:1">New books</a> For a more complicated search, say "Picture books" / subject: Christmas / location: Children's room / Available Only It just provides a shorter more readable link
Thank you Nick! That helps :) I will add that example. I think maybe I misunderstood how to use the filters. Because in the OPAC, you need to do a search to get the filters, so in the test plan when it says to copy the URL, it's the URL for search + filter, not just filter. It gave me something like cgi-bin/koha/opac-search.pl?idx=&q=shakespeare&limit=search_filter:4 Anyway, now I have the URL you gave me, so it's all good. Ill put that in the manual with the new books example.
(In reply to Caroline Cyr La Rose from comment #154) > Thank you Nick! That helps :) I will add that example. > > I think maybe I misunderstood how to use the filters. Because in the OPAC, > you need to do a search to get the filters, so in the test plan when it says > to copy the URL, it's the URL for search + filter, not just filter. It gave > me something like > cgi-bin/koha/opac-search.pl?idx=&q=shakespeare&limit=search_filter:4 > > Anyway, now I have the URL you gave me, so it's all good. Ill put that in > the manual with the new books example. Yeah, it would be nice to provide the staff/opac link to the filter with no extra query in the filters list - you can file that and I'll try to get to it sometime