File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import EdiTDorContext from "./ediTDorContext";
1616import { editdorReducer } from "./editorReducers" ;
1717
1818export const UPDATE_OFFLINE_TD = "UPDATE_OFFLINE_TD" ;
19+ export const UPDATE_JSON_INDENTATION =
20+ "UPDATE_JSON_INDENTATION" ;
1921export const UPDATE_IS_MODIFIED = "UPDATE_IS_MODIFIED" ;
2022export const SET_FILE_HANDLE = "SET_FILE_HANDLE" ;
2123export const REMOVE_FORM_FROM_TD = "REMOVE_FORM_FROM_TD" ;
@@ -93,8 +95,17 @@ const GlobalState: React.FC<IGlobalStateProps> = ({ children }) => {
9395 nameRepository : "" ,
9496 dynamicValues : { } ,
9597 } ,
98+ jsonIndentation :2 ,
99+ updateJsonIndentation :( ) => { }
96100 } ) ;
97101
102+ const updateJsonIndentation = ( indentation :number ) => {
103+ dispatch ( {
104+ type :UPDATE_JSON_INDENTATION ,
105+ jsonIndentation :indentation
106+ } )
107+ }
108+
98109 const updateOfflineTD = ( offlineTD : string ) => {
99110 dispatch ( { type : UPDATE_OFFLINE_TD , offlineTD : offlineTD } ) ;
100111 } ;
@@ -202,11 +213,13 @@ const GlobalState: React.FC<IGlobalStateProps> = ({ children }) => {
202213 updateValidationMessage,
203214 updateNorthboundConnection,
204215 updateContributeCatalog,
216+ jsonIndentation :editdorState . jsonIndentation ,
217+ updateJsonIndentation
205218 } }
206219 >
207220 { children }
208221 </ EdiTDorContext . Provider >
209222 ) ;
210223} ;
211224
212- export default GlobalState ;
225+ export default GlobalState ;
You can’t perform that action at this time.
0 commit comments