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

3126 refactor config registry #3249

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

AbdulWahabMemon
Copy link
Contributor

@AbdulWahabMemon AbdulWahabMemon commented May 10, 2024

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

Fixes #3126

Engineer 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 FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.2%. Comparing base (ac82739) to head (3bb9387).
Report is 52 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main   #3249      +/-   ##
==========================================
+ Coverage     29.6%   47.2%   +17.5%     
+ Complexity     658      10     -648     
==========================================
  Files          239       4     -235     
  Lines        11204     235   -10969     
  Branches      1948      31    -1917     
==========================================
- Hits          3323     111    -3212     
+ Misses        7447     116    -7331     
+ Partials       434       8     -426     
Flag Coverage Δ
engine ?
geowidget 47.2% <ø> (ø)
quest ?

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

see 234 files with indirect coverage changes

# Conflicts:
#	android/engine/src/main/java/org/smartregister/fhircore/engine/sync/SyncListenerManager.kt
#	android/engine/src/test/java/org/smartregister/fhircore/engine/sync/SyncBroadcasterTest.kt
#	android/engine/src/test/java/org/smartregister/fhircore/engine/sync/SyncListenerManagerTest.kt
@@ -830,4 +898,276 @@ constructor(
ResourceType.Parameters,
)
}

private suspend fun fetchCompositionConfig(coroutineScope: CoroutineScope) {
val compConfigFlow1 = Sync.oneTimeSync<CompositionSyncWorker>(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use full names for the variables e.g. compositionConfigFlow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

val compConfigFlow1 = Sync.oneTimeSync<CompositionSyncWorker>(context)
compConfigFlow1.handleCompositionSyncJobStatus(coroutineScope)
compConfigFlow1.collect { compConfigFlowJobStatus ->
when (compConfigFlowJobStatus) {
Copy link
Contributor

Choose a reason for hiding this comment

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

SAB(Same as above). compositionConfigFlowJobStatus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


resourceIds.forEach {
Timber.d("configSync composition Config adding resourceType - ${resourceType} and id= ${it}")
val compConfigParamPairsReq = mutableListOf<Pair<ResourceType, Map<String, String>>>()
Copy link
Contributor

Choose a reason for hiding this comment

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

SAB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


private suspend fun fetchCompositionManifestRequest(coroutineScope: CoroutineScope) {

val compositionManifestFlow4 = Sync.oneTimeSync<CompositionManifestSyncWorker>(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove the No. 4 suffix here since it is the only flow in this methods scope

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

}

private suspend fun fetchCompositionListRequest(coroutineScope: CoroutineScope) {
val compListFlow2 = Sync.oneTimeSync<CompositionListSyncWorker>(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

SAB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

}

private suspend fun fetchCompositionConfigRequest(coroutineScope: CoroutineScope) {
val compositionConfigFlow3 = Sync.oneTimeSync<CompositionConfigSyncWorker>(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

SAB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated



private suspend fun fetchCompListItemRequest(coroutineScope: CoroutineScope) {
val compListFlow2 = Sync.oneTimeSync<CompListItemSyncWorker>(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

SAB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@ellykits ellykits assigned ellykits and unassigned AbdulWahabMemon May 22, 2024
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.

Refactor app configurations sync to use download managers
3 participants