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

Add Geowidget module #1548

Merged
merged 34 commits into from
Sep 7, 2022
Merged

Add Geowidget module #1548

merged 34 commits into from
Sep 7, 2022

Conversation

ekigamba
Copy link
Contributor

@ekigamba ekigamba commented Aug 17, 2022

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #1558

  • Integrate into Quest
  • Add Geowidget debug build variant that enables running quest with Geowidget
  • Implement displaying families with locations on Quest
  • Implement family registration with location from geo-widget

Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIR Core app to verify my change fixes the issue and/or does not break the app

To-do

  • Remove testFeatureGeneration in P2PReceiverTransferDaoTest
  • Re-enable removed sync configs in quest/src/main/assets/configs/app/sync_config.json
  • Update the AppMainActivity#launchFamilyProfile with navigation to the family profile

Notes

  • BLOCKED by configurable family profile work
  • Use app\debug as the app-id to use the local default configurations with Location syncing enabled

- Integrate into Quest
- Add Geowidget debug build variant that enables running quest with Geowidget
- Implement displaying families with locations on Quest
- Implement family registration with location from geowidget
- Turf is used for measurements and calculations but a runtime dependency on Mapbox SDK
- Remove hardcoded Geowidget menu
- Remove geowidget module from FHIR Core engine
- Move kujaku dependency to deps.gradle file
- Update naming in fhircore_style.json
- Add GEOWIDGET_ENABLED BuildConfig to disable the maps menu
- Fix maps English translation for configurable menu
- Code cleanup
- Add family-id to feature JSON
- Cleanup code in GeowidgetActivity
- Comment out hardcoded questionnaire and structure-map
- Enable parsing feature from the Location Boundary GeoJSON extension
- Refactor code in GeowidgetActivity
- Code reformat
- Move strings to strings.xml
- Add jacoco report generation to the Geowidget module
- Add licenses to the Geowidget module files
- Fix wildcard imports in Geowidget tests
@ekigamba ekigamba force-pushed the integrate-kujaku branch 2 times, most recently from 5e36d4f to d4baa92 Compare August 21, 2022 09:57
@codecov
Copy link

codecov bot commented Aug 21, 2022

Codecov Report

Merging #1548 (da25ddd) into main (98f2c5e) will decrease coverage by 1.59%.
The diff coverage is 31.03%.

@@             Coverage Diff              @@
##               main    #1548      +/-   ##
============================================
- Coverage     52.29%   50.69%   -1.60%     
- Complexity      661      666       +5     
============================================
  Files           196      205       +9     
  Lines          6959     7196     +237     
  Branches       1250     1363     +113     
============================================
+ Hits           3639     3648       +9     
- Misses         2709     2882     +173     
- Partials        611      666      +55     
Flag Coverage Δ
engine 63.98% <23.07%> (-0.81%) ⬇️
geowidget 40.09% <40.09%> (?)
quest 32.69% <22.66%> (-2.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gister/fhircore/engine/configuration/ConfigType.kt 70.00% <0.00%> (-7.78%) ⬇️
...ter/fhircore/engine/configuration/Configuration.kt 25.00% <ø> (ø)
...fhircore/engine/configuration/app/ConfigService.kt 80.85% <ø> (-3.94%) ⬇️
.../configuration/geowidget/GeoWidgetConfiguration.kt 0.00% <0.00%> (ø)
...rcore/engine/ui/usersetting/UserSettingFragment.kt 0.00% <0.00%> (ø)
...hircore/engine/ui/usersetting/UserSettingScreen.kt 0.00% <0.00%> (ø)
...core/engine/ui/usersetting/UserSettingViewModel.kt 90.47% <ø> (ø)
...hircore/engine/util/extension/AndroidExtensions.kt 40.25% <0.00%> (-2.21%) ⬇️
...egister/fhircore/geowidget/model/GeoWidgetEvent.kt 0.00% <0.00%> (ø)
...egister/fhircore/quest/navigation/NavigationArg.kt 0.00% <ø> (-50.00%) ⬇️
... and 64 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ekigamba ekigamba marked this pull request as ready for review August 22, 2022 14:08
ekigamba and others added 5 commits August 22, 2022 20:44
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Refactor the implementation for navigating to maps UI to use the
Navigation configs. Also fix sync location by organization.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Introduce GeoWidgetConfiguration which will be used to configure the
map.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
ellykits and others added 9 commits September 1, 2022 10:49
In order to honor the single Activtivity architecture, the GeoWidgetActivity
has been converted to a Fragment and all the composable screens are now wrapped
in a Fragment. Using a Fragment allows for a more hybrid approach that will
also take care of other custom views that are still using XML layout at the
same time be able to render composable views.

Instead of using Composable (MainScreen) as the NavigationHost, we now use the
AppMainActivity as the Host, with NavHostFragment as the container for the
fragments.

UserProfileScreen has also been renamed to UserSettingScreen and it is now rendered
in the UserSettingFragment.

The application side menu (drawer navigation) has been moved to RegisterFragement setContent
method. It makes sense to be able to access the drawer via the registers. MainScreen is therefore
no longer needed so it has been deleted.

GeoWidgetViewModel is now instantiated in the GeoWidgetFragement with the activityViewModels
extension function. This is to allow the activity to access the geoWidgetEventLiveData to
react to the events created via the GeoWidgetFragment.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Indicate tests that are passing, skipped or failed

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
@ndegwamartin
Copy link
Contributor

@ellykits before merge please create an issue to track the drop in code coverage

@f-odhiambo f-odhiambo self-requested a review September 7, 2022 12:04
@ellykits ellykits merged commit 0ffd664 into main Sep 7, 2022
@ellykits ellykits deleted the integrate-kujaku branch September 7, 2022 12:28
qiarie pushed a commit that referenced this pull request Jan 15, 2025
* Add Geowidget module

- Integrate into Quest
- Add Geowidget debug build variant that enables running quest with Geowidget
- Implement displaying families with locations on Quest
- Implement family registration with location from geowidget

* Zoom to registered families & remove register family btn

* Fix Kujaku version and add turf dependency

- Turf is used for measurements and calculations but a runtime dependency on Mapbox SDK

* Connect maps menu to Geowidget

- Remove hardcoded Geowidget menu
- Remove geowidget module from FHIR Core engine
- Move kujaku dependency to deps.gradle file
- Update naming in fhircore_style.json
- Add GEOWIDGET_ENABLED BuildConfig to disable the maps menu
- Fix maps English translation for configurable menu
- Code cleanup

* Disable  maps menu when geowidgetEnabled config is false

* Update eCBIS geowidget questionnaire to work with non-geowidget versions

* Add empty action when family is clicked

- Add family-id to feature JSON
- Cleanup code in GeowidgetActivity
- Comment out hardcoded questionnaire and structure-map

* Enable syncing of Locations in quest

* Enable saving new points into Location boundary extension

- Enable parsing feature from the Location Boundary GeoJSON extension
- Refactor code in GeowidgetActivity
- Code reformat
- Move strings to strings.xml

* Add Geowidget module tests & spotless checks to CI

- Add jacoco report generation to the Geowidget module
- Add licenses to the Geowidget module files
- Fix wildcard imports in Geowidget tests

* Move data from AppMainActivity

* Add KujakuFhirCoreConverterTest

- Rename KujakuConversionInterface to KujakuFhirCoreConverter
- Code cleanup

* Add GeowidgetViewModel tests

* GeowidgetActivity tests

* Re-enable removed sync configs

* Fix quest sync config failing test

* Exclude META-INF/sun-jaxb.episode from packing in Geowidget module

- This fixes the build failure

* Exclude META-INF files causing build failure in geowidget

- Fix codacy reported issues

* Set application flavor for geowidget

Refactor the implementation for navigating to maps UI to use the
Navigation configs. Also fix sync location by organization.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Navigate to profile from geowidget

Introduce GeoWidgetConfiguration which will be used to configure the
map.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Refactor GeoWidgetActivity to a Fragement

In order to honor the single Activtivity architecture, the GeoWidgetActivity
has been converted to a Fragment and all the composable screens are now wrapped
in a Fragment. Using a Fragment allows for a more hybrid approach that will
also take care of other custom views that are still using XML layout at the
same time be able to render composable views.

Instead of using Composable (MainScreen) as the NavigationHost, we now use the
AppMainActivity as the Host, with NavHostFragment as the container for the
fragments.

UserProfileScreen has also been renamed to UserSettingScreen and it is now rendered
in the UserSettingFragment.

The application side menu (drawer navigation) has been moved to RegisterFragement setContent
method. It makes sense to be able to access the drawer via the registers. MainScreen is therefore
no longer needed so it has been deleted.

GeoWidgetViewModel is now instantiated in the GeoWidgetFragement with the activityViewModels
extension function. This is to allow the activity to access the geoWidgetEventLiveData to
react to the events created via the GeoWidgetFragment.

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Setup toolbar on map view

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Remove P2P menu for Geowidget NavMenu

* Delete irrelevant test

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix failing tests across modules

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix GeoWidgeViewModelTest

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Fix permissions request from GeoWidgetFragment

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

* Set test logs

Indicate tests that are passing, skipped or failed

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>

Signed-off-by: Elly Kitoto <junkmailstoelly@gmail.com>
Co-authored-by: Elly Kitoto <junkmailstoelly@gmail.com>
Co-authored-by: Francis Odhiambo Otieno <4540684+f-odhiambo@users.noreply.github.com>
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.

[Quest/Geo-Widget] - Add Geo-Widget module into FHIR Core
4 participants