Skip to content
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

Factor out job cards into Composables for new data entry points #2892

Merged
merged 32 commits into from
Feb 5, 2025

Conversation

sufyanAbbasi
Copy link
Contributor

@sufyanAbbasi sufyanAbbasi commented Dec 2, 2024

Fixes #2446

Reimplements the entire add LOI/selection UX to match the new designs (see above issue).

  • Removes the old RecycleView and Cards UI and rebuilds them using Composables instead.
  • Handles multiple ad-hoc jobs by showing each job in a modal and does not show the modal if there is only one ad-hoc job.
  • Also does not show the "+" button or the "add data" button when the user is viewer only.
  • TODO: Get translations for add_data and add_site.
Screenshot 2024-12-19 at 1 24 37 AM Screenshot 2024-12-19 at 1 24 52 AM Screenshot 2024-12-19 at 1 25 11 AM Screenshot 2024-12-19 at 1 33 33 AM

@gino-m PTAL?

@sufyanAbbasi sufyanAbbasi requested a review from gino-m December 2, 2024 20:51
@gino-m gino-m changed the title [Draft - Needs Styling] Implements new, simplified LOI flow [Draft - Needs Styling] Introduce new data collection entry points Dec 4, 2024
Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

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

Hey @sufyanAbbasi so cool to see this is working! A few suggestions/tweaks. Once we do those, I think we can submit as is without too much UI churn for now. @rawbzz Is still finalizing the latest designs, but what you have here takes us much closer.

# Conflicts:
#	ground/src/main/java/com/google/android/ground/ui/home/mapcontainer/HomeScreenMapContainerFragment.kt
@sufyanAbbasi sufyanAbbasi changed the title [Draft - Needs Styling] Introduce new data collection entry points Factor our job cards into Composables for new data entry points Dec 19, 2024
@sufyanAbbasi sufyanAbbasi marked this pull request as ready for review December 19, 2024 09:47
@auto-assign auto-assign bot requested a review from gino-m December 19, 2024 09:47
@sufyanAbbasi sufyanAbbasi changed the title Factor our job cards into Composables for new data entry points Factor out job cards into Composables for new data entry points Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 20.37736% with 211 lines in your changes missing coverage. Please review.

Project coverage is 62.99%. Comparing base (9d951fa) to head (3fdab5b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...und/ui/home/mapcontainer/jobs/JobMapComposables.kt 16.81% 172 Missing and 11 partials ⚠️
...ome/mapcontainer/HomeScreenMapContainerFragment.kt 25.92% 14 Missing and 6 partials ⚠️
...me/mapcontainer/HomeScreenMapContainerViewModel.kt 50.00% 3 Missing and 4 partials ⚠️
.../java/com/google/android/ground/util/ComposeExt.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2892      +/-   ##
============================================
- Coverage     64.20%   62.99%   -1.22%     
- Complexity     1276     1289      +13     
============================================
  Files           272      273       +1     
  Lines          6532     6731     +199     
  Branches        909      935      +26     
============================================
+ Hits           4194     4240      +46     
- Misses         1737     1872     +135     
- Partials        601      619      +18     
Files with missing lines Coverage Δ
.../mapcontainer/jobs/DataCollectionEntryPointData.kt 100.00% <100.00%> (ø)
...n/java/com/google/android/ground/ui/theme/Color.kt 100.00% <100.00%> (ø)
.../java/com/google/android/ground/util/ComposeExt.kt 33.33% <0.00%> (-4.17%) ⬇️
...me/mapcontainer/HomeScreenMapContainerViewModel.kt 51.94% <50.00%> (+6.11%) ⬆️
...ome/mapcontainer/HomeScreenMapContainerFragment.kt 17.39% <25.92%> (-0.19%) ⬇️
...und/ui/home/mapcontainer/jobs/JobMapComposables.kt 16.81% <16.81%> (ø)

... and 2 files with indirect coverage changes

gino-m
gino-m previously requested changes Dec 19, 2024
Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

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

Great work, @sufyanAbbasi 🥳 A few nits, otherwise LGTM!

sufyanAbbasi and others added 11 commits December 19, 2024 12:03
Added "add_site" and two more strings (untranslated)
Added "add_site" and two more strings (untranslated)
Remaining translations added ("unnamed_job" and "job_site_icon").
Remaining translations added ("unnamed_job" and "job_site_icon").
Remaining translations added ("unnamed_job" and "job_site_icon").
@gino-m
Copy link
Collaborator

gino-m commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 20.43796% with 218 lines in your changes missing coverage. Please review.

Project coverage is 61.23%. Comparing base (543795e) to head (55393d8).

Files with missing lines Patch % Lines
.../ground/ui/home/mapcontainer/jobs/JobMapAdapter.kt 20.58% 176 Missing and 13 partials ⚠️
...ome/mapcontainer/HomeScreenMapContainerFragment.kt 26.31% 9 Missing and 5 partials ⚠️
...me/mapcontainer/HomeScreenMapContainerViewModel.kt 7.14% 13 Missing ⚠️
...roid/ground/ui/home/mapcontainer/jobs/MapUiData.kt 0.00% 2 Missing ⚠️
Additional details and impacted files

Would you be able to add tests for modified lines? We can focus on the ones reported here by codecov if it helps.

@gino-m
Copy link
Collaborator

gino-m commented Jan 26, 2025

@sufyanAbbasi RFAL?

@sufyanAbbasi
Copy link
Contributor Author

Sorry I had to take a little time to merge in the ground --> app file change and added a test file to cover the core view model logic. I think we're good to go!

@gino-m
Copy link
Collaborator

gino-m commented Jan 27, 2025

Hi @shobhitagarwal1612! PTAL?

# Conflicts:
#	app/src/main/res/values-pt/strings.xml
# Conflicts:
#	app/src/main/java/com/google/android/ground/ui/home/mapcontainer/HomeScreenMapContainerFragment.kt
@sufyanAbbasi sufyanAbbasi dismissed gino-m’s stale review February 5, 2025 15:58

Already LGTMed!

@sufyanAbbasi sufyanAbbasi merged commit 06f4dd1 into master Feb 5, 2025
5 checks passed
@sufyanAbbasi sufyanAbbasi deleted the sufy/2446/new-loi-flow branch February 5, 2025 15:58
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.

[Data collection] Simplify data collection entry point
4 participants