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

(feat) adding support for questionInfo #152

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

arodidev
Copy link
Contributor

@arodidev arodidev commented Dec 7, 2023

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

This PR adds support for rendering a tooltip which gives the user more information about a field within the React Form Engine.

Screenshots

Screenshot 2023-12-08 at 12 21 08

Related Issue

Other

@arodidev arodidev marked this pull request as ready for review December 7, 2023 12:49
Copy link
Member

@pirupius pirupius left a comment

Choose a reason for hiding this comment

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

Looking at this UI now. A part of me thinks we should consider dedicating time and moving this tooltip next to the label.

Comment on lines 46 to 55
<div className={styles.tooltipWithUnspecified}>
<OHRIUnspecified question={field} onChange={onChange} handler={formFieldHandlers[field.type]} />
{field.questionInfo && <OHRITooltip field={field} />}
</div>
</div>
) : (
questionFragment
<div className={styles.parent}>
{questionFragment}
<div className={styles.tooltip}>{field.questionInfo && <OHRITooltip field={field} />}</div>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Having 2 different references looks unnecessary. This can be condensed by renaming the class to some thing more generic and then adding the check only to show the Tooltip component

Comment on lines 54 to 57
<div className={styles.tooltipWithUnspecified}>
<OHRIUnspecified question={fieldDescriptor} onChange={onFieldChange} handler={handler} />
{fieldDescriptor.questionInfo && <OHRITooltip field={fieldDescriptor} />}
</div>
Copy link
Member

Choose a reason for hiding this comment

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

same comment applies here about drying this out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been resolved.

@pirupius pirupius merged commit a3597bb into openmrs:main Dec 14, 2023
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.

2 participants