Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
* or submit itself to any jurisdiction.
*/

import { FilterInputModel } from '../../common/filters/FilterInputModel.js';
import { RawTextFilterModel } from '../../common/filters/RawTextFilterModel.js';

/**
* Model to handle the state of the Author Filter
*/
export class AuthorFilterModel extends FilterInputModel {
export class AuthorFilterModel extends RawTextFilterModel {
/**
* Constructor
*
Expand All @@ -32,7 +32,7 @@ export class AuthorFilterModel extends FilterInputModel {
* @return {boolean} true if '!Anonymous' is included in the raw filter string, false otherwise.
*/
isAnonymousExcluded() {
return this._raw.includes('!Anonymous');
return this._value.includes('!Anonymous');
}

/**
Expand All @@ -42,28 +42,13 @@ export class AuthorFilterModel extends FilterInputModel {
*/
toggleAnonymousFilter() {
if (this.isAnonymousExcluded()) {
this._raw = this._raw.split(',')
this._value = this._value.split(',')
.filter((author) => author.trim() !== '!Anonymous')
.join(',');
} else {
this._raw += super.isEmpty ? '!Anonymous' : ', !Anonymous';
this._value += super.isEmpty ? '!Anonymous' : ', !Anonymous';
}

this._value = this.valueFromRaw(this._raw);
this.notify();
}

/**
* Reset the filter to its default value and notify the observers.
*
* @return {void}
*/
clear() {
if (this.isEmpty) {
return;
}

super.reset();
this.notify();
}
}
33 changes: 13 additions & 20 deletions lib/public/components/Filters/LogsFilter/author/authorFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@
import { h } from '/js/src/index.js';
import { iconX } from '/js/src/icons.js';
import { switchInput } from '../../../common/form/switchInput.js';

/**
* Returns a text input field that can be used to filter logs by author
*
* @param {AuthorFilterModel} authorFilterModel The author filter model object
* @returns {Component} A text box that allows the user to enter an author substring to match against all logs
*/
const authorFilterTextInput = (authorFilterModel) => h('input.w-40', {
type: 'text',
id: 'authorFilterText',
value: authorFilterModel.raw,
oninput: (e) => authorFilterModel.update(e.target.value),
});
import { rawTextFilter } from '../../common/filters/rawTextFilter.js';

/**
* Returns a button that can be used to reset the author filter.
Expand All @@ -36,7 +24,7 @@ const authorFilterTextInput = (authorFilterModel) => h('input.w-40', {
*/
const resetAuthorFilterButton = (authorFilterModel) => h(
'.btn.btn-pill.f7',
{ disabled: authorFilterModel.isEmpty, onclick: () => authorFilterModel.clear() },
{ disabled: authorFilterModel.isEmpty, onclick: () => authorFilterModel.reset() },
iconX(),
);

Expand All @@ -55,11 +43,16 @@ export const excludeAnonymousLogAuthorToggle = (authorFilterModel) => switchInpu
/**
* Returns a authorFilter component with text input, reset button, and anonymous exclusion button.
*
* @param {LogModel} logModel the log model object
* @returns {Component} the author filter component
* @param {LogsOverviewModel} logsOverviewModel the log overview model
* @param {FilteringModel} logsOverviewModel.filteringModel the runs overview model
* @return {Component} the filter component
*/
export const authorFilter = ({ authorFilter }) => h('.flex-row.items-center.g3', [
authorFilterTextInput(authorFilter),
resetAuthorFilterButton(authorFilter),
excludeAnonymousLogAuthorToggle(authorFilter),
export const authorFilter = ({ filteringModel }) => h('.flex-row.items-center.g3', [
rawTextFilter(filteringModel.get('authorFilter'), {
classes: ['w-40'],
id: 'authorFilterText',
value: filteringModel.get('authorFilter').raw,
}),
resetAuthorFilterButton(filteringModel.get('authorFilter')),
excludeAnonymousLogAuthorToggle(filteringModel.get('authorFilter')),
]);
119 changes: 0 additions & 119 deletions lib/public/components/Filters/common/filters/FilterInputModel.js

This file was deleted.

8 changes: 4 additions & 4 deletions lib/public/components/Filters/common/filters/textFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { h } from '/js/src/index.js';
/**
* Returns a text filter component
*
* @param {FilterInputModel|TextTokensFilterModel} filterInputModel the model of the text filter
* @param {TextTokensFilterModel} textTokensFilterModel the model of the text filter
* @param {Object} attributes the additional attributes to pass to the component, such as id and classes
* @return {Component} the filter component
*/
export const textFilter = (filterInputModel, attributes) => h('input', {
export const textFilter = (textTokensFilterModel, attributes) => h('input', {
...attributes,
type: 'text',
value: filterInputModel.raw,
oninput: (e) => filterInputModel.update(e.target.value),
value: textTokensFilterModel.raw,
oninput: (e) => textTokensFilterModel.update(e.target.value),
}, '');
Loading
Loading