mirror of https://github.com/apache/superset.git
feat: partitionchart controls migration (#9768)
* fix lint error * fix: import lint error * pull in latests code * delete control from plugin registry * fixing again... * another fix with rebase... * commit change * update packages and fix test * fix: add ignore to lint error * fix mr * fix lint * fix imports Co-authored-by: Phillip Kelley-Dotson <pkd@pkd.lan>
This commit is contained in:
parent
c4016e3b71
commit
38c57f45ac
|
@ -6575,9 +6575,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@superset-ui/control-utils": {
|
"@superset-ui/control-utils": {
|
||||||
"version": "0.13.3",
|
"version": "0.13.9",
|
||||||
"resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.9.tgz",
|
||||||
"integrity": "sha512-I9eMrqZRB5PbSWygGoptxOdu9t8X8LU3+VTo7OjAEcn3EYAQHIRmuMudq1KDnrGt+rKCBOHaWm5JMbMIj2GodA=="
|
"integrity": "sha512-R8BkUqd5WaDfFB7LiGfNBD3kfFsoqwRzIUDNvZxVzBJsmYTgF0pPVV9OB9pKZ/fImEqd/WqPb5PyB7FMtRj5Ug==",
|
||||||
|
"requires": {
|
||||||
|
"@types/react-bootstrap": "0.32.21",
|
||||||
|
"lodash": "^4.17.15",
|
||||||
|
"react-bootstrap": "^0.33.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@superset-ui/core": {
|
"@superset-ui/core": {
|
||||||
"version": "0.13.5",
|
"version": "0.13.5",
|
||||||
|
@ -6820,9 +6825,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@superset-ui/legacy-plugin-chart-partition": {
|
"@superset-ui/legacy-plugin-chart-partition": {
|
||||||
"version": "0.13.5",
|
"version": "0.13.11",
|
||||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.13.5.tgz",
|
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.13.11.tgz",
|
||||||
"integrity": "sha512-YsgbAqj/sQKEWUmI0XXy6rJvGsWSPwfekmtWpa55CF19A+TJEuCCHmIGDPupgZsIqgJBZArwYT3HNnn7a8TfxA==",
|
"integrity": "sha512-z49rqBLWQ7GRf1MCz3QdYz+8HRmK8UJo1kHRKBnqah4NQB4jemgWnOznNHuPXxOCIct1ZejvUmaf5EAg/24dMQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"d3": "^3.5.17",
|
"d3": "^3.5.17",
|
||||||
"d3-hierarchy": "^1.1.8",
|
"d3-hierarchy": "^1.1.8",
|
||||||
|
@ -7511,6 +7516,14 @@
|
||||||
"csstype": "^2.2.0"
|
"csstype": "^2.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/react-bootstrap": {
|
||||||
|
"version": "0.32.21",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/react-bootstrap/-/react-bootstrap-0.32.21.tgz",
|
||||||
|
"integrity": "sha512-AV/6cMUBbKArEQcjXEzpoHexHi6hJL0cH3Vcw9qI4Ob2g/XFRvyTAFdMlGlp8HZmOHXL35PdF0K75Z31Po87qg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/react": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/react-dom": {
|
"@types/react-dom": {
|
||||||
"version": "16.9.5",
|
"version": "16.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.5.tgz",
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
"@superset-ui/chart-composition": "^0.13.5",
|
"@superset-ui/chart-composition": "^0.13.5",
|
||||||
"@superset-ui/color": "^0.13.3",
|
"@superset-ui/color": "^0.13.3",
|
||||||
"@superset-ui/connection": "^0.13.5",
|
"@superset-ui/connection": "^0.13.5",
|
||||||
"@superset-ui/control-utils": "^0.13.3",
|
"@superset-ui/control-utils": "^0.13.9",
|
||||||
"@superset-ui/core": "^0.13.5",
|
"@superset-ui/core": "^0.13.5",
|
||||||
"@superset-ui/dimension": "^0.13.3",
|
"@superset-ui/dimension": "^0.13.3",
|
||||||
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.6",
|
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.6",
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
"@superset-ui/legacy-plugin-chart-markup": "^0.13.3",
|
"@superset-ui/legacy-plugin-chart-markup": "^0.13.3",
|
||||||
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.13.5",
|
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.13.5",
|
||||||
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.13.3",
|
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.13.3",
|
||||||
"@superset-ui/legacy-plugin-chart-partition": "^0.13.5",
|
"@superset-ui/legacy-plugin-chart-partition": "^0.13.11",
|
||||||
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.13.10",
|
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.13.10",
|
||||||
"@superset-ui/legacy-plugin-chart-rose": "^0.13.10",
|
"@superset-ui/legacy-plugin-chart-rose": "^0.13.10",
|
||||||
"@superset-ui/legacy-plugin-chart-sankey": "^0.13.10",
|
"@superset-ui/legacy-plugin-chart-sankey": "^0.13.10",
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import ColumnOption from 'src/components/ColumnOption';
|
import ColumnOption from 'src/components/ColumnOption';
|
||||||
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
||||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
describe('ColumnOption', () => {
|
describe('ColumnOption', () => {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import { Col, Row } from 'react-bootstrap';
|
import { Col, Row } from 'react-bootstrap';
|
||||||
import TextControl from 'src/explore/components/controls/TextControl';
|
import TextControl from 'src/explore/components/controls/TextControl';
|
||||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
|
||||||
import FormRow from 'src/components/FormRow';
|
import FormRow from 'src/components/FormRow';
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import MetricOption from 'src/components/MetricOption';
|
import MetricOption from 'src/components/MetricOption';
|
||||||
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
||||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
describe('MetricOption', () => {
|
describe('MetricOption', () => {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
import React from 'react';
|
|
||||||
import { shallow } from 'enzyme';
|
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
|
||||||
import OptionDescription from 'src/components/OptionDescription';
|
|
||||||
|
|
||||||
const defaultProps = {
|
|
||||||
option: {
|
|
||||||
label: 'Some option',
|
|
||||||
description: 'Description for some option',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('OptionDescription', () => {
|
|
||||||
let wrapper;
|
|
||||||
let props;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
props = { option: { ...defaultProps.option } };
|
|
||||||
wrapper = shallow(<OptionDescription {...props} />);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('renders an InfoTooltipWithTrigger', () => {
|
|
||||||
expect(wrapper.find(InfoTooltipWithTrigger)).toHaveLength(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('renders a span with the label', () => {
|
|
||||||
expect(wrapper.find('.option-label').text()).toBe('Some option');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -19,9 +19,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { Panel } from 'react-bootstrap';
|
import { Panel } from 'react-bootstrap';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
|
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
|
|
@ -22,10 +22,10 @@ import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import Dialog from 'react-bootstrap-dialog';
|
import Dialog from 'react-bootstrap-dialog';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import { exportChart } from '../../explore/exploreUtils';
|
import { exportChart } from '../../explore/exploreUtils';
|
||||||
import * as actions from '../actions/sqlLab';
|
import * as actions from '../actions/sqlLab';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
|
@ -36,6 +36,7 @@ const propTypes = {
|
||||||
errorMessage: PropTypes.string,
|
errorMessage: PropTypes.string,
|
||||||
templateParams: PropTypes.string,
|
templateParams: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
vizRequest: {},
|
vizRequest: {},
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,11 +24,11 @@ import { connect } from 'react-redux';
|
||||||
import { Alert } from 'react-bootstrap';
|
import { Alert } from 'react-bootstrap';
|
||||||
import Dialog from 'react-bootstrap-dialog';
|
import Dialog from 'react-bootstrap-dialog';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import shortid from 'shortid';
|
import shortid from 'shortid';
|
||||||
import { exportChart } from '../../explore/exploreUtils';
|
import { exportChart } from '../../explore/exploreUtils';
|
||||||
import * as actions from '../actions/sqlLab';
|
import * as actions from '../actions/sqlLab';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
|
|
|
@ -27,9 +27,9 @@ import 'brace/mode/markdown';
|
||||||
import 'brace/theme/textmate';
|
import 'brace/theme/textmate';
|
||||||
|
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import ModalTrigger from '../../components/ModalTrigger';
|
import ModalTrigger from '../../components/ModalTrigger';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { MenuItem } from 'react-bootstrap';
|
import { MenuItem } from 'react-bootstrap';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
export function MenuItemContent({ faIcon, text, tooltip, children }) {
|
export function MenuItemContent({ faIcon, text, tooltip, children }) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import ColumnTypeLabel from './ColumnTypeLabel';
|
import ColumnTypeLabel from './ColumnTypeLabel';
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
column: PropTypes.object.isRequired,
|
column: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Row, Col } from 'react-bootstrap';
|
import { Row, Col } from 'react-bootstrap';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
const STYLE_ROW = { marginTop: '5px', minHeight: '30px' };
|
const STYLE_ROW = { marginTop: '5px', minHeight: '30px' };
|
||||||
const STYLE_RALIGN = { textAlign: 'right' };
|
const STYLE_RALIGN = { textAlign: 'right' };
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { kebabCase } from 'lodash';
|
|
||||||
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
|
|
||||||
|
|
||||||
const propTypes = {
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
tooltip: PropTypes.string,
|
|
||||||
icon: PropTypes.string,
|
|
||||||
className: PropTypes.string,
|
|
||||||
onClick: PropTypes.func,
|
|
||||||
placement: PropTypes.string,
|
|
||||||
bsStyle: PropTypes.string,
|
|
||||||
};
|
|
||||||
const defaultProps = {
|
|
||||||
icon: 'info-circle',
|
|
||||||
className: 'text-muted',
|
|
||||||
placement: 'right',
|
|
||||||
};
|
|
||||||
const tooltipStyle = { wordWrap: 'break-word' };
|
|
||||||
|
|
||||||
export default function InfoTooltipWithTrigger({
|
|
||||||
label,
|
|
||||||
tooltip,
|
|
||||||
icon,
|
|
||||||
className,
|
|
||||||
onClick,
|
|
||||||
placement,
|
|
||||||
bsStyle,
|
|
||||||
}) {
|
|
||||||
const iconClass = `fa fa-${icon} ${className} ${
|
|
||||||
bsStyle ? `text-${bsStyle}` : ''
|
|
||||||
}`;
|
|
||||||
const iconEl = (
|
|
||||||
<i
|
|
||||||
className={iconClass}
|
|
||||||
onClick={onClick}
|
|
||||||
style={{ cursor: onClick ? 'pointer' : null }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
if (!tooltip) {
|
|
||||||
return iconEl;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<OverlayTrigger
|
|
||||||
placement={placement}
|
|
||||||
overlay={
|
|
||||||
<Tooltip id={`${kebabCase(label)}-tooltip`} style={tooltipStyle}>
|
|
||||||
{tooltip}
|
|
||||||
</Tooltip>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{iconEl}
|
|
||||||
</OverlayTrigger>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoTooltipWithTrigger.propTypes = propTypes;
|
|
||||||
InfoTooltipWithTrigger.defaultProps = defaultProps;
|
|
|
@ -67,6 +67,7 @@ export const FilterMenu = ({
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={ft.id}
|
key={ft.id}
|
||||||
eventKey={ft}
|
eventKey={ft}
|
||||||
|
// @ts-ignore
|
||||||
onSelect={(fltr: typeof ft) =>
|
onSelect={(fltr: typeof ft) =>
|
||||||
setInternalFilters([...internalFilters, fltr])
|
setInternalFilters([...internalFilters, fltr])
|
||||||
}
|
}
|
||||||
|
@ -112,6 +113,7 @@ export const FilterInputs = ({
|
||||||
bsSize="small"
|
bsSize="small"
|
||||||
value={ft.operator}
|
value={ft.operator}
|
||||||
placeholder={filter ? getDefaultFilterOperator(filter) : ''}
|
placeholder={filter ? getDefaultFilterOperator(filter) : ''}
|
||||||
|
// @ts-ignore
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
updateInternalFilter(i, {
|
updateInternalFilter(i, {
|
||||||
operator: e.currentTarget.value,
|
operator: e.currentTarget.value,
|
||||||
|
@ -146,6 +148,7 @@ export const FilterInputs = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{filter.input !== 'select' && (
|
{filter.input !== 'select' && (
|
||||||
|
// @ts-ignore
|
||||||
<FormControl
|
<FormControl
|
||||||
type={filter.input ? filter.input : 'text'}
|
type={filter.input ? filter.input : 'text'}
|
||||||
bsSize="small"
|
bsSize="small"
|
||||||
|
|
|
@ -206,6 +206,7 @@ const ListView: FunctionComponent<Props> = ({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{bulkActions.map(action => (
|
{bulkActions.map(action => (
|
||||||
|
// @ts-ignore
|
||||||
<MenuItem
|
<MenuItem
|
||||||
id={action.name}
|
id={action.name}
|
||||||
key={action.key || action.name}
|
key={action.key || action.name}
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import ColumnTypeLabel from './ColumnTypeLabel';
|
import ColumnTypeLabel from './ColumnTypeLabel';
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
metric: PropTypes.object.isRequired,
|
metric: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
const propTypes = {
|
|
||||||
option: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
// This component provides a general tooltip for options
|
|
||||||
// in a SelectControl
|
|
||||||
export default function OptionDescription({ option }) {
|
|
||||||
return (
|
|
||||||
<span>
|
|
||||||
<span className="m-r-5 option-label">{option.label}</span>
|
|
||||||
{option.description && (
|
|
||||||
<InfoTooltipWithTrigger
|
|
||||||
className="m-r-5 text-muted"
|
|
||||||
icon="question-circle-o"
|
|
||||||
tooltip={option.description}
|
|
||||||
label={`descr-${option.label}`}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
OptionDescription.propTypes = propTypes;
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -20,12 +20,12 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Label, OverlayTrigger } from 'react-bootstrap';
|
import { Label, OverlayTrigger } from 'react-bootstrap';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import AdhocFilterEditPopover from './AdhocFilterEditPopover';
|
import AdhocFilterEditPopover from './AdhocFilterEditPopover';
|
||||||
import AdhocFilter from '../AdhocFilter';
|
import AdhocFilter from '../AdhocFilter';
|
||||||
import columnType from '../propTypes/columnType';
|
import columnType from '../propTypes/columnType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import adhocMetricType from '../propTypes/adhocMetricType';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
||||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
import { ControlLabel, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
import { ControlLabel, OverlayTrigger, Tooltip } from 'react-bootstrap';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Panel } from 'react-bootstrap';
|
import { Panel } from 'react-bootstrap';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
|
|
|
@ -183,6 +183,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
|
||||||
type="text"
|
type="text"
|
||||||
bsSize="sm"
|
bsSize="sm"
|
||||||
value={name}
|
value={name}
|
||||||
|
// @ts-ignore
|
||||||
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setName(event.target.value)
|
setName(event.target.value)
|
||||||
}
|
}
|
||||||
|
@ -198,6 +199,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
|
||||||
componentClass="textarea"
|
componentClass="textarea"
|
||||||
bsSize="sm"
|
bsSize="sm"
|
||||||
value={description}
|
value={description}
|
||||||
|
// @ts-ignore
|
||||||
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setDescription(event.target.value)
|
setDescription(event.target.value)
|
||||||
}
|
}
|
||||||
|
@ -221,6 +223,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
|
||||||
type="text"
|
type="text"
|
||||||
bsSize="sm"
|
bsSize="sm"
|
||||||
value={cacheTimeout}
|
value={cacheTimeout}
|
||||||
|
// @ts-ignore
|
||||||
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setCacheTimeout(event.target.value.replace(/[^0-9]/, ''))
|
setCacheTimeout(event.target.value.replace(/[^0-9]/, ''))
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ import {
|
||||||
} from 'react-bootstrap';
|
} from 'react-bootstrap';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import { getChartKey } from '../../exploreUtils';
|
import { getChartKey } from '../../exploreUtils';
|
||||||
import { runAnnotationQuery } from '../../../chart/chartAction';
|
import { runAnnotationQuery } from '../../../chart/chartAction';
|
||||||
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
|
||||||
|
|
||||||
import AnnotationLayer from './AnnotationLayer';
|
import AnnotationLayer from './AnnotationLayer';
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import {
|
||||||
arrayMove,
|
arrayMove,
|
||||||
} from 'react-sortable-hoc';
|
} from 'react-sortable-hoc';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import ControlHeader from '../ControlHeader';
|
import ControlHeader from '../ControlHeader';
|
||||||
import controlMap from './';
|
import controlMap from './';
|
||||||
import './CollectionControl.less';
|
import './CollectionControl.less';
|
||||||
|
|
|
@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
|
||||||
import { OverlayTrigger, Popover } from 'react-bootstrap';
|
import { OverlayTrigger, Popover } from 'react-bootstrap';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import FormRow from '../../../components/FormRow';
|
import FormRow from '../../../components/FormRow';
|
||||||
import SelectControl from './SelectControl';
|
import SelectControl from './SelectControl';
|
||||||
import CheckboxControl from './CheckboxControl';
|
import CheckboxControl from './CheckboxControl';
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
import Select from 'react-select';
|
import Select from 'react-select';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
import BoundsControl from './BoundsControl';
|
import BoundsControl from './BoundsControl';
|
||||||
import CheckboxControl from './CheckboxControl';
|
import CheckboxControl from './CheckboxControl';
|
||||||
|
|
||||||
|
|
|
@ -1,233 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
import React from 'react';
|
|
||||||
import { t } from '@superset-ui/translation';
|
|
||||||
import { validateNonEmpty } from '@superset-ui/validator';
|
|
||||||
import OptionDescription from '../../components/OptionDescription';
|
|
||||||
import { NVD3TimeSeries } from './sections';
|
|
||||||
import {
|
|
||||||
D3_TIME_FORMAT_OPTIONS,
|
|
||||||
D3_FORMAT_DOCS,
|
|
||||||
D3_FORMAT_OPTIONS,
|
|
||||||
} from '../controls';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
controlPanelSections: [
|
|
||||||
{
|
|
||||||
label: t('Query'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [
|
|
||||||
['metrics'],
|
|
||||||
['adhoc_filters'],
|
|
||||||
['groupby'],
|
|
||||||
['limit', 'timeseries_limit_metric'],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'order_desc',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Sort Descending'),
|
|
||||||
default: true,
|
|
||||||
description: t('Whether to sort descending or ascending'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'contribution',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Contribution'),
|
|
||||||
default: false,
|
|
||||||
description: t('Compute the contribution to the total'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
['row_limit', null],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Time Series Options'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'time_series_option',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
label: t('Options'),
|
|
||||||
validators: [validateNonEmpty],
|
|
||||||
default: 'not_time',
|
|
||||||
valueKey: 'value',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: t('Not Time Series'),
|
|
||||||
value: 'not_time',
|
|
||||||
description: t('Ignore time'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Time Series'),
|
|
||||||
value: 'time_series',
|
|
||||||
description: t('Standard time series'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Aggregate Mean'),
|
|
||||||
value: 'agg_mean',
|
|
||||||
description: t('Mean of values over specified period'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Aggregate Sum'),
|
|
||||||
value: 'agg_sum',
|
|
||||||
description: t('Sum of values over specified period'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Difference'),
|
|
||||||
value: 'point_diff',
|
|
||||||
description: t(
|
|
||||||
'Metric change in value from `since` to `until`',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Percent Change'),
|
|
||||||
value: 'point_percent',
|
|
||||||
description: t(
|
|
||||||
'Metric percent change in value from `since` to `until`',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Factor'),
|
|
||||||
value: 'point_factor',
|
|
||||||
description: t(
|
|
||||||
'Metric factor change from `since` to `until`',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Advanced Analytics'),
|
|
||||||
value: 'adv_anal',
|
|
||||||
description: t('Use the Advanced Analytics options below'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
optionRenderer: op => <OptionDescription option={op} />,
|
|
||||||
valueRenderer: op => <OptionDescription option={op} />,
|
|
||||||
description: t('Settings for time series'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Chart Options'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [
|
|
||||||
['color_scheme', 'label_colors'],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'number_format',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
freeForm: true,
|
|
||||||
label: t('Number format'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 'SMART_NUMBER',
|
|
||||||
choices: D3_FORMAT_OPTIONS,
|
|
||||||
description: D3_FORMAT_DOCS,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'date_time_format',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
freeForm: true,
|
|
||||||
label: t('Date Time Format'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 'smart_date',
|
|
||||||
choices: D3_TIME_FORMAT_OPTIONS,
|
|
||||||
description: D3_FORMAT_DOCS,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'partition_limit',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
label: t('Partition Limit'),
|
|
||||||
isInt: true,
|
|
||||||
default: '5',
|
|
||||||
description: t(
|
|
||||||
'The maximum number of subdivisions of each group; ' +
|
|
||||||
'lower values are pruned first',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'partition_threshold',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
label: t('Partition Threshold'),
|
|
||||||
isFloat: true,
|
|
||||||
default: '0.05',
|
|
||||||
description: t(
|
|
||||||
'Partitions whose height to parent height proportions are ' +
|
|
||||||
'below this value are pruned',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'log_scale',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Log Scale'),
|
|
||||||
default: false,
|
|
||||||
renderTrigger: true,
|
|
||||||
description: t('Use a log scale'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'equal_date_size',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Equal Date Sizes'),
|
|
||||||
default: true,
|
|
||||||
renderTrigger: true,
|
|
||||||
description: t(
|
|
||||||
'Check to force date partitions to have the same height',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'rich_tooltip',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Rich Tooltip'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: true,
|
|
||||||
description: t(
|
|
||||||
'The rich tooltip shows a list of all series for that point in time',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
NVD3TimeSeries[1],
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -41,7 +41,6 @@ import Mapbox from '../explore/controlPanels/Mapbox';
|
||||||
import Markup from '../explore/controlPanels/Markup';
|
import Markup from '../explore/controlPanels/Markup';
|
||||||
import PairedTtest from '../explore/controlPanels/PairedTtest';
|
import PairedTtest from '../explore/controlPanels/PairedTtest';
|
||||||
import Para from '../explore/controlPanels/Para';
|
import Para from '../explore/controlPanels/Para';
|
||||||
import Partition from '../explore/controlPanels/Partition';
|
|
||||||
import Separator from '../explore/controlPanels/Separator';
|
import Separator from '../explore/controlPanels/Separator';
|
||||||
import Table from '../explore/controlPanels/Table';
|
import Table from '../explore/controlPanels/Table';
|
||||||
import TimeTable from '../explore/controlPanels/TimeTable';
|
import TimeTable from '../explore/controlPanels/TimeTable';
|
||||||
|
@ -63,7 +62,6 @@ export default function setupPlugins() {
|
||||||
.registerValue('markup', Markup)
|
.registerValue('markup', Markup)
|
||||||
.registerValue('paired_ttest', PairedTtest)
|
.registerValue('paired_ttest', PairedTtest)
|
||||||
.registerValue('para', Para)
|
.registerValue('para', Para)
|
||||||
.registerValue('partition', Partition)
|
|
||||||
.registerValue('separator', Separator)
|
.registerValue('separator', Separator)
|
||||||
.registerValue('table', Table)
|
.registerValue('table', Table)
|
||||||
.registerValue('time_table', TimeTable)
|
.registerValue('time_table', TimeTable)
|
||||||
|
|
|
@ -24,9 +24,9 @@ import { Table, Thead, Th, Tr, Td } from 'reactable-arc';
|
||||||
import { formatNumber } from '@superset-ui/number-format';
|
import { formatNumber } from '@superset-ui/number-format';
|
||||||
import { formatTime } from '@superset-ui/time-format';
|
import { formatTime } from '@superset-ui/time-format';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import MetricOption from '../../components/MetricOption';
|
import MetricOption from '../../components/MetricOption';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
import FormattedNumber from './FormattedNumber';
|
import FormattedNumber from './FormattedNumber';
|
||||||
import SparklineCell from './SparklineCell';
|
import SparklineCell from './SparklineCell';
|
||||||
import './TimeTable.less';
|
import './TimeTable.less';
|
||||||
|
|
|
@ -22,10 +22,10 @@ import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import Dialog from 'react-bootstrap-dialog';
|
import Dialog from 'react-bootstrap-dialog';
|
||||||
import { t } from '@superset-ui/translation';
|
import { t } from '@superset-ui/translation';
|
||||||
|
import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
|
||||||
|
|
||||||
import { exportChart } from '../../explore/exploreUtils';
|
import { exportChart } from '../../explore/exploreUtils';
|
||||||
import * as actions from '../actions/sqlLab';
|
import * as actions from '../actions/sqlLab';
|
||||||
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
|
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
|
|
Loading…
Reference in New Issue