-
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
Open
Suyog241005
wants to merge
21
commits into
rjsf-team:main
Choose a base branch
from
Suyog241005:fix/#4601-added-UiSchema-enableMarkdownInHelp-flag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14,789
−3,857
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
877604f
updated core/Fieldhelp, react-bootstrap/fieldHelpTemplate, antd/HelpF…
Suyog241005 f2395f5
added the ui:enableMarkdownInHelp flag in UiSchema
Suyog241005 bad27f9
Updated Changelog.md
Suyog241005 8f86a8f
Implemented help field markdown using RichHelp.tsx component, added t…
Suyog241005 53e9be0
updated the tests
Suyog241005 ded4061
updated the changes according to descriptionField
Suyog241005 024aa16
Update CHANGELOG.md
Suyog241005 90f62f0
Update CHANGELOG.md
Suyog241005 df5ed97
Updated
Suyog241005 a35fbd3
Updated
Suyog241005 8d5ed07
added the ui:enableMarkdownInHelp flag in UiSchema
Suyog241005 119bad6
added the ui:enableMarkdownInHelp flag in UiSchema
Suyog241005 c8116ed
added the ui:enableMarkdownInHelp flag in UiSchema
Suyog241005 bc08e21
Updated
Suyog241005 046b34a
updated to pass the test
Suyog241005 b54db98
Updated
Suyog241005 cd25de4
updated to pass the test
Suyog241005 db23358
updated to pass the test
Suyog241005 9f45580
fix(antd): update FieldHelpTemplate to match snapshot expectations
Suyog241005 6251cd5
updated the tests
Suyog241005 d1e773a
Updated antd HelpField to consistently use Markdown for help text & r…
Suyog241005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
heath-freenome marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; | ||
| import { RichHelp } from '@rjsf/core'; | ||
|
|
||
| /** The `FieldHelpTemplate` component renders any help desired for a field | ||
| * | ||
| * @param props - The `FieldHelpProps` to be rendered | ||
| */ | ||
| export default function FieldHelpTemplate< | ||
| T = any, | ||
| S extends StrictRJSFSchema = RJSFSchema, | ||
| F extends FormContextType = any, | ||
| >(props: FieldHelpProps<T, S, F>) { | ||
| const { fieldPathId, help, uiSchema, registry } = props; | ||
| if (!help) { | ||
| return null; | ||
| } | ||
|
|
||
| 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> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,6 @@ export default function FieldTemplate< | |
| onRemoveProperty, | ||
| rawErrors, | ||
| rawDescription, | ||
| rawHelp, | ||
| readonly, | ||
| registry, | ||
| required, | ||
|
|
@@ -100,7 +99,7 @@ export default function FieldTemplate< | |
| <Form.Item | ||
| colon={colon} | ||
| hasFeedback={schema.type !== 'array' && schema.type !== 'object'} | ||
| help={(!!rawHelp && help) || (rawErrors?.length ? errors : undefined)} | ||
| help={help || (rawErrors?.length ? errors : undefined)} | ||
|
Comment on lines
-103
to
+102
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious about this change... Why remove
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Suyog241005 Still wondering about this... |
||
| htmlFor={id} | ||
| label={displayLabel && !isCheckbox && label} | ||
| labelCol={labelCol} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; | ||
| import Markdown from 'markdown-to-jsx'; | ||
|
|
||
| /** The `FieldHelpTemplate` component renders any help desired for a field | ||
| * | ||
| * @param props - The `FieldHelpProps` to be rendered | ||
| */ | ||
| export default function FieldHelpTemplate< | ||
| T = any, | ||
| S extends StrictRJSFSchema = RJSFSchema, | ||
| F extends FormContextType = any, | ||
| >(props: FieldHelpProps<T, S, F>) { | ||
| const { fieldPathId, help } = props; | ||
| if (!help) { | ||
| return null; | ||
| } | ||
| const id = helpId(fieldPathId); | ||
| return ( | ||
| <div id={id} className='help-block'> | ||
| <Markdown options={{ disableParsingRawHTML: true }}>{help as string}</Markdown> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.