alfresco-ng2-components icon indicating copy to clipboard operation
alfresco-ng2-components copied to clipboard

Hard wiring between search component and search service should be avoided

Open yregaieg opened this issue 5 years ago • 0 comments

Type of issue: (check with "[x]")

  • [ ] New feature request
  • [X] Bug
  • [ ] Support request
  • [ ] Documentation

Current behaviour: I wasn't aware of the hardwiring inside the search component to the searchService dataLoaded observable and I had a usecase where even though I used a switchMap for my type ahead to search for autocomplete candidates I always end up with results from an earlier request (one that takes longer to reply since it has a wider result set) kicking in after I get the correct display with expected results and causes the search component to refresh with an outdated resultset not matching the term in the search input so I have this line : https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/core/services/search.service.ts#L63 and this line : https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/content-services/search/components/search.component.ts#L118 to blame

I wonder how no one before me stumbled across this with the people picker for permissions entring or in any similar scenario where search service and search component are used for similar scenarios this actually means one can not have multiple search results in ADF shown in the same view because every time a result kicks in all search components are notified so no way to create a dashboard with some panels listing the results of some predefined queries for instance

Expected behavior: The wiring should either be done in a cleaner way in the glue code or through config

Steps to reproduce the issue:

Component name and version: ADF-3.0, SearchService, SearchComponent

Browser and version: ALL

Node version (for build issues):
10.x

New feature request: Type ahead search

yregaieg avatar Sep 20 '19 14:09 yregaieg