Skip to content

[O2B-1552] Move ad hoc filters inside runs overviews model to filtering model#2106

Open
NarrowsProjects wants to merge 87 commits intomainfrom
improv/O2B-1552/Move-ad-hoc-filters-inside-runsOverviewModel-to-filteringModel
Open

[O2B-1552] Move ad hoc filters inside runs overviews model to filtering model#2106
NarrowsProjects wants to merge 87 commits intomainfrom
improv/O2B-1552/Move-ad-hoc-filters-inside-runsOverviewModel-to-filteringModel

Conversation

@NarrowsProjects
Copy link
Copy Markdown
Collaborator

@NarrowsProjects NarrowsProjects commented Mar 10, 2026

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • The monte carlo reproducable as not bad filters from the runs per .... overview pages has been changed to also be cleared when the 'reset all filters' button is pressed to be in line with all other filters.

Notable changes for developers:

Filter restructuring

  • ddflpFilter, dcsFilter, and epnFilter have been moved to the filteringModel.
  • detectorsQc[_id][notBadFraction] filters have been moved to a new model: MultiCompositeFilterModel.
  • gaq[notBadFraction] now uses its own filter model with unique normalization logic: GaqFilterModel.

New filter models

  • GaqFilterModel

    • Dedicated model for gaq[notBadFraction].
    • Implements custom normalization logic.
  • ToggleFilterModel

    • Introduced for toggle-based filters.
    • mcReproducibleAsNotBad has been converted to use this model.
  • MultiCompositeFilterModel

    • New flexible model:
      • Can be instantiated with filters.
      • Supports adding filters dynamically after instantiation.
    • Computes normalized values based on:
      • Insertion keys
      • Normalized child filters

Shared filter behavior

  • mcReproducibleAsNotBad:
    • Converted into a ToggleFilterModel.
    • Integrated into both:
      • GaqFilterModel
      • MultiCompositeFilterModel
    • Important: both models must use the same instance for correct behavior.

New components

  • RadioButtonFilter
    • Replaces filters associated with the restructured filter models.
  • ToggleFilter (component + model)
    • Introduced alongside ToggleFilterModel.

Renaming

  • detectorsQc[_id][notBadFraction]detectorsQcNotBadFraction[_id]

    • Reduces nesting within the filterModel.

Implementation note

  • This approach avoids:

    • Creating a custom wrapper around NumericalComparisonFilterModel solely for normalization, or
    • Nesting MultiCompositeFilterModel within another MultiCompositeFilterModel to achieve automatic normalization.

Changes made to the database:

  • N/A

Guust and others added 30 commits February 20, 2026 10:23
* Filtering by stableBeamsStart and stableBeamsEnd has been added to LHC Fills overview page
* lhcFills endpoint & DTO validation modified and testing added for the aforementioned changes
---------

Co-authored-by: GuustMetz <guust.metz@cern.ch>
Co-authored-by: Guust <metzguust@gmail.com>
* Replaced the two-query pattern with a single queryBuilder in GetAllEnvironmentsUseCase. The previous approach was redundant following Sequelize performance improvements; furthermore, the original implementation's logic was flawed which resulted in the pagination bug.
@NarrowsProjects NarrowsProjects changed the title [O2B-1552] Move ad hoc filters inside runs overview model to filtering model [O2B-1552] Move ad hoc filters inside runs overviews model to filtering model Apr 17, 2026
Base automatically changed from improv/O2B-1547/Migrate-LhcPeriodOverviewModel-to-use-FilteringModel-pattern to main April 17, 2026 13:31
*
* @return {boolean} true if filter is stable beams only
*/
isToggled() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a getter? isToggled represents a state rather than an action, so I think it would be more natural, what do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, especially since there is already precedence for this with how FilterModels have isEmpty as a getter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

2 participants