Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hofix] work around circular deps #3598

Merged
merged 2 commits into from
Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {

import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
import ControlHeader from '../ControlHeader';
import controlMap from './';

const propTypes = {
name: PropTypes.string.isRequired,
Expand Down Expand Up @@ -63,6 +64,7 @@ export default class CollectionControl extends React.Component {
if (this.props.value.length === 0) {
return <div className="text-muted">{this.props.placeholder}</div>;
}
const control = controlMap[this.props.control];
return (
<SortableListGroup
useDragHandle
Expand All @@ -79,7 +81,7 @@ export default class CollectionControl extends React.Component {
<SortableDragger />
</div>
<div className="pull-left">
<this.props.control
<control
{...o}
onChange={this.onChange.bind(this, i)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ const controlMap = {
TimeSeriesColumnControl,
VizTypeControl,
};

export default controlMap;
3 changes: 1 addition & 2 deletions superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ALL_COLOR_SCHEMES, spectrums } from '../../modules/colors';
import MetricOption from '../../components/MetricOption';
import ColumnOption from '../../components/ColumnOption';
import { t } from '../../locales';
import controlMap from '../components/controls';

const D3_FORMAT_DOCS = 'D3 format syntax: https://github.com/d3/d3-format';

Expand Down Expand Up @@ -1444,7 +1443,7 @@ export const controls = {
type: 'CollectionControl',
label: t('Time Series Columns'),
validators: [v.nonEmpty],
control: controlMap.TimeSeriesColumnControl,
control: 'TimeSeriesColumnControl',
},

};
Expand Down
6 changes: 1 addition & 5 deletions superset/assets/visualizations/time_table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import propTypes from 'prop-types';
import { Table, Thead, Th } from 'reactable';
import d3 from 'd3';
import { Sparkline, LineSeries, PointSeries } from '@data-ui/sparkline';
import { Sparkline, LineSeries } from '@data-ui/sparkline';

import MetricOption from '../javascripts/components/MetricOption';
import TooltipWrapper from '../javascripts/components/TooltipWrapper';
Expand Down Expand Up @@ -94,10 +94,6 @@ function viz(slice, payload) {
showArea={false}
stroke={brandColor}
/>
<PointSeries
points={['min', 'max', 'last']}
fill={brandColor}
/>
</Sparkline>
</div>
</TooltipWrapper>);
Expand Down