-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Collection Home): add export collection row option
refactored CommitDetails to work directly with VersionInfo props to make the entire Export modal rely on only a VersionInfo for it's backing data. Also added an export e2e test
- Loading branch information
Showing
7 changed files
with
86 additions
and
61 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
import * as React from 'react' | ||
import numeral from 'numeral' | ||
|
||
import { Structure, Commit } from '../models/dataset' | ||
import { VersionInfo } from '../models/store' | ||
|
||
import Icon from './chrome/Icon' | ||
import RelativeTimestamp from './RelativeTimestamp' | ||
|
||
interface CommitDetailsProps { | ||
structure: Structure | ||
commit: Commit | ||
path: string | ||
} | ||
|
||
const CommitDetails: React.FunctionComponent<CommitDetailsProps> = (props) => { | ||
const { structure, commit, path } = props | ||
return ( | ||
<> | ||
<span className='dataset-details' style={{ marginBottom: '6px' }}><Icon icon='stickyNote' size='sm' color='medium' />{commit.title}</span> | ||
<div className='dataset-details-container'> | ||
<span className='dataset-details'><Icon icon='commit' size='sm' color='medium' /><span title={path}>{path.substring(path.length - 7)}</span></span> | ||
<span className='dataset-details'><Icon icon='clock' size='sm' color='medium' /><RelativeTimestamp timestamp={commit.timestamp}/></span> | ||
<span className='dataset-details'><Icon icon='hdd' size='sm' color='medium' />{numeral(structure.length).format('0.0b')}</span> | ||
<span className='dataset-details'><Icon icon='bars' size='sm' color='medium' />{numeral(structure.entries).format('0,0')} rows</span> | ||
</div> | ||
</> | ||
) | ||
} | ||
const CommitDetails: React.FunctionComponent<VersionInfo> = ({ | ||
commitTitle, | ||
commitTime, | ||
bodySize, | ||
bodyRows, | ||
path | ||
}) => ( | ||
<> | ||
{commitTitle && <span className='dataset-details' style={{ marginBottom: '6px' }}><Icon icon='stickyNote' size='sm' color='medium' />{commitTitle}</span>} | ||
<div className='dataset-details-container'> | ||
<span className='dataset-details'><Icon icon='commit' size='sm' color='medium' /><span title={path}>{path.substring(path.length - 7)}</span></span> | ||
<span className='dataset-details'><Icon icon='clock' size='sm' color='medium' /><RelativeTimestamp timestamp={commitTime}/></span> | ||
<span className='dataset-details'><Icon icon='hdd' size='sm' color='medium' />{numeral(bodySize).format('0.0b')}</span> | ||
<span className='dataset-details'><Icon icon='bars' size='sm' color='medium' />{numeral(bodyRows).format('0,0')} rows</span> | ||
</div> | ||
</> | ||
) | ||
|
||
export default CommitDetails |
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