-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fix: lambda python functions not rendering correctly on flowchart #851
Merged
Merged
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ac1bd25
update demo project to 0.18.1
tynandebold 1bf863d
fix the bug
tynandebold 74564b2
update release notes
tynandebold 48b530a
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into fi…
tynandebold 4d8dec4
better implementation
tynandebold 8c216a7
fix search highlighting
tynandebold acd397a
cleaner
tynandebold af2eba7
update releaes notes
tynandebold 1f6eb76
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into fi…
tynandebold f2923b8
update
tynandebold 8692956
z-index search close icon
tynandebold 54a18d5
added to readme
rashidakanchwala 450a1af
update
tynandebold 4a271ba
Merge branch 'fix/lambda-python-functions-on-flowchart' of https://gi…
tynandebold 9df69c8
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into fi…
tynandebold c152a64
undo readme changes
rashidakanchwala b3923fb
Merge branch 'fix/lambda-python-functions-on-flowchart' of github.com…
rashidakanchwala 7b08e6f
undo readme changes
rashidakanchwala bebec6c
undo plotly readme changes
rashidakanchwala 0bfe837
undo readme-2
rashidakanchwala 45240cc
cleanup
tynandebold abbea45
Merge branch 'fix/lambda-python-functions-on-flowchart' of https://gi…
tynandebold 1027bd9
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into fi…
tynandebold 7c25f75
Merge branch 'main' into fix/lambda-python-functions-on-flowchart
tynandebold 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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React, { memo } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import classnames from 'classnames'; | ||
import { changed } from '../../utils'; | ||
import { changed, replaceMatches } from '../../utils'; | ||
import NodeIcon from '../icons/node-icon'; | ||
import VisibleIcon from '../icons/visible'; | ||
import InvisibleIcon from '../icons/invisible'; | ||
|
@@ -11,6 +11,13 @@ import { getNodeActive } from '../../selectors/nodes'; | |
// The exact fixed height of a row as measured by getBoundingClientRect() | ||
export const nodeListRowHeight = 37; | ||
|
||
// HTML tags to replace partial and curry Python functions so we | ||
// don't get a conflict with using dangerouslySetInnerHTML | ||
const stringsToReplace = { | ||
'<lambda>': '<lambda>', | ||
'<partial>': '<partial>', | ||
}; | ||
|
||
/** | ||
* Returns `true` if there are no props changes, therefore the last render can be reused. | ||
* Performance: Checks only the minimal set of props known to change after first render. | ||
|
@@ -124,7 +131,9 @@ const NodeListRow = memo( | |
'pipeline-nodelist__row__label--disabled': disabled, | ||
} | ||
)} | ||
dangerouslySetInnerHTML={{ __html: label }} | ||
dangerouslySetInnerHTML={{ | ||
__html: replaceMatches(label, stringsToReplace), | ||
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. Replace the |
||
}} | ||
/> | ||
</TextButton> | ||
{typeof count === 'number' && ( | ||
|
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
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.
I think the solve for this is to leave the
<>
in place in the backend and then change it to use the HTML entities only where we need it in the frontend.