mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
* Carapal react mockup This is really just a mock up written in React to try different components. It could become scaffolding to build a prototype, or not. * Merging in Alanna's theme tweaks for SQL lab * Tweak the display of the alert message in navbar * Sketching the middleware refresh for Queries * Adjustments * Implement timer sync. * CTAS * Refactor the queries to be stored as a dict. (#994) * Download csv endpoint. (#992) * CSV download engdpoint. * Use lower case booleans. * Replcate loop with the object lookup by key. * First changes for the sync * Address comments * Fix query deletions. Update only the queries from the store. * Sync queries using tmp_id. * simplify * Fix the tests in the carapal. (#1023) * Sync queries using tmp_id. * Fix the unit tests * Bux fixes. Pass 2. * Tweakin' & linting * Adding alpha label to the SQL LAb navbar entry * Fixing the python unit tests
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
|
|
|
|
|
|
class Link extends React.Component {
|
|
render() {
|
|
let tooltip = (
|
|
<Tooltip id="tooltip">
|
|
{this.props.tooltip}
|
|
</Tooltip>
|
|
);
|
|
const link = (
|
|
<a
|
|
href={this.props.href}
|
|
onClick={this.props.onClick}
|
|
style={this.props.style}
|
|
className={'Link ' + this.props.className}
|
|
>
|
|
{this.props.children}
|
|
</a>
|
|
);
|
|
if (this.props.tooltip) {
|
|
return (
|
|
<OverlayTrigger
|
|
overlay={tooltip}
|
|
placement={this.props.placement}
|
|
delayShow={300}
|
|
delayHide={150}
|
|
>
|
|
{link}
|
|
</OverlayTrigger>
|
|
);
|
|
}
|
|
return link;
|
|
}
|
|
}
|
|
Link.propTypes = {
|
|
children: React.PropTypes.object,
|
|
className: React.PropTypes.string,
|
|
href: React.PropTypes.string,
|
|
onClick: React.PropTypes.func,
|
|
placement: React.PropTypes.string,
|
|
style: React.PropTypes.object,
|
|
tooltip: React.PropTypes.string,
|
|
};
|
|
Link.defaultProps = {
|
|
disabled: false,
|
|
href: '#',
|
|
tooltip: null,
|
|
placement: 'top',
|
|
onClick: () => {},
|
|
};
|
|
|
|
export default Link;
|