@@ -25,23 +25,29 @@ import { keyCodes } from '@elastic/eui';
2525import { Vis , VisState } from 'ui/vis' ;
2626import { PersistedState } from 'ui/persisted_state' ;
2727import { DefaultEditorNavBar , OptionTab } from './navbar' ;
28- import { setStateParamValue , EditorAction } from '../../state/actions ' ;
28+ import { setStateParamValue , EditorAction , SetValidity , SetTouched } from '../../state' ;
2929import { AggGroupNames } from '../../agg_groups' ;
3030import { DefaultEditorAggCommonProps } from '../agg_common_props' ;
3131
3232interface DefaultEditorSideBarProps {
33- dispatch : React . Dispatch < EditorAction > ;
3433 applyChanges ( ) : void ;
34+ dispatch : React . Dispatch < EditorAction > ;
35+ formIsTouched : boolean ;
3536 optionTabs : OptionTab [ ] ;
37+ setTouched : SetTouched ;
38+ setValidity : SetValidity ;
3639 state : VisState ;
3740 uiState : PersistedState ;
3841 vis : Vis ;
3942}
4043
4144function DefaultEditorSideBar ( {
42- dispatch,
4345 applyChanges,
46+ dispatch,
47+ formIsTouched,
4448 optionTabs,
49+ setTouched,
50+ setValidity,
4551 state,
4652 uiState,
4753 vis,
@@ -57,8 +63,9 @@ function DefaultEditorSideBar({
5763 responseAggs ,
5864 ] ) ;
5965
60- const setValidity = ( ) => { } ;
61- const setTouched = ( ) => { } ;
66+ const setStateValidity = useCallback ( ( value : boolean ) => {
67+ setValidity ( 'visOptions' , value ) ;
68+ } , [ ] ) ;
6269
6370 const setStateValue : DefaultEditorAggCommonProps [ 'setStateParamValue' ] = useCallback (
6471 ( paramName , value ) => {
@@ -85,6 +92,7 @@ function DefaultEditorSideBar({
8592
8693 const dataTabProps = {
8794 dispatch,
95+ formIsTouched,
8896 metricAggs,
8997 state,
9098 schemas : vis . type . schemas ,
@@ -100,7 +108,7 @@ function DefaultEditorSideBar({
100108 vis,
101109 uiState,
102110 setValue : setStateValue ,
103- setValidity,
111+ setValidity : setStateValidity ,
104112 setTouched,
105113 } ;
106114
0 commit comments