Skip to content
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

Merged
merged 6 commits into from
Nov 27, 2024
Merged

Conversation

Darkeye14
Copy link
Contributor

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 anything

  • If you have multiple commits please combine them into one commit by squashing them.

@Darkeye14
Copy link
Contributor Author

@itsPronay bhai, Please review this!

Comment on lines +56 to +58
list?.let {
viewModel.setClientList(clientsList = list)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a simple doubt. Shouldn't we set clientListFirst and sync later?
image

Copy link
Contributor Author

@Darkeye14 Darkeye14 Nov 24, 2024

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

Copy link
Contributor

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

Copy link
Contributor Author

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 = { _, _ -> },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix missing routes here.
image

Copy link
Contributor Author

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.

Copy link
Contributor

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

Comment on lines +344 to +348
MifosClientDetailsScreen(
padding = padding,
loanAccountSelected = loanAccountSelected,
savingsAccountSelected = savingsAccountSelected,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Bhai

Comment on lines 438 to 508
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))

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@Darkeye14
Copy link
Contributor Author

Darkeye14 commented Nov 27, 2024

Mifos Scaffold instead of CreateClientHeader

WhatsApp.Video.2024-11-27.at.20.15.17_d69b7294.mp4

@therajanmaurya therajanmaurya merged commit 6f6c76e into openMF:master Nov 27, 2024
1 check failed
Darkeye14 added a commit to Darkeye14/android-client that referenced this pull request Nov 28, 2024
Refactor Client module CleanUp (openMF#2240)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants