-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Calendar Optimization and IcalRepository Integration #41
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…y in MainActivity
…pository pattern, and add ViewModel factory
…I components and code structure
- Implement tests for handling multi-day non-recurring events. - Add tests for events without an end date. - Ensure events outside the date range are ignored. - Test recurring events with multiple instances. - Include tests for empty calendar data. - Validate the application handles malformed iCal data without crashing.
- Added tests for Calendar navigation buttons (previous/next month) - Added tests for event search dialog functionality (open, search, cancel) - Improved event item display test with correct title and date verification - Optimized test structure and removed redundant logic
…oud warning Improved handling of side effects by replacing let with also.
- Added exception handling in fetchICalData() for IOException and general exceptions. - Ensures proper logging and stable app state in case of network or other fetch-related failures. - Prevents app crashes due to network issues or unexpected errors during iCal data fetching.
- Added tests to ensure IOException and general exceptions are handled correctly in fetchICalData(). - Validated that CalendarViewModel state remains stable and empty in case of network failures or parsing errors. - Increased test coverage for edge cases in exception handling.
…stability and better SonarCloud coverage.
- Added tests to verify proper handling of IOException, ParserException, and general exceptions. - Ensured parseICalData catches errors correctly and sets icalEvents to an empty list. - Improved overall test coverage for CalendarViewModel error scenarios.
# Conflicts: # app/build.gradle.kts
Quality Gate failedFailed conditions |
Kenzoud
approved these changes
Oct 17, 2024
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.
The code is well-structured and reflects the TA's recommended changes from the last review. Everything looks good from my side.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements various optimizations and new features for the calendar functionality in the application. The key changes are as follows:
IcalRepository Integration: Introduced
IcalRepository
interface and implementedHttpIcalRepository
andMockIcalRepository
classes to handle calendar data fetching. This allows for better testing and flexibility in data retrieval methods.CalendarViewModel Refactor: Updated
CalendarViewModel
to use the repository pattern for fetching iCal data. This includes:OkHttpClient
within the ViewModel withIcalRepository
.ViewModelProvider.Factory
for easier instantiation.mutableStateListOf<VEvent>()
toMutableStateFlow<List<VEvent>>
. This ensures proper handling of state updates and aligns with the best practices for managing UI state in Jetpack Compose.CalendarViewModel Tests: Added comprehensive unit tests for
CalendarViewModel
to cover:Improved Testing: Added unit tests for
CalendarScreen
and ensured mock data is used viaMockIcalRepository
. Refactored test cases to accommodate the repository changes and ensure proper test coverage.UI Enhancements:
CalendarScreen
layout to enhance user experience.Bug Fixes: Addressed several issues related to event parsing, including proper handling of recurring and non-recurring events.