Migrates Label component from Bootstrap to AntD. (#12774)

This commit is contained in:
Michael S. Molina
2021-02-02 03:15:07 -03:00
committed by GitHub
parent 388edbf7b2
commit 2adfb85597
21 changed files with 162 additions and 225 deletions

View File

@@ -20,16 +20,16 @@ import React from 'react';
import PropTypes from 'prop-types';
import Label from 'src/components/Label';
import { STATE_BSSTYLE_MAP } from '../constants';
import { STATE_TYPE_MAP } from '../constants';
const propTypes = {
query: PropTypes.object.isRequired,
};
export default function QueryStateLabel({ query }) {
const bsStyle = STATE_BSSTYLE_MAP[query.state];
const type = STATE_TYPE_MAP[query.state];
return (
<Label className="m-r-3" bsStyle={bsStyle}>
<Label className="m-r-3" type={type}>
{query.state}
</Label>
);

View File

@@ -143,7 +143,7 @@ const QueryTable = props => {
<ModalTrigger
className="ResultsModal"
triggerNode={
<Label bsStyle="info" className="pointer">
<Label type="info" className="pointer">
{t('View results')}
</Label>
}

View File

@@ -33,7 +33,7 @@ import QueryHistory from './QueryHistory';
import ResultSet from './ResultSet';
import {
STATUS_OPTIONS,
STATE_BSSTYLE_MAP,
STATE_TYPE_MAP,
LOCALSTORAGE_MAX_QUERY_AGE_MS,
} from '../constants';
@@ -97,10 +97,7 @@ export class SouthPane extends React.PureComponent {
render() {
if (this.props.offline) {
return (
<Label
className="m-r-3"
bsStyle={STATE_BSSTYLE_MAP[STATUS_OPTIONS.offline]}
>
<Label className="m-r-3" type={STATE_TYPE_MAP[STATUS_OPTIONS.offline]}>
{STATUS_OPTIONS.offline}
</Label>
);

View File

@@ -71,7 +71,7 @@ import ShareSqlLabQuery from './ShareSqlLabQuery';
import SqlEditorLeftBar from './SqlEditorLeftBar';
import AceEditorWrapper from './AceEditorWrapper';
import {
STATE_BSSTYLE_MAP,
STATE_TYPE_MAP,
SQL_EDITOR_GUTTER_HEIGHT,
SQL_EDITOR_GUTTER_MARGIN,
SQL_TOOLBAR_HEIGHT,
@@ -575,7 +575,7 @@ class SqlEditor extends React.PureComponent {
this.props.latestQuery.rows,
)}
>
<Label bsStyle="warning">LIMIT</Label>
<Label type="warning">LIMIT</Label>
</Tooltip>
);
}
@@ -670,7 +670,7 @@ class SqlEditor extends React.PureComponent {
<Timer
startTime={this.props.latestQuery.startDttm}
endTime={this.props.latestQuery.endDttm}
state={STATE_BSSTYLE_MAP[this.props.latestQuery.state]}
state={STATE_TYPE_MAP[this.props.latestQuery.state]}
isRunning={this.props.latestQuery.state === 'running'}
/>
)}