From df652affa553f9a67d93a1aa9dc2f1df24a5f109 Mon Sep 17 00:00:00 2001 From: Felix Ouk Date: Thu, 14 Sep 2017 16:38:10 -0700 Subject: [PATCH] Add CustomWildcardFieldList and DropZone to DataPane component --- src/components/data-pane/index.tsx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/components/data-pane/index.tsx b/src/components/data-pane/index.tsx index 6f684d33c..7cf085662 100644 --- a/src/components/data-pane/index.tsx +++ b/src/components/data-pane/index.tsx @@ -1,20 +1,30 @@ +import {Schema} from 'compassql/build/src/schema'; import * as React from 'react'; import * as CSSModules from 'react-css-modules'; import {connect} from 'react-redux'; +import {CustomWildcardAction} from '../../actions/custom-wildcard-field'; +import {ActionHandler} from '../../actions/redux-action'; import {Dataset, State} from '../../models'; import {VoyagerConfig} from '../../models/config'; +import {CustomWildcardFieldDef} from '../../models/custom-wildcard-field'; import {selectConfig, selectDataset} from '../../selectors/'; +import {selectSchema} from '../../selectors/dataset'; +import {selectCustomWildcardFieldDefs} from '../../selectors/index'; import {DataSelector} from '../data-selector'; import * as styles from './data-pane.scss'; -import {FieldList, PresetWildcardFieldList} from './field-list'; +import {CustomWildcardFieldList, FieldList, PresetWildcardFieldList} from './field-list'; +import {CustomWildcardFieldDropZone} from './wildcard-field-drop-zone'; -export interface DataPanelProps { - data: Dataset; +export interface DataPanelProps extends ActionHandler { config: VoyagerConfig; + customWildcardFieldDefs: CustomWildcardFieldDef[]; + data: Dataset; + schema: Schema; } export class DataPaneBase extends React.PureComponent { public render() { + const {schema, handleAction} = this.props; const {name} = this.props.data; const fieldCount = this.props.data.schema.fieldSchemas.length; const {showDataSourceSelector, manualSpecificationOnly} = this.props.config; @@ -29,8 +39,14 @@ export class DataPaneBase extends React.PureComponent {

Wildcard Fields

+ +
); + return (

Data

@@ -54,8 +70,10 @@ export class DataPaneBase extends React.PureComponent { export const DataPane = connect( (state: State) => { return { + config: selectConfig(state), + customWildcardFieldDefs: selectCustomWildcardFieldDefs(state), data: selectDataset(state), - config: selectConfig(state) + schema: selectSchema(state) }; } )(CSSModules(DataPaneBase, styles));