Skip to content

feat : Activate migrated to CMP #2388

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

Merged
merged 9 commits into from
May 27, 2025
Merged

Conversation

revanthkumarJ
Copy link

@revanthkumarJ revanthkumarJ commented May 26, 2025

Fixes - Jira-413

Screenshot 2025-05-27 101234
Screenshot 2025-05-27 101244
image
image

@revanthkumarJ revanthkumarJ changed the title Activate migrated to CMP feat : Activate migrated to CMP May 27, 2025
@revanthkumarJ revanthkumarJ marked this pull request as ready for review May 27, 2025 04:49
)
}
//
//private class ActivateUiStateProvider : PreviewParameterProvider<ActivateUiState> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Enable Compose Multiplatform Preview, Uncomment these lines

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -40,15 +50,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the dispatcher

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -40,15 +50,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
activateClientUseCase(clientId, clientPayload).collect { result ->
when (result) {
is Resource.Error<*> ->
is DataState.Error<*> ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why these DataState type contains <*> fix it

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -74,15 +84,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the dispatcher

Copy link
Author

Choose a reason for hiding this comment

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

done

Comment on lines 120 to 123
LaunchedEffect(true){
snackbarHostState.showSnackbar(getString( state.message))
}
onBackPressed()
Copy link
Contributor

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

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

Snackbar might not show by the time onBackPressed() is called, use alertdialog whenever possible.

Also if I am not wrong it only runs during the initial composition.

Copy link
Author

Choose a reason for hiding this comment

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

changed to MifosAlertDialog

Comment on lines 209 to 212
fun formatDate(millis: Long): String {
val dateTime = Instant.fromEpochMilliseconds(millis).toLocalDateTime(TimeZone.currentSystemDefault())
return "${dateTime.dayOfMonth} ${dateTime.month.name.lowercase().replaceFirstChar { it.uppercase() }} ${dateTime.year}"
}
Copy link
Contributor

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

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

can we put this in common? since it will be used in like 5/7 screen

Copy link
Author

Choose a reason for hiding this comment

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

ok i will move it to common

@@ -57,15 +67,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Contributor

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

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

Screenshot 2025-05-27 at 11 12 44 AM

remove dispatchers.IO , check line 84 as well

@niyajali niyajali merged commit c840321 into openMF:kmp-impl May 27, 2025
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