mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
chore: Migrates ControlHeader icons (#15265)
This commit is contained in:
parent
a7e103765a
commit
1e8fb8b55c
@ -18,10 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { t, css } from '@superset-ui/core';
|
import { t, css, withTheme } from '@superset-ui/core';
|
||||||
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
||||||
import { Tooltip } from 'src/components/Tooltip';
|
import { Tooltip } from 'src/components/Tooltip';
|
||||||
import { FormLabel } from 'src/components/Form';
|
import { FormLabel } from 'src/components/Form';
|
||||||
|
import Icons from 'src/components/Icons';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
@ -45,7 +46,7 @@ const defaultProps = {
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class ControlHeader extends React.Component {
|
class ControlHeader extends React.Component {
|
||||||
renderOptionalIcons() {
|
renderOptionalIcons() {
|
||||||
if (this.props.hovered) {
|
if (this.props.hovered) {
|
||||||
return (
|
return (
|
||||||
@ -91,6 +92,9 @@ export default class ControlHeader extends React.Component {
|
|||||||
}
|
}
|
||||||
const labelClass =
|
const labelClass =
|
||||||
this.props.validationErrors.length > 0 ? 'text-danger' : '';
|
this.props.validationErrors.length > 0 ? 'text-danger' : '';
|
||||||
|
|
||||||
|
const { theme } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ControlHeader" data-test={`${this.props.name}-header`}>
|
<div className="ControlHeader" data-test={`${this.props.name}-header`}>
|
||||||
<div className="pull-left">
|
<div className="pull-left">
|
||||||
@ -117,7 +121,10 @@ export default class ControlHeader extends React.Component {
|
|||||||
placement="top"
|
placement="top"
|
||||||
title={this.props.warning}
|
title={this.props.warning}
|
||||||
>
|
>
|
||||||
<i className="fa fa-exclamation-circle text-warning" />
|
<Icons.AlertSolid
|
||||||
|
iconColor={theme.colors.alert.base}
|
||||||
|
iconSize="s"
|
||||||
|
/>
|
||||||
</Tooltip>{' '}
|
</Tooltip>{' '}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@ -128,7 +135,10 @@ export default class ControlHeader extends React.Component {
|
|||||||
placement="top"
|
placement="top"
|
||||||
title={this.props.danger}
|
title={this.props.danger}
|
||||||
>
|
>
|
||||||
<i className="fa fa-exclamation-circle text-danger" />
|
<Icons.ErrorSolid
|
||||||
|
iconColor={theme.colors.error.base}
|
||||||
|
iconSize="s"
|
||||||
|
/>
|
||||||
</Tooltip>{' '}
|
</Tooltip>{' '}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@ -139,7 +149,10 @@ export default class ControlHeader extends React.Component {
|
|||||||
placement="top"
|
placement="top"
|
||||||
title={this.props.validationErrors.join(' ')}
|
title={this.props.validationErrors.join(' ')}
|
||||||
>
|
>
|
||||||
<i className="fa fa-exclamation-circle text-danger" />
|
<Icons.ErrorSolid
|
||||||
|
iconColor={theme.colors.error.base}
|
||||||
|
iconSize="s"
|
||||||
|
/>
|
||||||
</Tooltip>{' '}
|
</Tooltip>{' '}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@ -157,3 +170,5 @@ export default class ControlHeader extends React.Component {
|
|||||||
|
|
||||||
ControlHeader.propTypes = propTypes;
|
ControlHeader.propTypes = propTypes;
|
||||||
ControlHeader.defaultProps = defaultProps;
|
ControlHeader.defaultProps = defaultProps;
|
||||||
|
|
||||||
|
export default withTheme(ControlHeader);
|
||||||
|
Loading…
Reference in New Issue
Block a user