Skip to content
Merged
Show file tree
Hide file tree
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.
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
a9a1cd9
fix: fix Selectionmodel.normalized to use selected rather than select…
Mar 12, 2026
a222599
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Mar 26, 2026
7a5601f
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Mar 30, 2026
12dba35
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Apr 7, 2026
623fe33
chore: provide the authorFilterMode directly to the component
Apr 13, 2026
e082924
chore: alter rawTextFilter to accept a boolean parameter that determi…
Apr 13, 2026
b3dd4b7
chore: 1. revert previous change. 2. overwrite reset in author model …
Apr 13, 2026
12877b4
chore: remove true from the reset function call
Apr 13, 2026
370c475
chore: add placeholders for the new rawTextFilters
Apr 13, 2026
83e00ee
improve reset readability
Apr 13, 2026
82ff985
check runnumber fill number and lhc period for existence rather than …
Apr 13, 2026
1574c4d
undo test comments
Apr 13, 2026
0bcf334
chore rename reset to clear()
Apr 13, 2026
7731fd3
make overview test more efficient with beforeEach
Apr 13, 2026
3bf7e66
test: remove unneeded OpenFilterPanel calls
Apr 13, 2026
906674f
remove takescreenshot
Apr 14, 2026
a760812
Remove unneeded javadoc params
Apr 14, 2026
3addfc7
chore: change the with margins to roughly span the filters the entire…
Apr 14, 2026
85b9473
test: add happy-flow rootOnly test
Apr 14, 2026
e711fe9
test: add log sorting tests for runs and for envirionments
Apr 14, 2026
4fa1173
reduce the width of the author filter component
Apr 14, 2026
88db5d8
chore removed unneeded length checks from should successfully filter …
Apr 15, 2026
da4caf5
chore: remove the needless 'limit' part of the rootOnly logs test
Apr 15, 2026
c768ba5
Merge branch 'main' into improv/O2B-1534/Migrate-Log-Overview-to-use-…
NarrowsProjects Apr 15, 2026
39df769
feat: create textInputFilter
Apr 16, 2026
f095cce
chore: replace runNumbersFilter and rawTextFileters with logsActiveCo…
Apr 16, 2026
6fec661
feat: add a width argument to textinputFIlter
Apr 16, 2026
e095876
replace the rest of the rawTextFilters
Apr 16, 2026
033ff35
update tests to function with the new textInput components
Apr 16, 2026
a40f51f
fix failing tests
Apr 16, 2026
fa83c7f
chore: delete fillNumbersFilter createdFilter, logs/environmentFilter…
Apr 17, 2026
5216900
undo incorrect return description of the author component jsdoc
Apr 17, 2026
3d35206
chore: improve the jsdoc of selectionmodel
Apr 17, 2026
d37463c
Merge branch 'improv/O2B-1534/Migrate-Log-Overview-to-use-FilteringMo…
Apr 17, 2026
a7df032
make textFitler calls oneliners
Apr 17, 2026
d1e38cc
Merge branch 'main' into improv/O2B-1548/Migrate-qcFlagTypesOverviewM…
NarrowsProjects Apr 17, 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
36 changes: 36 additions & 0 deletions lib/public/components/Filters/QcFlagTypesFilter/bad.js
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';

Copy link
Copy Markdown
Collaborator Author

@NarrowsProjects NarrowsProjects Apr 10, 2026

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

/**
* 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;
9 changes: 9 additions & 0 deletions lib/public/components/common/selection/SelectionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,13 @@ export class SelectionModel extends Observable {
get optionsSelectedByDefault() {
return this._defaultSelection;
}

/**
* Returns the normalized value of the selection
*
* @return {string|string[]|boolean|boolean[]|number|number[]|SelectionOption|SelectionOption[]} the normalized value
*/
get normalized() {
return (this._allowEmpty || this._multiple) ? this.selected.join() : this.current;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import { h } from '/js/src/index.js';
import { formatTimestamp } from '../../../utilities/formatting/formatTimestamp.js';
import { textFilter } from '../../../components/Filters/common/filters/textFilter.js';
import { checkboxes } from '../../../components/Filters/common/filters/checkboxFilter.js';
import { qcFlagTypeColoredBadge } from '../../../components/qcFlags/qcFlagTypeColoredBadge.js';
import badFilterRadioButtons from '../../../components/Filters/QcFlagTypesFilter/bad.js';

/**
* List of active columns for a QC Flag Types table
Expand All @@ -30,10 +30,7 @@ export const qcFlagTypesActiveColumns = {
name: {
name: 'Name',
visible: true,
filter: ({ namesFilterModel }) => textFilter(
namesFilterModel,
{ class: 'w-75 mt1', placeholder: 'e.g. BadPID, ...' },
),
filter: ({ filteringModel }) => textFilter(filteringModel.get('names'), { class: 'w-75 mt1', placeholder: 'e.g. BadPID, ...' }),
classes: 'f6',
sortable: true,
format: (_, qcFlagType) => qcFlagTypeColoredBadge(qcFlagType),
Expand All @@ -43,21 +40,15 @@ export const qcFlagTypesActiveColumns = {
name: 'Method',
visible: true,
sortable: true,
filter: ({ methodsFilterModel }) => textFilter(
methodsFilterModel,
{ class: 'w-75 mt1', placeholder: 'e.g. Bad PID, ...' },
),
filter: ({ filteringModel }) => textFilter(filteringModel.get('methods'), { class: 'w-75 mt1', placeholder: 'e.g. Bad PID, ...' }),
classes: 'f6',
},

bad: {
name: 'Bad',
visible: true,
sortable: true,
filter: ({ isBadFilterModel }) => checkboxes(
isBadFilterModel,
{ class: 'w-75 mt1', selector: 'qc-flag-type-bad-filter' },
),
filter: ({ filteringModel }) => badFilterRadioButtons(filteringModel.get('bad')),
classes: 'f6 w-5',
format: (bad) => bad ? h('.danger', 'Yes') : h('.success', 'No'),
},
Expand Down
85 changes: 25 additions & 60 deletions lib/public/views/QcFlagTypes/Overview/QcFlagTypesOverviewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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({
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.

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;
}

/**
Expand All @@ -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();
}

/**
Expand All @@ -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();
}
}
2 changes: 1 addition & 1 deletion test/public/qcFlagTypes/overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = () => {
it('should successfully apply QC flag type bad filter', async () => {
await waitForTableLength(page, 7);

await pressElement(page, '.bad-filter input[type=checkbox]', true);
await pressElement(page, '#badFilterRadioBad', true);
await checkColumnValuesWithRegex(page, 'bad', '^Yes$');

await pressElement(page, '#reset-filters', true);
Expand Down
Loading