Skip to content
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

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Conversation

utas-raymondng
Copy link
Contributor

@utas-raymondng utas-raymondng commented Oct 30, 2024

Use this to do testing uuid for testing

1045cb37-d0de-4596-8e5f-c9e77df44742,

you may need to reload this one with indexer

return (
<TextAreaBaseGrid>
<Grid item md={12}>
<Typography
variant="detailContent"
component="div"
dangerouslySetInnerHTML={{
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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();

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Contributor

@HavierD HavierD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HavierD HavierD merged commit a58c6f4 into main Oct 31, 2024
3 checks passed
@HavierD HavierD deleted the bugs/5964-fix-abstract-formatting branch October 31, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants