Skip to content

Commit

Permalink
Maded modifications based on comments:
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu committed Oct 7, 2016
1 parent be5020c commit 184134e
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 87 deletions.
Expand Up @@ -38,7 +38,7 @@ class ChartControl extends React.Component {
}
render() {
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">Chart Options</div>
<div className="panel-body">
<h5 className="section-heading">Datasource</h5>
Expand Down
36 changes: 18 additions & 18 deletions caravel/assets/javascripts/explorev2/components/GroupBy.jsx
Expand Up @@ -20,25 +20,25 @@ const defaultProps = {
};

const GroupBy = (props) => {
const selects = [];
selects.push({
key: 'groupByColumns',
title: 'GroupBy Column',
options: props.groupByColumnOpts,
value: props.groupByColumns,
multi: true,
width: '12',
});
selects.push({
key: 'metrics',
title: 'Metrics',
options: props.metricsOpts,
value: props.metrics,
multi: true,
width: '12',
});
const selects = [
{
key: 'groupByColumns',
title: 'Group By',
options: props.groupByColumnOpts,
value: props.groupByColumns,
multi: true,
width: '12',
},
{
key: 'metrics',
title: 'Metrics',
options: props.metricsOpts,
value: props.metrics,
multi: true,
width: '12',
}];
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">GroupBy</div>
<div className="panel-body">
<SelectArray selectArray={selects} />
Expand Down
36 changes: 18 additions & 18 deletions caravel/assets/javascripts/explorev2/components/NotGroupBy.jsx
Expand Up @@ -20,25 +20,25 @@ const defaultProps = {
};

const NotGroupBy = (props) => {
const selects = [];
selects.push({
key: 'columns',
title: 'Columns',
options: props.columnOpts,
value: props.columns,
multi: true,
width: '12',
});
selects.push({
key: 'orderings',
title: 'Orderings',
options: props.orderingOpts,
value: props.orderings,
multi: true,
width: '12',
});
const selects = [
{
key: 'columns',
title: 'Columns',
options: props.columnOpts,
value: props.columns,
multi: true,
width: '12',
},
{
key: 'orderings',
title: 'Orderings',
options: props.orderingOpts,
value: props.orderings,
multi: true,
width: '12',
}];
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">Not GroupBy</div>
<div className="panel-body">
<SelectArray selectArray={selects} />
Expand Down
32 changes: 16 additions & 16 deletions caravel/assets/javascripts/explorev2/components/Options.jsx
Expand Up @@ -17,23 +17,23 @@ const defaultProps = {
};

const Options = (props) => {
const selects = [];
selects.push({
key: 'timeStampFormat',
title: 'Timestamp Format',
options: timestampOptions.map((t) => ({ value: t[0], label: t[1] })),
value: props.timeStampFormat,
width: '12',
});
selects.push({
key: 'rowLimit',
title: 'Row Limit',
options: rowLimitOptions.map((r) => ({ value: r, label: r })),
value: props.rowLimit,
width: '12',
});
const selects = [
{
key: 'timeStampFormat',
title: 'Timestamp Format',
options: timestampOptions.map((t) => ({ value: t[0], label: t[1] })),
value: props.timeStampFormat,
width: '12',
},
{
key: 'rowLimit',
title: 'Row Limit',
options: rowLimitOptions.map((r) => ({ value: r, label: r })),
value: props.rowLimit,
width: '12',
}];
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">Options</div>
<div className="panel-body">
<SelectArray selectArray={selects} />
Expand Down
Expand Up @@ -13,7 +13,7 @@ class SqlClause extends React.Component {
}
render() {
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">SQL</div>
<div className="panel-body">
<div className="row">
Expand Down
59 changes: 29 additions & 30 deletions caravel/assets/javascripts/explorev2/components/TimeFilter.jsx
Expand Up @@ -26,37 +26,36 @@ const defaultProps = {
};

const TimeFilter = (props) => {
const timeColumnTitle =
(props.datasourceType === 'table') ? 'Time Column' : 'Time Granularity';
const timeGrainTitle =
(props.datasourceType === 'table') ? 'Time Grain' : 'Origin';
const selects = [];
selects.push({
key: 'timeColumn',
title: timeColumnTitle,
options: props.timeColumnOpts,
value: props.timeColumn,
});
selects.push({
key: 'timeGrain',
title: timeGrainTitle,
options: props.timeGrainOpts,
value: props.timeGrain,
});
selects.push({
key: 'since',
title: 'Since',
options: sinceOptions.map((s) => ({ value: s, label: s })),
value: props.since,
});
selects.push({
key: 'until',
title: 'Until',
options: untilOptions.map((u) => ({ value: u, label: u })),
value: props.until,
});
const isDatasourceTypeTable = props.datasourceType === 'table';
const timeColumnTitle = isDatasourceTypeTable ? 'Time Column' : 'Time Granularity';
const timeGrainTitle = isDatasourceTypeTable ? 'Time Grain' : 'Origin';
const selects = [
{
key: 'timeColumn',
title: timeColumnTitle,
options: props.timeColumnOpts,
value: props.timeColumn,
},
{
key: 'timeGrain',
title: timeGrainTitle,
options: props.timeGrainOpts,
value: props.timeGrain,
},
{
key: 'since',
title: 'Since',
options: sinceOptions.map((s) => ({ value: s, label: s })),
value: props.since,
},
{
key: 'until',
title: 'Until',
options: untilOptions.map((u) => ({ value: u, label: u })),
value: props.until,
}];
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">Time Filter</div>
<div className="panel-body">
<SelectArray selectArray={selects} />
Expand Down
Expand Up @@ -3,9 +3,9 @@ import * as actions from '../actions/exploreActions';
import { addToArr, removeFromArr, alterInArr } from '../../../utils/reducerUtils';

const setFormInViz = function (state, action) {
const newForm = Object.assign({}, state);
newForm[action.key] = action.value;
return newForm;
const newFormData = Object.assign({}, state);
newFormData[action.key] = action.value;
return newFormData;
};

const setVizInState = function (state, action) {
Expand Down

0 comments on commit 184134e

Please sign in to comment.