Skip to content

Commit a640a39

Browse files
author
GuustMetz
committed
feat: replace epn's filter component with the common radioButton componnent
1 parent 3cf6c1b commit a640a39

File tree

2 files changed

+5
-44
lines changed

2 files changed

+5
-44
lines changed

lib/public/views/Runs/ActiveColumns/runsActiveColumns.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
import { CopyToClipboardComponent, h } from '/js/src/index.js';
1515
import { runNumbersFilter } from '../../../components/Filters/RunsFilter/runNumbersFilter.js';
1616
import { displayRunEorReasonsOverview } from '../format/displayRunEorReasonOverview.js';
17-
import ddflpFilter from '../../../components/Filters/RunsFilter/ddflp.js';
18-
import dcsFilter from '../../../components/Filters/RunsFilter/dcs.js';
19-
import epnFilter from '../../../components/Filters/RunsFilter/epn.js';
2017
import { formatTimestamp } from '../../../utilities/formatting/formatTimestamp.js';
2118
import { displayRunDuration } from '../format/displayRunDuration.js';
2219
import { frontLink } from '../../../components/common/navigation/frontLink.js';
@@ -552,7 +549,7 @@ export const runsActiveColumns = {
552549
classes: 'w-2 f6 w-wrapped',
553550
format: (boolean) => boolean ? 'On' : 'Off',
554551
exportFormat: (boolean) => boolean ? 'On' : 'Off',
555-
filter: epnFilter,
552+
filter: ({ filteringModel }) => radioButtonFilter(filteringModel.get('epn'), 'epn'),
556553
},
557554
epnTopology: {
558555
name: 'EPN Topology',

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

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class RunsOverviewModel extends OverviewPageModel {
9393
inelasticInteractionRateAtEnd: new NumericalComparisonFilterModel(),
9494
ddflp: new RadioButtonFilterModel([{ label: 'ANY' }, { label: 'ON', value: true }, { label: 'OFF', value: false }]),
9595
dcs: new RadioButtonFilterModel([{ label: 'ANY' }, { label: 'ON', value: true }, { label: 'OFF', value: false }]),
96+
epn: new RadioButtonFilterModel([{ label: 'ANY' }, { label: 'ON', value: true }, { label: 'OFF', value: false }]),
9697
});
9798

9899
this._filteringModel.observe(() => this._applyFilters(true));
@@ -150,10 +151,6 @@ export class RunsOverviewModel extends OverviewPageModel {
150151

151152
this._triggerValuesFilters = new Set();
152153

153-
this.dcsFilter = '';
154-
155-
this.epnFilter = '';
156-
157154
if (fetch) {
158155
this._applyFilters(true);
159156
}
@@ -164,10 +161,7 @@ export class RunsOverviewModel extends OverviewPageModel {
164161
* @return {Boolean} If any filter is active
165162
*/
166163
isAnyFilterActive() {
167-
return this._filteringModel.isAnyFilterActive()
168-
|| this._triggerValuesFilters.size !== 0
169-
|| this.dcsFilter !== ''
170-
|| this.epnFilter !== '';
164+
return this._filteringModel.isAnyFilterActive() || this._triggerValuesFilters.size !== 0;
171165
}
172166

173167
/**
@@ -197,33 +191,6 @@ export class RunsOverviewModel extends OverviewPageModel {
197191
this._applyFilters();
198192
}
199193

200-
/**
201-
* Returns the boolean of epn
202-
* @return {Boolean} if epn is on
203-
*/
204-
getEpnFilterOperation() {
205-
return this.epnFilter;
206-
}
207-
208-
/**
209-
* Sets the boolean of the filter if no new inputs were detected for 200 milliseconds
210-
* @param {boolean} operation if the epn is on
211-
* @return {undefined}
212-
*/
213-
setEpnFilterOperation(operation) {
214-
this.epnFilter = operation;
215-
this._applyFilters();
216-
}
217-
218-
/**
219-
* Unchecks the epn checkbox and fetches all the runs.
220-
* @return {undefined}
221-
*/
222-
removeEpn() {
223-
this.epnFilter = '';
224-
this._applyFilters();
225-
}
226-
227194
/**
228195
* Returns the list of URL params corresponding to the currently applied filter
229196
*
@@ -235,11 +202,8 @@ export class RunsOverviewModel extends OverviewPageModel {
235202
return {
236203
...this._triggerValuesFilters.size !== 0 && {
237204
'filter[triggerValues]': Array.from(this._triggerValuesFilters).join(),
238-
},
239-
...(this.epnFilter === true || this.epnFilter === false) && {
240-
'filter[epn]': this.epnFilter,
241-
},
242-
};
205+
}
206+
}
243207
}
244208

245209
/**

0 commit comments

Comments
 (0)