@@ -36,7 +36,6 @@ const FILTER_PLACEHOLDER = '...';
36
36
let autoCompleteJS ;
37
37
38
38
const dom = {
39
- filterList : null ,
40
39
favIcon : null ,
41
40
searchFilterEdit : null ,
42
41
searchThings : null ,
@@ -61,12 +60,6 @@ export async function ready() {
61
60
fillSearchFilterEdit ( selection . rql ) ;
62
61
} ) ;
63
62
64
- dom . filterList . addEventListener ( 'click' , ( event ) => {
65
- if ( event . target && event . target . classList . contains ( 'dropdown-item' ) ) {
66
- fillSearchFilterEdit ( event . target . textContent ) ;
67
- }
68
- } ) ;
69
-
70
63
dom . searchThings . onclick = ( ) => {
71
64
fillHistory ( dom . searchFilterEdit . value ) ;
72
65
ThingsSearch . searchTriggered ( dom . searchFilterEdit . value ) ;
@@ -106,7 +99,6 @@ function onEnvironmentChanged() {
106
99
if ( ! Environments . current ( ) [ 'pinnedThings' ] ) {
107
100
Environments . current ( ) . pinnedThings = [ ] ;
108
101
}
109
- updateFilterList ( ) ;
110
102
}
111
103
112
104
function fillSearchFilterEdit ( fillString ) {
@@ -119,19 +111,6 @@ function fillSearchFilterEdit(fillString) {
119
111
}
120
112
}
121
113
122
- /**
123
- * Updates the UI filterList
124
- */
125
- function updateFilterList ( ) {
126
- dom . filterList . innerHTML = '' ;
127
- Utils . addDropDownEntries ( dom . filterList , [ 'Favorite search filters' ] , true ) ;
128
- Utils . addDropDownEntries ( dom . filterList , Environments . current ( ) . filterList ?? [ ] ) ;
129
- Utils . addDropDownEntries ( dom . filterList , [ 'Example search filters' ] , true ) ;
130
- Utils . addDropDownEntries ( dom . filterList , filterExamples ) ;
131
- Utils . addDropDownEntries ( dom . filterList , [ 'Recent search filters' ] , true ) ;
132
- Utils . addDropDownEntries ( dom . filterList , filterHistory ) ;
133
- }
134
-
135
114
async function createFilterList ( query ) {
136
115
const date24h = new Date ( ) ;
137
116
const date1h = new Date ( ) ;
@@ -181,11 +160,6 @@ async function createFilterList(query) {
181
160
rql : `like(thingId,"${ FILTER_PLACEHOLDER } *")` ,
182
161
group : 'ThingId' ,
183
162
} ,
184
- {
185
- label : `exists ${ FILTER_PLACEHOLDER } ` ,
186
- rql : `exists(${ FILTER_PLACEHOLDER } )` ,
187
- group : 'Other' ,
188
- } ,
189
163
...( Environments . current ( ) . filterList ?? [ ] ) . map ( ( f ) => ( { label : f , rql : f , group : 'Favorite' } ) ) ,
190
164
...( Environments . current ( ) . fieldList ?? [ ] ) . map ( ( f ) => ( {
191
165
label : `${ f . label } = ${ FILTER_PLACEHOLDER } ` ,
@@ -198,6 +172,7 @@ async function createFilterList(query) {
198
172
group : 'Field' ,
199
173
} ) ) ,
200
174
...filterHistory . map ( ( f ) => ( { label : f , rql : f , group : 'Recent' } ) ) ,
175
+ ...filterExamples . map ( ( f ) => ( { label : f , rql : f , group : 'Example' } ) ) ,
201
176
] ;
202
177
}
203
178
@@ -247,7 +222,6 @@ function checkAndMarkParameter() {
247
222
function fillHistory ( filter ) {
248
223
if ( ! filterHistory . includes ( filter ) ) {
249
224
filterHistory . unshift ( filter ) ;
250
- updateFilterList ( ) ;
251
225
}
252
226
}
253
227
0 commit comments