@@ -41,9 +41,10 @@ export class LogsOverviewModel extends Observable {
4141 authorFilter : new AuthorFilterModel ( ) ,
4242 titleFilter : new RawTextFilterModel ( ) ,
4343 contentFilter : new RawTextFilterModel ( ) ,
44- listingTagsFilterModel : new TagFilterModel ( tagsProvider . items$ ) ,
44+ tags : new TagFilterModel ( tagsProvider . items$ ) ,
4545 run : new RawTextFilterModel ( ) ,
4646 environments : new RawTextFilterModel ( ) ,
47+ lhcFills : new RawTextFilterModel ( ) ,
4748 } ) ;
4849
4950 this . _filteringModel . observe ( ( ) => this . _applyFilters ( ) ) ;
@@ -125,8 +126,6 @@ export class LogsOverviewModel extends Observable {
125126 this . runFilterOperation = 'AND' ;
126127 this . environmentFilterOperation = 'AND' ;
127128 this . lhcFillFilterOperation = 'AND' ;
128- this . lhcFillFilterValues = [ ] ;
129- this . _lhcFillFilterRawValue = '' ;
130129
131130 this . _pagination . reset ( ) ;
132131
@@ -144,7 +143,6 @@ export class LogsOverviewModel extends Observable {
144143 ! this . _filteringModel . isAnyFilterActive ( )
145144 || this . createdFilterFrom !== ''
146145 || this . createdFilterTo !== ''
147- || this . lhcFillFilterValues . length !== 0
148146 ) ;
149147 }
150148
@@ -198,27 +196,6 @@ export class LogsOverviewModel extends Observable {
198196 return this . _lhcFillFilterRawValue ;
199197 }
200198
201- /**
202- * Add a lhcFill to the filter
203- * @param {string } rawLhcFills The LHC fills to be added to the filter criteria
204- * @returns {void }
205- */
206- setLhcFillsFilter ( rawLhcFills ) {
207- this . _lhcFillFilterRawValue = rawLhcFills ;
208-
209- // Split the lhc fills string by comma or whitespace, remove falsy values like empty strings, and convert to int
210- const lhcFills = rawLhcFills
211- . split ( / [ , ] + / )
212- . filter ( Boolean )
213- . map ( ( fillNumberStr ) => parseInt ( fillNumberStr . trim ( ) , 10 ) ) ;
214-
215- // Allow empty lhcFills only if raw lhcFills is an empty string
216- if ( lhcFills . length > 0 || rawLhcFills . length === 0 ) {
217- this . lhcFillFilterValues = lhcFills ;
218- this . _applyFilters ( ) ;
219- }
220- }
221-
222199 /**
223200 * Returns the current minimum creation datetime
224201 * @returns {Integer } The current minimum creation datetime
@@ -327,9 +304,10 @@ export class LogsOverviewModel extends Observable {
327304 const titleFilter = this . _filteringModel . get ( 'titleFilter' ) ;
328305 const contentFilter = this . _filteringModel . get ( 'contentFilter' ) ;
329306 const authorFilter = this . _filteringModel . get ( 'authorFilter' ) ;
330- const listingTagsFilterModel = this . _filteringModel . get ( 'listingTagsFilterModel ' ) ;
307+ const tags = this . _filteringModel . get ( 'tags ' ) ;
331308 const run = this . _filteringModel . get ( 'run' ) ;
332309 const environments = this . _filteringModel . get ( 'environments' ) ;
310+ const lhcFills = this . _filteringModel . get ( 'lhcFills' ) ;
333311
334312 return {
335313 ...! titleFilter . isEmpty && {
@@ -349,9 +327,9 @@ export class LogsOverviewModel extends Observable {
349327 'filter[created][to]' :
350328 new Date ( `${ this . createdFilterTo . replace ( / \/ / g, '-' ) } T23:59:59.999` ) . getTime ( ) ,
351329 } ,
352- ...! listingTagsFilterModel . isEmpty && {
353- 'filter[tags][values]' : listingTagsFilterModel . selected . join ( ) ,
354- 'filter[tags][operation]' : listingTagsFilterModel . combinationOperator ,
330+ ...! tags . isEmpty && {
331+ 'filter[tags][values]' : tags . selected . join ( ) ,
332+ 'filter[tags][operation]' : tags . combinationOperator ,
355333 } ,
356334 ...! run . isEmpty && {
357335 'filter[run][values]' : run . normalized ,
@@ -361,8 +339,8 @@ export class LogsOverviewModel extends Observable {
361339 'filter[environments][values]' : environments . normalized ,
362340 'filter[environments][operation]' : this . environmentFilterOperation . toLowerCase ( ) ,
363341 } ,
364- ...this . lhcFillFilterValues . length > 0 && {
365- 'filter[lhcFills][values]' : this . lhcFillFilterValues . join ( ) ,
342+ ...! lhcFills . isEmpty && {
343+ 'filter[lhcFills][values]' : lhcFills . normalized ,
366344 'filter[lhcFills][operation]' : this . lhcFillFilterOperation . toLowerCase ( ) ,
367345 } ,
368346 ...sortOn && sortDirection && {
0 commit comments