-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Feature: added the ui:enableMarkdownInHelp flag in UiSchema #4855
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
Feature: added the ui:enableMarkdownInHelp flag in UiSchema #4855
Conversation
6e9390a to
e7391fd
Compare
|
Hi @heath-freenome , all the test cases for this PR have passed successfully. Could you please review it when you get the chance and let me know if any further changes or improvements are needed before merging? |
e7391fd to
b337908
Compare
heath-freenome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please add test to formTest.tsx in snapshot-tests to verify the markdown help
packages/daisyui/src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/primereact/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/react-bootstrap/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/semantic-ui/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/semantic-ui/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/daisyui/src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/fluentui-rc/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/primereact/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
packages/react-bootstrap/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
398ab33 to
17938e6
Compare
|
@Suyog241005 If you could respond to my questions I've left in the review, I'd appreciate it |
|
@heath-freenome I’ve updated the changelog as requested. Please let me know if anything else needs adjustment. |
heath-freenome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more changes
packages/react-bootstrap/src/FieldHelpTemplate/FieldHelpTemplate.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
c918d74 to
472829c
Compare
|
Hi @heath-freenome, I’ve implemented all the requested changes. Could you please review the latest updates when you get a chance? |
| return ( | ||
| <FormHelperText component='div' id={id}> | ||
| {help} | ||
| <FormHelperText id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore the component='div'
| <FormHelperText id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> | |
| <FormHelperText component='div' id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> |
d1e773a to
4b3bca1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this entire file since you now have FieldHelpTemplate.
| const id = helpId(fieldPathId); | ||
|
|
||
| return ( | ||
| <div id={id} className='ant-form-item-extra'> | ||
| <div className='help-block'> | ||
| {typeof help === 'string' ? help : <RichHelp help={help} registry={registry} uiSchema={uiSchema} />} | ||
| </div> | ||
| </div> | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the extra div and ant-form-item-extra required? And also, doesn't the RichHelp already handle the help is string case?
| const id = helpId(fieldPathId); | |
| return ( | |
| <div id={id} className='ant-form-item-extra'> | |
| <div className='help-block'> | |
| {typeof help === 'string' ? help : <RichHelp help={help} registry={registry} uiSchema={uiSchema} />} | |
| </div> | |
| </div> | |
| ); | |
| return ( | |
| <div id={helpId(fieldPathId)} className='help-block'> | |
| <RichHelp help={help} registry={registry} uiSchema={uiSchema} /> | |
| </div> | |
| ); |
| return ( | ||
| <FormHelperText component='div' id={id}> | ||
| {help} | ||
| <FormHelperText component={'div'} id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <FormHelperText component={'div'} id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> | |
| <FormHelperText component='div' id={helpId(fieldPathId)} style={{ marginTop: '5px' }}> |
4b3bca1 to
7cd0eb1
Compare
…estored text-danger logic in Bootstrap FieldHelpTemplate & updated core test to expect div.help-block instead of p.help-block
7cd0eb1 to
6910c5c
Compare
|
@heath-freenome , i have made the changes as per instructed |
Thanks for all your hard work! |
The pleasure is mine 😊 |
Reasons for making this change
This PR implements the ability to render markdown in help text fields across all themes by introducing a new
ui:enableMarkdownInHelpflag, similar to the existingui:enableMarkdownInDescriptionfunctionality.-Updated all theme packages to support markdown in help text
Fixes 4601
Checklist
npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:updateto update snapshots, if needed.