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

Enhance Image and ActionableButton Widget to add ability to copy text #3040

Merged
merged 25 commits into from
Feb 22, 2024

Conversation

SebaMutuku
Copy link
Contributor

@SebaMutuku SebaMutuku commented Feb 6, 2024

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

Fixes #3033

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

Sample config for this

   {
          "viewType": "CARD",
          "padding": 16,
          "visible": "true",
          "header": {
            "viewType": "COMPOUND_TEXT",
            "primaryText": "THINKMD TASKS",
            "primaryTextColor": "#6F7274",
            "fontSize": 18.0,
            "padding": 16
          },
          "content": [
            {
              "viewType": "BUTTON",
              "smallSized": "true",
              "text": "Share ThinkMD Self Assessment link",
              "status": "DUE",
              "visible": "true",
              "enabled": "@{patientActive}",
              "startIcon": {
                "type": "local",
                "reference": "ic_copy",
                "color": "#0000FF"
              },
              "actions": [
                {
                  "trigger": "ON_CLICK",
                  "workflow": "COPY_TEXT",
                  "params": [
                    {
                      "paramType": "PARAMDATA",
                      "key": "copyText",
                      "value": "https://jakarta-thinkmd-v4-app-2hqzu73qzq-et.a.run.app/#/start/@{patientId}"
                    }
                  ]
                }
              ]
            }
          ]
        },

@SebaMutuku SebaMutuku added the DNM DO NOT MERGE label Feb 6, 2024
Copy link
Collaborator

@ellykits ellykits left a comment

Choose a reason for hiding this comment

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

👍 LGTM. Just a simple comment on the test case.

Comment on lines 107 to 111
composeRule
.onNodeWithText("Copy Button Text", useUnmergedTree = true)
.assertExists()
.assertIsDisplayed()
.performClick()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be a verification done for this perform click action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will update the test to test on click function instead

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 142 lines in your changes are missing coverage. Please review.

Comparison is base (ad3a737) 64.5% compared to head (eb48629) 29.8%.
Report is 179 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main   #3040      +/-   ##
==========================================
- Coverage     64.5%   29.8%   -34.8%     
+ Complexity    1075     652     -423     
==========================================
  Files          218     236      +18     
  Lines         9635   11088    +1453     
  Branches      1897    1935      +38     
==========================================
- Hits          6218    3307    -2911     
- Misses        2234    7350    +5116     
+ Partials      1183     431     -752     
Flag Coverage Δ
engine 66.1% <71.4%> (-6.6%) ⬇️
geowidget 47.2% <ø> (-17.1%) ⬇️
quest 5.2% <0.0%> (-53.7%) ⬇️

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

Files Coverage Δ
...core/engine/configuration/ConfigurationRegistry.kt 68.0% <100.0%> (-9.2%) ⬇️
...egister/fhircore/quest/ui/main/AppMainViewModel.kt 4.4% <ø> (-65.2%) ⬇️
...ter/fhircore/quest/ui/register/RegisterFragment.kt 5.6% <ø> (-41.2%) ⬇️
...rcore/engine/configuration/view/ImageProperties.kt 81.8% <80.0%> (+47.2%) ⬆️
...gine/configuration/workflow/ApplicationWorkflow.kt 0.0% <0.0%> (-100.0%) ⬇️
...ter/fhircore/quest/ui/main/components/AppDrawer.kt 0.0% <0.0%> (-68.7%) ⬇️
...egister/fhircore/quest/ui/profile/ProfileScreen.kt 0.0% <0.0%> (-50.3%) ⬇️
...fhircore/quest/ui/shared/components/ExtendedFab.kt 0.0% <0.0%> (-51.4%) ⬇️
...fhircore/quest/ui/shared/components/ServiceCard.kt 0.0% <0.0%> (-65.6%) ⬇️
...ore/quest/ui/shared/components/ActionableButton.kt 0.0% <0.0%> (-83.4%) ⬇️
... and 4 more

... and 113 files with indirect coverage changes

@SebaMutuku SebaMutuku removed the DNM DO NOT MERGE label Feb 7, 2024
@SebaMutuku SebaMutuku changed the title Enhance Actionable Button to add ability to copy text Enhance Image WIdget to add ability to copy text Feb 8, 2024
@SebaMutuku
Copy link
Contributor Author

SebaMutuku commented Feb 8, 2024

@MargaretNjenga @f-odhiambo , adding the link to be copied as text might jump to 3 lines or more and would not have a better UI/UX. However, we can add a text description instead and then a copy icon
Here's a sample copy link option
image

Then a toast shows when one clicks on the icon, below message appears
image

Kindly advise if there's anything needed to change as I fix failing tests

@f-odhiambo
Copy link
Contributor

@SebaMutuku Can we add the 'Tap icon ...' text as normal text and not make it look like a hyperlink? Rest of the stuff LGTM

@SebaMutuku
Copy link
Contributor Author

SebaMutuku commented Feb 9, 2024

@f-odhiambo This has been updated
image

@f-odhiambo
Copy link
Contributor

f-odhiambo commented Feb 9, 2024

@SebaMutuku Let's make the other text grey

@SebaMutuku
Copy link
Contributor Author

@f-odhiambo this is configurable. I only used that color for visibility

@pld pld changed the title Enhance Image WIdget to add ability to copy text Enhance Image Widget to add ability to copy text Feb 12, 2024
@pld pld added the Blocked Item is blocked by another prerequisite label Feb 12, 2024
@pld
Copy link
Member

pld commented Feb 12, 2024

@f-odhiambo @SebaMutuku I have marked this as blocked, it needs design review, fine to continue on functional requirements but it is not efficient to work on the design until @rowo and @HenryRae have reviewed, thank you

@HenryRae
Copy link

HenryRae commented Feb 13, 2024

@SebaMutuku @MargaretNjenga what are we trying to archive here with the copy link on the profile?

What does this mean to getting consent from users first about sharing link?

@HenryRae
Copy link

HenryRae commented Feb 13, 2024

Here's a link to the proposed design.

image
cc: @SebaMutuku @MargaretNjenga @f-odhiambo

@SebaMutuku
Copy link
Contributor Author

@HenryRae this has been effected.
cc @f-odhiambo @pld @MargaretNjenga

image

@SebaMutuku SebaMutuku removed the Blocked Item is blocked by another prerequisite label Feb 13, 2024
@SebaMutuku SebaMutuku changed the title Enhance Image Widget to add ability to copy text Enhance Image and ActionableButton Widget to add ability to copy text Feb 13, 2024
Copy link
Member

@pld pld left a comment

Choose a reason for hiding this comment

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

looks good! @SebaMutuku can you update the docs to show how to add this copy text link to an app?

@SebaMutuku
Copy link
Contributor Author

@pld updated.

pld
pld previously approved these changes Feb 15, 2024
ellykits
ellykits previously approved these changes Feb 19, 2024
Copy link
Collaborator

@ellykits ellykits left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ellykits
Copy link
Collaborator

Address the CI issues @SebaMutuku so we can merge this.

@SebaMutuku SebaMutuku dismissed stale reviews from ellykits and pld via 1658100 February 20, 2024 09:36
@ellykits ellykits merged commit 0b03f5b into main Feb 22, 2024
3 of 5 checks passed
@ellykits ellykits deleted the fix_issue_3033_add_copy_text_widget branch February 22, 2024 07:57
AbdulWahabMemon added a commit that referenced this pull request Feb 23, 2024
* main:
  add docs on tagging (#3089)
  Constrain isAAB option to Boolean type (#3093)
  Create manual-apk-release.yml (#3003)
  Fix setting related entity location on Group member and related resources (#3092)
  Enhance Image and ActionableButton Widget to add ability to copy text (#3040)
  Add Related entity location tag on newly created resources via configs (#3086)
  Spotless clean
  Fixes config resources flagged for upsync 🐛
  Clean up
AbdulWahabMemon added a commit that referenced this pull request Feb 23, 2024
* main:
  add docs on tagging (#3089)
  Constrain isAAB option to Boolean type (#3093)
  Create manual-apk-release.yml (#3003)
  Fix setting related entity location on Group member and related resources (#3092)
  Enhance Image and ActionableButton Widget to add ability to copy text (#3040)
  Add Related entity location tag on newly created resources via configs (#3086)
  Spotless clean
  Fixes config resources flagged for upsync 🐛
  Clean up
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.

[Feature] Add copy text widget
5 participants