Implemented a Export Dialog Box in Transaction Screen#2607
Implemented a Export Dialog Box in Transaction Screen#2607gurnoorpannu wants to merge 3 commits intoopenMF:developmentfrom
Conversation
📝 WalkthroughWalkthroughThis PR introduces a loan transaction export feature by adding UI strings for export/reporting functionality, a new ExportTransactionsDialog composable with date range selection and validation, and integrating the export dialog into the LoanTransactionsScreen with a new toolbar export button. Changes
Sequence DiagramsequenceDiagram
actor User
participant LoanTransactionsScreen as LoanTransactionsScreen
participant ExportTransactionsDialog as ExportTransactionsDialog
participant DatePicker as DatePicker Component
User->>LoanTransactionsScreen: Tap export button
LoanTransactionsScreen->>LoanTransactionsScreen: Set showExportDialog = true
LoanTransactionsScreen->>ExportTransactionsDialog: Show dialog
User->>ExportTransactionsDialog: Select from date
ExportTransactionsDialog->>DatePicker: Open from-date picker
DatePicker->>ExportTransactionsDialog: Return selected date
ExportTransactionsDialog->>ExportTransactionsDialog: Update fromDate state
User->>ExportTransactionsDialog: Select to date
ExportTransactionsDialog->>DatePicker: Open to-date picker
DatePicker->>ExportTransactionsDialog: Return selected date
ExportTransactionsDialog->>ExportTransactionsDialog: Update toDate state & validate range
alt Valid date range
User->>ExportTransactionsDialog: Tap generate report
ExportTransactionsDialog->>LoanTransactionsScreen: onGenerateReport(fromDate, toDate)
LoanTransactionsScreen->>ExportTransactionsDialog: Dismiss dialog
else Invalid date range
ExportTransactionsDialog->>ExportTransactionsDialog: Show error message
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I think the the close(x) button should be black with transparent background. |
|
| private fun formatDateFromMillis(millis: Long?): String { | ||
| if (millis == null) return "" | ||
| val localDate = Instant.fromEpochMilliseconds(millis) | ||
| .toLocalDateTime(TimeZone.currentSystemDefault()) |
There was a problem hiding this comment.
there is a time zone mismatch with fun createSelectableDatesFrom(minDate: LocalDate) = object : SelectableDates I suggest using TimeZone.UTC for consistency
|
|
||
| <!-- Export Loan Transactions --> | ||
| <string name="feature_loan_export">Export</string> | ||
| <string name="feature_loan_export_transactions">Export</string> |
There was a problem hiding this comment.
why two different keys with same values ? you meant the second one to be Export Transactions did't you
| } | ||
|
|
||
| @OptIn(ExperimentalTime::class) | ||
| @Composable |
There was a problem hiding this comment.
I think this function should not be annotated with Composable it does not emit UI, call remember or other compose APIs or take compose parameter, marking it with compose it triggers unnecessary recomposition tracking overhead.
| var showToDatePicker by rememberSaveable { mutableStateOf(false) } | ||
| var fromDate: Long? by rememberSaveable { mutableStateOf(null) } | ||
| var toDate: Long? by rememberSaveable { mutableStateOf(null) } | ||
| var showInvalidDateRangeError by remember { mutableStateOf(false) } |
There was a problem hiding this comment.
this will be lost on config change, should not it be rememberSaveable also ?



Fixes - Jira-#657
Before:-

After:-
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.
Summary by CodeRabbit