To simplify user interaction with the platform and avoid constant switching between lists, it was necessary to develop a unified search page for all system entities. The search should support adaptive filters that would rebuild depending on the selected content type, support ranking logic, lazy loading of filter options, and different types.
Implementation
Development was carried out in close collaboration with another backend developer. Together, we designed the API structure and wrote brief documentation with request/response formats.
Source Code above is mutated for demonstration purposes
Content `Source Code` requires special access key
Please, communicate with administrator to obtain the access key here
All entities involved in the search were added to the SP search service, and the search service is essentially a wrapper that calls the search. The frontend was developed in ReactJS. A separate page was created, with a web part and a user control that embedded the React app JS bundle. Development was done using class components with TypeScript, bundler - Webpack, state management - Redux, state reading - reselect. For server side effects, redux-saga was chosen. The collection of all information from the filter view is handled by the Redux Forms library. The application area consists of a search bar, a sidebar with filter blocks, a results area, and a page with an extended set of filters. Each filter is described by a JSON structure that takes into account all business requirements for display, such as:
Linking the filter to the type of content being searched
Filter type
Order of the filter block
Order of filter options (with the ability to manually specify filters)
Belonging of the filter to quick access/all filters page
Input controls are based on the React-Widgets library, which was significantly improved in a forked repository, and several pull requests even made it into the official version! (for example, this one, but not this, this, or this). The filter configuration is presented in a JS file stored in the SharePoint library and can be changed and re-uploaded at any time (reconfiguration without rebuilding).
Content type element with meta-information
(identifiers changed)
{id:0x0100E737C3D7E2C747AA8DD044E37D606A4E0088D43E65F6214A4A80534AC6302E0CEC*,title:Division,isActive:true,resultType:20,customer:KsupEgrCustomer,legal:KsupEgrPerformerLegal,workServicesType:KsupWorkServicesTypeMetadata,keyTechnologies:KsupKeyTechnologies,divisionType:KsupDivisionType],displayFields:[Title:Title,KsupProjectCount:Numberof projects,KsupDivisionType:Division type
]},
{title:Work and ServiceType,name: workServicesType,type: term,quick:true,loadable:true,props:{termName:Work and ServiceType,values:[],sortBy: alphabet,sortDirection: asc
}}