Skip to content

Commit dee055c

Browse files
committed
Remove use of NormalizationKey for NumericalComparisonFilterModel
1 parent f23584d commit dee055c

3 files changed

Lines changed: 10 additions & 20 deletions

File tree

lib/public/components/Filters/common/filters/NumericalComparisonFilterModel.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ export class NumericalComparisonFilterModel extends FilterModel {
2121
/**
2222
* Constructor
2323
* @param {object} [options] options of the filter
24-
* @param {boolean} [options.useOperatorAsNormalizationKey] if true, operator value will be used as normalization key, else operator will be
25-
* passed with key `operator` and `operand` will be passed as `limit`
2624
* @param {number} [options.scale] scale applied on the value of the operand in normalization
2725
* @param {boolean} [options.integer=false] if true, value is parsed as integer (else, it will be parsed as float)
2826
*/
2927
constructor(options) {
3028
super();
31-
const { useOperatorAsNormalizationKey, scale = 1, integer = false } = options || {};
32-
this._useOperatorAsNormalizationKey = Boolean(useOperatorAsNormalizationKey);
29+
const { scale = 1, integer = false } = options || {};
3330

3431
this._operatorSelectionModel = new ComparisonSelectionModel();
3532
this._operatorSelectionModel.visualChange$.bubbleTo(this._visualChange$);
@@ -86,16 +83,10 @@ export class NumericalComparisonFilterModel extends FilterModel {
8683
* @inheritDoc
8784
*/
8885
get normalized() {
89-
if (this._useOperatorAsNormalizationKey) {
90-
return {
91-
[this._operatorSelectionModel.current]: this._operandInputModel.value,
92-
};
93-
} else {
94-
return {
95-
operator: this._operatorSelectionModel.current,
96-
limit: this._operandInputModel.value,
97-
};
98-
}
86+
return {
87+
operator: this._operatorSelectionModel.current,
88+
limit: this._operandInputModel.value,
89+
};
9990
}
10091

10192
// eslint-disable-next-line valid-jsdoc

lib/public/views/Runs/Overview/RunsOverviewModel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ export class RunsOverviewModel extends OverviewPageModel {
8383
odcTopologyFullName: new RawTextFilterModel(),
8484
eorReason: new EorReasonFilterModel(eorReasonTypeProvider.items$),
8585
magnets: new MagnetsFilteringModel(magnetsCurrentLevelsProvider.items$),
86-
muInelasticInteractionRate: new NumericalComparisonFilterModel({ useOperatorAsNormalizationKey: true }),
87-
inelasticInteractionRateAvg: new NumericalComparisonFilterModel({ useOperatorAsNormalizationKey: true }),
88-
inelasticInteractionRateAtStart: new NumericalComparisonFilterModel({ useOperatorAsNormalizationKey: true }),
89-
inelasticInteractionRateAtMid: new NumericalComparisonFilterModel({ useOperatorAsNormalizationKey: true }),
90-
inelasticInteractionRateAtEnd: new NumericalComparisonFilterModel({ useOperatorAsNormalizationKey: true }),
86+
muInelasticInteractionRate: new NumericalComparisonFilterModel(),
87+
inelasticInteractionRateAvg: new NumericalComparisonFilterModel(),
88+
inelasticInteractionRateAtStart: new NumericalComparisonFilterModel(),
89+
inelasticInteractionRateAtMid: new NumericalComparisonFilterModel(),
90+
inelasticInteractionRateAtEnd: new NumericalComparisonFilterModel(),
9191
});
9292

9393
this._filteringModel.observe(() => this._applyFilters(true));

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
5151
this._skimmableRuns$.bubbleTo(this);
5252

5353
this._gaqNotBadFractionFilterModel = new NumericalComparisonFilterModel({
54-
useOperatorAsNormalizationKey: true,
5554
scale: 0.01,
5655
integer: true,
5756
});

0 commit comments

Comments
 (0)