From 1bbf014566d424b35cb28148d610c4907c3bc346 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Tue, 19 Oct 2021 13:10:18 +0000 Subject: [PATCH] Allow filtering multiple properties in the transation log Currently only one property can be searched at a time Test: build winscope, record a transaction log and select fields to filter Bug: 159619726 Change-Id: I9712ca9a9ddc11e20d44e7c5c671803de386f368 --- tools/winscope/src/TransactionsView.vue | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tools/winscope/src/TransactionsView.vue b/tools/winscope/src/TransactionsView.vue index d2ac62cb0..47164d4fe 100644 --- a/tools/winscope/src/TransactionsView.vue +++ b/tools/winscope/src/TransactionsView.vue @@ -40,15 +40,17 @@
- - - - + + + + + {{ property }} + + +
@@ -197,7 +199,7 @@ export default { searchInput: '', selectedTree: null, filters: [], - selectedProperty: null, + selectedProperties: [], selectedTransaction: null, transactionEntryComponent: TransactionEntry, transactionsTrace, @@ -252,12 +254,12 @@ export default { ); } - if (this.selectedProperty) { + if (this.selectedProperties.length > 0) { + const regexFilter = new RegExp(this.selectedProperties.join("|"), "i"); filteredData = filteredData.filter( this.filterTransactions((transaction) => { for (const key in transaction.obj) { - if (this.isMeaningfulChange(transaction.obj, key) && - key === this.selectedProperty) { + if (this.isMeaningfulChange(transaction.obj, key) && regexFilter.test(key)) { return true; } }