#3502935: Refactor the Search component to treat filter changes generically
Closes #3502935
Merge request reports
Activity
added 6 commits
-
ccb8aa59...291be59e - 5 commits from branch
project:2.0.x
- 70d47478 - Merging 2.0.x
-
ccb8aa59...291be59e - 5 commits from branch
added 2 commits
- Resolved by utkarsh_33
- Resolved by utkarsh_33
- Resolved by utkarsh_33
- Resolved by utkarsh_33
- Resolved by utkarsh_33
105 filters: {}, 116 106 }; 117 dispatch('selectCategory', detail); 107 Object.keys(filterDefinitions).forEach((key) => { 108 detail.filters[key] = $filters[key]; 109 }); 110 111 dispatch('FilterChange', detail); 118 112 stateContext.setPage(0, 0); 119 113 stateContext.setRows(detail.rows); 114 if ( 115 event && 116 event.target && 117 filterDefinitions[event.target.name]._type === 'boolean' 118 ) { 119 refreshLiveRegion(); I think i know that this is the reason behind what @NarendraR mentioned in #10.And this is not the issue that is caused by this MR(in my opinion as i tested this on 2.0.x and issue persist there as well). We could open a follow-up maybe to get this fixed. I would leave it on @NarendraR or @phenaproxima to decide whether this makes sense.
changed this line in version 22 of the diff
186 187 async function onSelectCategory(event) { 188 $filters.categories = event.detail.category; 189 await load(0); 190 page.set(0); 191 } 192 186 async function onSort(event) { 193 187 sort.set(event.detail.sort); 194 188 sortText = sorts[$sort]; 195 189 await load(0); 196 190 page.set(0); 197 191 } 198 async function onAdvancedFilter() { 199 await load(0); 192 async function onFilterChange(event) { 193 await load(0, event.detail.filters); So this makes sense in concept, but...the
load()
function doesn't take a second parameter, so this is pretty much thrown out. Let's changeload()
so that it builds the query string using the filters you're passing in here, and that way we can removeSearchComponent.toSearchParams()
, which was always meant to be a kludge anyway. Go go go!!
added 2 commits