diff --git a/packages/insomnia-app/app/ui/components/codemirror/code-editor.tsx b/packages/insomnia-app/app/ui/components/codemirror/code-editor.tsx index 51b1680b5..5f0fdde39 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/code-editor.tsx +++ b/packages/insomnia-app/app/ui/components/codemirror/code-editor.tsx @@ -94,17 +94,35 @@ export type CodeEditorOnChange = (value: string) => void; type ReduxProps = ReturnType; -const mapStateToProps = (state: RootState) => { - const { hotKeyRegistry, autocompleteDelay } = selectSettings(state); +interface OwnProps { + ignoreEditorFontSettings?: boolean; +} + +const mapStateToProps = (state: RootState, { ignoreEditorFontSettings }: OwnProps) => { + const { + hotKeyRegistry, + autocompleteDelay, + editorFontSize, + editorIndentSize, + editorKeyMap, + editorLineWrapping, + editorIndentWithTabs, + nunjucksPowerUserMode, + } = selectSettings(state); return { hotKeyRegistry, autocompleteDelay, + fontSize: ignoreEditorFontSettings ? undefined : editorFontSize, + indentSize: ignoreEditorFontSettings ? undefined : editorIndentSize, + keyMap: editorKeyMap, + lineWrapping: ignoreEditorFontSettings ? undefined : editorLineWrapping, + indentWithTabs: ignoreEditorFontSettings ? undefined : editorIndentWithTabs, + nunjucksPowerUserMode, }; }; interface Props extends ReduxProps { - indentWithTabs?: boolean; onChange?: CodeEditorOnChange; onCursorActivity?: (cm: CodeMirror.EditorFromTextArea) => void; onFocus?: (e: FocusEvent) => void; @@ -116,21 +134,16 @@ interface Props extends ReduxProps { onPaste?: (e: ClipboardEvent) => void; onCodeMirrorInit?: (editor: CodeMirror.EditorFromTextArea) => void; render?: HandleRender; - nunjucksPowerUserMode?: boolean; getRenderContext?: HandleGetRenderContext; getAutocompleteConstants?: () => string[] | PromiseLike; getAutocompleteSnippets?: () => CodeMirror.Snippet[]; - keyMap?: string; mode?: string; id?: string; placeholder?: string; - lineWrapping?: boolean; hideLineNumbers?: boolean; hideGutters?: boolean; noMatchBrackets?: boolean; hideScrollbars?: boolean; - fontSize?: number; - indentSize?: number; defaultValue?: string; tabIndex?: number; autoPrettify?: boolean; @@ -155,6 +168,7 @@ interface Props extends ReduxProps { infoOptions?: GraphQLInfoOptions; jumpOptions?: ModifiedGraphQLJumpOptions; uniquenessKey?: string; + // TODO: I think this prop can actually be removed entirely isVariableUncovered?: boolean; raw?: boolean; } @@ -581,6 +595,7 @@ export class UnconnectedCodeEditor extends Component { this.codeMirror?.clearHistory(); // Setup nunjucks listeners + // TODO: we shouldn't need to set setup nunjucks if we're in readonly mode if (this.props.render && !this.props.nunjucksPowerUserMode) { this.codeMirror?.enableNunjucksTags( this.props.render, diff --git a/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.tsx b/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.tsx index 9cbd386ef..11b5aa629 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.tsx +++ b/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.tsx @@ -24,7 +24,6 @@ interface Props { onPaste?: (e: ClipboardEvent) => void; render?: HandleRender; getRenderContext?: HandleGetRenderContext; - nunjucksPowerUserMode?: boolean; getAutocompleteConstants?: () => string[] | PromiseLike; placeholder?: string; className?: string; @@ -352,7 +351,6 @@ export class OneLineEditor extends PureComponent { render, onPaste, getRenderContext, - nunjucksPowerUserMode, getAutocompleteConstants, isVariableUncovered, mode: syntaxMode, @@ -374,6 +372,7 @@ export class OneLineEditor extends PureComponent { noStyleActiveLine noLint singleLine + ignoreEditorFontSettings autoCloseBrackets={false} tabIndex={0} id={id} @@ -388,7 +387,6 @@ export class OneLineEditor extends PureComponent { onChange={onChange} render={render} getRenderContext={getRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} getAutocompleteConstants={getAutocompleteConstants} className={classnames('editor--single-line', className)} defaultValue={defaultValue} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/asap-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/asap-auth.tsx index 3c894df25..df94c8c91 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/asap-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/asap-auth.tsx @@ -28,7 +28,6 @@ interface Props { request: Request; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; } @@ -83,7 +82,6 @@ export class AsapAuth extends PureComponent { handleRender, handleGetRenderContext, request, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -106,7 +104,6 @@ export class AsapAuth extends PureComponent { mode={mode} onChange={onChange} defaultValue={authentication[property] || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/auth-wrapper.tsx b/packages/insomnia-app/app/ui/components/editors/auth/auth-wrapper.tsx index 88a15aa07..ca47680a8 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/auth-wrapper.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/auth-wrapper.tsx @@ -33,7 +33,6 @@ interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; handleUpdateSettingsShowPasswords: (showPasswords: boolean) => Promise; - nunjucksPowerUserMode: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; request: Request; showPasswords: boolean; @@ -49,7 +48,6 @@ export class AuthWrapper extends PureComponent { request, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, handleUpdateSettingsShowPasswords, onChange, showPasswords, @@ -64,7 +62,6 @@ export class AuthWrapper extends PureComponent { handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} showPasswords={showPasswords} isVariableUncovered={isVariableUncovered} @@ -77,7 +74,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords} onChange={onChange} showPasswords={showPasswords} @@ -90,7 +86,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} isVariableUncovered={isVariableUncovered} /> @@ -101,7 +96,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} showPasswords={showPasswords} onChange={onChange} isVariableUncovered={isVariableUncovered} @@ -114,7 +108,6 @@ export class AuthWrapper extends PureComponent { handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} showPasswords={showPasswords} isVariableUncovered={isVariableUncovered} @@ -126,7 +119,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords} onChange={onChange} showPasswords={showPasswords} @@ -139,7 +131,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} isVariableUncovered={isVariableUncovered} /> @@ -151,7 +142,6 @@ export class AuthWrapper extends PureComponent { handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} showPasswords={showPasswords} isVariableUncovered={isVariableUncovered} @@ -165,7 +155,6 @@ export class AuthWrapper extends PureComponent { request={request} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} onChange={onChange} isVariableUncovered={isVariableUncovered} /> diff --git a/packages/insomnia-app/app/ui/components/editors/auth/aws-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/aws-auth.tsx index 47adf5f06..534d91bb5 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/aws-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/aws-auth.tsx @@ -12,7 +12,6 @@ import { HelpTooltip } from '../../help-tooltip'; interface Props { request: Request; - nunjucksPowerUserMode: boolean; showPasswords: boolean; isVariableUncovered: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; @@ -56,7 +55,6 @@ export class AWSAuth extends PureComponent { renderRow(key: string, label: string, onChange: (...args: any[]) => any, help?: string) { const { request, - nunjucksPowerUserMode, handleRender, handleGetRenderContext, isVariableUncovered, @@ -79,7 +77,6 @@ export class AWSAuth extends PureComponent { id={key} onChange={onChange} defaultValue={request.authentication[key] || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/basic-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/basic-auth.tsx index 77d3f0f6b..6f9bb2128 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/basic-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/basic-auth.tsx @@ -15,7 +15,6 @@ interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise; - nunjucksPowerUserMode: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; request: Request; showPasswords: boolean; @@ -53,7 +52,6 @@ export class BasicAuth extends PureComponent { showPasswords, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -79,7 +77,6 @@ export class BasicAuth extends PureComponent { disabled={authentication.disabled} onChange={this._handleChangeUsername} defaultValue={authentication.username || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} @@ -99,7 +96,6 @@ export class BasicAuth extends PureComponent { disabled={authentication.disabled} password={authentication.password} onChange={this._handleChangePassword} - nunjucksPowerUserMode={nunjucksPowerUserMode} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/bearer-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/bearer-auth.tsx index 3792d7528..6b151a083 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/bearer-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/bearer-auth.tsx @@ -12,7 +12,6 @@ import { HelpTooltip } from '../../help-tooltip'; interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; request: Request; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; isVariableUncovered: boolean; @@ -40,7 +39,6 @@ export class BearerAuth extends PureComponent { request, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -66,7 +64,6 @@ export class BearerAuth extends PureComponent { disabled={authentication.disabled} onChange={this._handleChangeToken} defaultValue={authentication.token || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} @@ -95,7 +92,6 @@ export class BearerAuth extends PureComponent { disabled={authentication.disabled} onChange={this._handleChangePrefix} defaultValue={authentication.prefix || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/digest-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/digest-auth.tsx index 89d102ce4..63ff915e9 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/digest-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/digest-auth.tsx @@ -14,7 +14,6 @@ interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise; - nunjucksPowerUserMode: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; request: Request; showPasswords: boolean; @@ -43,7 +42,6 @@ export class DigestAuth extends PureComponent { request, showPasswords, handleRender, - nunjucksPowerUserMode, handleGetRenderContext, isVariableUncovered, } = this.props; @@ -70,7 +68,6 @@ export class DigestAuth extends PureComponent { disabled={authentication.disabled} onChange={this._handleChangeUsername} defaultValue={authentication.username || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} @@ -90,7 +87,6 @@ export class DigestAuth extends PureComponent { disabled={authentication.disabled} password={authentication.password} onChange={this._handleChangePassword} - nunjucksPowerUserMode={nunjucksPowerUserMode} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/hawk-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/hawk-auth.tsx index dea3129e0..54197e51c 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/hawk-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/hawk-auth.tsx @@ -17,7 +17,6 @@ interface Props { request: Request; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; } @@ -133,7 +132,6 @@ export class HawkAuth extends PureComponent { handleRender, handleGetRenderContext, request, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -156,7 +154,6 @@ export class HawkAuth extends PureComponent { type="text" onChange={onChange} defaultValue={authentication[property] || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/ntlm-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/ntlm-auth.tsx index 0f9b16bc1..420382b27 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/ntlm-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/ntlm-auth.tsx @@ -14,7 +14,6 @@ interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise; - nunjucksPowerUserMode: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; request: Request; showPasswords: boolean; @@ -44,7 +43,6 @@ export class NTLMAuth extends PureComponent { showPasswords, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -70,7 +68,6 @@ export class NTLMAuth extends PureComponent { disabled={authentication.disabled} onChange={this._handleChangeUsername} defaultValue={authentication.username || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} @@ -90,7 +87,6 @@ export class NTLMAuth extends PureComponent { disabled={authentication.disabled} password={authentication.password} onChange={this._handleChangePassword} - nunjucksPowerUserMode={nunjucksPowerUserMode} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-1-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-1-auth.tsx index 9f3e941b0..2d7e912c9 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-1-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-1-auth.tsx @@ -33,7 +33,6 @@ cJV+wRTs/Szp6LXAgMmTkKMJ+9XXErUIUgwbl27Y3Rv/9ox1p5VRg+A= interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; showPasswords: boolean; isVariableUncovered: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; @@ -199,7 +198,6 @@ export class OAuth1Auth extends PureComponent { handleRender, handleGetRenderContext, request, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -225,7 +223,6 @@ export class OAuth1Auth extends PureComponent { onChange={onChange} defaultValue={request.authentication[property] || ''} render={handleRender} - nunjucksPowerUserMode={nunjucksPowerUserMode} getAutocompleteConstants={handleAutocomplete} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.tsx b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.tsx index 1438b1071..00479a8f6 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.tsx +++ b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.tsx @@ -37,7 +37,6 @@ interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise; - nunjucksPowerUserMode: boolean; onChange: (arg0: Request, arg1: RequestAuthentication) => Promise; request: Request; showPasswords: boolean; @@ -326,7 +325,6 @@ export class OAuth2Auth extends PureComponent { handleRender, handleGetRenderContext, request, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { authentication } = request; @@ -352,7 +350,6 @@ export class OAuth2Auth extends PureComponent { onChange={onChange} defaultValue={request.authentication[property] || ''} render={handleRender} - nunjucksPowerUserMode={nunjucksPowerUserMode} getAutocompleteConstants={handleAutocomplete} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/body/body-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/body-editor.tsx index 14789dabe..7b92f75d3 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/body-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/body-editor.tsx @@ -138,7 +138,6 @@ export class BodyEditor extends PureComponent { onChange={this._handleFormUrlEncodedChange} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} parameters={request.body.params || []} /> @@ -150,7 +149,6 @@ export class BodyEditor extends PureComponent { onChange={this._handleFormChange} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} parameters={request.body.params || []} /> @@ -178,16 +176,10 @@ export class BodyEditor extends PureComponent { return ( diff --git a/packages/insomnia-app/app/ui/components/editors/body/form-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/form-editor.tsx index ebd61bef8..827a8589a 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/form-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/form-editor.tsx @@ -8,7 +8,6 @@ import { KeyValueEditor } from '../../key-value-editor/key-value-editor'; interface Props { onChange: Function; parameters: any[]; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender?: HandleRender; handleGetRenderContext?: HandleGetRenderContext; @@ -22,7 +21,6 @@ export class FormEditor extends PureComponent { onChange, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; return ( @@ -37,7 +35,6 @@ export class FormEditor extends PureComponent { descriptionPlaceholder="description" handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} onChange={onChange} pairs={parameters} diff --git a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx index 413ebaf2b..68299fae8 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx @@ -665,7 +665,6 @@ export class GraphQLEditor extends PureComponent { content, render, getRenderContext, - settings, className, uniquenessKey, isVariableUncovered, @@ -771,9 +770,6 @@ export class GraphQLEditor extends PureComponent { dynamicHeight manualPrettify uniquenessKey={uniquenessKey ? uniquenessKey + '::query' : undefined} - fontSize={settings.editorFontSize} - indentSize={settings.editorIndentSize} - keyMap={settings.editorKeyMap} defaultValue={query} className={className} onChange={this._handleQueryChange} @@ -781,7 +777,6 @@ export class GraphQLEditor extends PureComponent { onCursorActivity={this._handleQueryUserActivity} onFocus={this._handleQueryFocus} mode="graphql" - lineWrapping={settings.editorLineWrapping} placeholder="" {...graphqlOptions} /> @@ -824,9 +819,6 @@ export class GraphQLEditor extends PureComponent { uniquenessKey={uniquenessKey ? uniquenessKey + '::variables' : undefined} debounceMillis={DEBOUNCE_MILLIS * 4} manualPrettify={false} - fontSize={settings.editorFontSize} - indentSize={settings.editorIndentSize} - keyMap={settings.editorKeyMap} defaultValue={variables} className={className} render={render} @@ -836,11 +828,9 @@ export class GraphQLEditor extends PureComponent { variableToType: variableTypes, }} noLint={!variableTypes} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} onChange={this._handleVariablesChange} mode="graphql-variables" - lineWrapping={settings.editorLineWrapping} placeholder="" /> diff --git a/packages/insomnia-app/app/ui/components/editors/body/raw-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/raw-editor.tsx index eeed2ea25..b6c43b477 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/raw-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/raw-editor.tsx @@ -9,17 +9,11 @@ interface Props { onChange: CodeEditorOnChange; content: string; contentType: string; - fontSize: number; - indentSize: number; - keyMap: string; - lineWrapping: boolean; - nunjucksPowerUserMode: boolean; uniquenessKey: string; isVariableUncovered: boolean; className?: string; render?: HandleRender; getRenderContext?: HandleGetRenderContext; - indentWithTabs?: boolean; } @autoBindMethodsForReact(AUTOBIND_CFG) @@ -29,13 +23,7 @@ export class RawEditor extends PureComponent { className, content, contentType, - fontSize, getRenderContext, - indentSize, - keyMap, - lineWrapping, - indentWithTabs, - nunjucksPowerUserMode, isVariableUncovered, onChange, render, @@ -46,19 +34,13 @@ export class RawEditor extends PureComponent { diff --git a/packages/insomnia-app/app/ui/components/editors/body/url-encoded-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/url-encoded-editor.tsx index f7d2c1419..cf3ce125a 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/url-encoded-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/url-encoded-editor.tsx @@ -8,7 +8,6 @@ import { KeyValueEditor } from '../../key-value-editor/key-value-editor'; interface Props { onChange: Function; parameters: any[]; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender?: HandleRender; handleGetRenderContext?: HandleGetRenderContext; @@ -22,7 +21,6 @@ export class UrlEncodedEditor extends PureComponent { onChange, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; return ( @@ -37,7 +35,6 @@ export class UrlEncodedEditor extends PureComponent { onChange={onChange} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} pairs={parameters} /> diff --git a/packages/insomnia-app/app/ui/components/editors/environment-editor.tsx b/packages/insomnia-app/app/ui/components/editors/environment-editor.tsx index 23ebc423c..9c8d8a837 100644 --- a/packages/insomnia-app/app/ui/components/editors/environment-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/environment-editor.tsx @@ -59,14 +59,9 @@ export interface EnvironmentInfo { interface Props { environmentInfo: EnvironmentInfo; didChange: (...args: any[]) => any; - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; render: (...args: any[]) => any; getRenderContext: (...args: any[]) => any; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; - lineWrapping: boolean; } // There was existing logic to also handle warnings, but it was removed in PR#2601 as there were no more warnings @@ -145,14 +140,9 @@ export class EnvironmentEditor extends PureComponent { render() { const { environmentInfo, - editorFontSize, - editorIndentSize, - editorKeyMap, render, getRenderContext, - nunjucksPowerUserMode, isVariableUncovered, - lineWrapping, ...props } = this.props; const { error } = this.state; @@ -166,13 +156,8 @@ export class EnvironmentEditor extends PureComponent { void; - settings: Settings; readOnly?: boolean; handleRender?: HandleRender; isVariableUncovered?: boolean; @@ -18,17 +16,11 @@ export const GRPCEditor: FunctionComponent = ({ content, handleChange, readOnly, - settings, handleGetRenderContext, handleRender, isVariableUncovered, }) => ( = ({ render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} /> ); diff --git a/packages/insomnia-app/app/ui/components/editors/password-editor.tsx b/packages/insomnia-app/app/ui/components/editors/password-editor.tsx index 8e5e1c635..e6bb0c527 100644 --- a/packages/insomnia-app/app/ui/components/editors/password-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/password-editor.tsx @@ -10,7 +10,6 @@ import { OneLineEditor } from '../codemirror/one-line-editor'; interface Props { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; onChange: (...args: any[]) => any; password: string; disabled: boolean; @@ -42,7 +41,6 @@ export class PasswordEditor extends PureComponent { showAllPasswords, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, onChange, } = this.props; @@ -58,7 +56,6 @@ export class PasswordEditor extends PureComponent { id="password" onChange={onChange} defaultValue={password || ''} - nunjucksPowerUserMode={nunjucksPowerUserMode} render={handleRender} getRenderContext={handleGetRenderContext} isVariableUncovered={isVariableUncovered} diff --git a/packages/insomnia-app/app/ui/components/editors/request-headers-editor.tsx b/packages/insomnia-app/app/ui/components/editors/request-headers-editor.tsx index c5371235f..781bd8b6d 100644 --- a/packages/insomnia-app/app/ui/components/editors/request-headers-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/request-headers-editor.tsx @@ -14,10 +14,6 @@ import { KeyValueEditor } from '../key-value-editor/key-value-editor'; interface Props { onChange: (r: Request, headers: RequestHeader[]) => Promise; bulk: boolean; - editorFontSize: number; - editorIndentSize: number; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; @@ -107,12 +103,8 @@ export class RequestHeadersEditor extends PureComponent { const { bulk, request, - editorFontSize, - editorIndentSize, - editorLineWrapping, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; return bulk ? ( @@ -120,11 +112,7 @@ export class RequestHeadersEditor extends PureComponent { @@ -138,7 +126,6 @@ export class RequestHeadersEditor extends PureComponent { valuePlaceholder="value" descriptionPlaceholder="description" pairs={request.headers} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} diff --git a/packages/insomnia-app/app/ui/components/editors/request-parameters-editor.tsx b/packages/insomnia-app/app/ui/components/editors/request-parameters-editor.tsx index be92af101..7159b944b 100644 --- a/packages/insomnia-app/app/ui/components/editors/request-parameters-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/request-parameters-editor.tsx @@ -10,10 +10,6 @@ import { KeyValueEditor } from '../key-value-editor/key-value-editor'; interface Props { onChange: (r: Request, parameters: RequestParameter[]) => Promise; bulk: boolean; - editorFontSize: number; - editorIndentSize: number; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; @@ -82,23 +78,15 @@ export class RequestParametersEditor extends PureComponent { const { bulk, request, - editorFontSize, - editorIndentSize, - editorLineWrapping, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; return bulk ? ( @@ -110,7 +98,6 @@ export class RequestParametersEditor extends PureComponent { valuePlaceholder="value" descriptionPlaceholder="description" pairs={request.parameters} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} diff --git a/packages/insomnia-app/app/ui/components/key-value-editor/key-value-editor.tsx b/packages/insomnia-app/app/ui/components/key-value-editor/key-value-editor.tsx index 36315cd61..e4b22407a 100644 --- a/packages/insomnia-app/app/ui/components/key-value-editor/key-value-editor.tsx +++ b/packages/insomnia-app/app/ui/components/key-value-editor/key-value-editor.tsx @@ -27,7 +27,6 @@ interface Props { pairs: any[]; handleRender?: HandleRender; handleGetRenderContext?: HandleGetRenderContext; - nunjucksPowerUserMode?: boolean; isVariableUncovered?: boolean; handleGetAutocompleteNameConstants?: Function; handleGetAutocompleteValueConstants?: Function; @@ -433,7 +432,6 @@ export class KeyValueEditor extends PureComponent { descriptionPlaceholder, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, handleGetAutocompleteNameConstants, handleGetAutocompleteValueConstants, @@ -469,7 +467,6 @@ export class KeyValueEditor extends PureComponent { onBlurValue={this._handleBlurValue} onBlurDescription={this._handleBlurDescription} onMove={this._handleMove} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} diff --git a/packages/insomnia-app/app/ui/components/key-value-editor/row.tsx b/packages/insomnia-app/app/ui/components/key-value-editor/row.tsx index 3cdcb951f..b413e6c47 100644 --- a/packages/insomnia-app/app/ui/components/key-value-editor/row.tsx +++ b/packages/insomnia-app/app/ui/components/key-value-editor/row.tsx @@ -43,7 +43,6 @@ interface Props { onBlurDescription?: Function; handleRender?: HandleRender; handleGetRenderContext?: HandleGetRenderContext; - nunjucksPowerUserMode?: boolean; isVariableUncovered?: boolean; handleGetAutocompleteNameConstants?: Function; handleGetAutocompleteValueConstants?: Function; @@ -278,7 +277,6 @@ class KeyValueEditorRow extends PureComponent { pair, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; return displayDescription ? ( @@ -302,7 +300,6 @@ class KeyValueEditorRow extends PureComponent { onFocus={this._handleFocusDescription} render={handleRender} getRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} /> @@ -318,7 +315,6 @@ class KeyValueEditorRow extends PureComponent { valuePlaceholder, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; @@ -361,7 +357,6 @@ class KeyValueEditorRow extends PureComponent { onFocus={this._handleFocusValue} render={handleRender} getRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} getAutocompleteConstants={this._handleAutocompleteValues} /> @@ -435,7 +430,6 @@ class KeyValueEditorRow extends PureComponent { namePlaceholder, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, sortable, noDropZone, @@ -489,7 +483,6 @@ class KeyValueEditorRow extends PureComponent { defaultValue={pair.name} render={handleRender} getRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} getAutocompleteConstants={this._handleAutocompleteNames} forceInput={forceInput} diff --git a/packages/insomnia-app/app/ui/components/markdown-editor.tsx b/packages/insomnia-app/app/ui/components/markdown-editor.tsx index 9b1fd5e08..34975cf11 100644 --- a/packages/insomnia-app/app/ui/components/markdown-editor.tsx +++ b/packages/insomnia-app/app/ui/components/markdown-editor.tsx @@ -12,13 +12,8 @@ import { MarkdownPreview } from './markdown-preview'; interface Props { onChange: Function; defaultValue: string; - fontSize: number; - indentSize: number; - keyMap: string; - lineWrapping: boolean; handleRender?: HandleRender; handleGetRenderContext?: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; placeholder?: string; defaultPreviewMode?: boolean; @@ -63,10 +58,6 @@ export class MarkdownEditor extends PureComponent { render() { const { - fontSize, - lineWrapping, - indentSize, - keyMap, mode, placeholder, defaultPreviewMode, @@ -74,7 +65,6 @@ export class MarkdownEditor extends PureComponent { tall, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { markdown } = this.state; @@ -103,14 +93,9 @@ export class MarkdownEditor extends PureComponent { mode={mode || 'text/x-markdown'} placeholder={placeholder} debounceMillis={300} - keyMap={keyMap} - fontSize={fontSize} - lineWrapping={lineWrapping} - indentSize={indentSize} defaultValue={markdown} render={handleRender} getRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} onChange={this._handleChange} /> diff --git a/packages/insomnia-app/app/ui/components/modals/code-prompt-modal.tsx b/packages/insomnia-app/app/ui/components/modals/code-prompt-modal.tsx index 6c594e206..b49037d24 100644 --- a/packages/insomnia-app/app/ui/components/modals/code-prompt-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/code-prompt-modal.tsx @@ -25,11 +25,6 @@ const MODES = { }; interface Props { - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleGetRenderContext?: HandleGetRenderContext; handleRender?: HandleRender; @@ -117,13 +112,8 @@ export class CodePromptModal extends PureComponent { render() { const { handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, handleRender, - editorKeyMap, - editorIndentSize, - editorFontSize, - editorLineWrapping, } = this.props; const { submitName, @@ -170,11 +160,6 @@ export class CodePromptModal extends PureComponent { handleGetRenderContext={enableRender ? handleGetRenderContext : undefined} handleRender={enableRender ? handleRender : undefined} mode={mode} - keyMap={editorKeyMap} - indentSize={editorIndentSize} - fontSize={editorFontSize} - lineWrapping={editorLineWrapping} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} /> @@ -188,15 +173,10 @@ export class CodePromptModal extends PureComponent { defaultValue={defaultValue} placeholder={placeholder} onChange={this._handleChange} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} getRenderContext={handleGetRenderContext} render={handleRender} mode={mode} - keyMap={editorKeyMap} - indentSize={editorIndentSize} - fontSize={editorFontSize} - lineWrapping={editorLineWrapping} /> diff --git a/packages/insomnia-app/app/ui/components/modals/cookie-modify-modal.tsx b/packages/insomnia-app/app/ui/components/modals/cookie-modify-modal.tsx index 5008b9493..5f5cc355f 100644 --- a/packages/insomnia-app/app/ui/components/modals/cookie-modify-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/cookie-modify-modal.tsx @@ -19,7 +19,6 @@ import { OneLineEditor } from '../codemirror/one-line-editor'; interface Props extends ModalProps { handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; workspace: Workspace; cookieJar: CookieJar; @@ -188,7 +187,6 @@ export class CookieModifyModal extends PureComponent { const { handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; @@ -204,7 +202,6 @@ export class CookieModifyModal extends PureComponent { this._handleChange(field, value)} diff --git a/packages/insomnia-app/app/ui/components/modals/environment-edit-modal.tsx b/packages/insomnia-app/app/ui/components/modals/environment-edit-modal.tsx index 74df7bf77..3837dc29e 100644 --- a/packages/insomnia-app/app/ui/components/modals/environment-edit-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/environment-edit-modal.tsx @@ -12,14 +12,9 @@ import { EnvironmentEditor } from '../editors/environment-editor'; interface Props { onChange: Function; - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; render: HandleRender; getRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; - lineWrapping: boolean; } interface State { @@ -89,13 +84,8 @@ export class EnvironmentEditModal extends PureComponent { render() { const { - editorKeyMap, - editorFontSize, - editorIndentSize, - lineWrapping, render, getRenderContext, - nunjucksPowerUserMode, isVariableUncovered, ...extraProps } = this.props; @@ -109,17 +99,12 @@ export class EnvironmentEditModal extends PureComponent { Environment Overrides (JSON Format) diff --git a/packages/insomnia-app/app/ui/components/modals/generate-code-modal.tsx b/packages/insomnia-app/app/ui/components/modals/generate-code-modal.tsx index b8f000a42..3668872a3 100644 --- a/packages/insomnia-app/app/ui/components/modals/generate-code-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/generate-code-modal.tsx @@ -32,9 +32,6 @@ const TO_ADD_CONTENT_LENGTH = { interface Props { environmentId: string; - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; } interface State { @@ -138,7 +135,6 @@ export class GenerateCodeModal extends PureComponent { render() { const { cmd, target, client } = this.state; - const { editorFontSize, editorIndentSize, editorKeyMap } = this.props; const targets = HTTPSnippet.availableTargets(); // NOTE: Just some extra precautions in case the target is messed up let clients: HTTPSnippetClient[] = []; @@ -192,15 +188,11 @@ export class GenerateCodeModal extends PureComponent { diff --git a/packages/insomnia-app/app/ui/components/modals/generate-config-modal.tsx b/packages/insomnia-app/app/ui/components/modals/generate-config-modal.tsx index 01cf13241..eaff0ae7a 100644 --- a/packages/insomnia-app/app/ui/components/modals/generate-config-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/generate-config-modal.tsx @@ -5,7 +5,6 @@ import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; import { parseApiSpec } from '../../../common/api-specs'; import { AUTOBIND_CFG } from '../../../common/constants'; import type { ApiSpec } from '../../../models/api-spec'; -import type { Settings } from '../../../models/settings'; import type { ConfigGenerator } from '../../../plugins'; import * as plugins from '../../../plugins'; import { CopyButton } from '../base/copy-button'; @@ -19,10 +18,6 @@ import { HelpTooltip } from '../help-tooltip'; import { Notice } from '../notice'; import { showModal } from './index'; -interface Props { - settings: Settings; -} - interface Config { label: string; docsLink?: string; @@ -42,7 +37,7 @@ interface ShowOptions { } @autoBindMethodsForReact(AUTOBIND_CFG) -export class GenerateConfigModal extends PureComponent { +export class GenerateConfigModal extends PureComponent<{}, State> { modal: Modal | null = null; state: State = { @@ -93,7 +88,6 @@ export class GenerateConfigModal extends PureComponent { } renderConfigTabPanel(config: Config) { - const { settings } = this.props; const linkIcon = ; if (config.error) { return ( @@ -111,12 +105,7 @@ export class GenerateConfigModal extends PureComponent { diff --git a/packages/insomnia-app/app/ui/components/modals/request-group-settings-modal.tsx b/packages/insomnia-app/app/ui/components/modals/request-group-settings-modal.tsx index 755aca0f1..0b3d000f8 100644 --- a/packages/insomnia-app/app/ui/components/modals/request-group-settings-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/request-group-settings-modal.tsx @@ -15,11 +15,6 @@ import { HelpTooltip } from '../help-tooltip'; import { MarkdownEditor } from '../markdown-editor'; interface Props { - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; @@ -199,13 +194,8 @@ export class RequestGroupSettingsModal extends React.PureComponent _renderDescription() { const { - editorLineWrapping, - editorFontSize, - editorIndentSize, - editorKeyMap, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; @@ -220,14 +210,9 @@ export class RequestGroupSettingsModal extends React.PureComponent ref={this._setEditorRef} className="margin-top" defaultPreviewMode={defaultPreviewMode} - fontSize={editorFontSize} - indentSize={editorIndentSize} - keyMap={editorKeyMap} placeholder="Write a description" - lineWrapping={editorLineWrapping} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} defaultValue={requestGroup.description} onChange={this._handleDescriptionChange} diff --git a/packages/insomnia-app/app/ui/components/modals/request-settings-modal.tsx b/packages/insomnia-app/app/ui/components/modals/request-settings-modal.tsx index 3b839aa02..43c248f31 100644 --- a/packages/insomnia-app/app/ui/components/modals/request-settings-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/request-settings-modal.tsx @@ -17,11 +17,6 @@ import { HelpTooltip } from '../help-tooltip'; import { MarkdownEditor } from '../markdown-editor'; interface Props { - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; @@ -325,13 +320,8 @@ export class RequestSettingsModal extends PureComponent { _renderDescription() { const { - editorLineWrapping, - editorFontSize, - editorIndentSize, - editorKeyMap, handleRender, handleGetRenderContext, - nunjucksPowerUserMode, isVariableUncovered, } = this.props; const { showDescription, defaultPreviewMode, request } = this.state; @@ -346,14 +336,9 @@ export class RequestSettingsModal extends PureComponent { ref={this._setEditorRef} className="margin-top" defaultPreviewMode={defaultPreviewMode} - fontSize={editorFontSize} - indentSize={editorIndentSize} - keyMap={editorKeyMap} placeholder="Write a description" - lineWrapping={editorLineWrapping} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} defaultValue={request.description} onChange={this._handleDescriptionChange} diff --git a/packages/insomnia-app/app/ui/components/modals/response-debug-modal.tsx b/packages/insomnia-app/app/ui/components/modals/response-debug-modal.tsx index aac95c80e..4ed28ecc0 100644 --- a/packages/insomnia-app/app/ui/components/modals/response-debug-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/response-debug-modal.tsx @@ -4,23 +4,18 @@ import React, { PureComponent } from 'react'; import { AUTOBIND_CFG } from '../../../common/constants'; import * as models from '../../../models/index'; import type { Response } from '../../../models/response'; -import type { Settings } from '../../../models/settings'; import { ResponseTimelineViewer } from '../../components/viewers/response-timeline-viewer'; import { Modal } from '../base/modal'; import { ModalBody } from '../base/modal-body'; import { ModalHeader } from '../base/modal-header'; -interface Props { - settings: Settings; -} - interface State { response: Response | null; title: string | null; } @autoBindMethodsForReact(AUTOBIND_CFG) -export class ResponseDebugModal extends PureComponent { +export class ResponseDebugModal extends PureComponent<{}, State> { modal: Modal | null = null; state: State = { @@ -48,7 +43,6 @@ export class ResponseDebugModal extends PureComponent { } render() { - const { settings } = this.props; const { response, title } = this.state; return ( @@ -62,9 +56,6 @@ export class ResponseDebugModal extends PureComponent { > {response ? ( ) : ( diff --git a/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.tsx b/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.tsx index fdcb58d3c..3792fc37c 100644 --- a/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.tsx @@ -29,13 +29,8 @@ const ROOT_ENVIRONMENT_NAME = 'Base Environment'; interface Props extends ModalProps { handleChangeEnvironment: (id: string | null) => void; activeEnvironmentId: string | null; - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - lineWrapping: boolean; render: HandleRender; getRenderContext: HandleGetRenderContext; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; } @@ -433,13 +428,8 @@ export class WorkspaceEnvironmentsEditModal extends PureComponent render() { const { activeEnvironmentId, - editorFontSize, - editorIndentSize, - editorKeyMap, getRenderContext, isVariableUncovered, - lineWrapping, - nunjucksPowerUserMode, render, } = this.props; const { subEnvironments, rootEnvironment, isValid } = this.state; @@ -587,17 +577,12 @@ export class WorkspaceEnvironmentsEditModal extends PureComponent
diff --git a/packages/insomnia-app/app/ui/components/modals/workspace-settings-modal.tsx b/packages/insomnia-app/app/ui/components/modals/workspace-settings-modal.tsx index 8be0099af..e7e912208 100644 --- a/packages/insomnia-app/app/ui/components/modals/workspace-settings-modal.tsx +++ b/packages/insomnia-app/app/ui/components/modals/workspace-settings-modal.tsx @@ -66,11 +66,6 @@ interface Props extends ReduxProps { clientCertificates: ClientCertificate[]; workspace: Workspace; apiSpec: ApiSpec; - editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - editorLineWrapping: boolean; - nunjucksPowerUserMode: boolean; isVariableUncovered: boolean; handleRender: HandleRender; handleGetRenderContext: HandleGetRenderContext; @@ -297,13 +292,8 @@ export class UnconnectedWorkspaceSettingsModal extends PureComponent !c.isPrivate); @@ -347,14 +337,9 @@ export class UnconnectedWorkspaceSettingsModal extends PureComponent = ({ environmentId, workspaceId, forceRefreshKey, - settings, handleRender, handleGetRenderContext, isVariableUncovered, @@ -83,7 +82,6 @@ export const GrpcRequestPane: FunctionComponent = ({ placeholder="grpcb.in:9000" onChange={handleChange.url} render={handleRender} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} getAutocompleteConstants={getExistingGrpcUrls} getRenderContext={handleGetRenderContext} @@ -121,7 +119,6 @@ export const GrpcRequestPane: FunctionComponent = ({ = ({ settings, activeRequest, forceRefreshKey }) => { +export const GrpcResponsePane: FunctionComponent = ({ activeRequest, forceRefreshKey }) => { // Used to refresh input fields to their default value when switching between requests. // This is a common pattern in this codebase. const uniquenessKey = `${forceRefreshKey}::${activeRequest._id}`; @@ -32,7 +30,6 @@ export const GrpcResponsePane: FunctionComponent = ({ settings, activeReq {!!responseMessages.length && ( diff --git a/packages/insomnia-app/app/ui/components/panes/placeholder-response-pane.tsx b/packages/insomnia-app/app/ui/components/panes/placeholder-response-pane.tsx index ec78b829e..ee6bf7af7 100644 --- a/packages/insomnia-app/app/ui/components/panes/placeholder-response-pane.tsx +++ b/packages/insomnia-app/app/ui/components/panes/placeholder-response-pane.tsx @@ -9,6 +9,7 @@ interface Props { hotKeyRegistry: HotKeyRegistry; } +// TODO: get hotKeyRegistry from redux export const PlaceholderResponsePane: FunctionComponent = ({ hotKeyRegistry, children }) => ( diff --git a/packages/insomnia-app/app/ui/components/panes/request-pane.tsx b/packages/insomnia-app/app/ui/components/panes/request-pane.tsx index 7eaea717f..f265987d7 100644 --- a/packages/insomnia-app/app/ui/components/panes/request-pane.tsx +++ b/packages/insomnia-app/app/ui/components/panes/request-pane.tsx @@ -272,7 +272,6 @@ export class RequestPane extends PureComponent { handleUpdateSettingsShowPasswords={updateSettingsShowPasswords} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} onChange={updateRequestAuthentication} /> @@ -300,11 +299,7 @@ export class RequestPane extends PureComponent { key={headerEditorKey} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} - editorFontSize={settings.editorFontSize} - editorIndentSize={settings.editorIndentSize} - editorLineWrapping={settings.editorLineWrapping} onChange={updateRequestParameters} request={request} bulk={settings.useBulkParametersEditor} @@ -333,11 +328,7 @@ export class RequestPane extends PureComponent { key={headerEditorKey} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} - editorFontSize={settings.editorFontSize} - editorIndentSize={settings.editorIndentSize} - editorLineWrapping={settings.editorLineWrapping} onChange={updateRequestHeaders} request={request} bulk={settings.useBulkHeaderEditor} diff --git a/packages/insomnia-app/app/ui/components/panes/response-pane.tsx b/packages/insomnia-app/app/ui/components/panes/response-pane.tsx index 37a392575..10fb1a133 100644 --- a/packages/insomnia-app/app/ui/components/panes/response-pane.tsx +++ b/packages/insomnia-app/app/ui/components/panes/response-pane.tsx @@ -48,9 +48,6 @@ interface Props { filterHistory: string[]; disableHtmlPreviewJs: boolean; editorFontSize: number; - editorIndentSize: number; - editorKeyMap: string; - editorLineWrapping: boolean; loadStartTime: number; responses: Response[]; hotKeyRegistry: HotKeyRegistry; @@ -229,9 +226,6 @@ export class ResponsePane extends PureComponent { const { disableHtmlPreviewJs, editorFontSize, - editorIndentSize, - editorKeyMap, - editorLineWrapping, environment, filter, disableResponsePreviewLinks, @@ -336,9 +330,6 @@ export class ResponsePane extends PureComponent { disablePreviewLinks={disableResponsePreviewLinks} download={this._handleDownloadResponseBody} editorFontSize={editorFontSize} - editorIndentSize={editorIndentSize} - editorKeyMap={editorKeyMap} - editorLineWrapping={editorLineWrapping} error={response.error} filter={filter} filterHistory={filterHistory} @@ -373,9 +364,6 @@ export class ResponsePane extends PureComponent { diff --git a/packages/insomnia-app/app/ui/components/request-url-bar.tsx b/packages/insomnia-app/app/ui/components/request-url-bar.tsx index aa9a0258b..bbe01759f 100644 --- a/packages/insomnia-app/app/ui/components/request-url-bar.tsx +++ b/packages/insomnia-app/app/ui/components/request-url-bar.tsx @@ -353,7 +353,6 @@ export class RequestUrlBar extends PureComponent { const { request, handleRender, - nunjucksPowerUserMode, isVariableUncovered, handleGetRenderContext, handleAutocompleteUrls, @@ -378,7 +377,6 @@ export class RequestUrlBar extends PureComponent { forceEditor type="text" render={handleRender} - nunjucksPowerUserMode={nunjucksPowerUserMode} isVariableUncovered={isVariableUncovered} getAutocompleteConstants={handleAutocompleteUrls} getRenderContext={handleGetRenderContext} diff --git a/packages/insomnia-app/app/ui/components/viewers/grpc-tabbed-messages.tsx b/packages/insomnia-app/app/ui/components/viewers/grpc-tabbed-messages.tsx index 209858c31..8b924f231 100644 --- a/packages/insomnia-app/app/ui/components/viewers/grpc-tabbed-messages.tsx +++ b/packages/insomnia-app/app/ui/components/viewers/grpc-tabbed-messages.tsx @@ -3,7 +3,6 @@ import React, { FunctionComponent } from 'react'; import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; import { HandleGetRenderContext, HandleRender } from '../../../common/render'; -import { Settings } from '../../../models/settings'; import { Button } from '../base/button'; import { GRPCEditor } from '../editors/grpc-editor'; @@ -14,7 +13,6 @@ interface Message { } interface Props { - settings: Settings; messages?: Message[]; tabNamePrefix: 'Stream' | 'Response'; bodyText?: string; @@ -29,7 +27,6 @@ interface Props { } export const GrpcTabbedMessages: FunctionComponent = ({ - settings, showActions, bodyText, messages, @@ -88,7 +85,6 @@ export const GrpcTabbedMessages: FunctionComponent = ({ = ({ )} {orderedMessages.map(m => ( - + ))} diff --git a/packages/insomnia-app/app/ui/components/viewers/response-error-viewer.tsx b/packages/insomnia-app/app/ui/components/viewers/response-error-viewer.tsx index 1eef85e5e..c32f93199 100644 --- a/packages/insomnia-app/app/ui/components/viewers/response-error-viewer.tsx +++ b/packages/insomnia-app/app/ui/components/viewers/response-error-viewer.tsx @@ -1,5 +1,7 @@ import React, { FC, memo } from 'react'; +import { useSelector } from 'react-redux'; +import { selectSettings } from '../../redux/selectors'; import { Link } from '../base/link'; import { showModal } from '../modals/index'; import { SettingsModal } from '../modals/settings-modal'; @@ -7,10 +9,10 @@ import { SettingsModal } from '../modals/settings-modal'; interface Props { error: string; url: string; - fontSize: number; } -export const ResponseErrorViewer: FC = memo(({ error, fontSize }) => { +export const ResponseErrorViewer: FC = memo(({ error }) => { let msg: React.ReactNode = null; + const { editorFontSize } = useSelector(selectSettings); if (error?.toLowerCase().indexOf('certificate') !== -1) { msg = ( @@ -37,7 +39,7 @@ export const ResponseErrorViewer: FC = memo(({ error, fontSize }) => {
         {error}
diff --git a/packages/insomnia-app/app/ui/components/viewers/response-multipart-viewer.tsx b/packages/insomnia-app/app/ui/components/viewers/response-multipart-viewer.tsx
index ab91571db..240984368 100644
--- a/packages/insomnia-app/app/ui/components/viewers/response-multipart-viewer.tsx
+++ b/packages/insomnia-app/app/ui/components/viewers/response-multipart-viewer.tsx
@@ -40,9 +40,6 @@ interface Props {
   filter: string;
   filterHistory: string[];
   editorFontSize: number;
-  editorIndentSize: number;
-  editorKeyMap: string;
-  editorLineWrapping: boolean;
   url: string;
 }
 
@@ -222,9 +219,6 @@ export class ResponseMultipartViewer extends PureComponent {
       disableHtmlPreviewJs,
       disablePreviewLinks,
       editorFontSize,
-      editorIndentSize,
-      editorKeyMap,
-      editorLineWrapping,
       filter,
       filterHistory,
       responseId,
@@ -303,9 +297,6 @@ export class ResponseMultipartViewer extends PureComponent {
               disablePreviewLinks={disablePreviewLinks}
               download={download}
               editorFontSize={editorFontSize}
-              editorIndentSize={editorIndentSize}
-              editorKeyMap={editorKeyMap}
-              editorLineWrapping={editorLineWrapping}
               error={null}
               filter={filter}
               filterHistory={filterHistory}
diff --git a/packages/insomnia-app/app/ui/components/viewers/response-raw-viewer.tsx b/packages/insomnia-app/app/ui/components/viewers/response-raw-viewer.tsx
index ebe1f615e..7a5d77be2 100644
--- a/packages/insomnia-app/app/ui/components/viewers/response-raw-viewer.tsx
+++ b/packages/insomnia-app/app/ui/components/viewers/response-raw-viewer.tsx
@@ -6,7 +6,6 @@ import { CodeEditor,  UnconnectedCodeEditor } from '../codemirror/code-editor';
 
 interface Props {
   value: string;
-  fontSize?: number;
   responseId?: string;
 }
 @autoBindMethodsForReact(AUTOBIND_CFG)
@@ -30,14 +29,12 @@ export class ResponseRawViewer extends PureComponent {
   }
 
   render() {
-    const { fontSize, responseId, value } = this.props;
+    const { responseId, value } = this.props;
     return (
        {
   }
 
   render() {
-    const { editorFontSize, editorIndentSize, editorLineWrapping } = this.props;
     const { timeline, timelineKey } = this.state;
     const rows = timeline
       .map(this.renderRow)
@@ -110,9 +106,6 @@ export class ResponseTimelineViewer extends PureComponent {
         readOnly
         onClickLink={clickLink}
         defaultValue={rows}
-        fontSize={editorFontSize}
-        indentSize={editorIndentSize}
-        lineWrapping={editorLineWrapping}
         className="pad-left"
         mode="curl"
       />
diff --git a/packages/insomnia-app/app/ui/components/viewers/response-viewer.tsx b/packages/insomnia-app/app/ui/components/viewers/response-viewer.tsx
index 76d1c5efe..26c4ea1da 100644
--- a/packages/insomnia-app/app/ui/components/viewers/response-viewer.tsx
+++ b/packages/insomnia-app/app/ui/components/viewers/response-viewer.tsx
@@ -31,9 +31,6 @@ export interface ResponseViewerProps {
   disablePreviewLinks: boolean;
   download: (...args: any[]) => any;
   editorFontSize: number;
-  editorIndentSize: number;
-  editorKeyMap: string;
-  editorLineWrapping: boolean;
   filter: string;
   filterHistory: string[];
   getBody: (...args: any[]) => any;
@@ -284,9 +281,6 @@ export class ResponseViewer extends Component {
       disablePreviewLinks,
       download,
       editorFontSize,
-      editorIndentSize,
-      editorKeyMap,
-      editorLineWrapping,
       error: responseError,
       filter,
       filterHistory,
@@ -301,7 +295,7 @@ export class ResponseViewer extends Component {
     if (error) {
       return (
         
- +
); } @@ -415,9 +409,6 @@ export class ResponseViewer extends Component { disablePreviewLinks={disablePreviewLinks} download={download} editorFontSize={editorFontSize} - editorIndentSize={editorIndentSize} - editorKeyMap={editorKeyMap} - editorLineWrapping={editorLineWrapping} filter={filter} filterHistory={filterHistory} key={responseId} @@ -446,7 +437,6 @@ export class ResponseViewer extends Component { responseId={responseId} ref={this._setSelectableViewRef} value={this._getBody()} - fontSize={editorFontSize} /> ); } @@ -460,10 +450,6 @@ export class ResponseViewer extends Component { defaultValue={this._getBody()} filter={filter} filterHistory={filterHistory} - fontSize={editorFontSize} - indentSize={editorIndentSize} - keyMap={editorKeyMap} - lineWrapping={editorLineWrapping} mode={this._getMode()} noMatchBrackets onClickLink={disablePreviewLinks ? undefined : this._handleClickLink} diff --git a/packages/insomnia-app/app/ui/components/wrapper-debug.tsx b/packages/insomnia-app/app/ui/components/wrapper-debug.tsx index a6f6da29c..5562ae436 100644 --- a/packages/insomnia-app/app/ui/components/wrapper-debug.tsx +++ b/packages/insomnia-app/app/ui/components/wrapper-debug.tsx @@ -297,7 +297,6 @@ export class WrapperDebug extends PureComponent { ); @@ -309,9 +308,6 @@ export class WrapperDebug extends PureComponent { disableHtmlPreviewJs={settings.disableHtmlPreviewJs} disableResponsePreviewLinks={settings.disableResponsePreviewLinks} editorFontSize={settings.editorFontSize} - editorIndentSize={settings.editorIndentSize} - editorKeyMap={settings.editorKeyMap} - editorLineWrapping={settings.editorLineWrapping} environment={activeEnvironment} filter={responseFilter} filterHistory={responseFilterHistory} diff --git a/packages/insomnia-app/app/ui/components/wrapper-design.tsx b/packages/insomnia-app/app/ui/components/wrapper-design.tsx index c4cb374e0..8dfb2a69c 100644 --- a/packages/insomnia-app/app/ui/components/wrapper-design.tsx +++ b/packages/insomnia-app/app/ui/components/wrapper-design.tsx @@ -146,7 +146,7 @@ export class WrapperDesign extends PureComponent { } _renderEditor() { - const { activeApiSpec, settings } = this.props.wrapperProps; + const { activeApiSpec } = this.props.wrapperProps; const { lintMessages } = this.state; if (!activeApiSpec) { @@ -159,10 +159,6 @@ export class WrapperDesign extends PureComponent { { this.autocompleteSnippets(unitTest)} lintOptions={WrapperUnitTest.lintOptions} onChange={this._handleUnitTestCodeChange.bind(this, unitTest)} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} isVariableUncovered={settings.isVariableUncovered} mode="javascript" - lineWrapping={settings.editorLineWrapping} placeholder="" /> diff --git a/packages/insomnia-app/app/ui/components/wrapper.tsx b/packages/insomnia-app/app/ui/components/wrapper.tsx index b98e6b607..fd04b6a93 100644 --- a/packages/insomnia-app/app/ui/components/wrapper.tsx +++ b/packages/insomnia-app/app/ui/components/wrapper.tsx @@ -533,7 +533,7 @@ export class Wrapper extends PureComponent { - + @@ -541,36 +541,21 @@ export class Wrapper extends PureComponent { ref={registerModal} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} - editorFontSize={settings.editorFontSize} - editorIndentSize={settings.editorIndentSize} - editorKeyMap={settings.editorKeyMap} - editorLineWrapping={settings.editorLineWrapping} isVariableUncovered={isVariableUncovered} /> @@ -588,7 +573,6 @@ export class Wrapper extends PureComponent { { clientCertificates={activeWorkspaceClientCertificates} workspace={activeWorkspace} apiSpec={activeApiSpec} - editorFontSize={settings.editorFontSize} - editorIndentSize={settings.editorIndentSize} - editorKeyMap={settings.editorKeyMap} - editorLineWrapping={settings.editorLineWrapping} handleRender={handleRender} handleGetRenderContext={handleGetRenderContext} - nunjucksPowerUserMode={settings.nunjucksPowerUserMode} handleRemoveWorkspace={this._handleRemoveActiveWorkspace} handleClearAllResponses={this._handleActiveWorkspaceClearAllResponses} isVariableUncovered={isVariableUncovered} @@ -625,9 +604,6 @@ export class Wrapper extends PureComponent { { settings={settings} /> - + { @@ -702,14 +673,9 @@ export class Wrapper extends PureComponent {