Skip to content

Conversation

@itsPronay
Copy link
Collaborator

@itsPronay itsPronay commented Sep 1, 2025

image

Didn't create a Jira ticket, click here to create new.

Please Add Screenshots If there are any UI changes.

Before After

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

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

@itsPronay itsPronay marked this pull request as draft September 1, 2025 19:38
@itsPronay
Copy link
Collaborator Author

it is not ready for review yet, its a draft

@itsPronay itsPronay changed the title Client upcoming charges final feat: Client upcoming charges UI Sep 5, 2025
@itsPronay itsPronay marked this pull request as ready for review September 5, 2025 10:19
@itsPronay
Copy link
Collaborator Author

@revanthkumarJ @Nagarjuna0033 any idea how do i get count of total charges as i am getting that as PagingData?

dueAsOf = if (charge.dueDate != null) {
DateHelper.getDateAsString(charge.dueDate!!)
} else {
"N/A"
Copy link
Member

Choose a reason for hiding this comment

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

hard coded string, move to strings.xml

due = if (charge.amount != null && charge.amountPaid != null) {
(charge.amount!! - charge.amountPaid!!).toString()
} else {
"N/A"
Copy link
Member

Choose a reason for hiding this comment

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

hard coded string, move to strings.xml

Comment on lines +67 to +89

fun checkNetworkAndGetCharges() {
viewModelScope.launch {
val isOnline = networkMonitor.isOnline.first()
when (isOnline) {
true -> {
mutableStateFlow.update { it.copy(dialogState = null) }
getClientCharges()
}

false -> {
mutableStateFlow.update {
it.copy(
dialogState = ClientUpcomingChargesState.DialogState.Error(
getString(Res.string.feature_client_error_not_connected_internet),
),
)
}
}
}
}
}

Copy link
Contributor

@TheKalpeshPawar TheKalpeshPawar Sep 5, 2025

Choose a reason for hiding this comment

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

why aren't you using .collect,
It will update automatically UI when network status changes, without having to call the function.
Fetching a single boolean value continuously, isn't that much expensive operation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we only need to check connectivity once before calling getClientCharges(), thats why i didn't use collect as it is unnecessary

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair, I find updating automatically fun. But okay.

Copy link
Collaborator Author

@itsPronay itsPronay Sep 5, 2025

Choose a reason for hiding this comment

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

let me give you an example 😀, lets say user is browsing savings accounts list, which is already loaded.
if we use collect - By chance, even for a second if the user loses internet, the screen will disappear depending on your usage :) which is not a good experience...

thats why it is preferable that we only show errorScreen if it fails to fetch at starting (using first() ) , otherwise we can just show a snackbar, which we are already doing

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. understood. I will update composables I am working on as well.

menuList: List<Actions>,
onActionClicked: (Actions) -> Unit,
) {
MifosActionsListingComponentOutline {
Copy link
Contributor

@TheKalpeshPawar TheKalpeshPawar Sep 5, 2025

Choose a reason for hiding this comment

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

Moves this MifosActionsListingComponentOutline inside the column and don't put action button inside this,
In figma design when you expand the card, the outline doesn't apply to the drop down box.

see the rest of the components.
I forgot to modify this one. I made changes to rest of them.

If another is left, update it.

Copy link
Contributor

Choose a reason for hiding this comment

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

while you are at it. use a better animation to update the corner radius, I have just put a spring() animation spec.

Comment on lines 131 to 134
.padding(6.dp),
text = org.jetbrains.compose.resources.stringResource(Res.string.client_upcoming_charges_no_more_charges_available),
style = MaterialTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
Copy link
Contributor

Choose a reason for hiding this comment

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

You could fix this import issue.

@therajanmaurya therajanmaurya merged commit f6932ab into openMF:development Sep 5, 2025
2 checks passed
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.

4 participants