-
Notifications
You must be signed in to change notification settings - Fork 21
[O2B-1508] LHCfills beam types filter #2045
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
Merged
Changes from all commits
Commits
Show all changes
103 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 e95c847
[O2B-1503] Added front end fill number filter
Houwie7000 5077fec
[O2B-1503] fillNumbers work, todo ranges
Houwie7000 9130c87
[O2B-1503] ranges accepted by fill numbers filter
Houwie7000 0d0986e
[O2B-1503] Added/fixed test lhc-fill overview
Houwie7000 804cd4c
[O2B-1503] doc change
Houwie7000 2f5932a
[O2B-1503] JSDoc enhancements. Extracted duplicate functions to utils…
Houwie7000 1e3f503
[O2B-1503] placeholder text changed
Houwie7000 de7d95b
[O2B-1505] Added beam duration filter to frontend
Houwie7000 cafcba1
[O2B-1505] added simple UI test
Houwie7000 4c28a84
[O2B-1505] Filter+DTO work
Houwie7000 a34340e
[O2B-1505] Beam duration filter works, TODO testing
Houwie7000 9921652
[O2B-1505] tests added/improv
Houwie7000 1c2fffb
[O2B-1505] Fixed tests
Houwie7000 d40bd5c
[O2B-1505] Cleanup, remove logs, docs
Houwie7000 d3c1ead
[O2B-1505] Fixed test
Houwie7000 fe5f6c7
[O2B-1505] Doc fixes
Houwie7000 7628bca
[O2B-1505] remove getStableBeamsOnly
Houwie7000 a533088
[O2B-1505] Fixed 00:00:00 bug, added test
Houwie7000 36bdd8d
[O2B-1506] Frontend run duration filter code
Houwie7000 b7fe810
[O2B-1506] Run duration filter tests + backend
Houwie7000 0751b57
[O2B-1506] Fixed GehAllLhcFillsUseCase run duration tests
Houwie7000 6f77e0c
[O2B-1506] Fixed 00:00:00 filter, added test to cover condition
Houwie7000 618daa1
[O2B-1508] Frontend Beams type filter working.
Houwie7000 8701246
[O2B-1508] Basic backend UseCase works
Houwie7000 e64d28f
[O2B-1508] Load possible beamstypes for the beam_type filter from the…
Houwie7000 19269b8
[O2B-1508] Beams types filter works with data from backend.
Houwie7000 18ea386
[O2B-1508] Handle beamtype 'null'. Added tests
Houwie7000 fd055ca
Merge branch 'main' into feature/O2B-1503/lhcfills-fill-numbers-filter
Houwie7000 6a47048
[O2B-1505] Processed feedback
Houwie7000 8e82b34
[O2B-1503] Processed feedback, added tests
Houwie7000 e5bbc05
[O2B-1503] Added test for splitStringToStringsTrimmed()
Houwie7000 668f90e
Merge branch 'feature/O2B-1503/lhcfills-fill-numbers-filter' into fea…
Houwie7000 a047600
Merge branch 'main' into feature/O2B-1505/lhcfills-beam-duration-filter
Houwie7000 7ce2103
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 f113473
[O2B-1505] Remove old code
Houwie7000 16246a0
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 d75c03e
[O2-1506] Process feedback from upstream
Houwie7000 bd1b836
[O2B-1505] Processed feedback, timeValidator JOI updated, debounce re…
Houwie7000 9e3bc30
Merge branch 'main' into feature/O2B-1505/lhcfills-beam-duration-filter
Houwie7000 3d2f665
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 a04fac2
[O2B-1506] Improvements from upstream integrated
Houwie7000 ff540af
[O2B-1505] Fixed validateTime error handling, removed unused code, TO…
Houwie7000 9e4e68c
[O2B-1505] processed feedback, empty id, code deduplication, bad doc
Houwie7000 0af9bdf
[O2B-1505] API + UI tests added
Houwie7000 45acea2
[O2B-1505] disable 00:00:00 conversion to null for DB
Houwie7000 fd057c2
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 4a4ed6d
[O2B-1505] typo removed
Houwie7000 ce6fb68
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 eca4ffa
[1506] WIP testing, usecase fixing
Houwie7000 133aa01
[O2B-1505] Removed outdated 00:00:00 usecase test
Houwie7000 191fd52
[O2B-1505] amountFilter -> durationFilter
Houwie7000 754f669
Merge branch 'feature/O2B-1505/lhcfills-beam-duration-filter' into fe…
Houwie7000 15e6a39
[1506] Changed the handling of >= 00:00:00 for the runDuration on lhc…
Houwie7000 78a2d12
Merge branch 'main' into feature/O2B-1506/lhcfills-run-duration-filter
Houwie7000 7b4f035
Merge branch 'feature/O2B-1506/lhcfills-run-duration-filter' into fea…
Houwie7000 1bdf8d0
[O2B-1506] fix outdated usecase test
Houwie7000 6a516b8
Merge branch 'feature/O2B-1506/lhcfills-run-duration-filter' into fea…
Houwie7000 2aec67f
[O2B-1508] Tests
Houwie7000 637ad11
[O2B-1506] Consolidated beam and run duration filter elements
Houwie7000 4e68523
[O2B-1506] Fixed > and < added tests
Houwie7000 8b726c6
Merge branch 'feature/O2B-1506/lhcfills-run-duration-filter' into fea…
Houwie7000 516bbbc
[O2B-1508] fixed test
Houwie7000 c6e6867
[O2B-1508] Linting, missing semicolon
Houwie7000 475c273
[O2B-1508] fixed api test
Houwie7000 e301404
[O2B-1508] Refactor distinct beam types query in LhcFillRepository
isaachilly 92c7f4f
[O2B-1508] Remove support for 'null' beamType filtering
isaachilly 8797eb6
[O2B-1508] Refactor and relocate beam types API and service logic to …
isaachilly 17f361e
Merge branch 'main' into feature/O2B-1508/lhcfills-beam-types-filter
isaachilly cf3ebb0
[O2B-1508] Remove redundant change to operator
isaachilly 38a9041
Merge branch 'main' into feature/O2B-1508/lhcfills-beam-types-filter
isaachilly 8ff1398
[O2B-1508] Rename beamsType to beamType across codebase
isaachilly a0a8a98
[O2B-1508] Refactor BeamTypeFilterModel to use SelectionFilterModel
isaachilly 466a839
Merge branch 'feature/O2B-1508/lhcfills-beam-types-filter' of github.…
isaachilly 817164b
Merge branch 'main' into feature/O2B-1508/lhcfills-beam-types-filter
isaachilly 1ec3173
[O2B-1508] Clean up beam type handling and unused code
isaachilly 54dee2f
[O2B-1508] Improve beamType filter tests
isaachilly 2050c41
[O2B-1508] HomePage had undetectable error in instantiating lhcfills …
isaachilly d1827e8
[O2B-1508] Remove unnecessary parameters
isaachilly 86fed3b
[O2B-1508] Update beamType tests
isaachilly ca53064
[O2B-1508] Add beam type validator and integrate into DTO
isaachilly 11a371e
Merge branch 'main' into feature/O2B-1508/lhcfills-beam-types-filter
isaachilly 56cb4e8
[O2B-1508] Rename beamType filter to beamTypes
isaachilly 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
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
36 changes: 36 additions & 0 deletions
36
lib/public/components/Filters/LhcFillsFilter/BeamTypeFilterModel.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,36 @@ | ||
| /** | ||
| * @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 { beamTypesProvider } from '../../../services/beamTypes/beamTypesProvider.js'; | ||
| import { SelectionFilterModel } from '../common/filters/SelectionFilterModel.js'; | ||
|
|
||
| /** | ||
| * Beam type filter model | ||
| */ | ||
| export class BeamTypeFilterModel extends SelectionFilterModel { | ||
| /** | ||
| * Constructor | ||
NarrowsProjects marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| */ | ||
| constructor() { | ||
| super({}); | ||
|
|
||
| beamTypesProvider.items$.observe(() => { | ||
| beamTypesProvider.items$.getCurrent().apply({ | ||
| Success: (types) => { | ||
| const beamTypes = types.map((type) => ({ value: type.beam_type })); | ||
| this._selectionModel.setAvailableOptions(beamTypes); | ||
| }, | ||
| }); | ||
| }); | ||
| } | ||
| } | ||
26 changes: 26 additions & 0 deletions
26
lib/public/components/Filters/LhcFillsFilter/beamTypeFilter.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,26 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. 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-o2.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 { checkboxes } from '../common/filters/checkboxFilter.js'; | ||
|
|
||
| /** | ||
| * Renders a list of checkboxes that lets the user look for beam types | ||
| * | ||
| * @param {BeamTypeFilterModel} beamTypeFilterModel beamTypeFilterModel | ||
| * @return {Component} the filter | ||
| */ | ||
| export const beamTypeFilter = (beamTypeFilterModel) => | ||
| checkboxes( | ||
| beamTypeFilterModel.selectionModel, | ||
| { selector: 'beam-types' }, | ||
| ); |
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,30 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. 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-o2.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 { getRemoteData } from '../../utilities/fetch/getRemoteData.js'; | ||
| import { RemoteDataProvider } from '../RemoteDataProvider.js'; | ||
|
|
||
| /** | ||
| * Service class to fetch beams types from the backend | ||
| */ | ||
| export class BeamTypesProvider extends RemoteDataProvider { | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| async getRemoteData() { | ||
| const { data } = await getRemoteData('/api/lhcFills/beamTypes'); | ||
| return data; | ||
| } | ||
| } | ||
|
|
||
| export const beamTypesProvider = new BeamTypesProvider(); |
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
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,34 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. 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-o2.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. | ||
| */ | ||
|
|
||
| const { repositories: { LhcFillRepository }, sequelize } = require('../../../database'); | ||
| const { Op } = require('sequelize'); | ||
|
|
||
| /** | ||
| * Return the a list of unique beam types which is built from the runs data | ||
| * | ||
| * @returns {Promise<SequelizeBeamType[]>} Promise resolving with the list of unique beam types | ||
| */ | ||
| exports.getAllBeamTypes = async () => { | ||
| const beamTypes = await LhcFillRepository.findAll({ | ||
| attributes: [[sequelize.fn('DISTINCT', sequelize.col('beam_type')), 'beam_type']], | ||
| where: { | ||
| beam_type: { | ||
| [Op.ne]: null, | ||
| }, | ||
| }, | ||
| order: [['beam_type', 'ASC']], | ||
| raw: true, | ||
| }); | ||
| return beamTypes; | ||
| }; |
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,47 @@ | ||
| /** | ||
| * @license | ||
| * Copyright CERN and copyright holders of ALICE O2. 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-o2.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. | ||
| */ | ||
|
|
||
| export const BEAM_TYPE_INVALID = 'beamType.invalid'; | ||
|
|
||
| /** | ||
| * Validates beam types to have correct format | ||
| * Expects a string containing comma separated values. | ||
| * | ||
| * @param {string} value Beam types string to validate | ||
| * @param {*} helpers The helpers object | ||
| * @returns {string} The value if validation passes | ||
| */ | ||
| export const validateBeamTypes = (value, helpers) => { | ||
| const beamTypes = value.split(','); | ||
|
|
||
| for (const type of beamTypes) { | ||
| // Max length accepted is 15 characters including spaces (e.g. "PROTON - PROTON") | ||
| if (type.length > 15) { | ||
| return helpers.error(BEAM_TYPE_INVALID, { | ||
| message: `Beam type exceeds max length of 15 characters: ${type}`, | ||
| }); | ||
| } | ||
|
|
||
| /* | ||
| * Accepts combinations of letters and numbers separated by a hyphen, with optional spaces | ||
| * around the hyphen (e.g. "PROTON-PROTON", "PROTON - PROTON", "P1-P2") | ||
| */ | ||
| if (!/^[A-Za-z0-9]+ ?- ?[A-Za-z0-9]+$/.test(type)) { | ||
| return helpers.error(BEAM_TYPE_INVALID, { | ||
| message: `Invalid beam type format: ${type}`, | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| return value; | ||
| }; |
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.