Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: fix number facets behavior #550

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ export class BucketsComponent implements OnInit, OnDestroy, OnChanges {
// COMPONENT F£UNCTIONS =====================================================
/**
* Check if a value is present in selected filters.
* @param value - string: filter value
* @param value: filter value (could be string, number, ...)
* @return `true` if value is present in the aggregation filters, `false` otherwise.
*/
isSelected(value: string): boolean {
return this.aggregationFilters.includes(value);
isSelected(value: any): boolean {
return this.aggregationFilters.includes(value.toString());
}

/**
Expand Down Expand Up @@ -161,9 +161,9 @@ export class BucketsComponent implements OnInit, OnDestroy, OnChanges {
this._recordSearchService.updateAggregationFilter(this.aggregationKey, [bucket.key], bucket);
} else {
const aggFilter = this.aggregationsFilters[index];
if (!aggFilter.values.includes(bucket.key)) {
if (!aggFilter.values.includes(bucket.key.toString())) {
// Bucket value is not yet selected, we add value to selected values.
this.aggregationsFilters[index].values.push(bucket.key);
this.aggregationsFilters[index].values.push(bucket.key.toString());
this._recordSearchService.updateAggregationFilter(
this.aggregationKey,
this.aggregationsFilters[index].values,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class RecordSearchService {
* @param bucket Bucket containing the value to remove
*/
removeAggregationFilter(key: string, bucket: any) {
this.removeFilter(key, bucket.key);
this.removeFilter(key, bucket.key.toString());
this.removeChildrenFilters(bucket);
this.removeParentFilters(bucket);
// Update selected aggregations filters
Expand Down