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

(fix) O3-3781: Custom Widgets throwing error when rendering. #1967

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

usamaidrsk
Copy link
Member

@usamaidrsk usamaidrsk commented Aug 21, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Fix can not read from undefined Custom Widget.
A quick test, use this config, provided by Reagan on this slack thread

Screenshots

image

Related Issue

Other

https://openmrs.atlassian.net/browse/O3-3781

@vasharma05
Copy link
Member

@usamaidrsk, the PR titles should be specific to user case, instead of technical issue/ improvement.
For this PR, the correct PR title will be: (fix) O3-3781: Custom Widgets throwing error when rendering.

Then the description will state the technical issue.

@usamaidrsk usamaidrsk changed the title (fix) O3-3781: Fix can not read from undefined Custom Widget. (fix) O3-3781: Custom Widgets throwing error when rendering. Aug 21, 2024
Copy link
Member

@vasharma05 vasharma05 left a comment

Choose a reason for hiding this comment

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

@usamaidrsk , please add a screenshot, @kazlaw can you please provide the configuration for adding a custom widget?
Thanks!

@kazlaw
Copy link
Contributor

kazlaw commented Aug 22, 2024

@usamaidrsk , please add a screenshot, @kazlaw can you please provide the configuration for adding a custom widget? Thanks!

@vasharma05 , @usamaidrsk something like this

"extensionSlots": {
      "patient-chart-summary-dashboard-slot": {
        "add": [
          "obs-by-encounter-widget#consultation"
        ],
        "order": [
          "obs-by-encounter-widget#consultation"
        ],
        "configure": {
          "obs-by-encounter-widget#consultation": {
            "title": "Motif de consultation",
            "showGraphByDefault": true,
            "encounterTypes": [
              "f9fdbe63-12b4-479f-b8fd-dcbfde6aa944"
            ],
            "Display conditions": {
              "privileges": [
                "Add Users"
              ]
            },
            "data": [
              {
                "label": "Motif de consultation",
                "concept": "0a061333-1611-45b3-8096-f7c339b4fdfc",
                "color": "blue"
              },
              {
                "label": "Duration",
                "concept": "d178d5cf-52c3-4722-bb12-5861daa2815c",
                "color": "green"
              },
              {
                "label": "Time Units",
                "concept": "d6593e37-b7a8-482b-856f-6f6a8db25508",
                "color": "green"
              }
            ],
            "table": {
              "pageSize": 6
            }
          }
        }
      }
    },

@usamaidrsk usamaidrsk requested a review from vasharma05 August 22, 2024 10:17
Copy link
Contributor

@brandones brandones left a comment

Choose a reason for hiding this comment

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

Putting the fix in, since it's kind of a no-brainer. Though fleshing out the associated PR documentation as requested is quite welcome. Thanks @usamaidrsk

@brandones brandones dismissed vasharma05’s stale review August 22, 2024 15:24

The fix is trivial and very sensible, obviously the right thing to do

@brandones brandones merged commit 9418c93 into openmrs:main Aug 22, 2024
6 checks passed
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.

5 participants