Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix of '[FEATURE] Reports by Excluding Tags'- reviews resoled
Browse files Browse the repository at this point in the history
  • Loading branch information
shamim-emon committed Sep 23, 2024
1 parent 5a54321 commit 2282880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ fun BoxWithConstraintsScope.FilterOverlay(

FilterDivider()

tagsFilter(
TagsFilter(
filter = localFilter,
onIncludesTagButtonClick = {
includedTagModalVisible = true
Expand Down Expand Up @@ -474,7 +474,7 @@ fun BoxWithConstraintsScope.FilterOverlay(
}

@Composable
fun ColumnScope.tagsFilter(
fun ColumnScope.TagsFilter(
filter: ReportFilter?,
onIncludesTagButtonClick: () -> Unit,
onExcludesTagButtonClick: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,12 @@ class ReportViewModel @Inject constructor(
transactionRepository.findAll()
}

val exacludeableByTagTransactionsIds = if (filter.excludedTags.isNotEmpty()) {
val excludeableByTagTransactionsIds = if (filter.excludedTags.isNotEmpty()) {
tagRepository.findByAllAssociatedIdForTagId(filter.excludedTags)
.asSequence()
.flatMap { it.value }
.map { TransactionId(it.associatedId.value) }
.distinct()
.map { TransactionId(it.associatedId.value) }
.toList()
.let {
transactionRepository.findByIds(it)
Expand All @@ -406,7 +406,7 @@ class ReportViewModel @Inject constructor(
}

return transactions
.filter { !exacludeableByTagTransactionsIds.contains(it.id) }
.filter { !excludeableByTagTransactionsIds.contains(it.id) }
.filter {
with(transactionMapper) {
filter.trnTypes.contains(it.getTransactionType())
Expand Down

0 comments on commit 2282880

Please sign in to comment.