Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,11 @@ object TextFieldsValidator {
else -> null
}
}

fun dropDownEmptyValidator(input: Boolean): StringResource? {
return when {
input -> Res.string.error_field_empty
else -> null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@
<string name="charges_view_charges">View Charges</string>
<string name="charges_client_update_not_support_error_msg">Updating client charges is not supported. Please delete the existing charge and create a new one.</string>

<!--Fixed Deposit Account -->
<string name="feature_fixed_deposit_deposit_amount">Deposit Amount</string>
<string name="feature_fixed_deposit_deposit_period_type">Deposit Period Type</string>
<string name="feature_fixed_interest_compounding">Interest Compounding</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,29 @@ class CreateFixedDepositAccountViewmodel(
}

DataState.Loading -> {
setLoadingState()
mutableStateFlow.update {
it.copy(
isOverlayLoading = true,
)
}
}
}
}
}

private fun setLoadingState() {
private fun setSuccessState() {
mutableStateFlow.update {
it.copy(
screenState = NewFixedDepositAccountState.ScreenState.Loading,
screenState = NewFixedDepositAccountState.ScreenState.Success,
isOverlayLoading = false,
)
}
}

private fun setSuccessState() {
mutableStateFlow.update {
it.copy(screenState = NewFixedDepositAccountState.ScreenState.Success)
}
}
private fun setErrorState(message: String) {
mutableStateFlow.update {
it.copy(
screenState = NewFixedDepositAccountState.ScreenState.Error(message),
isOverlayLoading = false,
)
}
}
Expand Down Expand Up @@ -274,6 +274,7 @@ data class NewFixedDepositAccountState(
val fixedDepositAccountDetail: FixedDepositAccountDetailsState = FixedDepositAccountDetailsState(),
val fixedDepositAccountTerms: FixedDepositAccountTermsState = FixedDepositAccountTermsState(),
val template: FixedDepositTemplate = FixedDepositTemplate(),
val isOverlayLoading: Boolean = false,
) {
sealed interface ScreenState {
data class Error(val message: String) : ScreenState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package com.mifos.feature.recurringDeposit.newRecurringDepositAccount

import androidclient.feature.recurringdeposit.generated.resources.Res
import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_create_recurring_deposit_account
import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_charges
import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_details
import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_step_interest
Expand All @@ -28,6 +27,7 @@ import com.mifos.core.designsystem.component.MifosScaffold
import com.mifos.core.ui.components.MifosBreadcrumbNavBar
import com.mifos.core.ui.components.MifosErrorComponent
import com.mifos.core.ui.components.MifosProgressIndicator
import com.mifos.core.ui.components.MifosProgressIndicatorOverlay
import com.mifos.core.ui.components.MifosStepper
import com.mifos.core.ui.components.Step
import com.mifos.core.ui.util.EventsEffect
Expand Down Expand Up @@ -104,8 +104,6 @@ private fun RecurringAccountScaffold(
)

MifosScaffold(
title = stringResource(Res.string.feature_recurring_deposit_create_recurring_deposit_account),
onBackPressed = { onAction(RecurringAccountAction.NavigateBack) },
modifier = modifier,
) { paddingValues ->
Column(
Expand Down Expand Up @@ -141,5 +139,8 @@ private fun RecurringAccountScaffold(
}
}
}
if (state.isOverlayLoading) {
MifosProgressIndicatorOverlay()
}
}
}
Loading