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 24
24
<string name =" feature_loan_account_filter_bronze" >Bronze</string >
25
25
26
26
<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 >
27
28
28
29
<string name =" feature_loan_account_dashboard" >Total Borrowings</string >
29
30
<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
34
34
import androidx.compose.ui.unit.dp
35
35
import androidx.lifecycle.compose.collectAsStateWithLifecycle
36
36
import mifos_mobile.feature.loan_account.generated.resources.Res
37
+ import mifos_mobile.feature.loan_account.generated.resources.feature_account_empty_filtered_loan_accounts
37
38
import mifos_mobile.feature.loan_account.generated.resources.feature_account_empty_loan_accounts
38
39
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account
39
40
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_dashboard
@@ -255,6 +256,12 @@ internal fun LoanAccountContent(
255
256
error = Res .string.feature_account_empty_loan_accounts,
256
257
)
257
258
}
259
+ if (state.isFilteredEmpty && ! state.isEmpty) {
260
+ EmptyDataView (
261
+ icon = MifosIcons .Info ,
262
+ error = Res .string.feature_account_empty_filtered_loan_accounts,
263
+ )
264
+ }
258
265
}
259
266
}
260
267
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class LoanAccountsViewmodel(
126
126
loanAccounts = filtered,
127
127
selectedFilters = selectedFilters,
128
128
dialogState = null ,
129
+ isFilteredEmpty = filtered.isEmpty(),
129
130
)
130
131
}
131
132
sendEvent(LoanAccountsEvent .LoadingCompleted )
@@ -187,7 +188,8 @@ class LoanAccountsViewmodel(
187
188
mutableStateFlow.update {
188
189
it.copy(
189
190
items = filtered.size,
190
- isEmpty = filtered.isEmpty(),
191
+ isEmpty = loanAccounts.isEmpty(),
192
+ isFilteredEmpty = filtered.isEmpty(),
191
193
loanAccounts = filtered,
192
194
originalAccounts = loanAccounts,
193
195
currency = loanAccounts.firstOrNull()?.currency?.displaySymbol,
@@ -250,6 +252,7 @@ data class LoanAccountsState(
250
252
val loanAccounts : List <LoanAccount >? ,
251
253
val originalAccounts : List <LoanAccount >? = null ,
252
254
val isEmpty : Boolean = false ,
255
+ val isFilteredEmpty : Boolean = false ,
253
256
254
257
/* * Number of filtered accounts */
255
258
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
12
12
import mifos_mobile.feature.loan_account.generated.resources.Res
13
13
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_active
14
14
import 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
15
16
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_closed
16
17
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_disburse
17
18
import mifos_mobile.feature.loan_account.generated.resources.feature_loan_account_filter_in_arrears
@@ -85,7 +86,7 @@ enum class FilterUtil(
85
86
*/
86
87
IN_ARREARS (
87
88
label = Res .string.feature_loan_account_filter_in_arrears,
88
- matchCondition = { it.status?.overpaid == true },
89
+ matchCondition = { it.inArrears == true },
89
90
),
90
91
91
92
/* *
@@ -103,7 +104,7 @@ enum class FilterUtil(
103
104
),
104
105
105
106
BRONZE (
106
- label = Res .string.feature_loan_account_filter_personal ,
107
+ label = Res .string.feature_loan_account_filter_bronze ,
107
108
matchCondition = { it.productName?.contains(" bronze" , ignoreCase = true ) == true },
108
109
),
109
110
;
You can’t perform that action at this time.
0 commit comments