@@ -43,6 +43,7 @@ export class LogsOverviewModel extends Observable {
4343 contentFilter : new RawTextFilterModel ( ) ,
4444 listingTagsFilterModel : new TagFilterModel ( tagsProvider . items$ ) ,
4545 run : new RawTextFilterModel ( ) ,
46+ environments : new RawTextFilterModel ( ) ,
4647 } ) ;
4748
4849 this . _filteringModel . observe ( ( ) => this . _applyFilters ( ) ) ;
@@ -122,13 +123,7 @@ export class LogsOverviewModel extends Observable {
122123 this . createdFilterTo = '' ;
123124
124125 this . runFilterOperation = 'AND' ;
125- this . runFilterValues = [ ] ;
126- this . _runFilterRawValue = '' ;
127-
128126 this . environmentFilterOperation = 'AND' ;
129- this . environmentFilterValues = [ ] ;
130- this . _environmentFilterRawValue = '' ;
131-
132127 this . lhcFillFilterOperation = 'AND' ;
133128 this . lhcFillFilterValues = [ ] ;
134129 this . _lhcFillFilterRawValue = '' ;
@@ -149,8 +144,6 @@ export class LogsOverviewModel extends Observable {
149144 ! this . _filteringModel . isAnyFilterActive ( )
150145 || this . createdFilterFrom !== ''
151146 || this . createdFilterTo !== ''
152- || this . runFilterValues . length !== 0
153- || this . environmentFilterValues . length !== 0
154147 || this . lhcFillFilterValues . length !== 0
155148 ) ;
156149 }
@@ -163,29 +156,6 @@ export class LogsOverviewModel extends Observable {
163156 return this . _runFilterRawValue ;
164157 }
165158
166- /**
167- * Add a run to the filter
168- * @param {string } rawRuns The runs to be added to the filter criteria
169- * @returns {undefined }
170- */
171- setRunsFilter ( rawRuns ) {
172- this . _runFilterRawValue = rawRuns ;
173- const runs = [ ] ;
174- const valuesRegex = / ( [ 0 - 9 ] + ) , ? / g;
175-
176- let match = valuesRegex . exec ( rawRuns ) ;
177- while ( match ) {
178- runs . push ( parseInt ( match [ 1 ] , 10 ) ) ;
179- match = valuesRegex . exec ( rawRuns ) ;
180- }
181-
182- // Allow empty runs only if raw runs is an empty string
183- if ( runs . length > 0 || rawRuns . length === 0 ) {
184- this . runFilterValues = runs ;
185- this . _applyFilters ( ) ;
186- }
187- }
188-
189159 /**
190160 * Returns the raw current environment filter
191161 * @returns {string } the raw current environment filter
@@ -359,6 +329,7 @@ export class LogsOverviewModel extends Observable {
359329 const authorFilter = this . _filteringModel . get ( 'authorFilter' ) ;
360330 const listingTagsFilterModel = this . _filteringModel . get ( 'listingTagsFilterModel' ) ;
361331 const run = this . _filteringModel . get ( 'run' ) ;
332+ const environments = this . _filteringModel . get ( 'environments' ) ;
362333
363334 return {
364335 ...! titleFilter . isEmpty && {
@@ -386,8 +357,8 @@ export class LogsOverviewModel extends Observable {
386357 'filter[run][values]' : run . normalized ,
387358 'filter[run][operation]' : this . runFilterOperation . toLowerCase ( ) ,
388359 } ,
389- ...this . environmentFilterValues . length > 0 && {
390- 'filter[environments][values]' : this . environmentFilterValues ,
360+ ...! environments . isEmpty && {
361+ 'filter[environments][values]' : environments . normalized ,
391362 'filter[environments][operation]' : this . environmentFilterOperation . toLowerCase ( ) ,
392363 } ,
393364 ...this . lhcFillFilterValues . length > 0 && {
0 commit comments