Skip to content

Commit 58ae973

Browse files
committed
add filter
1 parent 38b082d commit 58ae973

4 files changed

Lines changed: 52 additions & 2 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @license
3+
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
4+
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
5+
* All rights not expressly granted are reserved.
6+
*
7+
* This software is distributed under the terms of the GNU General Public
8+
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
9+
*
10+
* In applying this license CERN does not waive the privileges and immunities
11+
* granted to it by virtue of its status as an Intergovernmental Organization
12+
* or submit itself to any jurisdiction.
13+
*/
14+
15+
const NonPhysicsProductionsNamesWords = Object.freeze({
16+
TEST: 'test',
17+
DEBUG: 'debug',
18+
});
19+
20+
module.exports.NonPhysicsProductionsNamesWords = NonPhysicsProductionsNamesWords;
21+
22+
module.exports.NON_PHYSICS_PRODUCTIONS_NAMES_WORDS = Object.values(NonPhysicsProductionsNamesWords);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
4+
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
5+
* All rights not expressly granted are reserved.
6+
*
7+
* This software is distributed under the terms of the GNU General Public
8+
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
9+
*
10+
* In applying this license CERN does not waive the privileges and immunities
11+
* granted to it by virtue of its status as an Intergovernmental Organization
12+
* or submit itself to any jurisdiction.
13+
*/
14+
15+
export const NonPhysicsProductionsNamesWords = Object.freeze({
16+
TEST: 'test',
17+
DEBUG: 'debug',
18+
});
19+
20+
export const NON_PHYSICS_PRODUCTIONS_NAMES_WORDS = Object.values(NonPhysicsProductionsNamesWords);

lib/public/views/DataPasses/ActiveColumns/dataPassesActiveColumns.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export const dataPassesActiveColumns = {
104104
},
105105

106106
nonPhysicsProductions: {
107-
name: 'include nonphysical productions',
108-
// filter: (runsOverviewModel) => checkboxes(runsOverviewModel.filteringModel.get('runQualities').selectionModel),
107+
name: 'Include nonphysics productions',
108+
filter: ({ filteringModel }) => checkboxes(filteringModel.get('nonPhysics').selectionModel),
109109
visible: false,
110110
},
111111
};

lib/public/views/DataPasses/PerLhcPeriodOverview/DataPassesPerLhcPeriodOverviewModel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313
import { FilteringModel } from '../../../components/Filters/common/FilteringModel.js';
14+
import { SelectionFilterModel } from '../../../components/Filters/common/filters/SelectionFilterModel.js';
1415
import { TextTokensFilterModel } from '../../../components/Filters/common/filters/TextTokensFilterModel.js';
16+
import { NON_PHYSICS_PRODUCTIONS_NAMES_WORDS, NonPhysicsProductionsNamesWords } from '../../../domain/enums/NonPhysicsProductionsNamesWords.js';
1517
import { OverviewPageModel } from '../../../models/OverviewModel.js';
1618
import { buildUrl } from '/js/src/index.js';
1719

@@ -26,6 +28,9 @@ export class DataPassesPerLhcPeriodOverviewModel extends OverviewPageModel {
2628
super();
2729
this._filteringModel = new FilteringModel({
2830
names: new TextTokensFilterModel(),
31+
nonPhysics: new SelectionFilterModel({
32+
availableOptions: NON_PHYSICS_PRODUCTIONS_NAMES_WORDS.map((word) => ({ label: word.toUpperCase(), value: word })),
33+
}),
2934
});
3035

3136
this._filteringModel.visualChange$.bubbleTo(this);
@@ -47,10 +52,13 @@ export class DataPassesPerLhcPeriodOverviewModel extends OverviewPageModel {
4752
* @inheritdoc
4853
*/
4954
getRootEndpoint() {
55+
const nonPhysicsSelectionModel = this._filteringModel.get('nonPhysics').selectionModel;
5056
const params = {
5157
filter: {
5258
lhcPeriodIds: [this._lhcPeriodId],
5359
names: this._filteringModel.get('names').normalized,
60+
includeTest: nonPhysicsSelectionModel.selected.includes(NonPhysicsProductionsNamesWords.TEST),
61+
includeDebug: nonPhysicsSelectionModel.selected.includes(NonPhysicsProductionsNamesWords.DEBUG),
5462
},
5563
};
5664

0 commit comments

Comments
 (0)