File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed
feature/loan-account/src/commonMain
kotlin/org/mifos/mobile/feature/loanaccount Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 2424 <string name =" feature_loan_account_filter_bronze" >Bronze</string >
2525
2626 <string name =" feature_account_empty_loan_accounts" >There is no LoanAccount associated with you</string >
27+ <string name =" feature_account_empty_filtered_loan_accounts" >There is no LoanAccount associated with Filters you Selected</string >
2728
2829 <string name =" feature_loan_account_dashboard" >Total Borrowings</string >
2930 <string name =" feature_loan_account" >Loan Account</string >
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import androidx.compose.ui.Modifier
3434import androidx.compose.ui.unit.dp
3535import androidx.lifecycle.compose.collectAsStateWithLifecycle
3636import mifos_mobile.feature.loan_account.generated.resources.Res
37+ import mifos_mobile.feature.loan_account.generated.resources.feature_account_empty_filtered_loan_accounts
3738import mifos_mobile.feature.loan_account.generated.resources.feature_account_empty_loan_accounts
3839import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account
3940import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_dashboard
@@ -255,6 +256,12 @@ internal fun LoanAccountContent(
255256 error = Res .string.feature_account_empty_loan_accounts,
256257 )
257258 }
259+ if (state.isFilteredEmpty && ! state.isEmpty) {
260+ EmptyDataView (
261+ icon = MifosIcons .Info ,
262+ error = Res .string.feature_account_empty_filtered_loan_accounts,
263+ )
264+ }
258265 }
259266}
260267
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class LoanAccountsViewmodel(
126126 loanAccounts = filtered,
127127 selectedFilters = selectedFilters,
128128 dialogState = null ,
129+ isFilteredEmpty = filtered.isEmpty(),
129130 )
130131 }
131132 sendEvent(LoanAccountsEvent .LoadingCompleted )
@@ -187,7 +188,8 @@ class LoanAccountsViewmodel(
187188 mutableStateFlow.update {
188189 it.copy(
189190 items = filtered.size,
190- isEmpty = filtered.isEmpty(),
191+ isEmpty = loanAccounts.isEmpty(),
192+ isFilteredEmpty = filtered.isEmpty(),
191193 loanAccounts = filtered,
192194 originalAccounts = loanAccounts,
193195 currency = loanAccounts.firstOrNull()?.currency?.displaySymbol,
@@ -250,6 +252,7 @@ data class LoanAccountsState(
250252 val loanAccounts : List <LoanAccount >? ,
251253 val originalAccounts : List <LoanAccount >? = null ,
252254 val isEmpty : Boolean = false ,
255+ val isFilteredEmpty : Boolean = false ,
253256
254257 /* * Number of filtered accounts */
255258 val items : Int? = 0 ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ package org.mifos.mobile.feature.loanaccount.utils
1212import mifos_mobile.feature.loan_account.generated.resources.Res
1313import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_active
1414import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_approval_pending
15+ import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_bronze
1516import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_closed
1617import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_disburse
1718import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_in_arrears
@@ -85,7 +86,7 @@ enum class FilterUtil(
8586 */
8687 IN_ARREARS (
8788 label = Res .string.feature_loan_account_filter_in_arrears,
88- matchCondition = { it.status?.overpaid == true },
89+ matchCondition = { it.inArrears == true },
8990 ),
9091
9192 /* *
@@ -103,7 +104,7 @@ enum class FilterUtil(
103104 ),
104105
105106 BRONZE (
106- label = Res .string.feature_loan_account_filter_personal ,
107+ label = Res .string.feature_loan_account_filter_bronze ,
107108 matchCondition = { it.productName?.contains(" bronze" , ignoreCase = true ) == true },
108109 ),
109110 ;
You can’t perform that action at this time.
0 commit comments