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

[Security Solution] updates host risk score decimal count (UI) #119228

Merged
merged 5 commits into from
Nov 29, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const columns: Array<EuiTableFieldDataColumnType<LinkPanelListItem>> = [
align: 'right',
field: 'count',
name: 'Risk Score',
render: (riskScore) => (isNaN(riskScore) ? riskScore : Number.parseFloat(riskScore).toFixed(2)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure what value can be in riskScore, but the isNaN will return false if riskScore will be a null or ''.
And Number.parseFloat(null) will be NaN.

Here are more examples of this isNaN behaviour
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#examples

So maybe, we want to use Number.isNaN instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for catching this! updating now

sortable: true,
truncateText: true,
width: '15%',
Expand Down