Skip to content

Commit 98ef02e

Browse files
tables with all string columns
1 parent 93acdd3 commit 98ef02e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

classes/Visualizer/Gutenberg/src/Components/Sidebar/ColumnSettings.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class ColumnSettings extends Component {
2828
*/
2929
const settings = this.props.chart['visualizer-settings'];
3030

31+
if ( ! settings.series ) {
32+
return;
33+
}
34+
3135
Object.keys( settings.series )
3236
.map( i => {
3337
if ( settings.series[i] !== undefined ) {
@@ -47,6 +51,10 @@ class ColumnSettings extends Component {
4751

4852
const type = this.props.chart['visualizer-chart-type'];
4953

54+
if ( ! settings.series ) {
55+
return null;
56+
}
57+
5058
return (
5159
<PanelBody
5260
title={ __( 'Column Settings' ) }
@@ -56,14 +64,15 @@ class ColumnSettings extends Component {
5664

5765
{ Object.keys( settings.series )
5866
.map( ( i ) => {
67+
5968
return (
6069
<PanelBody
6170
title={ series[i].label }
6271
className="visualizer-inner-sections"
6372
initialOpen={ false }
6473
>
6574

66-
{ ( 'date' === series[i].type || 'datetime' === series[i].type || 'timeofday' === series[i].type ) && (
75+
{ 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( series[i].type ) && (
6776
<Fragment>
6877
<TextControl
6978
label={ __( 'Display Date Format' ) }
@@ -171,7 +180,7 @@ class ColumnSettings extends Component {
171180
</Fragment>
172181
) }
173182

174-
{ ( 'boolean' === series[i].type ) && ( 'dataTable' === type ) && (
183+
{ ( 'boolean' === series[i].type ) && (
175184
<Fragment>
176185
<TextControl
177186
label={ __( 'Truthy value' ) }

0 commit comments

Comments
 (0)