@@ -28,6 +28,7 @@ import {
2828 getTruncateNumbersWithPound ,
2929 getShowEmptyStrings ,
3030 getShowNullStrings ,
31+ getShowExtraGroupColumn ,
3132 updateSettings as updateSettingsAction ,
3233 RootState ,
3334 WorkspaceSettings ,
@@ -56,6 +57,7 @@ interface FormattingSectionContentProps {
5657 truncateNumbersWithPound : boolean ;
5758 showEmptyStrings : boolean ;
5859 showNullStrings : boolean ;
60+ showExtraGroupColumn : boolean ;
5961 updateSettings : ( settings : Partial < WorkspaceSettings > ) => void ;
6062 defaultDecimalFormatOptions : FormatOption ;
6163 defaultIntegerFormatOptions : FormatOption ;
@@ -72,6 +74,7 @@ interface FormattingSectionContentState {
7274 truncateNumbersWithPound : boolean ;
7375 showEmptyStrings : boolean ;
7476 showNullStrings : boolean ;
77+ showExtraGroupColumn : boolean ;
7578 timestampAtMenuOpen : Date ;
7679}
7780
@@ -113,6 +116,8 @@ export class FormattingSectionContent extends PureComponent<
113116 this . handleShowEmptyStringsChange . bind ( this ) ;
114117 this . handleShowNullStringsChange =
115118 this . handleShowNullStringsChange . bind ( this ) ;
119+ this . handleShowExtraGroupColumnChange =
120+ this . handleShowExtraGroupColumnChange . bind ( this ) ;
116121
117122 const {
118123 defaultDateTimeFormat,
@@ -124,6 +129,7 @@ export class FormattingSectionContent extends PureComponent<
124129 truncateNumbersWithPound,
125130 showEmptyStrings,
126131 showNullStrings,
132+ showExtraGroupColumn,
127133 } = props ;
128134
129135 this . containerRef = React . createRef ( ) ;
@@ -139,6 +145,7 @@ export class FormattingSectionContent extends PureComponent<
139145 truncateNumbersWithPound,
140146 showEmptyStrings,
141147 showNullStrings,
148+ showExtraGroupColumn,
142149 timestampAtMenuOpen : new Date ( ) ,
143150 } ;
144151 }
@@ -330,6 +337,15 @@ export class FormattingSectionContent extends PureComponent<
330337 this . queueUpdate ( update ) ;
331338 }
332339
340+ handleShowExtraGroupColumnChange ( ) : void {
341+ const { showExtraGroupColumn } = this . state ;
342+ const update = {
343+ showExtraGroupColumn : ! showExtraGroupColumn ,
344+ } ;
345+ this . setState ( update ) ;
346+ this . queueUpdate ( update ) ;
347+ }
348+
333349 commitChanges ( ) : void {
334350 const { updateSettings } = this . props ;
335351 const updates = this . pendingUpdates . reduce (
@@ -356,6 +372,7 @@ export class FormattingSectionContent extends PureComponent<
356372 truncateNumbersWithPound,
357373 showEmptyStrings,
358374 showNullStrings,
375+ showExtraGroupColumn,
359376 } = this . state ;
360377
361378 const {
@@ -596,6 +613,23 @@ export class FormattingSectionContent extends PureComponent<
596613 </ Checkbox >
597614 </ div >
598615 </ div >
616+
617+ < div className = "form-row mb-3" id = "show_extra_group_column_div" >
618+ < label
619+ className = "col-form-label col-3"
620+ htmlFor = "default-show-extra-group-column"
621+ >
622+ Rollup
623+ </ label >
624+ < div className = "col pr-0 pt-2" id = "default-show-extra-group-column" >
625+ < Checkbox
626+ checked = { showExtraGroupColumn }
627+ onChange = { this . handleShowExtraGroupColumnChange }
628+ >
629+ Show extra "group" column
630+ </ Checkbox >
631+ </ div >
632+ </ div >
599633 </ div >
600634 </ div >
601635 ) ;
@@ -614,6 +648,7 @@ const mapStateToProps = (
614648 truncateNumbersWithPound : getTruncateNumbersWithPound ( state ) ,
615649 showEmptyStrings : getShowEmptyStrings ( state ) ,
616650 showNullStrings : getShowNullStrings ( state ) ,
651+ showExtraGroupColumn : getShowExtraGroupColumn ( state ) ,
617652 timeZone : getTimeZone ( state ) ,
618653 defaults : getDefaultSettings ( state ) ,
619654} ) ;
0 commit comments