From 5a5432143d3b2d097e57e514a117dc7cffc9f5b5 Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Sun, 22 Sep 2024 21:50:29 +0600 Subject: [PATCH 1/2] Fix of '[FEATURE] Reports by Excluding Tags' --- .../java/com/ivy/reports/FilterOverlay.kt | 110 ++++++++++++++---- .../main/java/com/ivy/reports/ReportFilter.kt | 7 +- .../java/com/ivy/reports/ReportViewModel.kt | 25 +++- ...snapshot Report Screen no filter[Dark].png | Bin 54125 -> 54128 bytes ...napshot Report Screen no filter[Light].png | Bin 50920 -> 50923 bytes ...razziTest_snapshot Report Screen[Dark].png | Bin 49919 -> 49922 bytes ...azziTest_snapshot Report Screen[Light].png | Bin 47181 -> 47185 bytes .../core/src/main/res/values-de/strings.xml | 2 +- .../core/src/main/res/values-it/strings.xml | 2 +- .../src/main/res/values-pt-rBR/strings.xml | 2 +- .../core/src/main/res/values-vi/strings.xml | 2 +- .../src/main/res/values-zh-rCN/strings.xml | 2 +- .../src/main/res/values-zh-rTW/strings.xml | 2 +- .../ui/core/src/main/res/values/strings.xml | 2 +- 14 files changed, 119 insertions(+), 37 deletions(-) diff --git a/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt b/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt index 8aad381444..2b2e264f97 100644 --- a/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt +++ b/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt @@ -132,10 +132,16 @@ fun BoxWithConstraintsScope.FilterOverlay( var maxAmountModalShown by remember { mutableStateOf(false) } var includeKeywordModalShown by remember { mutableStateOf(false) } var excludeKeywordModalShown by remember { mutableStateOf(false) } - var tagModalVisible by remember { mutableStateOf(false) } - val selectedTags by remember(localFilter) { + var includedTagModalVisible by remember { mutableStateOf(false) } + var excludedTagModalVisible by remember { mutableStateOf(false) } + val includedTags by remember(localFilter) { derivedStateOf { - localFilter?.selectedTags?.toImmutableList() ?: persistentListOf() + localFilter?.includedTags?.toImmutableList() ?: persistentListOf() + } + } + val excludedTags by remember(localFilter) { + derivedStateOf { + localFilter?.excludedTags?.toImmutableList() ?: persistentListOf() } } @@ -272,10 +278,13 @@ fun BoxWithConstraintsScope.FilterOverlay( FilterDivider() - OthersFilter( + tagsFilter( filter = localFilter, - onTagButtonClick = { - tagModalVisible = true + onIncludesTagButtonClick = { + includedTagModalVisible = true + }, + onExcludesTagButtonClick = { + excludedTagModalVisible = true } ) @@ -396,15 +405,49 @@ fun BoxWithConstraintsScope.FilterOverlay( } ShowTagModal( - visible = tagModalVisible, + visible = includedTagModalVisible, + selectOnlyMode = true, + onDismiss = { + includedTagModalVisible = false + // Reset TagList, avoids showing incorrect tag list if user had searched for a tag previously + onTagSearch("") + }, + allTagList = allTags, + selectedTagList = includedTags, + onTagAdd = { + // Do Nothing + }, + onTagEdit = { oldTag, newTag -> + // Do Nothing + }, + onTagDelete = { + // Do Nothing + }, + onTagSelected = { + localFilter = nonNullFilter(localFilter).copy( + includedTags = nonNullFilter(localFilter).includedTags.plus(it.id) + ) + }, + onTagDeSelected = { + localFilter = nonNullFilter(localFilter).copy( + includedTags = nonNullFilter(localFilter).includedTags.minus(it.id) + ) + }, + onTagSearch = { + onTagSearch(it) + } + ) + + ShowTagModal( + visible = excludedTagModalVisible, selectOnlyMode = true, onDismiss = { - tagModalVisible = false + excludedTagModalVisible = false // Reset TagList, avoids showing incorrect tag list if user had searched for a tag previously onTagSearch("") }, allTagList = allTags, - selectedTagList = selectedTags, + selectedTagList = excludedTags, onTagAdd = { // Do Nothing }, @@ -416,12 +459,12 @@ fun BoxWithConstraintsScope.FilterOverlay( }, onTagSelected = { localFilter = nonNullFilter(localFilter).copy( - selectedTags = nonNullFilter(localFilter).selectedTags.plus(it.id) + excludedTags = nonNullFilter(localFilter).excludedTags.plus(it.id) ) }, onTagDeSelected = { localFilter = nonNullFilter(localFilter).copy( - selectedTags = nonNullFilter(localFilter).selectedTags.minus(it.id) + excludedTags = nonNullFilter(localFilter).excludedTags.minus(it.id) ) }, onTagSearch = { @@ -431,18 +474,45 @@ fun BoxWithConstraintsScope.FilterOverlay( } @Composable -fun ColumnScope.OthersFilter( +fun ColumnScope.tagsFilter( filter: ReportFilter?, - onTagButtonClick: () -> Unit, + onIncludesTagButtonClick: () -> Unit, + onExcludesTagButtonClick: () -> Unit, + @Suppress("UnusedParameter") modifier: Modifier = Modifier ) { FilterTitleText( - text = stringResource(R.string.others_optional), + text = stringResource(R.string.tags_optional), active = false ) + Spacer(Modifier.height(12.dp)) + + Text( + modifier = Modifier.padding(start = 32.dp), + text = stringResource(R.string.includes_uppercase), + style = UI.typo.b2.style( + fontWeight = FontWeight.ExtraBold + ) + ) + + TagFilter( + selectedTags = filter?.includedTags?.toImmutableList() ?: persistentListOf(), + onTagButtonClick = onIncludesTagButtonClick, + ) + + Spacer(Modifier.height(20.dp)) + + Text( + modifier = Modifier.padding(start = 32.dp), + text = stringResource(R.string.excludes_uppercase), + style = UI.typo.b2.style( + fontWeight = FontWeight.ExtraBold + ) + ) + TagFilter( - selectedTags = filter?.selectedTags?.toImmutableList() ?: persistentListOf(), - onTagButtonClick = onTagButtonClick, + selectedTags = filter?.excludedTags?.toImmutableList() ?: persistentListOf(), + onTagButtonClick = onExcludesTagButtonClick, ) } @@ -452,14 +522,6 @@ fun ColumnScope.TagFilter( onTagButtonClick: () -> Unit, @Suppress("UnusedParameter") modifier: Modifier = Modifier ) { - Text( - modifier = Modifier.padding(start = 32.dp, top = 16.dp), - text = stringResource(R.string.tags), - style = UI.typo.b2.style( - fontWeight = FontWeight.ExtraBold - ) - ) - Spacer(Modifier.height(12.dp)) if (selectedTags.isEmpty()) { diff --git a/screen/reports/src/main/java/com/ivy/reports/ReportFilter.kt b/screen/reports/src/main/java/com/ivy/reports/ReportFilter.kt index 35c4abc52e..33bad9d880 100644 --- a/screen/reports/src/main/java/com/ivy/reports/ReportFilter.kt +++ b/screen/reports/src/main/java/com/ivy/reports/ReportFilter.kt @@ -18,7 +18,9 @@ data class ReportFilter( val maxAmount: Double?, val includeKeywords: List, val excludeKeywords: List, - val selectedTags: List + val includedTags: List, + val excludedTags: List, + ) { companion object { fun emptyFilter( @@ -33,7 +35,8 @@ data class ReportFilter( excludeKeywords = emptyList(), minAmount = null, maxAmount = null, - selectedTags = emptyList() + includedTags = emptyList(), + excludedTags = emptyList() ) } diff --git a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt index 968c18ba27..a0c5e4ca35 100644 --- a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt +++ b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt @@ -111,9 +111,9 @@ class ReportViewModel @Inject constructor( private var overdueExpenses by mutableDoubleStateOf(0.0) private var history by mutableStateOf>(persistentListOf()) private var upcomingTransactions by - mutableStateOf>(persistentListOf()) + mutableStateOf>(persistentListOf()) private var overdueTransactions by - mutableStateOf>(persistentListOf()) + mutableStateOf>(persistentListOf()) private var accounts by mutableStateOf>(persistentListOf()) private var upcomingExpanded by mutableStateOf(false) private var overdueExpanded by mutableStateOf(false) @@ -375,8 +375,8 @@ class ReportViewModel @Inject constructor( val filterRange = filter.period?.toRange(ivyContext.startDayOfMonth, timeConverter, timeProvider) - val transactions = if (filter.selectedTags.isNotEmpty()) { - tagRepository.findByAllAssociatedIdForTagId(filter.selectedTags) + val transactions = if (filter.includedTags.isNotEmpty()) { + tagRepository.findByAllAssociatedIdForTagId(filter.includedTags) .asSequence() .flatMap { it.value } .map { TransactionId(it.associatedId.value) } @@ -389,7 +389,24 @@ class ReportViewModel @Inject constructor( transactionRepository.findAll() } + val exacludeableByTagTransactionsIds = if (filter.excludedTags.isNotEmpty()) { + tagRepository.findByAllAssociatedIdForTagId(filter.excludedTags) + .asSequence() + .flatMap { it.value } + .map { TransactionId(it.associatedId.value) } + .distinct() + .toList() + .let { + transactionRepository.findByIds(it) + }.map { + it.id + } + } else { + emptyList() + } + return transactions + .filter { !exacludeableByTagTransactionsIds.contains(it.id) } .filter { with(transactionMapper) { filter.trnTypes.contains(it.getTransactionType()) diff --git a/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen no filter[Dark].png b/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen no filter[Dark].png index 1e8097f0fa8bd5aaf941b6b652e5dac526df06b2..2cb02e579b7a8ac8e00d39a2c4402a2aa1c8dafe 100644 GIT binary patch delta 964 zcmV;#13UcfrUUS%1F$fF0V}gHfL~94PsQeu|KX|FG*V}ueRiK7o7G4OP3DsZDeK{> zsSiH*pg;68eoaO0lTm7FEKfV812=vRtCP@Nc|voFh5r>td8n~I%AXfmHP zNW*&MhK>*~zx?ukpC5ksq3yKOP7|NAItk5{Cp4$X8fJktVZTdF7S8mh$v#PW>7Gydq(n{hg_?9HikecLvK9 znns%Q6Phz*N_OwP_ik5TeRc2Arx1tUeWu5zP1zc0GE26cWF0c~ao1gU&D;5!<@n=| zZ@>NaTMyqnjXVB1tC!GRc|vmmDWW{$pQ+h2av5!=Aai*3>#x7w_sq?I?dcn7GD~V@ z?b@}yKJs*SPLdkGW|q`q>MntqqZ{|!bI*xuSiOYi$`hJJ3Bwf7i6@@eo_Xe(QBOb9 zY+0w;XPz~g*|9rnb z@1CkvS~frRD>q8 zog=P=!$Hp=OpeNS9uEX&-40Bgmnl zOPCHXpdMsO_nv$187&2j-wz_sS)?PMC8VXwcDn~3d~ngzyQ_iFTn1TJ%CziRXPwnY z3u*LHcsUed{92fQD^s$E9(riI_10Va`&oyB*fTvgj6ic#UPhazoN`K^E)$r{l3B2< zo1b^ydF}l3&tH-(7wop%ZWH%LXfCU)RqeIcUhRSlF6etaZ91o7n6b$ArelviwyjyS zrtjy>RBcYD%8LWiDbwqxDjoUM%Tn3e delta 961 zcmV;y13vulrUUJ!1F$fF0VuOEfL~94jawf1AD)U$BX#!KXZPu`S&fv?WIkz-vL2qA z`rv~P`a?hC*Hq*_8KtJi^0Z?*aO2moItk5{Cp4!x?zrPdQ?Xfh%39{Msn}_RCi6*y zG^|H%=m_!h%P;Tu`Qe8j+D<#|H1RpBlh9mwLUW3&VW#NPD1H3#$L+!kFDwOrW(ZB@ zlLqOfmtN|1mGIn<(9BVLxli_Y3QYz=bL9!mDbff%`skzW=bwKbh3C^xKiv*H?69fp zm~+{3!hBLYk3IHSuZ<5s{BVP&XYaV{&p6|Zw)NIqPh1-roo4;>`RAYS*GJxn z;uT?xn;V*W8%{c8>Ci7m+BTs%KcTrqc^G5={r7J--+Xg_d2os}jafFWXPb)9WR{#| ze9JAj^xzz(`}5|Ktd-~0V5zMHWe(JM=%I&3>!6YF%)a5JtcUV{-D|>pXfA`SD`i^tth3JQqlGkj zDZCttFn%q}l_}YOLk~T)-FoY-{r#-NLF}0x8%CfxDlenWQ%*UhPnQWyX2~pA*3Hj5 z@4R;Y`R6Z5mJ4>6Gd9QSd|y{hgoCTxMwi6Q0xdaKbDRshu=d87X80nxARFj4a{b jLz7X=6_dcrC>HcTu2H-iPq8#D00000NkvXXu0mjfXU_j| diff --git a/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen no filter[Light].png b/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen no filter[Light].png index f613991216a41e5d71bcbb3a8a7bfc1197e254de..ed3f774020ca31a8113a31258d320fefd96a1e22 100644 GIT binary patch delta 968 zcmV;(12_EWjRWhA1F$fF0j9GtfWkt5wJKIi{@torHB#UI{`c+hSWzQIXd;gqB+ZAb zOs!hA$}ai|w~3+ssF$iTrqzx*fD5<5)rrt-e}ra+FMs*Vm7!S8J83R6YbZ7gp@}?d zklcJ^TYHE<{pnBbes=BJW#0MDcc$*g)rrt-e}rZR&0(t0sZo0Fx#!Gnx7`+h6_`S3 zB99uRnKNhFa;5NWOK9p+d)klA?<6$g5Ss0e(9EDlXvBySX7Ap;mGB%te!Th2XFiiT zkLlx-6Xa3Z898#KEgP#>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W2TeVb(#vH zi6Xj|@k0+iWP{TU_v@ESG*_;l22fJ?oDOl(MKPx zlocJ+*Guh~9;?fR>KAsx=eXJtnr)y0s>VGtc_uQC-7?hg>Hv(SOOrjQz?)9r=~8B+J~?$vV{pnAehaY~}{ywX_5W9xQTn|*2%2RLi8{hbb9WEmbHs2X7COD@OJDku zx%19D?fIM^3o{I{mn;cHkle3K!s=4Ih;Tdl^r!!>M5uP os(;mh(X#}u9FyUBOc$j89|U&C+qyzVyZ`_I07*qoM6N<$f*uC(fB*mh diff --git a/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen[Dark].png b/screen/reports/src/test/snapshots/images/com.ivy.report_ReportPaparazziTest_snapshot Report Screen[Dark].png index 284c34c880ebe1821fdbf73d4f8da965ddfa67bf..9499ab9d66c1f93a092dc5f3dc7c1b5dcd51c544 100644 GIT binary patch delta 970 zcmV;*12z2rg#&_y1F$fF0ll*^fY?5NH7Zs^{@tipRZ`QZPq)ourBzadCUQ}Qr2cT7 zQ*XTSh8^_dFB3xB(Os&}F^zWA1)RSOiW8x^?-80QMvferX^K_9lln5#nqt!sn#e^J zlIxGG=pEv+Wy|b#KKbMm)2>~+#C#MdLUZ3EG*hS#QzxA&rFY(W$IP8OHz+WFh0sJU zs*oOk{Be6;DLg9@n)<3eZAZ^{5}I%b&3%v1Orc8X?z`_cpMU;&COjW}@If=9?92p1u0&tL=8)efM3OXOU4^p{Z{LA~e$xnkjVRv~S4enta=F5PlRHh6X7%dT_FU5FSAFY`KR<-RR?m0p9MczR@MZ3B zDl0U()69*~EQOk6yLIbk)~;P^ujq9mx~qFNkEJ!)a;J&X=#dlkL+bpv?z-!8UVN2i z)TmMBtFOMY;j7WO{(KZKLUZ3EG|QlqNJIS9G^mJoAiyeP%9xrO%xv zN~3e-p@$x_=Z8jT>zkzfWlE!SQRkfkQ(xWKrAwE@GALez=DtU022vR61R67DjQQEm zewMk?S2LUXsk(RXZcjKu6J^o20J)1V^=<0z(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ag - Andere (optional) + Tags (optional) Tags Tags durchsuchen Wechselkurse diff --git a/shared/ui/core/src/main/res/values-it/strings.xml b/shared/ui/core/src/main/res/values-it/strings.xml index 3d5ea47da4..7265398c84 100644 --- a/shared/ui/core/src/main/res/values-it/strings.xml +++ b/shared/ui/core/src/main/res/values-it/strings.xml @@ -450,7 +450,7 @@ Diminuzione Seleziona la destinazione del trasferimento Selezionare un altro conto come destinazione per il trasferimento - Altro (opzionale) + Tags (optional) Etichette Tag di Ricerca Tassi di cambio diff --git a/shared/ui/core/src/main/res/values-pt-rBR/strings.xml b/shared/ui/core/src/main/res/values-pt-rBR/strings.xml index dc1e8e1fc0..58661ec336 100644 --- a/shared/ui/core/src/main/res/values-pt-rBR/strings.xml +++ b/shared/ui/core/src/main/res/values-pt-rBR/strings.xml @@ -450,7 +450,7 @@ Diminuir Selecione o destino da transferência Selecione uma conta de destino diferente para a transferência - Outro (opcional) + Tags (optional) Tags Pesquisar Tags Taxas de câmbio diff --git a/shared/ui/core/src/main/res/values-vi/strings.xml b/shared/ui/core/src/main/res/values-vi/strings.xml index 39e11f2f9a..11088cdee5 100644 --- a/shared/ui/core/src/main/res/values-vi/strings.xml +++ b/shared/ui/core/src/main/res/values-vi/strings.xml @@ -449,7 +449,7 @@ Giảm Chọn tài khoản đích Chọn một tài khoản đích khác để chuyển - Khác (tùy chọn) + Tags (optional) Thẻ Tìm thẻ Các tỷ giá hối đoái diff --git a/shared/ui/core/src/main/res/values-zh-rCN/strings.xml b/shared/ui/core/src/main/res/values-zh-rCN/strings.xml index dcb0025bdc..6d83d63675 100644 --- a/shared/ui/core/src/main/res/values-zh-rCN/strings.xml +++ b/shared/ui/core/src/main/res/values-zh-rCN/strings.xml @@ -450,7 +450,7 @@ 减少 选择转账目标账户 请选择不同的目标账户进行转账 - 其他(可选) + Tags (optional) 标签 搜索标签 汇率 diff --git a/shared/ui/core/src/main/res/values-zh-rTW/strings.xml b/shared/ui/core/src/main/res/values-zh-rTW/strings.xml index cbad635d01..30db2b29cb 100644 --- a/shared/ui/core/src/main/res/values-zh-rTW/strings.xml +++ b/shared/ui/core/src/main/res/values-zh-rTW/strings.xml @@ -453,7 +453,7 @@ 減少 選擇傳輸目的地 選擇不同的目標帳戶進行轉帳 - 其他 (可選) + Tags (optional) 標籤 搜尋標籤 匯率 diff --git a/shared/ui/core/src/main/res/values/strings.xml b/shared/ui/core/src/main/res/values/strings.xml index 4b9184a7e1..8fb0dc95c0 100644 --- a/shared/ui/core/src/main/res/values/strings.xml +++ b/shared/ui/core/src/main/res/values/strings.xml @@ -453,7 +453,7 @@ Decrease Select the transfer destination Select a different destination account for the transfer - Other (optional) + Tags (optional) Tags Search Tags Exchange rates From 22828805647efae975ad73dd22353a8621416db1 Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Mon, 23 Sep 2024 06:16:50 +0600 Subject: [PATCH 2/2] Fix of '[FEATURE] Reports by Excluding Tags'- reviews resoled --- .../reports/src/main/java/com/ivy/reports/FilterOverlay.kt | 4 ++-- .../src/main/java/com/ivy/reports/ReportViewModel.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt b/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt index 2b2e264f97..63ac3391fe 100644 --- a/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt +++ b/screen/reports/src/main/java/com/ivy/reports/FilterOverlay.kt @@ -278,7 +278,7 @@ fun BoxWithConstraintsScope.FilterOverlay( FilterDivider() - tagsFilter( + TagsFilter( filter = localFilter, onIncludesTagButtonClick = { includedTagModalVisible = true @@ -474,7 +474,7 @@ fun BoxWithConstraintsScope.FilterOverlay( } @Composable -fun ColumnScope.tagsFilter( +fun ColumnScope.TagsFilter( filter: ReportFilter?, onIncludesTagButtonClick: () -> Unit, onExcludesTagButtonClick: () -> Unit, diff --git a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt index a0c5e4ca35..0febff6874 100644 --- a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt +++ b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt @@ -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) @@ -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())