-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(ui): Supporting display of columns and storage count in previews #7198
feat(ui): Supporting display of columns and storage count in previews #7198
Conversation
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.
only one real change requested (using rowCount
instead of columnCount
otherwise some minor nits - otherwise great stuff!
const formatBytesStat = (bytes: number) => { | ||
const formattedBytes = formatBytes(bytes); | ||
return ( | ||
<Tooltip title={`This dataset consumes ${formatNumberWithoutAbbreviation(bytes)} bytes of storage.`}> | ||
<b>{formattedBytes.number}</b> {formattedBytes.unit} | ||
</Tooltip> | ||
); | ||
}; |
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.
this is really more of a new component and not so much a helper function. so maybe we call this FormattedBytesStat
that accepts bytes
as a prop?
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.
yeah i like that!
datahub-web-react/src/app/entity/dataset/shared/DatasetStatsSummary.tsx
Outdated
Show resolved
Hide resolved
)) || | ||
undefined} |
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.
nitty nit: the || undefined
here isn't necessary! if you do {!!columnCount && (...
it will only render what comes next if !!columnCount
is truthy
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.
awesome! will change
|
||
const k = 1000; // We use IEEE standards definition of units of byte, where 1000 bytes = 1kb. | ||
const dm = decimals < 0 ? 0 : decimals; | ||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
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.
lol at "ZB" and "YB" that's a lotta bytes
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.
hahaha
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.
nice rice 👍
@jjoyce0510 seeing build failing with |
5af5846
to
a304f71
Compare
Summary
In this PR we introduce support for a) column count and b) storage size in bytes on the Dataset Stats Summary - this is shown both on the search card and on the entity profile.
Status
Ready for review
Screenshots
Checklist