mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
[WiP] rename project from Caravel to Superset (#1576)
* Change in files * Renamin files and folders * cleaning up a single piece of lint * Removing boat picture from docs * add superset word mark * Update rename note in docs * Fixing images * Pinning datatables * Fixing issues with mapbox-gl * Forgot to rename one file * Linting * v0.13.0 * adding pyyaml to dev-reqs
This commit is contained in:
committed by
GitHub
parent
973537fd9a
commit
15b67b2c6c
@@ -0,0 +1,59 @@
|
||||
import React from 'react';
|
||||
|
||||
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
|
||||
|
||||
const propTypes = {
|
||||
column: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
const iconMap = {
|
||||
pk: 'fa-key',
|
||||
fk: 'fa-link',
|
||||
index: 'fa-bookmark',
|
||||
};
|
||||
const tooltipTitleMap = {
|
||||
pk: 'Primary Key',
|
||||
fk: 'Foreign Key',
|
||||
index: 'Index',
|
||||
};
|
||||
|
||||
class ColumnElement extends React.PureComponent {
|
||||
render() {
|
||||
const col = this.props.column;
|
||||
let name = col.name;
|
||||
let icons;
|
||||
if (col.keys && col.keys.length > 0) {
|
||||
name = <strong>{col.name}</strong>;
|
||||
icons = col.keys.map((key, i) => (
|
||||
<span key={i} className="ColumnElement">
|
||||
<OverlayTrigger
|
||||
placement="right"
|
||||
overlay={
|
||||
<Tooltip id="idx-json" bsSize="lg">
|
||||
<strong>{tooltipTitleMap[key.type]}</strong>
|
||||
<hr />
|
||||
<pre className="text-small">
|
||||
{JSON.stringify(key, null, ' ')}
|
||||
</pre>
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
<i className={`fa text-muted m-l-2 ${iconMap[key.type]}`} />
|
||||
</OverlayTrigger>
|
||||
</span>
|
||||
));
|
||||
}
|
||||
return (
|
||||
<div className="clearfix table-column">
|
||||
<div className="pull-left m-l-10 col-name">
|
||||
{name}{icons}
|
||||
</div>
|
||||
<div className="pull-right text-muted">
|
||||
<small> {col.type}</small>
|
||||
</div>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
ColumnElement.propTypes = propTypes;
|
||||
|
||||
export default ColumnElement;
|
||||
Reference in New Issue
Block a user