-
Notifications
You must be signed in to change notification settings - Fork 352
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
#336/Fix broken unit tests caused by react-children-utilities dependency. #352
Closed
abrie
wants to merge
12
commits into
neherlab:master
from
abrie:remove-react-children-utilities-dependency
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
af0db3d
Refactor how labels/text are passed to FormHelpButton.
abrie 0bc1add
Remove react-children-utilities dependency.
abrie 2ded2c9
Apply yarn lint:fix.
abrie 9a9794c
Merge remote-tracking branch 'upstream/master'
abrie aff2ba4
Rename HelpParams 'text' -> 'content' and allow ReactNode type.
abrie 45727eb
Add missing content param to help helper.
abrie aef1621
Use help helper in SeverityCard help attribute.
abrie 0b8bf77
Add missing 'content' parameter to help helper.
abrie 44676e4
Handle undefined help attribute by showing message.
abrie 547521b
Fix broken code typo.
abrie 30fc208
Remove unused FormHelpButton label attribute.
abrie d2bdeaa
eslint --fix
abrie 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
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -12,16 +12,16 @@ function safeId(id: string) { | |
|
||
export interface HelpProps { | ||
label: string | ||
text: string | ||
content: string | React.ReactNode | ||
} | ||
|
||
export function help(label = '', text = ''): HelpProps { | ||
return { label, text } | ||
export function help(label: string, content: string | React.ReactNode): HelpProps { | ||
return { label, content } | ||
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. @gj262 |
||
} | ||
|
||
export interface FormHelpButtonProps { | ||
identifier: string | ||
help?: HelpProps | ||
help: HelpProps | ||
} | ||
|
||
export default function FormHelpButton({ identifier, help }: FormHelpButtonProps) { | ||
|
@@ -43,7 +43,7 @@ export default function FormHelpButton({ identifier, help }: FormHelpButtonProps | |
<Card className="card--help"> | ||
<CardBody> | ||
<h4>{help.label}</h4> | ||
<p>{help.text}</p> | ||
<p>{help.content}</p> | ||
</CardBody> | ||
</Card> | ||
</UncontrolledPopover> | ||
|
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.
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.
@gj262 Here's a unit test for setting HelpParams content to a
ReactNode