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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

dubdabasoduba
Copy link
Member

@dubdabasoduba dubdabasoduba commented Sep 23, 2024

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

Fixes #3517
Fixes #3518

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

- Updating the behaviour after clearing search bar on the maps
@dubdabasoduba dubdabasoduba self-assigned this Sep 23, 2024
@dubdabasoduba dubdabasoduba added the Bug-fix PR label for bug fix on release notes label Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 27.2%. Comparing base (83bb186) to head (7d561d5).

Files with missing lines Patch % Lines
...er/fhircore/engine/data/local/DefaultRepository.kt 0.0% 10 Missing ⚠️
...rcore/quest/ui/main/components/TopScreenSection.kt 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3516     +/-   ##
=========================================
- Coverage     27.2%   27.2%   -0.1%     
  Complexity     756     756             
=========================================
  Files          278     278             
  Lines        14219   14220      +1     
  Branches      2581    2582      +1     
=========================================
  Hits          3880    3880             
- Misses        9801    9802      +1     
  Partials       538     538             
Flag Coverage Δ
engine 63.7% <0.0%> (-0.1%) ⬇️
geowidget 15.4% <ø> (ø)
quest 5.6% <0.0%> (+<0.1%) ⬆️

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

Files with missing lines Coverage Δ
...rcore/quest/ui/main/components/TopScreenSection.kt 0.0% <0.0%> (ø)
...er/fhircore/engine/data/local/DefaultRepository.kt 59.4% <0.0%> (-0.3%) ⬇️

@ndegwamartin
Copy link
Contributor

@dubdabasoduba do we need a unit test for this?

onClick = {
onSearchTextChanged(SearchQuery.emptyText, performSearchOnValueChanged)
},
onClick = { onSearchTextChanged(SearchQuery.emptyText, true) },
Copy link
Contributor

@ndegwamartin ndegwamartin Sep 30, 2024

Choose a reason for hiding this comment

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

Might it be better to fix it by passing the value true from the line here?

Or even consider removing it entirely since the value true is the default.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ndegwamartin We want to automatically disable search on text change for the map but enable it for the registers. This disables it for the map.

We however want to refresh the map view every time we clear data for both the register and map views hence the true. If we use performSearchOnValueChanged this is updated to false on the link you shared earlier.

)
val maxSublistIndex = min(toIndex, searchResults.size)

if (fromIndex < maxSublistIndex) {
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 add an edge case unit test for when we only have one item in the searchResults (if there's none already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-fix PR label for bug fix on release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite scroll error at the bottom of the screen Refresh map after clearing search text
3 participants