-
Notifications
You must be signed in to change notification settings - Fork 658
Feature Terms Steps for Recurring Deposit account Flow. 551 #2544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ankitkumarrain
wants to merge
6
commits into
openMF:development
Choose a base branch
from
ankitkumarrain:mifo-551
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b776b40
feature Recurring Interest chart
ankitkumarrain 65c30ac
changed the code of interest page to terms page
ankitkumarrain 2b1d86f
fixed minor suggested changes
ankitkumarrain 76e90eb
add button on the bottom of terms page
ankitkumarrain cc0d0cf
Merge remote-tracking branch 'origin/development' into mifo-551
ankitkumarrain 934483f
minor changes
ankitkumarrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,26 +10,128 @@ | |
| package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages | ||
|
|
||
| import androidclient.feature.recurringdeposit.generated.resources.Res | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next_button | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_terms_page | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_back | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_calculation_days_in_year | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
| import com.mifos.core.designsystem.component.MifosTextFieldDropdown | ||
| import com.mifos.core.designsystem.theme.DesignToken | ||
| import com.mifos.core.ui.components.MifosProgressIndicatorMini | ||
| import com.mifos.core.ui.components.MifosTwoButtonRow | ||
| import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction | ||
| import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState | ||
| import org.jetbrains.compose.resources.stringResource | ||
|
|
||
| @Composable | ||
| fun TermsPage(onNext: () -> Unit) { | ||
| fun TermsPage( | ||
| state: RecurringAccountState, | ||
| onAction: (RecurringAccountAction) -> Unit, | ||
| ) { | ||
| Column(horizontalAlignment = Alignment.CenterHorizontally) { | ||
| Text(stringResource(Res.string.feature_recurring_deposit_terms_page)) | ||
| Spacer(Modifier.height(8.dp)) | ||
| Button(onClick = onNext) { | ||
| Text(stringResource(Res.string.feature_recurring_deposit_next_button)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCompoundingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCompoundingPeriodTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_compounding_period), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestPostingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestPostingPeriodTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_posting_period), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCalculationTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCalculationTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_calculation), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCalculationDaysInYearTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCalculationDaysInYearTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_calculation_days_in_year), | ||
| ) | ||
| if (state.recurringDepositAccountDetail.isMiniLoaderActive) { | ||
| MifosProgressIndicatorMini() | ||
| } | ||
|
|
||
| MifosTwoButtonRow( | ||
| firstBtnText = stringResource(Res.string.feature_recurring_deposit_back), | ||
| secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), | ||
| onFirstBtnClick = { onAction(RecurringAccountAction.OnBackPress) }, | ||
| onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, | ||
| isSecondButtonEnabled = state.recurringDepositAccountInterestChart.isTermsButtonEnabled, | ||
| isButtonIconVisible = true, | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think you can use isButtonEnabled some thing like that in MifosTwoButtonRow to make sure next button is enabled only after everything is filled |
||
| ) | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix type inconsistency causing incorrect button state.
The fields are declared as
Int?(nullable) with a default ofnull, butisTermsButtonEnabledchecks them against-1. Sincenull != -1evaluates totrue, the button will always be enabled even when no selections have been made.Based on the codebase convention (e.g.,
fieldOfficerIndex: Int = -1on line 662), use non-nullableIntwith-1as the sentinel value.Apply this diff:
🤖 Prompt for AI Agents