-
Notifications
You must be signed in to change notification settings - Fork 30
feat(settings): add JSON editor indentation option (2 or 4 spaces) #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7fb747a
b89ae9b
7236487
3fe5baf
10ebb53
5fc053a
a5896c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ export const UPDATE_VALIDATION_MESSAGE = "UPDATE_VALIDATION_MESSAGE"; | |
| export const UPDATE_NORTHBOUND_CONNECTION = "UPDATE_NORTHBOUND_CONNECTION"; | ||
| export const UPDATE_CONTRIBUTE_CATALOG = "UPDATE_CONTRIBUTE_CATALOG"; | ||
| export const UPDATE_BACKGROUND_TM = "UPDATE_BACKGROUND_TM"; | ||
| export const UPDATE_JSON_INDENTATION = "UPDATE_JSON_INDENTATION"; | ||
|
|
||
| interface IGlobalStateProps { | ||
| children: ReactNode; | ||
|
|
@@ -93,6 +94,7 @@ const GlobalState: React.FC<IGlobalStateProps> = ({ children }) => { | |
| nameRepository: "", | ||
| dynamicValues: {}, | ||
| }, | ||
| jsonIndentation: 2, | ||
| }); | ||
|
|
||
| const updateOfflineTD = (offlineTD: string) => { | ||
|
|
@@ -177,6 +179,13 @@ const GlobalState: React.FC<IGlobalStateProps> = ({ children }) => { | |
| }); | ||
| }; | ||
|
|
||
| const updateJsonIndentation = (value: 2 | 4) => { | ||
| dispatch({ | ||
| type: UPDATE_JSON_INDENTATION, | ||
| value, | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <EdiTDorContext.Provider | ||
| value={{ | ||
|
|
@@ -190,6 +199,8 @@ const GlobalState: React.FC<IGlobalStateProps> = ({ children }) => { | |
| validationMessage: editdorState.validationMessage, | ||
| northboundConnection: editdorState.northboundConnection, | ||
| contributeCatalog: editdorState.contributeCatalog, | ||
| jsonIndentation: editdorState.jsonIndentation, | ||
| updateJsonIndentation, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updateJsonIndentation should be in the last line
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updateJsonIndentation should be in the last line |
||
| updateOfflineTD, | ||
| updateIsModified, | ||
| setFileHandle, | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an increase of typescritp errors
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an increase of typescript errors |
Uh oh!
There was an error while loading. Please reload this page.