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

Added filter icon and navigation on click #2744

Merged
merged 6 commits into from
Sep 18, 2023
Merged

Conversation

Aleem92
Copy link
Contributor

@Aleem92 Aleem92 commented Sep 11, 2023

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

Fixes #2760

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

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #2744 (d8adbb8) into main (ad3a737) will increase coverage by 0.9%.
Report is 49 commits behind head on main.
The diff coverage is 60.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2744     +/-   ##
=========================================
+ Coverage     64.5%   65.4%   +0.9%     
+ Complexity    1075    1051     -24     
=========================================
  Files          218     221      +3     
  Lines         9635    9838    +203     
  Branches      1897    1809     -88     
=========================================
+ Hits          6218    6441    +223     
- Misses        2234    2293     +59     
+ Partials      1183    1104     -79     
Flag Coverage Δ
engine 72.3% <69.4%> (-0.4%) ⬇️
geowidget 65.5% <33.3%> (+1.1%) ⬆️
quest 60.7% <55.7%> (+1.8%) ⬆️

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

Files Changed Coverage Δ
...ata/remote/fhir/resource/FhirResourceDataSource.kt 93.3% <0.0%> (+0.4%) ⬆️
...hircore/engine/domain/model/FhirResourceConfigs.kt 43.2% <0.0%> (-1.3%) ⬇️
...ster/fhircore/engine/p2p/dao/BaseP2PTransferDao.kt 86.6% <0.0%> (-3.8%) ⬇️
...martregister/fhircore/engine/sync/AppSyncWorker.kt 91.6% <0.0%> (-8.4%) ⬇️
...ter/fhircore/engine/sync/OpenSrpDownloadManager.kt 42.8% <0.0%> (ø)
...rtregister/fhircore/engine/sync/SyncBroadcaster.kt 30.4% <0.0%> (-2.9%) ⬇️
...rcore/engine/util/extension/BigDecimalExtension.kt 0.0% <0.0%> (ø)
...ore/engine/util/helper/TransformSupportServices.kt 80.0% <0.0%> (-2.8%) ⬇️
...ter/fhircore/quest/data/QuestXFhirQueryResolver.kt 0.0% <0.0%> (-100.0%) ⬇️
...register/fhircore/quest/event/ToolbarClickEvent.kt 0.0% <0.0%> (ø)
... and 53 more

... and 32 files with indirect coverage changes

Comment on lines 51 to 52
onTitleIconClick = {},
onFilterIconClick = {},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have one-click action with different event types?

Implement event wrapper

sealed class ToolbarClickEvent {
   object FilterData : ToolbarClickEvent()
   object Navigate: ToolbarClickEvent()
 }

Update function parameter

fun TopScreenSection(
  modifier: Modifier = Modifier,
  title: String,
  searchText: String,
  searchPlaceholder: String? = null,
  toolBarHomeNavigation: ToolBarHomeNavigation = ToolBarHomeNavigation.OPEN_DRAWER,
  onSearchTextChanged: (String) -> Unit,
  onClick: (ToolbarClickEvent) -> Unit,
) {

Invoke event

  IconButton(onClick = { onTitleIconClick (ToolbarClickEvent.Navigate) } )

Finally update the logic to switch between the different click events.

@pld pld requested a review from allan-on September 13, 2023 18:10
@pld
Copy link
Member

pld commented Sep 13, 2023

@allan-on as the author of the issue, can you please review a build of this against the expected output in the issue, thank you!

@pld pld merged commit 0e7a95e into main Sep 18, 2023
6 checks passed
@pld pld deleted the 2698_add_register_filtering branch September 18, 2023 15:13
@allan-on allan-on mentioned this pull request Sep 18, 2023
2 tasks
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.

Add Register filter UI and configs
4 participants