Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
722caf7
chore: remove redundant model assignment.
Feb 20, 2026
f161cae
chore: move all filters denoted as so to a filteringModel
Feb 20, 2026
9faffaf
Make filterInputModel extend filterModel
Feb 20, 2026
247943b
rename inputfilter to ParsedInputFilter
Feb 20, 2026
114285d
implement authorfilter with ParsedInputFilterModel changes
Feb 20, 2026
f39f7ae
re-implement filter
Feb 20, 2026
df1fea3
add tag-filters to the filtering object
Feb 20, 2026
96ca85f
replace titleFilter and contentFilter with RawTextFilterModels
Feb 20, 2026
93b3291
make Authorfilter an implementation of RawTextFilterModel
Feb 20, 2026
5a5e830
add runs filter to the filteringmodel
Feb 20, 2026
b5e7148
add environments filter to the filteringmodel
Feb 20, 2026
3507ba0
add lhcFills filter to the filteringmodel
Feb 20, 2026
9c63409
add created filter to the filteringmodel
Feb 20, 2026
5500b3e
move the sort 'filter' to fetchlogs, since it doesn't actually filter…
Feb 20, 2026
a09ae8b
change filter to rawTextFilter for title
Feb 21, 2026
512999b
fix test by changing event type to 'change'
Feb 21, 2026
0f15812
fix content and author tests
Feb 21, 2026
7b641ca
import openFilteringPanel and resetFilters
Feb 21, 2026
5ab8218
fix createdAt filter test
Feb 21, 2026
4c96d73
change event types to change
Feb 21, 2026
18ce4dc
fix isAnyFilterActive
Feb 21, 2026
685dd38
remove _raw as from authorfilterModel, as it serves no purpose
Feb 21, 2026
4e132fd
chore: removed ParsedInputFilterModel
Mar 2, 2026
caf9812
chore: add toLowerCase to filterQueryParam computation
Mar 2, 2026
41c5a72
[O2B-1530] Lhc fills add sb duration filter (#2080)
NarrowsProjects Feb 24, 2026
f38f597
[O2B-1544] Fix pagination for filtered envs and add a test (#2096)
isaachilly Mar 5, 2026
3efdf1d
remove the combination operator from runs
Mar 5, 2026
fc61bea
remove the combination operator from envirionments
Mar 5, 2026
9c4df68
remove the combination operator from lhcFills
Mar 5, 2026
b860320
make filter computation much more compact using filteringmodel.normalize
Mar 5, 2026
7a00043
add happy-flow tests for logs api
Mar 5, 2026
ada3eb3
fix usecase unit tests
Mar 5, 2026
d290be7
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Mar 5, 2026
0d8d3d4
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Mar 5, 2026
237683a
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Mar 9, 2026
25244f4
chore: add filteringmodel to QcFlagTypesOverviewModel
Mar 9, 2026
6970a74
feat: move namesFilterModelFilter to fileringmodel
Mar 9, 2026
cdaaf0e
feat: move methodsFilterModelFilter to filteringModel
Mar 9, 2026
27a8bbc
feat: move methodsFilterModelFilter to filteringModel
Mar 9, 2026
c24d302
chore: add filteringModel to AnchoredSimulationPassesOverviewModel
Mar 10, 2026
2f6fcf1
chore: add namesFilterModel to the filteringModel instance
Mar 10, 2026
790d76b
chore: add filteringModel to SimulationPassesPerLhcPeriodOverviewModel
Mar 10, 2026
6fe055b
chore: add namesFilterModel to the filteringModel instance of Simulat…
Mar 10, 2026
0e5d567
chore: add filteringModel to overviewmodel class
Mar 10, 2026
05461dd
feat: move namesFilterModel to the filteringModel
Mar 10, 2026
102c1b6
feat: move yearsFilterModel to the filteringModel
Mar 10, 2026
e2ab763
feat: move pdpBeamTypes to the filteringModel
Mar 10, 2026
30d7b39
rename te bad filter to be a generic component
Mar 10, 2026
bdba964
feat: replace qcFlagType bad filter with radioButtonFilterModel
Mar 10, 2026
4790d30
feat: replace ddflp's filter component with the common radiButton com…
Mar 10, 2026
3cf6c1b
feat: replace ddflp's filter component with the common radioButton co…
Mar 10, 2026
17a4ce8
feat: replace epn's filter component with the common radioButton comp…
Mar 10, 2026
1cd5603
feat: replace triggerValue's filter component with the standard selec…
Mar 10, 2026
4cea58d
chore: remove unused components
Mar 11, 2026
a9a1cd9
fix: fix Selectionmodel.normalized to use selected rather than select…
Mar 12, 2026
f9c1adb
Merge branch 'improv/O2B-1548/Migrate-qcFlagTypesOverviewModel-to-use…
Mar 12, 2026
172b28c
Merge branch 'improv/O2B-1549/Migrate-AnchoredSimulationPassesOvervie…
Mar 12, 2026
cf342ea
Merge branch 'improv/O2B-1547/Migrate-LhcPeriodOverviewModel-to-use-F…
Mar 12, 2026
aded3af
rename triggerValue checkboxes to include the triggerValue name
Apr 2, 2026
fa199de
feat: create ToggleFilterModel
Apr 9, 2026
47c0105
revamp the stableBeamFilter to be more general for toggles
Apr 9, 2026
0c3f701
rename stableBeamFilter to toggleFilter
Apr 9, 2026
1333c45
feat: turn mcReproducibleNotAsBad into a toggleFilter
Apr 15, 2026
1365033
chore: remove mcreprodicebleAsNotBadToggle.js
Apr 15, 2026
39d282a
add optional ID to togglefilter.js
Apr 15, 2026
306d3d0
feat: create gaqFilterModel
Apr 15, 2026
7d7f6c9
feat: replace 'gaq[notBadFraction]' with a gaqFilterModel
Apr 15, 2026
accd756
feat: create MultiCompositionFilterModel
Apr 15, 2026
d7d6177
improve MultiCompositionFiltermodel
Apr 15, 2026
6df07ff
change tests to be compatible with the mc filter now being clearable
Apr 15, 2026
95773bd
feat: flatten the detectorsQc[id][NotBadFraction] to detectorsQcNotBa…
Apr 16, 2026
2ca9a26
test: update api tests for the new flat detectorsQcNotBadFraction name
Apr 16, 2026
6f3de22
chore: turn hasStableBeams back into a radiobutton
Apr 17, 2026
de86292
chore: update jsdoc for gaqfilterModel and MultiCompositionFilterModel
Apr 17, 2026
83fb6f7
chore improve comment explanation of mcReproducibleNotbad
Apr 17, 2026
aa550f8
chore: update ToggleFilterModel jsdoc
Apr 17, 2026
4e8ca69
Merge branch 'main' into improv/O2B-1552/Move-ad-hoc-filters-inside-r…
Apr 17, 2026
c5820a6
remove unused import
Apr 17, 2026
9c32b2e
fix linting issues
Apr 17, 2026
309e3df
Merge branch 'main' into improv/O2B-1552/Move-ad-hoc-filters-inside-r…
Apr 17, 2026
75fe876
feat: update parameters of togglefilterModel to include falseIsEmpty
Apr 17, 2026
6c61766
test: update GetAllRunsUsecase.test.js to use the new flat detectorsQ…
Apr 17, 2026
a3fe2e2
test: fixup misplacement of mcReproducibleAsNotBad in filters
Apr 20, 2026
aba1d47
Merge branch 'main' into improv/O2B-1552/Move-ad-hoc-filters-inside-r…
NarrowsProjects Apr 20, 2026
4e92c1e
feat: change GaqFilterModel.notBadFraction notification functionallit…
Apr 20, 2026
4e9559b
chore: fix linter problems
Apr 20, 2026
ee70acf
chore: force all filters managed by FilteringModel to extend FilterMo…
Apr 21, 2026
3bc171a
feat: update filteringModel to set filters to the url when they are u…
Apr 21, 2026
0957b9e
chore: mover router instantiation to before the pageModel instantiations
Apr 21, 2026
23d02fc
chore: pass router to the dataPassOverview models
Apr 21, 2026
51b8827
chore: pass router to the EnvironmentOverviewModel models
Apr 21, 2026
22efa5f
chore: pass router to the EnvironmentOverviewModel models
Apr 21, 2026
325fb6e
chore: pass router to the LhcPeriodOverview model
Apr 21, 2026
69521dc
chore: pass router to the LogsOverview model
Apr 21, 2026
fda7ea1
chore: pass router to the QcFlagTypesOverview model
Apr 21, 2026
555cd6d
chore: pass router to the RunsOverview model
Apr 21, 2026
2da2473
chore: pass router to the Simulation pass overview models
Apr 21, 2026
61bcae0
fixup: the import of buildUrl
Apr 21, 2026
3f06051
chore: add pageidentifiers field to FilteringModel
Apr 21, 2026
fb562c8
chore: add page identifiers to all of the overview page models
Apr 21, 2026
1f9af44
feat: make filteringmodel constructor more efficient
Apr 21, 2026
fda9365
Merge branch 'improv/O2B-1557/Force-all-filters-managed-by-FilteringM…
Apr 21, 2026
3a3fa99
test: create tests for logsOverviewPage
Apr 22, 2026
4b7b1f1
test: create tests for logsOverviewPage
Apr 22, 2026
fd8d650
feat: remove url params upon reset
Apr 22, 2026
5a54dfe
test: create tests for lhcFillsOverviewPage
Apr 22, 2026
aa0fdba
test: create tests for runsOverviewPage
Apr 22, 2026
f1218bd
fix: add semicolon
Apr 22, 2026
f8372f9
test: create tests for flagtypes overview and lhcperiod overview
Apr 23, 2026
c9f979a
test add runsPerLhcPeriodOverview tests
Apr 23, 2026
3045d5a
test add DataPassesPerLhcPeriodOverview tests
Apr 23, 2026
c11492b
test add anchoredSimulationPassOverview tests
Apr 23, 2026
e2ac217
test add DataPassesPerSimulationPassOverview tests
Apr 23, 2026
fda76f8
add runs per simulationpass and datapass tests
Apr 23, 2026
8806283
add filters index file
Apr 23, 2026
78923f2
chore: remove router from the observable constructor in DatapassesModel
Apr 23, 2026
edbcbc3
fix lint issues
Apr 23, 2026
cbd335d
add clearUrl parameter to filterIngModel
Apr 23, 2026
1ec54b2
test: upgrade the fillInput function
Apr 23, 2026
1a6fe58
chore: fix eslint errors
Apr 23, 2026
d45eded
chore: add missing reset filtering params for logs
Apr 24, 2026
de9af6f
chore: move the pageIdentifier definitions to the entity models
Apr 24, 2026
ae6c287
chore: rename pageIdentifiers to pageIdentifier
Apr 24, 2026
3390e10
chore: undo de-rowification
May 4, 2026
38aa69d
Merge branch 'improv/O2B-1557/Force-all-filters-managed-by-FilteringM…
May 4, 2026
1d173f4
Merge branch 'main' into feature/O2B-1556/Configure-FilteringModel-ob…
May 5, 2026
90e1911
add pageIdentifier setter and router getter back
May 5, 2026
f1bb637
add mcreproducable toggle back to test
May 5, 2026
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
18 changes: 9 additions & 9 deletions lib/public/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,27 @@ export default class Model extends Observable {
this._appConfiguration$ = new Observable();
this._inputDebounceTime = INPUT_DEBOUNCE_TIME;

// Setup router
this.router = new QueryRouter();
this.router.observe(this.handleLocationChange.bind(this));
this.router.bubbleTo(this);
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));

// Models

this.home = new HomePageModel(this);
this.home.bubbleTo(this);

this.lhcPeriods = new LhcPeriodsModel(this);
this.lhcPeriods = new LhcPeriodsModel(this.router);
this.lhcPeriods.bubbleTo(this);

this.dataPasses = new DataPassesModel(this);
this.dataPasses = new DataPassesModel(this.router);
this.dataPasses.bubbleTo(this);

this.qcFlags = new QcFlagsModel(this);
this.qcFlags.bubbleTo(this);

this.simulationPasses = new SimulationPassesModel(this);
this.simulationPasses = new SimulationPassesModel(this.router);
this.simulationPasses.bubbleTo(this);

this.qcFlagTypes = new QcFlagTypesModel(this);
Expand Down Expand Up @@ -178,12 +184,6 @@ export default class Model extends Observable {
this.errorModel = new ErrorModel();
this.errorModel.bubbleTo(this);

// Setup router
this.router = new QueryRouter();
this.router.observe(this.handleLocationChange.bind(this));
this.router.bubbleTo(this);
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));

// Init pages
this.handleLocationChange();
this.window.addEventListener('resize', debounce(() => this.notify(), 100));
Expand Down
46 changes: 41 additions & 5 deletions lib/public/components/Filters/common/FilteringModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { expandQueryLikeNestedKey } from '../../../utilities/expandNestedKey.js';
import { SelectionModel } from '../../common/selection/SelectionModel.js';
import { FilterModel } from './FilterModel.js';
import { Observable } from '/js/src/index.js';
import { buildUrl, Observable } from '/js/src/index.js';

/**
* Model representing a filtering system, including filter inputs visibility, filters values and so on
Expand All @@ -23,32 +23,52 @@ export class FilteringModel extends Observable {
/**
* Constructor
*
* @param {QueryRouter} router router that controls the application's page navigation
* @param {Object<string, FilterModel>} filters the filters with their label and model
*/
constructor(filters) {
constructor(router, filters) {
super();

this._visualChange$ = new Observable();
this._pageIdentifier = null;

this._router = router;
this._filters = {};
this._filterModels = [];
Object.entries(filters).forEach(([key, model]) => this.put(key, model));
}

/**
* Sets the page identifiers
*
* @param {string} identifier a string identifies a page from the router params.
* Used to prevent unneeded reads/writes from/to the url
* @returns {void}
*/
set pageIdentifier(identifier) {
this._pageIdentifier = identifier;
}

/**
* Reset the filters
*
* @param {boolean} [notify=false] if true the model notifies its observers
* @param {boolean} [clearUrl=false] if true filters will be removed from the url
* @return {void}
*/
reset(notify = false) {
reset(notify = false, clearUrl = false) {
for (const model of this._filterModels) {
model.reset();
}

if (notify) {
this.notify();
}

if (clearUrl) {
const { params } = this._router;
delete params.filter;
this._router.go(buildUrl('?', params), false, true);
}
}

/**
Expand Down Expand Up @@ -104,6 +124,22 @@ export class FilteringModel extends Observable {
return this._filters[key];
}

/**
* When the user updates the displayed Objects, the filters should be placed in the URL as well
* @returns {undefined}
*/
setFilterToURL() {
const { params } = this._router;
const newParams = { ...params };
newParams.filter = this.normalized;

if (this._pageIdentifier === params.page) {
this._router.go(buildUrl('?', newParams), false, true);
}

this.notify();
}

/**
* Add new filter
*
Expand All @@ -123,7 +159,7 @@ export class FilteringModel extends Observable {

this._filters[key] = filter;
this._filterModels.push(filter);
filter.bubbleTo(this);
filter.observe(() => this.setFilterToURL());
filter.visualChange$?.bubbleTo(this._visualChange$);
}
}
4 changes: 2 additions & 2 deletions lib/public/components/Filters/common/filtersPanelPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const filtersToggleContentHeader = (filteringModel) => h('.flex-row.justify-betw
'button#reset-filters.btn.btn-danger',
{
onclick: () => filteringModel.resetFiltering
? filteringModel.resetFiltering()
: filteringModel.reset(true),
? filteringModel.resetFiltering(true, true)
: filteringModel.reset(true, true),
disabled: !filteringModel.isAnyFilterActive(),
},
'Reset all filters',
Expand Down
7 changes: 4 additions & 3 deletions lib/public/views/DataPasses/DataPassesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import { DataPassesPerSimulationPassOverviewModel } from './PerSimulationPassOve
export class DataPassesModel extends Observable {
/**
* The constructor of the model
* @param {QueryRouter} router router that controls the application's page navigation
*/
constructor() {
constructor(router) {
super();

this._perLhcPeriodOverviewModel = new DataPassesPerLhcPeriodOverviewModel();
this._perLhcPeriodOverviewModel = new DataPassesPerLhcPeriodOverviewModel(router, 'data-passes-per-lhc-period-overview');
this._perLhcPeriodOverviewModel.bubbleTo(this);

this._perSimulationPassOverviewModel = new DataPassesPerSimulationPassOverviewModel();
this._perSimulationPassOverviewModel = new DataPassesPerSimulationPassOverviewModel(router, 'data-passes-per-simulation-pass-overview');
this._perSimulationPassOverviewModel.bubbleTo(this);
}

Expand Down
28 changes: 18 additions & 10 deletions lib/public/views/DataPasses/DataPassesOverviewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@ import { OverviewPageModel } from '../../models/OverviewModel.js';
export class DataPassesOverviewModel extends OverviewPageModel {
/**
* Constructor
* @param {QueryRouter} router router that controls the application's page navigation
* @param {string} pageIdentifier string that indicates what page this model represents
*/
constructor() {
constructor(router, pageIdentifier) {
super();
this._filteringModel = new FilteringModel({
names: new TextTokensFilterModel(),
'include[byName]': new SelectionFilterModel({
availableOptions: NON_PHYSICS_PRODUCTIONS_NAMES_WORDS.map((word) => ({ label: word.toUpperCase(), value: word })),
}),
});
this._filteringModel = new FilteringModel(
router,
{
names: new TextTokensFilterModel(),
'include[byName]': new SelectionFilterModel({
availableOptions: NON_PHYSICS_PRODUCTIONS_NAMES_WORDS.map((word) => ({ label: word.toUpperCase(), value: word })),
}),
},
);

this._filteringModel.pageIdentifier = pageIdentifier;
this._filteringModel.visualChange$.bubbleTo(this);
this._filteringModel.observe(() => {
this._pagination.currentPage = 1;
Expand All @@ -51,10 +57,12 @@ export class DataPassesOverviewModel extends OverviewPageModel {
/**
* Reset this model to its default
*
* @returns {void}
* @param {boolean} _fetch Whether to refetch all data after filters have been reset
* @param {boolean} [clearUrl=false] if true filters will be removed from the url
* @return {void}
*/
reset() {
this._filteringModel.reset();
reset(_fetch = true, clearUrl = false) {
this._filteringModel.reset(false, clearUrl);
super.reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import { buildUrl } from '/js/src/index.js';
export class DataPassesPerLhcPeriodOverviewModel extends DataPassesOverviewModel {
/**
* Constructor
* @param {QueryRouter} router router that controls the application's page navigation
* @param {string} pageIdentifier string that indicates what page this model represents
*/
constructor() {
super();
constructor(router, pageIdentifier) {
super(router, pageIdentifier);
this._lhcPeriodId = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import { DataPassesOverviewModel } from '../DataPassesOverviewModel.js';
export class DataPassesPerSimulationPassOverviewModel extends DataPassesOverviewModel {
/**
* Constructor
* @param {QueryRouter} router router that controls the application's page navigation
* @param {string} pageIdentifier string that indicates what page this model represents
*/
constructor() {
super();
constructor(router, pageIdentifier) {
super(router, pageIdentifier);
this._simulationPass = new ObservableData(RemoteData.notAsked());
this._simulationPass.bubbleTo(this);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/public/views/Environments/EnvironmentModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class EnvironmentModel extends Observable {
super();

// Sub-models
this._overviewModel = new EnvironmentOverviewModel(model);
this._overviewModel = new EnvironmentOverviewModel(model, 'env-overview');
this._overviewModel.bubbleTo(this);

this._detailsModel = new EnvironmentDetailsModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ export class EnvironmentOverviewModel extends OverviewPageModel {
/**
* Constructor
* @param {Model} model global model
* @param {string} pageIdentifier string that indicates what page this model represents
*/
constructor(model) {
constructor(model, pageIdentifier) {
super();

this._filteringModel = new FilteringModel({
created: new TimeRangeInputModel(),
runNumbers: new RawTextFilterModel(),
statusHistory: new RawTextFilterModel(),
currentStatus: new SelectionFilterModel({
availableOptions: Object.keys(StatusAcronym).map((status) => ({
value: status,
label: coloredEnvironmentStatusComponent(status),
rawLabel: status,
})),
}),
ids: new RawTextFilterModel(),
});
this._filteringModel = new FilteringModel(
model.router,
{
created: new TimeRangeInputModel(),
runNumbers: new RawTextFilterModel(),
statusHistory: new RawTextFilterModel(),
currentStatus: new SelectionFilterModel({
availableOptions: Object.keys(StatusAcronym).map((status) => ({
value: status,
label: coloredEnvironmentStatusComponent(status),
rawLabel: status,
})),
}),
ids: new RawTextFilterModel(),
},
);

this._filteringModel.pageIdentifier = pageIdentifier;
this._filteringModel.observe(() => this._applyFilters(true));
this._filteringModel.visualChange$?.bubbleTo(this);

Expand Down Expand Up @@ -87,10 +92,11 @@ export class EnvironmentOverviewModel extends OverviewPageModel {
/**
* Reset all filtering models
* @param {boolean} fetch Whether to refetch all data after filters have been reset
* @param {boolean} [clearUrl=false] if true filters will be removed from the url
* @return {void}
*/
resetFiltering(fetch = true) {
this._filteringModel.reset();
resetFiltering(fetch = true, clearUrl = false) {
this._filteringModel.reset(false, clearUrl);

if (fetch) {
this._applyFilters(true);
Expand Down
6 changes: 3 additions & 3 deletions lib/public/views/Home/Overview/HomePageModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export class HomePageModel extends Observable {
*/
constructor(model) {
super();
this._runsOverviewModel = new RunsOverviewModel(model);
this._runsOverviewModel = new RunsOverviewModel(model, 'home');
this._runsOverviewModel.bubbleTo(this);

this._logsOverviewModel = new LogsOverviewModel(model, true);
this._logsOverviewModel = new LogsOverviewModel(model, true, 'home');
this._logsOverviewModel.bubbleTo(this);

this._lhcFillsOverviewModel = new LhcFillsOverviewModel(true);
this._lhcFillsOverviewModel = new LhcFillsOverviewModel(model.router, true, 'home');
this._lhcFillsOverviewModel.bubbleTo(this);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/views/LhcFills/LhcFills.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class LhcFills extends Observable {
this.model = model;

// Sub-models
this._overviewModel = new LhcFillsOverviewModel(true);
this._overviewModel = new LhcFillsOverviewModel(model.router, true, 'lhc-fill-overview');
this._overviewModel.bubbleTo(this);

this._detailsModel = new LhcFillDetailsModel();
Expand Down
33 changes: 20 additions & 13 deletions lib/public/views/LhcFills/Overview/LhcFillsOverviewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ export class LhcFillsOverviewModel extends OverviewPageModel {
/**
* Constructor
*
* @param {QueryRouter} router router that controls the application's page navigation
* @param {boolean} [stableBeamsOnly=false] if true, overview will load stable beam only
* @param {string} pageIdentifier string that indicates what page this model represents
*/
constructor(stableBeamsOnly = false) {
constructor(router, stableBeamsOnly = false, pageIdentifier) {
super();

this._filteringModel = new FilteringModel({
fillNumbers: new RawTextFilterModel(),
beamDuration: new TextComparisonFilterModel(),
runDuration: new TextComparisonFilterModel(),
hasStableBeams: new ToggleFilterModel(stableBeamsOnly, true),
stableBeamsStart: new TimeRangeFilterModel(),
stableBeamsEnd: new TimeRangeFilterModel(),
beamTypes: new BeamTypeFilterModel(),
schemeName: new RawTextFilterModel(),
});
this._filteringModel = new FilteringModel(
router,
{
fillNumbers: new RawTextFilterModel(),
beamDuration: new TextComparisonFilterModel(),
runDuration: new TextComparisonFilterModel(),
hasStableBeams: new ToggleFilterModel(stableBeamsOnly, true),
stableBeamsStart: new TimeRangeFilterModel(),
stableBeamsEnd: new TimeRangeFilterModel(),
beamTypes: new BeamTypeFilterModel(),
schemeName: new RawTextFilterModel(),
},
);

this._filteringModel.pageIdentifier = pageIdentifier;
this._filteringModel.observe(() => this._applyFilters());
this._filteringModel.visualChange$.bubbleTo(this);

Expand Down Expand Up @@ -85,10 +91,11 @@ export class LhcFillsOverviewModel extends OverviewPageModel {
/**
* Reset all filtering models
* @param {boolean} fetch Whether to refetch all data after filters have been reset
* @param {boolean} [clearUrl=false] if true filters will be removed from the url
* @return {void}
*/
resetFiltering(fetch = true) {
this._filteringModel.reset();
resetFiltering(fetch = true, clearUrl = false) {
this._filteringModel.reset(false, clearUrl);

if (fetch) {
this._applyFilters();
Expand Down
Loading
Loading