-
Notifications
You must be signed in to change notification settings - Fork 123
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
Simplify JobMapComposables further by pulling logic out of view layers #3045
Merged
shobhitagarwal1612
merged 13 commits into
master
from
ashobhit/map-composable-cleanup-new
Feb 12, 2025
Merged
Simplify JobMapComposables further by pulling logic out of view layers #3045
shobhitagarwal1612
merged 13 commits into
master
from
ashobhit/map-composable-cleanup-new
Feb 12, 2025
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
* Remove redundant setCollectDataListener function. * Move data collection logic to HomeScreenMapContainerFragment. * Pass the onCollectData callback directly to the composables. * Remove the collectDataListener variable. * Add canUserSubmitData check in onCollectData method in the fragment.
…nData` * Removed `canUserSubmitData` from `JobMapComposables.updateData` and `LoiJobSheet`. * Moved `canUserSubmitData` state management to `AdHocDataCollectionButtonData` * Updated `HomeScreenMapContainerFragment` to use `AdHocDataCollectionButtonData`'s flag to check data submission permission. * Updated `InitializeAddLoiButton` in `JobMapComposables` to check `canCollectData` in `AdHocDataCollectionButtonData` instead of using the old state. * Updated `LoiJobSheet` in `JobMapComposables` to use `loiData.canCollectData` for data submission permission.
* Remove `State` from `canUserSubmitDataState` parameter in `LoiJobSheet` composable. * Pass `canUserSubmitData` directly instead of `canUserSubmitDataState` to `LoiJobSheet` in `JobMapComposables` * Update usages of `canUserSubmitDataState` in ModalContents preview and tests.
* Refactored `InitializeJobCard` to accept an `onCollectClicked` callback instead of `onCollectData`. * Refactored `InitializeAddLoiButton` to accept an `onCollectData` callback. * Updated logic to start data collection for a single job directly when adding a location of interest (LOI). * Removed unused parameters in InitializeJobCard. * Remove redundant condition to show/hide the add loi button.
* Ensure that the new LOI button is not shown if no job can collect data.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3045 +/- ##
============================================
+ Coverage 62.73% 62.89% +0.16%
+ Complexity 1300 1298 -2
============================================
Files 278 278
Lines 6792 6768 -24
Branches 947 949 +2
============================================
- Hits 4261 4257 -4
+ Misses 1910 1890 -20
Partials 621 621
|
…p-new' into ashobhit/map-composable-cleanup-new
anandwana001
approved these changes
Feb 12, 2025
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.
This PR aims at improving code health by pulling more complexity out of the composables.
Verified for regressions by running the app locally.
@anandwana001 PTAL?