-
Notifications
You must be signed in to change notification settings - Fork 21
[O2B-1502] Add Filtering panel to LHC-fills page #2030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graduta
merged 22 commits into
main
from
feature/O2B-1502/filtering-panel-lhc-fills-frontend
Dec 15, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
057c235
[O2B-1502] Filter model setup boilerplate code.
Houwie7000 a7a9eda
[O2B-1502] Add filter button on LHC-fills overview page.
Houwie7000 2648f1c
[O2B-1502] Added stable beams only to filter
Houwie7000 094e6c5
[O2B-1502] Filtering with Stable Beams Only works, radioButton elemen…
Houwie7000 da7ff37
[O2B-1502] Doc fixes
Houwie7000 ee72512
[O2B-1502] Increase timeout of detailsForSimulationPass test. Local m…
Houwie7000 96a04c0
[O2B-1502] Potential fix for test failure.
Houwie7000 6fa4034
Revert "[O2B-1502] Potential fix for test failure."
Houwie7000 17ea048
Merge branch 'main' into feature/O2B-1502/filtering-panel-lhc-fills-f…
graduta 695622b
[O2B-1502] Processed feedback
Houwie7000 87bee89
[O2B-1502] Git failed to detect rename. Ran: git mv RadioButton.js ra…
Houwie7000 5a18d9e
[O2B-1502] Added test import
Houwie7000 4c530ef
Revert "[O2B-1502] Processed feedback"
Houwie7000 51b50d9
[O2B-1502] Cherry pick previous feedback changes
Houwie7000 c0c8559
[O2B-1502] Integrated stable beam only filter into filtermodel.
Houwie7000 9934e56
[O2B-1502] fixed stable beam default value
Houwie7000 f247a6f
[O2B-1502] Fixed logic and type
Houwie7000 9b67281
[O2B-1502] Don't set any defaults in the filter as it will conflict w…
Houwie7000 ea0880f
[O2B-1502] Code cleanup
Houwie7000 46d4ae8
[O2B-1502] minor changes, processed feedback
Houwie7000 91e350c
[O2B-1502] Removed duplicate function due to override
Houwie7000 412fcad
Merge branch 'main' into feature/O2B-1502/filtering-panel-lhc-fills-f…
graduta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
lib/public/components/Filters/LhcFillsFilter/StableBeamFilterModel.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE Trg. This software is | ||
| * distributed under the terms of the GNU General Public License v3 (GPL | ||
| * Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * See http://alice-Trg.web.cern.ch/license for full licensing information. | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { SelectionModel } from '../../common/selection/SelectionModel.js'; | ||
|
|
||
| /** | ||
| * Stable beam filter model | ||
| * Holds true or false value | ||
| */ | ||
| export class StableBeamFilterModel extends SelectionModel { | ||
| /** | ||
| * Constructor | ||
| */ | ||
| constructor() { | ||
| super({ availableOptions: [{ value: true }, { value: false }], | ||
| defaultSelection: [{ value: false }], | ||
| multiple: false, | ||
| allowEmpty: false }); | ||
| } | ||
|
|
||
| /** | ||
| * Returns true if the current filter is stable beams only | ||
| * | ||
| * @return {boolean} true if filter is stable beams only | ||
| */ | ||
| isStableBeamsOnly() { | ||
| return this.current; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the current filter to stable beams only | ||
| * | ||
| * @param {boolean} value value to set this stable beams only filter with | ||
| * @return {void} | ||
| */ | ||
| setStableBeamsOnly(value) { | ||
| this.select({ value }); | ||
| } | ||
|
|
||
| /** | ||
| * Get normalized selected option | ||
| */ | ||
| get normalized() { | ||
| return this.current; | ||
| } | ||
|
|
||
| /** | ||
| * Overrides SelectionModel.isEmpty to respect the fact that stable beam filter cannot be empty. | ||
| * @returns {boolean} true if the current value of the filter is false. | ||
| */ | ||
| get isEmpty() { | ||
| return this.current === false; | ||
| } | ||
|
|
||
| /** | ||
| * Reset the filter to default values | ||
| * | ||
| * @return {void} | ||
| */ | ||
| resetDefaults() { | ||
| if (!this.isEmpty) { | ||
| this.reset(); | ||
| this.notify(); | ||
| } | ||
| } | ||
| } |
49 changes: 49 additions & 0 deletions
49
lib/public/components/Filters/LhcFillsFilter/stableBeamFilter.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE Trg. This software is | ||
| * distributed under the terms of the GNU General Public License v3 (GPL | ||
| * Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * See http://alice-Trg.web.cern.ch/license for full licensing information. | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { h } from '/js/src/index.js'; | ||
| import { switchInput } from '../../common/form/switchInput.js'; | ||
| import { radioButton } from '../../common/form/inputs/radioButton.js'; | ||
|
|
||
| /** | ||
| * Display a toggle switch or radio buttons to filter stable beams only | ||
| * | ||
| * @param {StableBeamFilterModel} stableBeamFilterModel the stableBeamFilterModel | ||
| * @param {boolean} radioButtonMode define whether or not to return radio buttons or a switch. | ||
| * @returns {Component} the toggle switch | ||
| */ | ||
| export const toggleStableBeamOnlyFilter = (stableBeamFilterModel, radioButtonMode = false) => { | ||
| const name = 'stableBeamsOnlyRadio'; | ||
| const labelOff = 'OFF'; | ||
| const labelOn = 'ON'; | ||
| if (radioButtonMode) { | ||
| return h('.form-group-header.flex-row.w-100', [ | ||
| radioButton({ | ||
| label: labelOff, | ||
| isChecked: !stableBeamFilterModel.isStableBeamsOnly(), | ||
| action: () => stableBeamFilterModel.setStableBeamsOnly(false), | ||
| name: name, | ||
| }), | ||
| radioButton({ | ||
| label: labelOn, | ||
| isChecked: stableBeamFilterModel.isStableBeamsOnly(), | ||
| action: () => stableBeamFilterModel.setStableBeamsOnly(true), | ||
| name: name, | ||
| }), | ||
| ]); | ||
| } else { | ||
| return switchInput(stableBeamFilterModel.isStableBeamsOnly(), (newState) => { | ||
| stableBeamFilterModel.setStableBeamsOnly(newState); | ||
| }, { labelAfter: 'STABLE BEAM ONLY' }); | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE Trg. This software is | ||
| * distributed under the terms of the GNU General Public License v3 (GPL | ||
| * Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * See http://alice-Trg.web.cern.ch/license for full licensing information. | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { h } from '/js/src/index.js'; | ||
|
|
||
| /** | ||
| * @typedef RadioButtonConfigStyle | ||
| * @property {string} labelStyle - value for the label's style property. | ||
| * @property {string} radioButtonStyle - value for the radio button's element styling. | ||
| */ | ||
|
|
||
| /** | ||
| * @typedef RadioButtonConfig - configuration object for radioButton. | ||
| * | ||
| * @property {string} label - label to be displayed to the user for radio button | ||
| * @property {boolean} isChecked - is radio button selected or not | ||
| * @property {function()} action - action to be followed on user click | ||
| * @property {string} id - id of the radiobutton element | ||
| * @property {string} name - name of the radiobutton element | ||
| * @property {RadioButtonConfigStyle} style - label style property | ||
| */ | ||
|
|
||
| /** | ||
| * Build a radio button with its configuration and actions | ||
| * @param {RadioButtonConfig} configuration - configuration object for radioButton. | ||
| * @return {vnode} - radio button with associated label. | ||
| */ | ||
| export const radioButton = (configuration = {}) => { | ||
| const { | ||
| label = '', | ||
| isChecked = false, | ||
| action = () => { }, | ||
| name = '', | ||
| id = `${name}${label}`, | ||
| style = { labelStyle: 'cursor: pointer;', radioButtonStyle: '.w-33' }, | ||
| } = configuration; | ||
| return h(`${style.radioButtonStyle}.form-check`, [ | ||
| h('input.form-check-input', { | ||
| onchange: action, | ||
| type: 'radio', | ||
| id, | ||
| name, | ||
| value: label, | ||
| checked: isChecked, | ||
| }), | ||
| h('label.form-check-label', { | ||
| style: style.labelStyle, | ||
| for: id, | ||
| }, label), | ||
| ]); | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.