-
Notifications
You must be signed in to change notification settings - Fork 0
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 abstract format issue on UI #211
Conversation
return ( | ||
<TextAreaBaseGrid> | ||
<Grid item md={12}> | ||
<Typography | ||
variant="detailContent" | ||
component="div" | ||
dangerouslySetInnerHTML={{ |
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.
Could you try not to use dangerouslySetInnerHTML
? Because it exposes our portal to XSS attacks.
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 disable the dangerouslySetInnerHTML for now, but we lost the ability to click on the link within the abstract
component="div" | ||
dangerouslySetInnerHTML={{ | ||
__html: isExpanded | ||
? isEnrichHtml |
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.
Can this nested ternary conditional operator be more readable? e.g.:
const generateText = () => {
return isExpanded? decodedText : truncateText(decodedText, truncateCount);
}
... other code...
isEnrighHtml? enrichHtml (geenrateText()) : generateText();
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.
Remove the isEnrichHTML option so it is not there now
@@ -63,3 +75,6 @@ const ExpandableTextArea: React.FC<ExpandableTextAreaProps> = ({ | |||
}; | |||
|
|||
export default ExpandableTextArea; | |||
function enrchHTML(arg0: string) { |
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 believe this function is auto-generated by IDE when you click "create function" accidently. Could you remove it?
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.
removed
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.
LGTM
Use this to do testing uuid for testing
1045cb37-d0de-4596-8e5f-c9e77df44742,
you may need to reload this one with indexer