- UIIN-2330Getting issue details... STATUS
Objective:
Investigate implementing an Advanced search component on the Inventory app that includes:
- all the Instance search options with the exception of Query search;
- boolean operator dropdown (AND/OR/NOT);
- another dropdown that supports the following values: starts with, contains all, contains any, exact match.
Approach:
- remove Query search from the AdvancedSearch component. It can be passed throw searchOptions property when it is needed;
- existing Boolean operators can be reused;
- add a dropdown with precision operators (starts with, contains all, contains any, exact match) to the AdvancedSearchRow component. The precision operator should replace the == comparator if one was chosen
(example: Keyword containsAll sun. Instead of Keyword==sun).
Examples of search box structures with precision operators:
- Search option - Title (all), search query - sun, precision operator - contains all. Search box structure - title containsAll sun.
- Search option - Contributor, search query - Robert, precision operator - starts with, boolean operator - OR, search option - Keyword (title, contributor, ...), search query - chess, precision operator - contains any. Search box structure - contributor startsWith Robert or keyword containsAny chess.
- Search option - Instance HRID, search query - inst000000000008, precision operator - exact match, boolean operator - AND, search option - Subject, search query - DVD-ROM. Search box structure - hrid exactMatch inst000000000008 and subject==DVD-ROM.
Changes in modules:
stripes-components
AdvancedSearch
- remove the Qeury search, it can be passed through the searchOptions property when needed;
- add a dropdown with precision operators (starts with, contains all, contains any, exact match);
- extend the parser (splitIntoRowsRegex) that converts the search string with precision operators.
stripes-smart-components
SearchAndSort
- nest an existing search to the AdvancedSearch component;
- add the state of the advanced search modal and the ability to manage it;
- pass the row state to inventory both on submitting and by clicking the search button in the modal. To be able to utilize advanced search not only in modal mode;
- add advanced search button;
- add advanced search reset having clicked the reset button;
- add the ability to search by clicking Enter key in the modal, when the search button is enabled.
UI-Inventory
- add "Advanced search" search option in the Instances section;
- add a query template for all precision operators for each Instance search option besides Query search (see table below);
- create a row formatter to get a query for each row of the advanced search modal;
- implement building of query for advanced search and separate it from a regular search;
- to honor the building of advanced query in facets (withFacets HOC).