Skip to content

Commit

Permalink
In selectors match on invoice.client.name, not full client search
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Aug 12, 2021
1 parent 3b16a14 commit 54cec05
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/redux/credit/credit_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ List<String> filteredCreditsSelector(
return false;
}
if (!credit.matchesFilter(creditListState.filter) &&
!client.matchesFilter(creditListState.filter)) {
!client.displayName
.toLowerCase()
.contains(creditListState.filter.toLowerCase())) {
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/redux/invoice/invoice_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ List<String> filteredInvoicesSelector(
return false;
}
if (!invoice.matchesFilter(invoiceListState.filter) &&
!client.matchesFilter(invoiceListState.filter)) {
!client.displayName
.toLowerCase()
.contains(invoiceListState.filter.toLowerCase())) {
return false;
}
if (invoiceListState.custom1Filters.isNotEmpty &&
Expand Down
4 changes: 3 additions & 1 deletion lib/redux/payment/payment_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ List<String> filteredPaymentsSelector(
}

if (!payment.matchesFilter(paymentListState.filter) &&
!client.matchesFilter(paymentListState.filter)) {
!client.displayName
.toLowerCase()
.contains(paymentListState.filter.toLowerCase())) {
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/redux/project/project_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ List<String> filteredProjectsSelector(
}

if (!project.matchesFilter(projectListState.filter) &&
!client.matchesFilter(projectListState.filter)) {
!client.displayName
.toLowerCase()
.contains(projectListState.filter.toLowerCase())) {
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/redux/quote/quote_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ List<String> filteredQuotesSelector(
} else if (!quote.matchesStatuses(quoteListState.statusFilters)) {
return false;
} else if (!quote.matchesFilter(quoteListState.filter) &&
!client.matchesFilter(quoteListState.filter)) {
!client.displayName
.toLowerCase()
.contains(quoteListState.filter.toLowerCase())) {
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/redux/recurring_invoice/recurring_invoice_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ List<String> filteredRecurringInvoicesSelector(
return false;
}
if (!invoice.matchesFilter(invoiceListState.filter) &&
!client.matchesFilter(invoiceListState.filter)) {
!client.displayName
.toLowerCase()
.contains(invoiceListState.filter.toLowerCase())) {
return false;
}
if (invoiceListState.custom1Filters.isNotEmpty &&
Expand Down
8 changes: 6 additions & 2 deletions lib/redux/task/task_selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,12 @@ List<String> filteredTasksSelector(
}

if (!task.matchesFilter(taskListState.filter) &&
!client.matchesFilter(taskListState.filter) &&
!project.matchesFilter(taskListState.filter)) {
!client.displayName
.toLowerCase()
.contains(taskListState.filter.toLowerCase()) &&
!project.name
.toLowerCase()
.contains(taskListState.filter.toLowerCase())) {
return false;
}

Expand Down

0 comments on commit 54cec05

Please sign in to comment.