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

OHRI-452 Form Patient Banner - Optional hideActionsOverflow, optional param #598

Merged
merged 2 commits into from
Mar 9, 2022

Conversation

larslemos
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

This is the current Patient Banner on the Form:
Screen Shot 2022-03-09 at 13 58 13

The objective is to make this an option Overflow Button, since for this scenario, the actions don't apply for our context.
Screen Shot 2022-03-09 at 14 02 12

Related Issue

https://issues.openmrs.org/browse/O3-1154?atlLinkOrigin=c2xhY2staW50ZWdyYXRpb258aXNzdWU%3D

Other

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2022

File size impact

Merging feature/ohri-452-overall-ui into master impact files as follow:

@openmrs/esm-form-entry-app (+8.02%)
Files new size
packages/esm-form-entry-app/dist/1.openmrs-esm-form-entry-app.js 1.48 MB (+109 kB / +7.92%) ↗️
packages/esm-form-entry-app/dist/openmrs-esm-form-entry-app.js 84.5 kB (+5.83 kB / +7.41%) ↗️
packages/esm-form-entry-app/dist/2.openmrs-esm-form-entry-app.js 46.1 kB (+5.19 kB / +12.69%) ↗️
Unmodified (1) 155 B (0 B / +0%) 👻
Total (4) 1.62 MB (+120 kB / +8.02%) ↗️
@openmrs/esm-generic-patient-widgets-app (no impact)
Files new size
Unmodified (14) 2.91 MB (0 B / +0%) 👻
Total (14) 2.91 MB (0 B / +0%) 👻
@openmrs/esm-patient-allergies-app (no impact)
Files new size
Unmodified (32) 2.59 MB (0 B / +0%) 👻
Total (32) 2.59 MB (0 B / +0%) 👻
@openmrs/esm-patient-appointments-app (no impact)
Files new size
Unmodified (24) 2.07 MB (0 B / +0%) 👻
Total (24) 2.07 MB (0 B / +0%) 👻
@openmrs/esm-patient-attachments-app (no impact)
Files new size
Unmodified (19) 1.61 MB (0 B / +0%) 👻
Total (19) 1.61 MB (0 B / +0%) 👻
@openmrs/esm-patient-banner-app (+0%)
Files new size
packages/esm-patient-banner-app/dist/661.js 261 kB (+26 B / +0.01%) ↗️
Unmodified (14) 731 kB (0 B / +0%) 👻
Total (15) 992 kB (+26 B / +0%) ↗️
@openmrs/esm-patient-biometrics-app (no impact)
Files new size
Unmodified (21) 2.54 MB (0 B / +0%) 👻
Total (21) 2.54 MB (0 B / +0%) 👻
@openmrs/esm-patient-chart-app (no impact)
Files new size
Unmodified (40) 3.58 MB (0 B / +0%) 👻
Total (40) 3.58 MB (0 B / +0%) 👻
@openmrs/esm-patient-clinical-view-app (no impact)
Files new size
Unmodified (19) 1.41 MB (0 B / +0%) 👻
Total (19) 1.41 MB (0 B / +0%) 👻
@openmrs/esm-patient-common-lib (no impact)

No file in @openmrs/esm-patient-common-lib group (see config below).

{
  "./packages/esm-patient-common-lib/dist/*.js": true,
  "./packages/esm-patient-common-lib/dist/*.css": true,
  "./packages/esm-patient-common-lib/dist/*.map": false,
  "./packages/esm-patient-common-lib/dist/*.txt": false,
  "./packages/esm-patient-common-lib/dist/*.json": false
}
@openmrs/esm-patient-conditions-app (no impact)
Files new size
Unmodified (25) 1.92 MB (0 B / +0%) 👻
Total (25) 1.92 MB (0 B / +0%) 👻
@openmrs/esm-patient-forms-app (no impact)
Files new size
Unmodified (24) 1.99 MB (0 B / +0%) 👻
Total (24) 1.99 MB (0 B / +0%) 👻
@openmrs/esm-patient-immunizations-app (no impact)
Files new size
Unmodified (21) 1.81 MB (0 B / +0%) 👻
Total (21) 1.81 MB (0 B / +0%) 👻
@openmrs/esm-patient-medications-app (no impact)
Files new size
Unmodified (19) 2.77 MB (0 B / +0%) 👻
Total (19) 2.77 MB (0 B / +0%) 👻
@openmrs/esm-patient-notes-app (no impact)
Files new size
Unmodified (24) 1.95 MB (0 B / +0%) 👻
Total (24) 1.95 MB (0 B / +0%) 👻
@openmrs/esm-patient-programs-app (no impact)
Files new size
Unmodified (20) 1.91 MB (0 B / +0%) 👻
Total (20) 1.91 MB (0 B / +0%) 👻
@openmrs/esm-patient-test-results-app (no impact)
Files new size
Unmodified (28) 3.92 MB (0 B / +0%) 👻
Total (28) 3.92 MB (0 B / +0%) 👻
@openmrs/esm-patient-vitals-app (no impact)
Files new size
Unmodified (25) 3.45 MB (0 B / +0%) 👻
Total (25) 3.45 MB (0 B / +0%) 👻
Generated by @jsenv/file-size-impact during Report bundle size#1958748593 on 8f7cc36

patientUuid,
onClick,
onTransition,
hideActionsOverflow,
Copy link
Member

Choose a reason for hiding this comment

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

It would be preferable, I think, to do this via configuration, not through code.

Copy link
Member

Choose a reason for hiding this comment

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

How will you otherwise be passing this prop to the banner? Perhaps the configuration happens upstream?

Copy link
Contributor Author

@larslemos larslemos Mar 9, 2022

Choose a reason for hiding this comment

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

Well, this solution took a lot of turns.
1st Initially the plan was to make a stylesheet appracoach
2nd Tried using hooks, but then after an event, the re-render was paiting again the Action.
3rd Is the current commit.

The alternative way would be below.

Have to refactor the module and:

  1. In patient-banner-component.tsx: Add an extension slot to act as a container for the Actions Overflow (actions-overflow-container)

  2. In /src, create a new folder (actions) with a component that returns the code for CustomOverflowMenuComponent

  3. In /src/index.ts, attach the actions component to the actions-overflow-container extension

  4. In OHRI, add config to remove actions-overflow-container extension when rendering OHRIForm

This does mean it will, work cause every time I try something, there is a new side-effect I learn from the esm behaviour.
@samuelmale @brandones your views?

Copy link
Contributor

@brandones brandones Mar 9, 2022

Choose a reason for hiding this comment

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

We are going to completely refactor this component, @larslemos . This solution is temporary. As stated below.

@brandones
Copy link
Contributor

@jonathandick , we need to refactor this component badly anyway. I think this will be lower-effort to refactor than by using the config for this. https://issues.openmrs.org/browse/O3-1161

@brandones brandones merged commit 1ca6ebb into openmrs:master Mar 9, 2022
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.

4 participants