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

Map search bug fixes #3516

Merged
merged 22 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c54d8ba
- Updating the infinite scroll paging
dubdabasoduba Sep 23, 2024
37a5ec8
- spotless apply
dubdabasoduba Sep 23, 2024
0016007
- Fix breaking tests on geo widget module
dubdabasoduba Sep 24, 2024
6d8477a
- Fix tests
dubdabasoduba Sep 25, 2024
552be3f
- Run spotless
dubdabasoduba Sep 25, 2024
6b034e8
Merge branch 'main' into feature/fix_infinite_scroll_page
dubdabasoduba Sep 25, 2024
cb48a2d
- Import `LazyPagingItems`
dubdabasoduba Sep 25, 2024
2042bc1
Merge branch 'main' of github.com:opensrp/fhircore into feature/fix_i…
dubdabasoduba Sep 28, 2024
3db24ca
Merge branch 'main' into feature/fix_infinite_scroll_page
dubdabasoduba Sep 30, 2024
7aac63f
Merge branch 'main' into feature/fix_infinite_scroll_page
dubdabasoduba Sep 30, 2024
7d561d5
Merge branch 'main' into feature/fix_infinite_scroll_page
dubdabasoduba Oct 1, 2024
d45e555
- Adding tests
dubdabasoduba Oct 2, 2024
23c2a62
Merge branch 'main' of github.com:opensrp/fhircore into feature/fix_i…
dubdabasoduba Oct 7, 2024
2150606
Merge branch 'feature/fix_infinite_scroll_page' of github.com:opensrp…
dubdabasoduba Oct 7, 2024
cfcf8cb
Merge branch 'main' of github.com:opensrp/fhircore into feature/fix_i…
dubdabasoduba Oct 9, 2024
eb77da0
Merge branch 'main' into feature/fix_infinite_scroll_page
Lentumunai-Mark Oct 14, 2024
53939d1
- Update the APK naming
dubdabasoduba Oct 14, 2024
d75f98e
Merge branch 'feature/fix_infinite_scroll_page' of github.com:opensrp…
dubdabasoduba Oct 14, 2024
6a803db
Ignore test to be refactored later
ellykits Oct 14, 2024
8eb4415
Merge branch 'feature/fix_infinite_scroll_page' of github.com:opensrp…
ellykits Oct 14, 2024
9c9533a
- Run spotless
dubdabasoduba Oct 14, 2024
41fecd7
Update kujaku version.
Lentumunai-Mark Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into feature/fix_infinite_scroll_page
dubdabasoduba authored Sep 25, 2024
commit 6b034e8f44d78ee81d2182dc16412d8a8f43e5f9
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ import com.google.android.fhir.sync.CurrentSyncJobStatus
import com.google.android.fhir.sync.SyncJobStatus
import com.google.android.fhir.sync.SyncOperation
import dagger.hilt.android.testing.HiltAndroidTest
import io.mockk.every
import io.mockk.mockk
import java.time.OffsetDateTime
import kotlinx.coroutines.flow.flowOf
import org.hl7.fhir.r4.model.ResourceType
@@ -261,11 +263,17 @@ class RegisterScreenTest {
)
val searchText = mutableStateOf(SearchQuery.emptyText)
val currentPage = mutableStateOf(0)
val pagingItems = mockk<LazyPagingItems<ResourceData>>().apply {}
val combinedLoadState: CombinedLoadStates = mockk()
val loadState: LoadState = mockk()

composeTestRule.setContent {
val data = listOf(ResourceData("1", ResourceType.Patient, emptyMap()))
val pagingItems = flowOf(PagingData.from(data)).collectAsLazyPagingItems()
every { pagingItems.itemCount } returns 0
every { combinedLoadState.refresh } returns loadState
every { combinedLoadState.append } returns loadState
every { loadState.endOfPaginationReached } returns true
every { pagingItems.loadState } returns combinedLoadState

composeTestRule.setContent {
RegisterScreen(
modifier = Modifier,
openDrawer = {},

Unchanged files with check annotations Beta

if (currentPage != null && pageSize != null) {
val fromIndex = currentPage * pageSize
val toIndex = (currentPage + 1) * pageSize
val maxSublistIndex = min(toIndex, searchResults.size)

Check warning on line 1073 in android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt

Codecov / codecov/patch

android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt#L1073

Added line #L1073 was not covered by tests
if (fromIndex < maxSublistIndex) {
with(searchResults.subList(fromIndex, maxSublistIndex)) {
mapResourceToRepositoryResourceData(
relatedResourcesConfig = relatedResourcesConfig,
configComputedRuleValues = configComputedRuleValues,
secondaryResourceConfigs = secondaryResourceConfigs,
filterActiveResources = filterActiveResources,
baseResourceConfig = baseResourceConfig,

Check warning on line 1082 in android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt

Codecov / codecov/patch

android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt#L1076-L1082

Added lines #L1076 - L1082 were not covered by tests
)
}
} else {
emptyList()

Check warning on line 1086 in android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt

Codecov / codecov/patch

android/engine/src/main/java/org/smartregister/fhircore/engine/data/local/DefaultRepository.kt#L1086

Added line #L1086 was not covered by tests
}
} else {
searchResults.mapResourceToRepositoryResourceData(
when {
!searchQuery.isBlank() -> {
IconButton(
onClick = { onSearchTextChanged(SearchQuery.emptyText, true) },

Check warning on line 240 in android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt

Codecov / codecov/patch

android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt#L240

Added line #L240 was not covered by tests
modifier = modifier.testTag(TRAILING_ICON_BUTTON_TEST_TAG),
) {
Icon(
You are viewing a condensed version of this merge commit. You can view the full changes here.