Skip to content
Merged
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
22 changes: 13 additions & 9 deletions addon/components/hyper-table-v2/filtering-renderers/numeric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class HyperTableV2FilteringRenderersNumeric extends Component<Hyp
@action
addRangeFilter(): void {
debounce(this, this._addRangeFilter, isTesting() ? 0 : RANGE_DEBOUNCE_TIME);
this.args.handler.triggerEvent('filterUpdateIntent', this.args.column, 'pending');
}

@action
Expand All @@ -91,15 +92,18 @@ export default class HyperTableV2FilteringRenderersNumeric extends Component<Hyp
}

private _addRangeFilter(): void {
this.args.handler.applyFilters(this.args.column, [
...(this.lowerBoundFilter
? [{ key: 'lower_bound', value: (parseInt(this.lowerBoundFilter) * this.multiplier).toString() }]
: []),
...(this.upperBoundFilter
? [{ key: 'upper_bound', value: (parseInt(this.upperBoundFilter) * this.multiplier).toString() }]
: []),
...(this.lowerBoundFilter || this.upperBoundFilter ? [{ key: 'existence', value: 'with' }] : [])
]);
this.args.handler
.applyFilters(this.args.column, [
...(this.lowerBoundFilter
? [{ key: 'lower_bound', value: (parseInt(this.lowerBoundFilter) * this.multiplier).toString() }]
: []),
...(this.upperBoundFilter
? [{ key: 'upper_bound', value: (parseInt(this.upperBoundFilter) * this.multiplier).toString() }]
: []),
...(this.lowerBoundFilter || this.upperBoundFilter ? [{ key: 'existence', value: 'with' }] : [])
])
.then(() => this.args.handler.triggerEvent('filterUpdateIntent', this.args.column, 'fulfilled'))
.catch(() => this.args.handler.triggerEvent('filterUpdateIntent', this.args.column, 'rejected'));
}

private initLowerBound(): void {
Expand Down