-
Notifications
You must be signed in to change notification settings - Fork 669
feature(clientAddress): Add client address create and read functionality #2493
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
Conversation
|
@sam-arth07 also upload a video what happens if address is disabled by admin. |
|
|
||
| LaunchedEffect(Unit) { | ||
| viewModel.loadClientAddress() | ||
| } |
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 think it can be moved to init{ } of viewmodel
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Actually this is intentional because when we navigate to client Address Lists after submitting the form, then we want to show the updated list of address and if this is moved to viewModel, then the list remains stale as both the screens are linked to the same viewModel so init won't rerun the loadClientAddress func. If there is is better way do share
| when (state.dialogState) { | ||
| is ClientAddressState.DialogState.Loading -> { | ||
| MifosCircularProgress() | ||
| } |
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.
we have a discussion regarding this with rajan sir and decided to not use Loading state inside dialog
follow how dialog , error managed here in this pr
#2491
and follow same here
| ) { | ||
| MifosBreadcrumbNavBar(navController) | ||
| if (state.dialogState == null) { | ||
| ClientAddressHeader( |
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.
here also instead of null do it differently as like above mentioned pr
|
|
||
| IconButton( | ||
| onClick = { | ||
| // ToDo: Implement Search Address Functionality |
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.
why can't we implement t in this pr 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.
| ) | ||
|
|
||
| Spacer(modifier = Modifier.height(12.dp)) | ||
|
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| } catch (e: Exception) { | ||
| mutableStateFlow.update { | ||
| it.copy( | ||
| dialogState = ClientAddressState.DialogState.Error( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| LaunchedEffect(Unit) { | ||
| viewModel.loadClientAddress() | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| init { | ||
| loadClientAddress() | ||
| loadAddressTemplate() |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Actually this is intentional because when we navigate to client Address Lists after submitting the form, then we want to show the updated list of address and if this is moved to viewModel, then the list remains stale as both the screens are linked to the same viewModel so init won't rerun the loadClientAddress func. If there is is better way do share |

Fixes - Jira-#576
Please Add Screenshots If there are any UI changes.
AddAddress.mp4
After Refactoring and minor changes:
updated.mp4
Please make sure these boxes are checked before submitting your pull request - thanks!
Run the static analysis check
./gradlew checkorci-prepush.shto make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.