-
Notifications
You must be signed in to change notification settings - Fork 599
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
Refactor Client module CleanUp #2240
Conversation
@itsPronay bhai, Please review this! |
list?.let { | ||
viewModel.setClientList(clientsList = list) | ||
} |
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.
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.
i'll check once. It most probably should be
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.
you can take ref from syncCenterDialogScreen
or you can check the old fragment itself
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.
Yeah, will do!!
) | ||
createClientRoute( | ||
onBackPressed = navController::popBackStack, | ||
hasDatatables = { _, _ -> } | ||
hasDatatables = { _, _ -> }, |
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.
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.
On it! everything has been fixed, apart from onCardClick. There seems to be an issue there.
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.
about that, let's connect tonight if you are free
MifosClientDetailsScreen( | ||
padding = padding, | ||
loanAccountSelected = loanAccountSelected, | ||
savingsAccountSelected = savingsAccountSelected, | ||
) |
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.
good one
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.
Thanks Bhai
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
Text( | ||
style = MaterialTheme.typography.headlineSmall, | ||
text = stringResource(id = R.string.feature_client_create_new_client), | ||
modifier = Modifier.padding(start = 16.dp) | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
Box( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 16.dp), | ||
) { | ||
Image( | ||
painter = if (selectedImageUri.path?.isNotEmpty() == true) rememberAsyncImagePainter( | ||
selectedImageUri | ||
) else painterResource( | ||
id = R.drawable.feature_client_ic_dp_placeholder | ||
), | ||
contentDescription = null, | ||
modifier = Modifier | ||
.align(Alignment.Center) | ||
.clickable { | ||
showImagePickerDialog = true | ||
} | ||
.border(color = DarkGray, width = 2.dp, shape = CircleShape) | ||
.size(80.dp) | ||
.clip(CircleShape) | ||
) | ||
ClientHeader() | ||
ClientImageSection(selectedImageUri = selectedImageUri) { | ||
showImagePickerDialog = true | ||
} | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
MifosOutlinedTextField( | ||
value = firstName, | ||
onValueChange = { firstName = it }, | ||
label = stringResource(id = R.string.feature_client_first_name_mandatory), | ||
error = null | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
MifosOutlinedTextField( | ||
value = middleName, | ||
onValueChange = { middleName = it }, | ||
label = stringResource(id = R.string.feature_client_middle_name), | ||
error = null | ||
ClientInputTextFields( | ||
firstName = firstName, | ||
middleName = middleName, | ||
lastName = lastName, | ||
mobileNumber = mobileNumber, | ||
externalId = externalId, | ||
onFirstNameChange = { firstName = it }, | ||
onMiddleNameChange = { middleName = it }, | ||
onLastNameChange = { lastName = it }, | ||
onMobileNumberChange = { mobileNumber = it }, | ||
onExternalIdChange = { externalId = it }, | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
MifosOutlinedTextField( | ||
value = lastName, | ||
onValueChange = { lastName = it }, | ||
label = stringResource(id = R.string.feature_client_last_name_mandatory), | ||
error = null | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
MifosOutlinedTextField( | ||
value = mobileNumber, | ||
onValueChange = { mobileNumber = it }, | ||
label = stringResource(id = R.string.feature_client_mobile_no), | ||
error = null, | ||
keyboardType = KeyboardType.Number | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
MifosOutlinedTextField( | ||
value = externalId, | ||
onValueChange = { externalId = it }, | ||
label = stringResource(id = R.string.feature_client_external_id), | ||
error = null | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
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.
Is there any reason why we removing this from here?
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.
Yes, the function seemed too complicated with a cyclometric complexity well beyond the threshold. hence had to optimize it and divide it into multiple fun
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.
ok. did you test the funcionality? Everything works?
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.
Yes, functionality has been preserved
Mifos Scaffold instead of CreateClientHeader WhatsApp.Video.2024-11-27.at.20.15.17_d69b7294.mp4 |
Refactor Client module CleanUp (openMF#2240)
Fixes #Issue_Number
Please Add Screenshots If there are any UI changes.
Please make sure these boxes are checked before submitting your pull request - thanks!
Apply the
MifosStyle.xml
style template to your code in Android Studio.Run the unit tests with
./gradlew check
to make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.