Skip to content

Commit e6f7802

Browse files
committed
Fix the issue with domain filter where searching for another domain doesn't clear the previous one
1 parent 1a9100e commit e6f7802

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

  • server/frontend/src/components/Buckets

server/frontend/src/components/Buckets/List.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ import PageNav from "../PageNav.vue";
228228
import Row from "./Row.vue";
229229
import HelpJSONQueryPopover from "../HelpJSONQueryPopover.vue";
230230
231+
const domainFilterSignature = {
232+
op: "AND",
233+
1: {
234+
op: "AND",
235+
0: {
236+
op: "OR",
237+
domain: MatchObjects.ANY,
238+
domain__endswith: MatchObjects.ANY,
239+
},
240+
domain__isnull: MatchObjects.ANY,
241+
},
242+
};
243+
231244
export default {
232245
components: {
233246
ClipLoader: LoadingSpinner,
@@ -268,18 +281,6 @@ export default {
268281
"size",
269282
];
270283
const defaultSortKeys = ["-priority_score", "-size", "-latest_report"];
271-
const domainFilterSignature = {
272-
op: "AND",
273-
1: {
274-
op: "AND",
275-
0: {
276-
op: "OR",
277-
domain: MatchObjects.ANY,
278-
domain__endswith: MatchObjects.ANY,
279-
},
280-
domain__isnull: MatchObjects.ANY,
281-
},
282-
};
283284
284285
return {
285286
advancedQuery: false,
@@ -288,7 +289,6 @@ export default {
288289
currentPage: 1,
289290
defaultSortKeys: defaultSortKeys,
290291
domainFilter: "",
291-
domainFilterSignature: domainFilterSignature,
292292
loading: false,
293293
modifiedCache: {},
294294
pageSize: 100,
@@ -352,7 +352,7 @@ export default {
352352
this.queryStr = JSON.stringify(parsedQuery, null, 2);
353353
// Extract domain filter if present
354354
const matcher = new MatchObjects();
355-
if (matcher.match(parsedQuery, this.domainFilterSignature)) {
355+
if (matcher.match(parsedQuery, domainFilterSignature)) {
356356
this.domainFilter = parsedQuery[1][0].domain;
357357
} else if (parsedQuery.domain) {
358358
this.domainFilter = parsedQuery.domain;
@@ -404,7 +404,7 @@ export default {
404404
let query = JSON.parse(this.queryStr);
405405
406406
const matcher = new MatchObjects();
407-
if (matcher.match(query, this.domainFilterSignature)) {
407+
if (matcher.match(query, domainFilterSignature)) {
408408
query = query[0];
409409
}
410410

0 commit comments

Comments
 (0)