mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[MNT-22207] - resetting query fragment when clicking Reset all button on search filters (#6928)
This commit is contained in:
@@ -988,6 +988,15 @@ describe('SearchFilterComponent', () => {
|
|||||||
expect(component.selectFacetBucket).toHaveBeenCalledTimes(2);
|
expect(component.selectFacetBucket).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should reset the query fragments when reset All is clicked', () => {
|
||||||
|
component.queryBuilder.queryFragments = { 'fragment1' : 'value1'};
|
||||||
|
component.responseFacets = [];
|
||||||
|
spyOn(queryBuilder, 'resetToDefaults').and.stub();
|
||||||
|
component.resetAll();
|
||||||
|
expect(component.queryBuilder.queryFragments).toEqual({});
|
||||||
|
expect(queryBuilder.resetToDefaults).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -178,8 +178,14 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
|
|||||||
this.queryBuilder.update();
|
this.queryBuilder.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetQueryFragments() {
|
||||||
|
this.queryBuilder.queryFragments = {};
|
||||||
|
this.queryBuilder.resetToDefaults();
|
||||||
|
}
|
||||||
|
|
||||||
resetAll() {
|
resetAll() {
|
||||||
this.resetAllSelectedBuckets();
|
this.resetAllSelectedBuckets();
|
||||||
|
this.resetQueryFragments();
|
||||||
this.responseFacets = null;
|
this.responseFacets = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user