Skip to content
Snippets Groups Projects

#3502935: Refactor the Search component to treat filter changes generically

Closes #3502935

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Adam G-H
  • Adam G-H
  • utkarsh_33 added 2 commits

    added 2 commits

    Compare with previous version

  • Adam G-H
  • utkarsh_33 added 3 commits

    added 3 commits

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H
  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • utkarsh_33 resolved all threads

    resolved all threads

  • 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();
  • 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 change load() so that it builds the query string using the filters you're passing in here, and that way we can remove SearchComponent.toSearchParams(), which was always meant to be a kludge anyway. Go go go!!

    • Please register or sign in to reply
  • utkarsh_33 added 1 commit

    added 1 commit

    • c20c68e6 - Wip to remove toSearchParams

    Compare with previous version

  • utkarsh_33 added 2 commits

    added 2 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading