-
Notifications
You must be signed in to change notification settings - Fork 21
[O2B-1548] Migrate qc flag types overview model to use filtering model pattern #2100
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 75 commits into
main
from
improv/O2B-1548/Migrate-qcFlagTypesOverviewModel-to-use-FilteringModel-pattern
Apr 17, 2026
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
722caf7
chore: remove redundant model assignment.
f161cae
chore: move all filters denoted as so to a filteringModel
9faffaf
Make filterInputModel extend filterModel
247943b
rename inputfilter to ParsedInputFilter
114285d
implement authorfilter with ParsedInputFilterModel changes
f39f7ae
re-implement filter
df1fea3
add tag-filters to the filtering object
96ca85f
replace titleFilter and contentFilter with RawTextFilterModels
93b3291
make Authorfilter an implementation of RawTextFilterModel
5a5e830
add runs filter to the filteringmodel
b5e7148
add environments filter to the filteringmodel
3507ba0
add lhcFills filter to the filteringmodel
9c63409
add created filter to the filteringmodel
5500b3e
move the sort 'filter' to fetchlogs, since it doesn't actually filter…
a09ae8b
change filter to rawTextFilter for title
512999b
fix test by changing event type to 'change'
0f15812
fix content and author tests
7b641ca
import openFilteringPanel and resetFilters
5ab8218
fix createdAt filter test
4c96d73
change event types to change
18ce4dc
fix isAnyFilterActive
685dd38
remove _raw as from authorfilterModel, as it serves no purpose
4e132fd
chore: removed ParsedInputFilterModel
caf9812
chore: add toLowerCase to filterQueryParam computation
41c5a72
[O2B-1530] Lhc fills add sb duration filter (#2080)
NarrowsProjects f38f597
[O2B-1544] Fix pagination for filtered envs and add a test (#2096)
isaachilly 3efdf1d
remove the combination operator from runs
fc61bea
remove the combination operator from envirionments
9c4df68
remove the combination operator from lhcFills
b860320
make filter computation much more compact using filteringmodel.normalize
7a00043
add happy-flow tests for logs api
ada3eb3
fix usecase unit tests
d290be7
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 0d8d3d4
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 237683a
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 25244f4
chore: add filteringmodel to QcFlagTypesOverviewModel
6970a74
feat: move namesFilterModelFilter to fileringmodel
cdaaf0e
feat: move methodsFilterModelFilter to filteringModel
27a8bbc
feat: move methodsFilterModelFilter to filteringModel
a9a1cd9
fix: fix Selectionmodel.normalized to use selected rather than select…
a222599
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 7a5601f
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 12dba35
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 623fe33
chore: provide the authorFilterMode directly to the component
e082924
chore: alter rawTextFilter to accept a boolean parameter that determi…
b3dd4b7
chore: 1. revert previous change. 2. overwrite reset in author model …
12877b4
chore: remove true from the reset function call
370c475
chore: add placeholders for the new rawTextFilters
83e00ee
improve reset readability
82ff985
check runnumber fill number and lhc period for existence rather than …
1574c4d
undo test comments
0bcf334
chore rename reset to clear()
7731fd3
make overview test more efficient with beforeEach
3bf7e66
test: remove unneeded OpenFilterPanel calls
906674f
remove takescreenshot
a760812
Remove unneeded javadoc params
3addfc7
chore: change the with margins to roughly span the filters the entire…
85b9473
test: add happy-flow rootOnly test
e711fe9
test: add log sorting tests for runs and for envirionments
4fa1173
reduce the width of the author filter component
88db5d8
chore removed unneeded length checks from should successfully filter …
da4caf5
chore: remove the needless 'limit' part of the rootOnly logs test
c768ba5
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects 39df769
feat: create textInputFilter
f095cce
chore: replace runNumbersFilter and rawTextFileters with logsActiveCo…
6fec661
feat: add a width argument to textinputFIlter
e095876
replace the rest of the rawTextFilters
033ff35
update tests to function with the new textInput components
a40f51f
fix failing tests
fa83c7f
chore: delete fillNumbersFilter createdFilter, logs/environmentFilter…
5216900
undo incorrect return description of the author component jsdoc
3d35206
chore: improve the jsdoc of selectionmodel
d37463c
Merge branch 'improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringMo…
a7df032
make textFitler calls oneliners
d1e38cc
Merge branch 'main' into improv/O2B-1548/Migrate-qcFlagTypesOverviewM…
NarrowsProjects 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
| 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 { radioButton } from '../../common/form/inputs/radioButton.js'; | ||
| import { h } from '/js/src/index.js'; | ||
|
|
||
| /** | ||
| * Radiobutton filter for the qcFlag 'bad' filter | ||
| * @param {SelectionModel} selectionModel the a selectionmodel | ||
| * @return {vnode} A number of radiobuttons corresponding with the selection options | ||
| */ | ||
| const badFilterRadioButtons = (selectionModel) => { | ||
| const name = 'badFilterRadio'; | ||
| return h( | ||
| '.form-group-header.flex-row.w-100', | ||
| selectionModel.options.map((option) => { | ||
| const { label } = option; | ||
| const action = () => selectionModel.select(option); | ||
| const isChecked = selectionModel.isSelected(option); | ||
|
|
||
| return radioButton({ label, isChecked, action, name }); | ||
| }), | ||
| ); | ||
| }; | ||
|
|
||
| export default badFilterRadioButtons; | ||
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 |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ import { TextTokensFilterModel } from '../../../components/Filters/common/filter | |
| import { OverviewPageModel } from '../../../models/OverviewModel.js'; | ||
| import { SelectionModel } from '../../../components/common/selection/SelectionModel.js'; | ||
| import { buildUrl } from '/js/src/index.js'; | ||
| import { FilteringModel } from '../../../components/Filters/common/FilteringModel.js'; | ||
|
|
||
| /** | ||
| * QcFlagTypesOverviewModel | ||
|
|
@@ -26,73 +27,39 @@ export class QcFlagTypesOverviewModel extends OverviewPageModel { | |
| constructor() { | ||
| super(); | ||
|
|
||
| this._namesFilterModel = new TextTokensFilterModel(); | ||
| this._registerFilter(this._namesFilterModel); | ||
| this._methodsFilterModel = new TextTokensFilterModel(); | ||
| this._registerFilter(this._methodsFilterModel); | ||
| this._isBadFilterModel = | ||
| new SelectionModel({ availableOptions: [{ label: 'Bad', value: true }, { label: 'Not Bad', value: false }] }); | ||
| this._registerFilter(this._isBadFilterModel); | ||
| } | ||
|
|
||
| /** | ||
| * @inheritdoc | ||
| */ | ||
| getRootEndpoint() { | ||
| const params = {}; | ||
| if (this.isAnyFilterActive()) { | ||
| params.filter = { | ||
| names: this._namesFilterModel.normalized, | ||
| methods: this._methodsFilterModel.normalized, | ||
| bad: this._isBadFilterModel.selected.length === 2 | ||
| ? undefined | ||
| : this._isBadFilterModel.selected[0], | ||
| }; | ||
| } | ||
|
|
||
| return buildUrl('/api/qcFlagTypes', params); | ||
| } | ||
| this._filteringModel = new FilteringModel({ | ||
| names: new TextTokensFilterModel(), | ||
| methods: new TextTokensFilterModel(), | ||
| bad: new SelectionModel({ | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous comment |
||
| availableOptions: [{ label: 'Any' }, { label: 'Bad', value: true }, { label: 'Not Bad', value: false }], | ||
| defaultSelection: [{ label: 'Any' }], | ||
| allowEmpty: false, | ||
| multiple: false, | ||
| }), | ||
| }); | ||
|
|
||
| /** | ||
| * Get names filter model | ||
| * | ||
| * @return {TextTokensFilterModel} names filter model | ||
| */ | ||
| get namesFilterModel() { | ||
| return this._namesFilterModel; | ||
| } | ||
| this._filteringModel.observe(() => { | ||
| this._pagination.silentlySetCurrentPage(1); | ||
| this.load(); | ||
| }); | ||
|
|
||
| /** | ||
| * Get methods filter model | ||
| * | ||
| * @return {TextTokensFilterModel} methods filter model | ||
| */ | ||
| get methodsFilterModel() { | ||
| return this._methodsFilterModel; | ||
| this._filteringModel.visualChange$.bubbleTo(this); | ||
| } | ||
|
|
||
| /** | ||
| * Returns filter model for filtering bad and not bad flags | ||
| * | ||
| * @return {TextTokensFilterModel} filter model for filtering bad and not bad flags | ||
| * @inheritdoc | ||
| */ | ||
| get isBadFilterModel() { | ||
| return this._isBadFilterModel; | ||
| getRootEndpoint() { | ||
| return buildUrl('/api/qcFlagTypes', { filter: this._filteringModel.normalized }); | ||
| } | ||
|
|
||
| /** | ||
| * Register a new filter model | ||
| * Return the model managing all filters | ||
| * | ||
| * @param {FilterModel} filterModel the filter model to register | ||
| * @return {void} | ||
| * @private | ||
| * @return {FilteringModel} the filtering model | ||
| */ | ||
| _registerFilter(filterModel) { | ||
| filterModel.visualChange$.bubbleTo(this); | ||
| filterModel.observe(() => { | ||
| this._pagination.silentlySetCurrentPage(1); | ||
| this.load(); | ||
| }); | ||
| get filteringModel() { | ||
| return this._filteringModel; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -101,7 +68,7 @@ export class QcFlagTypesOverviewModel extends OverviewPageModel { | |
| * @return {boolean} true if any filter is active | ||
| */ | ||
| isAnyFilterActive() { | ||
| return !this._namesFilterModel.isEmpty || !this._methodsFilterModel.isEmpty || this._isBadFilterModel.selected.length; | ||
| return this._filteringModel.isAnyFilterActive(); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -110,9 +77,7 @@ export class QcFlagTypesOverviewModel extends OverviewPageModel { | |
| * @returns {void} | ||
| */ | ||
| reset() { | ||
| this._methodsFilterModel.reset(); | ||
| this._namesFilterModel.reset(); | ||
| this._isBadFilterModel.reset(); | ||
| this._filteringModel.reset(); | ||
| super.reset(); | ||
| } | ||
| } | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are now a couple of filters that make use of radio buttons.
Make a common component for that in a later PR
Update:
This has now been done in O2B-1552