mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Remove prop drilling to code-editor (#4243)
This commit is contained in:
parent
e1ac78d8f7
commit
f3c6ae19a5
@ -94,17 +94,35 @@ export type CodeEditorOnChange = (value: string) => void;
|
|||||||
|
|
||||||
type ReduxProps = ReturnType<typeof mapStateToProps>;
|
type ReduxProps = ReturnType<typeof mapStateToProps>;
|
||||||
|
|
||||||
const mapStateToProps = (state: RootState) => {
|
interface OwnProps {
|
||||||
const { hotKeyRegistry, autocompleteDelay } = selectSettings(state);
|
ignoreEditorFontSettings?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapStateToProps = (state: RootState, { ignoreEditorFontSettings }: OwnProps) => {
|
||||||
|
const {
|
||||||
|
hotKeyRegistry,
|
||||||
|
autocompleteDelay,
|
||||||
|
editorFontSize,
|
||||||
|
editorIndentSize,
|
||||||
|
editorKeyMap,
|
||||||
|
editorLineWrapping,
|
||||||
|
editorIndentWithTabs,
|
||||||
|
nunjucksPowerUserMode,
|
||||||
|
} = selectSettings(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hotKeyRegistry,
|
hotKeyRegistry,
|
||||||
autocompleteDelay,
|
autocompleteDelay,
|
||||||
|
fontSize: ignoreEditorFontSettings ? undefined : editorFontSize,
|
||||||
|
indentSize: ignoreEditorFontSettings ? undefined : editorIndentSize,
|
||||||
|
keyMap: editorKeyMap,
|
||||||
|
lineWrapping: ignoreEditorFontSettings ? undefined : editorLineWrapping,
|
||||||
|
indentWithTabs: ignoreEditorFontSettings ? undefined : editorIndentWithTabs,
|
||||||
|
nunjucksPowerUserMode,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Props extends ReduxProps {
|
interface Props extends ReduxProps {
|
||||||
indentWithTabs?: boolean;
|
|
||||||
onChange?: CodeEditorOnChange;
|
onChange?: CodeEditorOnChange;
|
||||||
onCursorActivity?: (cm: CodeMirror.EditorFromTextArea) => void;
|
onCursorActivity?: (cm: CodeMirror.EditorFromTextArea) => void;
|
||||||
onFocus?: (e: FocusEvent) => void;
|
onFocus?: (e: FocusEvent) => void;
|
||||||
@ -116,21 +134,16 @@ interface Props extends ReduxProps {
|
|||||||
onPaste?: (e: ClipboardEvent) => void;
|
onPaste?: (e: ClipboardEvent) => void;
|
||||||
onCodeMirrorInit?: (editor: CodeMirror.EditorFromTextArea) => void;
|
onCodeMirrorInit?: (editor: CodeMirror.EditorFromTextArea) => void;
|
||||||
render?: HandleRender;
|
render?: HandleRender;
|
||||||
nunjucksPowerUserMode?: boolean;
|
|
||||||
getRenderContext?: HandleGetRenderContext;
|
getRenderContext?: HandleGetRenderContext;
|
||||||
getAutocompleteConstants?: () => string[] | PromiseLike<string[]>;
|
getAutocompleteConstants?: () => string[] | PromiseLike<string[]>;
|
||||||
getAutocompleteSnippets?: () => CodeMirror.Snippet[];
|
getAutocompleteSnippets?: () => CodeMirror.Snippet[];
|
||||||
keyMap?: string;
|
|
||||||
mode?: string;
|
mode?: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
lineWrapping?: boolean;
|
|
||||||
hideLineNumbers?: boolean;
|
hideLineNumbers?: boolean;
|
||||||
hideGutters?: boolean;
|
hideGutters?: boolean;
|
||||||
noMatchBrackets?: boolean;
|
noMatchBrackets?: boolean;
|
||||||
hideScrollbars?: boolean;
|
hideScrollbars?: boolean;
|
||||||
fontSize?: number;
|
|
||||||
indentSize?: number;
|
|
||||||
defaultValue?: string;
|
defaultValue?: string;
|
||||||
tabIndex?: number;
|
tabIndex?: number;
|
||||||
autoPrettify?: boolean;
|
autoPrettify?: boolean;
|
||||||
@ -155,6 +168,7 @@ interface Props extends ReduxProps {
|
|||||||
infoOptions?: GraphQLInfoOptions;
|
infoOptions?: GraphQLInfoOptions;
|
||||||
jumpOptions?: ModifiedGraphQLJumpOptions;
|
jumpOptions?: ModifiedGraphQLJumpOptions;
|
||||||
uniquenessKey?: string;
|
uniquenessKey?: string;
|
||||||
|
// TODO: I think this prop can actually be removed entirely
|
||||||
isVariableUncovered?: boolean;
|
isVariableUncovered?: boolean;
|
||||||
raw?: boolean;
|
raw?: boolean;
|
||||||
}
|
}
|
||||||
@ -581,6 +595,7 @@ export class UnconnectedCodeEditor extends Component<Props, State> {
|
|||||||
this.codeMirror?.clearHistory();
|
this.codeMirror?.clearHistory();
|
||||||
|
|
||||||
// Setup nunjucks listeners
|
// 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) {
|
if (this.props.render && !this.props.nunjucksPowerUserMode) {
|
||||||
this.codeMirror?.enableNunjucksTags(
|
this.codeMirror?.enableNunjucksTags(
|
||||||
this.props.render,
|
this.props.render,
|
||||||
|
@ -24,7 +24,6 @@ interface Props {
|
|||||||
onPaste?: (e: ClipboardEvent) => void;
|
onPaste?: (e: ClipboardEvent) => void;
|
||||||
render?: HandleRender;
|
render?: HandleRender;
|
||||||
getRenderContext?: HandleGetRenderContext;
|
getRenderContext?: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode?: boolean;
|
|
||||||
getAutocompleteConstants?: () => string[] | PromiseLike<string[]>;
|
getAutocompleteConstants?: () => string[] | PromiseLike<string[]>;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -352,7 +351,6 @@ export class OneLineEditor extends PureComponent<Props, State> {
|
|||||||
render,
|
render,
|
||||||
onPaste,
|
onPaste,
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
getAutocompleteConstants,
|
getAutocompleteConstants,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
mode: syntaxMode,
|
mode: syntaxMode,
|
||||||
@ -374,6 +372,7 @@ export class OneLineEditor extends PureComponent<Props, State> {
|
|||||||
noStyleActiveLine
|
noStyleActiveLine
|
||||||
noLint
|
noLint
|
||||||
singleLine
|
singleLine
|
||||||
|
ignoreEditorFontSettings
|
||||||
autoCloseBrackets={false}
|
autoCloseBrackets={false}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
id={id}
|
id={id}
|
||||||
@ -388,7 +387,6 @@ export class OneLineEditor extends PureComponent<Props, State> {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
render={render}
|
render={render}
|
||||||
getRenderContext={getRenderContext}
|
getRenderContext={getRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
getAutocompleteConstants={getAutocompleteConstants}
|
getAutocompleteConstants={getAutocompleteConstants}
|
||||||
className={classnames('editor--single-line', className)}
|
className={classnames('editor--single-line', className)}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
|
@ -28,7 +28,6 @@ interface Props {
|
|||||||
request: Request;
|
request: Request;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
}
|
}
|
||||||
@ -83,7 +82,6 @@ export class AsapAuth extends PureComponent<Props> {
|
|||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
request,
|
request,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -106,7 +104,6 @@ export class AsapAuth extends PureComponent<Props> {
|
|||||||
mode={mode}
|
mode={mode}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={authentication[property] || ''}
|
defaultValue={authentication[property] || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -33,7 +33,6 @@ interface Props {
|
|||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
handleUpdateSettingsShowPasswords: (showPasswords: boolean) => Promise<Settings>;
|
handleUpdateSettingsShowPasswords: (showPasswords: boolean) => Promise<Settings>;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
request: Request;
|
request: Request;
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
@ -49,7 +48,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request,
|
request,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
handleUpdateSettingsShowPasswords,
|
handleUpdateSettingsShowPasswords,
|
||||||
onChange,
|
onChange,
|
||||||
showPasswords,
|
showPasswords,
|
||||||
@ -64,7 +62,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -77,7 +74,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
@ -90,7 +86,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
@ -101,7 +96,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -114,7 +108,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -126,7 +119,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
@ -139,7 +131,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
@ -151,7 +142,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={handleUpdateSettingsShowPasswords}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
showPasswords={showPasswords}
|
showPasswords={showPasswords}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -165,7 +155,6 @@ export class AuthWrapper extends PureComponent<Props> {
|
|||||||
request={request}
|
request={request}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
|
@ -12,7 +12,6 @@ import { HelpTooltip } from '../../help-tooltip';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
request: Request;
|
request: Request;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
@ -56,7 +55,6 @@ export class AWSAuth extends PureComponent<Props> {
|
|||||||
renderRow(key: string, label: string, onChange: (...args: any[]) => any, help?: string) {
|
renderRow(key: string, label: string, onChange: (...args: any[]) => any, help?: string) {
|
||||||
const {
|
const {
|
||||||
request,
|
request,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
@ -79,7 +77,6 @@ export class AWSAuth extends PureComponent<Props> {
|
|||||||
id={key}
|
id={key}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={request.authentication[key] || ''}
|
defaultValue={request.authentication[key] || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -15,7 +15,6 @@ interface Props {
|
|||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
request: Request;
|
request: Request;
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
@ -53,7 +52,6 @@ export class BasicAuth extends PureComponent<Props> {
|
|||||||
showPasswords,
|
showPasswords,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -79,7 +77,6 @@ export class BasicAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
onChange={this._handleChangeUsername}
|
onChange={this._handleChangeUsername}
|
||||||
defaultValue={authentication.username || ''}
|
defaultValue={authentication.username || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -99,7 +96,6 @@ export class BasicAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
password={authentication.password}
|
password={authentication.password}
|
||||||
onChange={this._handleChangePassword}
|
onChange={this._handleChangePassword}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -12,7 +12,6 @@ import { HelpTooltip } from '../../help-tooltip';
|
|||||||
interface Props {
|
interface Props {
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
request: Request;
|
request: Request;
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
@ -40,7 +39,6 @@ export class BearerAuth extends PureComponent<Props> {
|
|||||||
request,
|
request,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -66,7 +64,6 @@ export class BearerAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
onChange={this._handleChangeToken}
|
onChange={this._handleChangeToken}
|
||||||
defaultValue={authentication.token || ''}
|
defaultValue={authentication.token || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -95,7 +92,6 @@ export class BearerAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
onChange={this._handleChangePrefix}
|
onChange={this._handleChangePrefix}
|
||||||
defaultValue={authentication.prefix || ''}
|
defaultValue={authentication.prefix || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -14,7 +14,6 @@ interface Props {
|
|||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
request: Request;
|
request: Request;
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
@ -43,7 +42,6 @@ export class DigestAuth extends PureComponent<Props> {
|
|||||||
request,
|
request,
|
||||||
showPasswords,
|
showPasswords,
|
||||||
handleRender,
|
handleRender,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
@ -70,7 +68,6 @@ export class DigestAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
onChange={this._handleChangeUsername}
|
onChange={this._handleChangeUsername}
|
||||||
defaultValue={authentication.username || ''}
|
defaultValue={authentication.username || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -90,7 +87,6 @@ export class DigestAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
password={authentication.password}
|
password={authentication.password}
|
||||||
onChange={this._handleChangePassword}
|
onChange={this._handleChangePassword}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -17,7 +17,6 @@ interface Props {
|
|||||||
request: Request;
|
request: Request;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
}
|
}
|
||||||
@ -133,7 +132,6 @@ export class HawkAuth extends PureComponent<Props> {
|
|||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
request,
|
request,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -156,7 +154,6 @@ export class HawkAuth extends PureComponent<Props> {
|
|||||||
type="text"
|
type="text"
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={authentication[property] || ''}
|
defaultValue={authentication[property] || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -14,7 +14,6 @@ interface Props {
|
|||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
request: Request;
|
request: Request;
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
@ -44,7 +43,6 @@ export class NTLMAuth extends PureComponent<Props> {
|
|||||||
showPasswords,
|
showPasswords,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -70,7 +68,6 @@ export class NTLMAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
onChange={this._handleChangeUsername}
|
onChange={this._handleChangeUsername}
|
||||||
defaultValue={authentication.username || ''}
|
defaultValue={authentication.username || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -90,7 +87,6 @@ export class NTLMAuth extends PureComponent<Props> {
|
|||||||
disabled={authentication.disabled}
|
disabled={authentication.disabled}
|
||||||
password={authentication.password}
|
password={authentication.password}
|
||||||
onChange={this._handleChangePassword}
|
onChange={this._handleChangePassword}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -33,7 +33,6 @@ cJV+wRTs/Szp6LXAgMmTkKMJ+9XXErUIUgwbl27Y3Rv/9ox1p5VRg+A=
|
|||||||
interface Props {
|
interface Props {
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
@ -199,7 +198,6 @@ export class OAuth1Auth extends PureComponent<Props> {
|
|||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
request,
|
request,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -225,7 +223,6 @@ export class OAuth1Auth extends PureComponent<Props> {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={request.authentication[property] || ''}
|
defaultValue={request.authentication[property] || ''}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
getAutocompleteConstants={handleAutocomplete}
|
getAutocompleteConstants={handleAutocomplete}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -37,7 +37,6 @@ interface Props {
|
|||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
handleUpdateSettingsShowPasswords: (arg0: boolean) => Promise<Settings>;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
onChange: (arg0: Request, arg1: RequestAuthentication) => Promise<Request>;
|
||||||
request: Request;
|
request: Request;
|
||||||
showPasswords: boolean;
|
showPasswords: boolean;
|
||||||
@ -326,7 +325,6 @@ export class OAuth2Auth extends PureComponent<Props, State> {
|
|||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
request,
|
request,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { authentication } = request;
|
const { authentication } = request;
|
||||||
@ -352,7 +350,6 @@ export class OAuth2Auth extends PureComponent<Props, State> {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={request.authentication[property] || ''}
|
defaultValue={request.authentication[property] || ''}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
getAutocompleteConstants={handleAutocomplete}
|
getAutocompleteConstants={handleAutocomplete}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -138,7 +138,6 @@ export class BodyEditor extends PureComponent<Props> {
|
|||||||
onChange={this._handleFormUrlEncodedChange}
|
onChange={this._handleFormUrlEncodedChange}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
parameters={request.body.params || []}
|
parameters={request.body.params || []}
|
||||||
/>
|
/>
|
||||||
@ -150,7 +149,6 @@ export class BodyEditor extends PureComponent<Props> {
|
|||||||
onChange={this._handleFormChange}
|
onChange={this._handleFormChange}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
parameters={request.body.params || []}
|
parameters={request.body.params || []}
|
||||||
/>
|
/>
|
||||||
@ -178,16 +176,10 @@ export class BodyEditor extends PureComponent<Props> {
|
|||||||
return (
|
return (
|
||||||
<RawEditor
|
<RawEditor
|
||||||
uniquenessKey={uniqueKey}
|
uniquenessKey={uniqueKey}
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
indentWithTabs={settings.editorIndentWithTabs}
|
|
||||||
contentType={contentType || 'text/plain'}
|
contentType={contentType || 'text/plain'}
|
||||||
content={request.body.text || ''}
|
content={request.body.text || ''}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={this._handleRawChange}
|
onChange={this._handleRawChange}
|
||||||
/>
|
/>
|
||||||
|
@ -8,7 +8,6 @@ import { KeyValueEditor } from '../../key-value-editor/key-value-editor';
|
|||||||
interface Props {
|
interface Props {
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
parameters: any[];
|
parameters: any[];
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
@ -22,7 +21,6 @@ export class FormEditor extends PureComponent<Props> {
|
|||||||
onChange,
|
onChange,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
@ -37,7 +35,6 @@ export class FormEditor extends PureComponent<Props> {
|
|||||||
descriptionPlaceholder="description"
|
descriptionPlaceholder="description"
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
pairs={parameters}
|
pairs={parameters}
|
||||||
|
@ -665,7 +665,6 @@ export class GraphQLEditor extends PureComponent<Props, State> {
|
|||||||
content,
|
content,
|
||||||
render,
|
render,
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
settings,
|
|
||||||
className,
|
className,
|
||||||
uniquenessKey,
|
uniquenessKey,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
@ -771,9 +770,6 @@ export class GraphQLEditor extends PureComponent<Props, State> {
|
|||||||
dynamicHeight
|
dynamicHeight
|
||||||
manualPrettify
|
manualPrettify
|
||||||
uniquenessKey={uniquenessKey ? uniquenessKey + '::query' : undefined}
|
uniquenessKey={uniquenessKey ? uniquenessKey + '::query' : undefined}
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
defaultValue={query}
|
defaultValue={query}
|
||||||
className={className}
|
className={className}
|
||||||
onChange={this._handleQueryChange}
|
onChange={this._handleQueryChange}
|
||||||
@ -781,7 +777,6 @@ export class GraphQLEditor extends PureComponent<Props, State> {
|
|||||||
onCursorActivity={this._handleQueryUserActivity}
|
onCursorActivity={this._handleQueryUserActivity}
|
||||||
onFocus={this._handleQueryFocus}
|
onFocus={this._handleQueryFocus}
|
||||||
mode="graphql"
|
mode="graphql"
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
placeholder=""
|
placeholder=""
|
||||||
{...graphqlOptions}
|
{...graphqlOptions}
|
||||||
/>
|
/>
|
||||||
@ -824,9 +819,6 @@ export class GraphQLEditor extends PureComponent<Props, State> {
|
|||||||
uniquenessKey={uniquenessKey ? uniquenessKey + '::variables' : undefined}
|
uniquenessKey={uniquenessKey ? uniquenessKey + '::variables' : undefined}
|
||||||
debounceMillis={DEBOUNCE_MILLIS * 4}
|
debounceMillis={DEBOUNCE_MILLIS * 4}
|
||||||
manualPrettify={false}
|
manualPrettify={false}
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
defaultValue={variables}
|
defaultValue={variables}
|
||||||
className={className}
|
className={className}
|
||||||
render={render}
|
render={render}
|
||||||
@ -836,11 +828,9 @@ export class GraphQLEditor extends PureComponent<Props, State> {
|
|||||||
variableToType: variableTypes,
|
variableToType: variableTypes,
|
||||||
}}
|
}}
|
||||||
noLint={!variableTypes}
|
noLint={!variableTypes}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={this._handleVariablesChange}
|
onChange={this._handleVariablesChange}
|
||||||
mode="graphql-variables"
|
mode="graphql-variables"
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
placeholder=""
|
placeholder=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,17 +9,11 @@ interface Props {
|
|||||||
onChange: CodeEditorOnChange;
|
onChange: CodeEditorOnChange;
|
||||||
content: string;
|
content: string;
|
||||||
contentType: string;
|
contentType: string;
|
||||||
fontSize: number;
|
|
||||||
indentSize: number;
|
|
||||||
keyMap: string;
|
|
||||||
lineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
uniquenessKey: string;
|
uniquenessKey: string;
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
render?: HandleRender;
|
render?: HandleRender;
|
||||||
getRenderContext?: HandleGetRenderContext;
|
getRenderContext?: HandleGetRenderContext;
|
||||||
indentWithTabs?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
@autoBindMethodsForReact(AUTOBIND_CFG)
|
||||||
@ -29,13 +23,7 @@ export class RawEditor extends PureComponent<Props> {
|
|||||||
className,
|
className,
|
||||||
content,
|
content,
|
||||||
contentType,
|
contentType,
|
||||||
fontSize,
|
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
indentSize,
|
|
||||||
keyMap,
|
|
||||||
lineWrapping,
|
|
||||||
indentWithTabs,
|
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
onChange,
|
onChange,
|
||||||
render,
|
render,
|
||||||
@ -46,19 +34,13 @@ export class RawEditor extends PureComponent<Props> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
manualPrettify
|
manualPrettify
|
||||||
uniquenessKey={uniquenessKey}
|
uniquenessKey={uniquenessKey}
|
||||||
fontSize={fontSize}
|
|
||||||
indentSize={indentSize}
|
|
||||||
indentWithTabs={indentWithTabs}
|
|
||||||
keyMap={keyMap}
|
|
||||||
defaultValue={content}
|
defaultValue={content}
|
||||||
className={className}
|
className={className}
|
||||||
render={render}
|
render={render}
|
||||||
getRenderContext={getRenderContext}
|
getRenderContext={getRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
mode={contentType}
|
mode={contentType}
|
||||||
lineWrapping={lineWrapping}
|
|
||||||
placeholder="..."
|
placeholder="..."
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
@ -8,7 +8,6 @@ import { KeyValueEditor } from '../../key-value-editor/key-value-editor';
|
|||||||
interface Props {
|
interface Props {
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
parameters: any[];
|
parameters: any[];
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
@ -22,7 +21,6 @@ export class UrlEncodedEditor extends PureComponent<Props> {
|
|||||||
onChange,
|
onChange,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
@ -37,7 +35,6 @@ export class UrlEncodedEditor extends PureComponent<Props> {
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
pairs={parameters}
|
pairs={parameters}
|
||||||
/>
|
/>
|
||||||
|
@ -59,14 +59,9 @@ export interface EnvironmentInfo {
|
|||||||
interface Props {
|
interface Props {
|
||||||
environmentInfo: EnvironmentInfo;
|
environmentInfo: EnvironmentInfo;
|
||||||
didChange: (...args: any[]) => any;
|
didChange: (...args: any[]) => any;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
render: (...args: any[]) => any;
|
render: (...args: any[]) => any;
|
||||||
getRenderContext: (...args: any[]) => any;
|
getRenderContext: (...args: any[]) => any;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: 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
|
// 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<Props, State> {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
environmentInfo,
|
environmentInfo,
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
render,
|
render,
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
lineWrapping,
|
|
||||||
...props
|
...props
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { error } = this.state;
|
const { error } = this.state;
|
||||||
@ -166,13 +156,8 @@ export class EnvironmentEditor extends PureComponent<Props, State> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
autoPrettify
|
autoPrettify
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
lineWrapping={lineWrapping}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
onChange={this._handleChange}
|
onChange={this._handleChange}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
render={render}
|
render={render}
|
||||||
getRenderContext={getRenderContext}
|
getRenderContext={getRenderContext}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
|
|
||||||
import { HandleGetRenderContext, HandleRender } from '../../../common/render';
|
import { HandleGetRenderContext, HandleRender } from '../../../common/render';
|
||||||
import type { Settings } from '../../../models/settings';
|
|
||||||
import { CodeEditor } from '../codemirror/code-editor';
|
import { CodeEditor } from '../codemirror/code-editor';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
content?: string;
|
content?: string;
|
||||||
handleChange?: (arg0: string) => void;
|
handleChange?: (arg0: string) => void;
|
||||||
settings: Settings;
|
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
isVariableUncovered?: boolean;
|
isVariableUncovered?: boolean;
|
||||||
@ -18,17 +16,11 @@ export const GRPCEditor: FunctionComponent<Props> = ({
|
|||||||
content,
|
content,
|
||||||
handleChange,
|
handleChange,
|
||||||
readOnly,
|
readOnly,
|
||||||
settings,
|
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
handleRender,
|
handleRender,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
}) => (
|
}) => (
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
indentWithTabs={settings.editorIndentWithTabs}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
defaultValue={content}
|
defaultValue={content}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
mode="application/json"
|
mode="application/json"
|
||||||
@ -38,6 +30,5 @@ export const GRPCEditor: FunctionComponent<Props> = ({
|
|||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -10,7 +10,6 @@ import { OneLineEditor } from '../codemirror/one-line-editor';
|
|||||||
interface Props {
|
interface Props {
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
onChange: (...args: any[]) => any;
|
onChange: (...args: any[]) => any;
|
||||||
password: string;
|
password: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
@ -42,7 +41,6 @@ export class PasswordEditor extends PureComponent<Props, State> {
|
|||||||
showAllPasswords,
|
showAllPasswords,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
onChange,
|
onChange,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
@ -58,7 +56,6 @@ export class PasswordEditor extends PureComponent<Props, State> {
|
|||||||
id="password"
|
id="password"
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={password || ''}
|
defaultValue={password || ''}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
|
@ -14,10 +14,6 @@ import { KeyValueEditor } from '../key-value-editor/key-value-editor';
|
|||||||
interface Props {
|
interface Props {
|
||||||
onChange: (r: Request, headers: RequestHeader[]) => Promise<Request>;
|
onChange: (r: Request, headers: RequestHeader[]) => Promise<Request>;
|
||||||
bulk: boolean;
|
bulk: boolean;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
@ -107,12 +103,8 @@ export class RequestHeadersEditor extends PureComponent<Props> {
|
|||||||
const {
|
const {
|
||||||
bulk,
|
bulk,
|
||||||
request,
|
request,
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorLineWrapping,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return bulk ? (
|
return bulk ? (
|
||||||
@ -120,11 +112,7 @@ export class RequestHeadersEditor extends PureComponent<Props> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
onChange={this._handleBulkUpdate}
|
onChange={this._handleBulkUpdate}
|
||||||
defaultValue={this._getHeadersString()}
|
defaultValue={this._getHeadersString()}
|
||||||
/>
|
/>
|
||||||
@ -138,7 +126,6 @@ export class RequestHeadersEditor extends PureComponent<Props> {
|
|||||||
valuePlaceholder="value"
|
valuePlaceholder="value"
|
||||||
descriptionPlaceholder="description"
|
descriptionPlaceholder="description"
|
||||||
pairs={request.headers}
|
pairs={request.headers}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
|
@ -10,10 +10,6 @@ import { KeyValueEditor } from '../key-value-editor/key-value-editor';
|
|||||||
interface Props {
|
interface Props {
|
||||||
onChange: (r: Request, parameters: RequestParameter[]) => Promise<Request>;
|
onChange: (r: Request, parameters: RequestParameter[]) => Promise<Request>;
|
||||||
bulk: boolean;
|
bulk: boolean;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
@ -82,23 +78,15 @@ export class RequestParametersEditor extends PureComponent<Props> {
|
|||||||
const {
|
const {
|
||||||
bulk,
|
bulk,
|
||||||
request,
|
request,
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorLineWrapping,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return bulk ? (
|
return bulk ? (
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
onChange={this._handleBulkUpdate}
|
onChange={this._handleBulkUpdate}
|
||||||
defaultValue={this._getQueriesString()}
|
defaultValue={this._getQueriesString()}
|
||||||
/>
|
/>
|
||||||
@ -110,7 +98,6 @@ export class RequestParametersEditor extends PureComponent<Props> {
|
|||||||
valuePlaceholder="value"
|
valuePlaceholder="value"
|
||||||
descriptionPlaceholder="description"
|
descriptionPlaceholder="description"
|
||||||
pairs={request.parameters}
|
pairs={request.parameters}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
|
@ -27,7 +27,6 @@ interface Props {
|
|||||||
pairs: any[];
|
pairs: any[];
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode?: boolean;
|
|
||||||
isVariableUncovered?: boolean;
|
isVariableUncovered?: boolean;
|
||||||
handleGetAutocompleteNameConstants?: Function;
|
handleGetAutocompleteNameConstants?: Function;
|
||||||
handleGetAutocompleteValueConstants?: Function;
|
handleGetAutocompleteValueConstants?: Function;
|
||||||
@ -433,7 +432,6 @@ export class KeyValueEditor extends PureComponent<Props, State> {
|
|||||||
descriptionPlaceholder,
|
descriptionPlaceholder,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
handleGetAutocompleteNameConstants,
|
handleGetAutocompleteNameConstants,
|
||||||
handleGetAutocompleteValueConstants,
|
handleGetAutocompleteValueConstants,
|
||||||
@ -469,7 +467,6 @@ export class KeyValueEditor extends PureComponent<Props, State> {
|
|||||||
onBlurValue={this._handleBlurValue}
|
onBlurValue={this._handleBlurValue}
|
||||||
onBlurDescription={this._handleBlurDescription}
|
onBlurDescription={this._handleBlurDescription}
|
||||||
onMove={this._handleMove}
|
onMove={this._handleMove}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
|
@ -43,7 +43,6 @@ interface Props {
|
|||||||
onBlurDescription?: Function;
|
onBlurDescription?: Function;
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode?: boolean;
|
|
||||||
isVariableUncovered?: boolean;
|
isVariableUncovered?: boolean;
|
||||||
handleGetAutocompleteNameConstants?: Function;
|
handleGetAutocompleteNameConstants?: Function;
|
||||||
handleGetAutocompleteValueConstants?: Function;
|
handleGetAutocompleteValueConstants?: Function;
|
||||||
@ -278,7 +277,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
pair,
|
pair,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return displayDescription ? (
|
return displayDescription ? (
|
||||||
@ -302,7 +300,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
onFocus={this._handleFocusDescription}
|
onFocus={this._handleFocusDescription}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -318,7 +315,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
valuePlaceholder,
|
valuePlaceholder,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
@ -361,7 +357,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
onFocus={this._handleFocusValue}
|
onFocus={this._handleFocusValue}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
getAutocompleteConstants={this._handleAutocompleteValues}
|
getAutocompleteConstants={this._handleAutocompleteValues}
|
||||||
/>
|
/>
|
||||||
@ -435,7 +430,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
namePlaceholder,
|
namePlaceholder,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
sortable,
|
sortable,
|
||||||
noDropZone,
|
noDropZone,
|
||||||
@ -489,7 +483,6 @@ class KeyValueEditorRow extends PureComponent<Props, State> {
|
|||||||
defaultValue={pair.name}
|
defaultValue={pair.name}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
getAutocompleteConstants={this._handleAutocompleteNames}
|
getAutocompleteConstants={this._handleAutocompleteNames}
|
||||||
forceInput={forceInput}
|
forceInput={forceInput}
|
||||||
|
@ -12,13 +12,8 @@ import { MarkdownPreview } from './markdown-preview';
|
|||||||
interface Props {
|
interface Props {
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
defaultValue: string;
|
defaultValue: string;
|
||||||
fontSize: number;
|
|
||||||
indentSize: number;
|
|
||||||
keyMap: string;
|
|
||||||
lineWrapping: boolean;
|
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
defaultPreviewMode?: boolean;
|
defaultPreviewMode?: boolean;
|
||||||
@ -63,10 +58,6 @@ export class MarkdownEditor extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
fontSize,
|
|
||||||
lineWrapping,
|
|
||||||
indentSize,
|
|
||||||
keyMap,
|
|
||||||
mode,
|
mode,
|
||||||
placeholder,
|
placeholder,
|
||||||
defaultPreviewMode,
|
defaultPreviewMode,
|
||||||
@ -74,7 +65,6 @@ export class MarkdownEditor extends PureComponent<Props, State> {
|
|||||||
tall,
|
tall,
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { markdown } = this.state;
|
const { markdown } = this.state;
|
||||||
@ -103,14 +93,9 @@ export class MarkdownEditor extends PureComponent<Props, State> {
|
|||||||
mode={mode || 'text/x-markdown'}
|
mode={mode || 'text/x-markdown'}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
debounceMillis={300}
|
debounceMillis={300}
|
||||||
keyMap={keyMap}
|
|
||||||
fontSize={fontSize}
|
|
||||||
lineWrapping={lineWrapping}
|
|
||||||
indentSize={indentSize}
|
|
||||||
defaultValue={markdown}
|
defaultValue={markdown}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={this._handleChange}
|
onChange={this._handleChange}
|
||||||
/>
|
/>
|
||||||
|
@ -25,11 +25,6 @@ const MODES = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleGetRenderContext?: HandleGetRenderContext;
|
handleGetRenderContext?: HandleGetRenderContext;
|
||||||
handleRender?: HandleRender;
|
handleRender?: HandleRender;
|
||||||
@ -117,13 +112,8 @@ export class CodePromptModal extends PureComponent<Props, State> {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
handleRender,
|
handleRender,
|
||||||
editorKeyMap,
|
|
||||||
editorIndentSize,
|
|
||||||
editorFontSize,
|
|
||||||
editorLineWrapping,
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
submitName,
|
submitName,
|
||||||
@ -170,11 +160,6 @@ export class CodePromptModal extends PureComponent<Props, State> {
|
|||||||
handleGetRenderContext={enableRender ? handleGetRenderContext : undefined}
|
handleGetRenderContext={enableRender ? handleGetRenderContext : undefined}
|
||||||
handleRender={enableRender ? handleRender : undefined}
|
handleRender={enableRender ? handleRender : undefined}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
keyMap={editorKeyMap}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
fontSize={editorFontSize}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -188,15 +173,10 @@ export class CodePromptModal extends PureComponent<Props, State> {
|
|||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={this._handleChange}
|
onChange={this._handleChange}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
keyMap={editorKeyMap}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
fontSize={editorFontSize}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +19,6 @@ import { OneLineEditor } from '../codemirror/one-line-editor';
|
|||||||
interface Props extends ModalProps {
|
interface Props extends ModalProps {
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
workspace: Workspace;
|
workspace: Workspace;
|
||||||
cookieJar: CookieJar;
|
cookieJar: CookieJar;
|
||||||
@ -188,7 +187,6 @@ export class CookieModifyModal extends PureComponent<Props, State> {
|
|||||||
const {
|
const {
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
@ -204,7 +202,6 @@ export class CookieModifyModal extends PureComponent<Props, State> {
|
|||||||
<OneLineEditor
|
<OneLineEditor
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
defaultValue={val || ''}
|
defaultValue={val || ''}
|
||||||
onChange={value => this._handleChange(field, value)}
|
onChange={value => this._handleChange(field, value)}
|
||||||
|
@ -12,14 +12,9 @@ import { EnvironmentEditor } from '../editors/environment-editor';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
render: HandleRender;
|
render: HandleRender;
|
||||||
getRenderContext: HandleGetRenderContext;
|
getRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
lineWrapping: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@ -89,13 +84,8 @@ export class EnvironmentEditModal extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
editorKeyMap,
|
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
lineWrapping,
|
|
||||||
render,
|
render,
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
...extraProps
|
...extraProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
@ -109,17 +99,12 @@ export class EnvironmentEditModal extends PureComponent<Props, State> {
|
|||||||
<ModalHeader>Environment Overrides (JSON Format)</ModalHeader>
|
<ModalHeader>Environment Overrides (JSON Format)</ModalHeader>
|
||||||
<ModalBody noScroll className="pad-top-sm">
|
<ModalBody noScroll className="pad-top-sm">
|
||||||
<EnvironmentEditor
|
<EnvironmentEditor
|
||||||
editorFontSize={editorFontSize}
|
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
editorKeyMap={editorKeyMap}
|
|
||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
key={requestGroup ? requestGroup._id : 'n/a'}
|
key={requestGroup ? requestGroup._id : 'n/a'}
|
||||||
lineWrapping={lineWrapping}
|
|
||||||
environmentInfo={environmentInfo}
|
environmentInfo={environmentInfo}
|
||||||
didChange={this._didChange}
|
didChange={this._didChange}
|
||||||
render={render}
|
render={render}
|
||||||
getRenderContext={getRenderContext}
|
getRenderContext={getRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
@ -32,9 +32,6 @@ const TO_ADD_CONTENT_LENGTH = {
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
environmentId: string;
|
environmentId: string;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@ -138,7 +135,6 @@ export class GenerateCodeModal extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { cmd, target, client } = this.state;
|
const { cmd, target, client } = this.state;
|
||||||
const { editorFontSize, editorIndentSize, editorKeyMap } = this.props;
|
|
||||||
const targets = HTTPSnippet.availableTargets();
|
const targets = HTTPSnippet.availableTargets();
|
||||||
// NOTE: Just some extra precautions in case the target is messed up
|
// NOTE: Just some extra precautions in case the target is messed up
|
||||||
let clients: HTTPSnippetClient[] = [];
|
let clients: HTTPSnippetClient[] = [];
|
||||||
@ -192,15 +188,11 @@ export class GenerateCodeModal extends PureComponent<Props, State> {
|
|||||||
<CopyButton content={cmd} className="pull-right" />
|
<CopyButton content={cmd} className="pull-right" />
|
||||||
</div>
|
</div>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
lineWrapping
|
|
||||||
placeholder="Generating code snippet..."
|
placeholder="Generating code snippet..."
|
||||||
className="border-top"
|
className="border-top"
|
||||||
key={Date.now()}
|
key={Date.now()}
|
||||||
mode={MODE_MAP[target.key] || target.key}
|
mode={MODE_MAP[target.key] || target.key}
|
||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
defaultValue={cmd}
|
defaultValue={cmd}
|
||||||
/>
|
/>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
@ -5,7 +5,6 @@ import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
|
|||||||
import { parseApiSpec } from '../../../common/api-specs';
|
import { parseApiSpec } from '../../../common/api-specs';
|
||||||
import { AUTOBIND_CFG } from '../../../common/constants';
|
import { AUTOBIND_CFG } from '../../../common/constants';
|
||||||
import type { ApiSpec } from '../../../models/api-spec';
|
import type { ApiSpec } from '../../../models/api-spec';
|
||||||
import type { Settings } from '../../../models/settings';
|
|
||||||
import type { ConfigGenerator } from '../../../plugins';
|
import type { ConfigGenerator } from '../../../plugins';
|
||||||
import * as plugins from '../../../plugins';
|
import * as plugins from '../../../plugins';
|
||||||
import { CopyButton } from '../base/copy-button';
|
import { CopyButton } from '../base/copy-button';
|
||||||
@ -19,10 +18,6 @@ import { HelpTooltip } from '../help-tooltip';
|
|||||||
import { Notice } from '../notice';
|
import { Notice } from '../notice';
|
||||||
import { showModal } from './index';
|
import { showModal } from './index';
|
||||||
|
|
||||||
interface Props {
|
|
||||||
settings: Settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Config {
|
interface Config {
|
||||||
label: string;
|
label: string;
|
||||||
docsLink?: string;
|
docsLink?: string;
|
||||||
@ -42,7 +37,7 @@ interface ShowOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
@autoBindMethodsForReact(AUTOBIND_CFG)
|
||||||
export class GenerateConfigModal extends PureComponent<Props, State> {
|
export class GenerateConfigModal extends PureComponent<{}, State> {
|
||||||
modal: Modal | null = null;
|
modal: Modal | null = null;
|
||||||
|
|
||||||
state: State = {
|
state: State = {
|
||||||
@ -93,7 +88,6 @@ export class GenerateConfigModal extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderConfigTabPanel(config: Config) {
|
renderConfigTabPanel(config: Config) {
|
||||||
const { settings } = this.props;
|
|
||||||
const linkIcon = <i className="fa fa-external-link-square" />;
|
const linkIcon = <i className="fa fa-external-link-square" />;
|
||||||
if (config.error) {
|
if (config.error) {
|
||||||
return (
|
return (
|
||||||
@ -111,12 +105,7 @@ export class GenerateConfigModal extends PureComponent<Props, State> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
className="tall pad-top-sm"
|
className="tall pad-top-sm"
|
||||||
defaultValue={config.content}
|
defaultValue={config.content}
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
mode={config.mimeType}
|
mode={config.mimeType}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
@ -15,11 +15,6 @@ import { HelpTooltip } from '../help-tooltip';
|
|||||||
import { MarkdownEditor } from '../markdown-editor';
|
import { MarkdownEditor } from '../markdown-editor';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
@ -199,13 +194,8 @@ export class RequestGroupSettingsModal extends React.PureComponent<Props, State>
|
|||||||
|
|
||||||
_renderDescription() {
|
_renderDescription() {
|
||||||
const {
|
const {
|
||||||
editorLineWrapping,
|
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
@ -220,14 +210,9 @@ export class RequestGroupSettingsModal extends React.PureComponent<Props, State>
|
|||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
className="margin-top"
|
className="margin-top"
|
||||||
defaultPreviewMode={defaultPreviewMode}
|
defaultPreviewMode={defaultPreviewMode}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
placeholder="Write a description"
|
placeholder="Write a description"
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
defaultValue={requestGroup.description}
|
defaultValue={requestGroup.description}
|
||||||
onChange={this._handleDescriptionChange}
|
onChange={this._handleDescriptionChange}
|
||||||
|
@ -17,11 +17,6 @@ import { HelpTooltip } from '../help-tooltip';
|
|||||||
import { MarkdownEditor } from '../markdown-editor';
|
import { MarkdownEditor } from '../markdown-editor';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
@ -325,13 +320,8 @@ export class RequestSettingsModal extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
_renderDescription() {
|
_renderDescription() {
|
||||||
const {
|
const {
|
||||||
editorLineWrapping,
|
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { showDescription, defaultPreviewMode, request } = this.state;
|
const { showDescription, defaultPreviewMode, request } = this.state;
|
||||||
@ -346,14 +336,9 @@ export class RequestSettingsModal extends PureComponent<Props, State> {
|
|||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
className="margin-top"
|
className="margin-top"
|
||||||
defaultPreviewMode={defaultPreviewMode}
|
defaultPreviewMode={defaultPreviewMode}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
placeholder="Write a description"
|
placeholder="Write a description"
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
defaultValue={request.description}
|
defaultValue={request.description}
|
||||||
onChange={this._handleDescriptionChange}
|
onChange={this._handleDescriptionChange}
|
||||||
|
@ -4,23 +4,18 @@ import React, { PureComponent } from 'react';
|
|||||||
import { AUTOBIND_CFG } from '../../../common/constants';
|
import { AUTOBIND_CFG } from '../../../common/constants';
|
||||||
import * as models from '../../../models/index';
|
import * as models from '../../../models/index';
|
||||||
import type { Response } from '../../../models/response';
|
import type { Response } from '../../../models/response';
|
||||||
import type { Settings } from '../../../models/settings';
|
|
||||||
import { ResponseTimelineViewer } from '../../components/viewers/response-timeline-viewer';
|
import { ResponseTimelineViewer } from '../../components/viewers/response-timeline-viewer';
|
||||||
import { Modal } from '../base/modal';
|
import { Modal } from '../base/modal';
|
||||||
import { ModalBody } from '../base/modal-body';
|
import { ModalBody } from '../base/modal-body';
|
||||||
import { ModalHeader } from '../base/modal-header';
|
import { ModalHeader } from '../base/modal-header';
|
||||||
|
|
||||||
interface Props {
|
|
||||||
settings: Settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
response: Response | null;
|
response: Response | null;
|
||||||
title: string | null;
|
title: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
@autoBindMethodsForReact(AUTOBIND_CFG)
|
||||||
export class ResponseDebugModal extends PureComponent<Props, State> {
|
export class ResponseDebugModal extends PureComponent<{}, State> {
|
||||||
modal: Modal | null = null;
|
modal: Modal | null = null;
|
||||||
|
|
||||||
state: State = {
|
state: State = {
|
||||||
@ -48,7 +43,6 @@ export class ResponseDebugModal extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { settings } = this.props;
|
|
||||||
const { response, title } = this.state;
|
const { response, title } = this.state;
|
||||||
return (
|
return (
|
||||||
<Modal ref={this._setModalRef} tall>
|
<Modal ref={this._setModalRef} tall>
|
||||||
@ -62,9 +56,6 @@ export class ResponseDebugModal extends PureComponent<Props, State> {
|
|||||||
>
|
>
|
||||||
{response ? (
|
{response ? (
|
||||||
<ResponseTimelineViewer
|
<ResponseTimelineViewer
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
response={response}
|
response={response}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
@ -29,13 +29,8 @@ const ROOT_ENVIRONMENT_NAME = 'Base Environment';
|
|||||||
interface Props extends ModalProps {
|
interface Props extends ModalProps {
|
||||||
handleChangeEnvironment: (id: string | null) => void;
|
handleChangeEnvironment: (id: string | null) => void;
|
||||||
activeEnvironmentId: string | null;
|
activeEnvironmentId: string | null;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
lineWrapping: boolean;
|
|
||||||
render: HandleRender;
|
render: HandleRender;
|
||||||
getRenderContext: HandleGetRenderContext;
|
getRenderContext: HandleGetRenderContext;
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,13 +428,8 @@ export class WorkspaceEnvironmentsEditModal extends PureComponent<Props, State>
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
activeEnvironmentId,
|
activeEnvironmentId,
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
getRenderContext,
|
getRenderContext,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
lineWrapping,
|
|
||||||
nunjucksPowerUserMode,
|
|
||||||
render,
|
render,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { subEnvironments, rootEnvironment, isValid } = this.state;
|
const { subEnvironments, rootEnvironment, isValid } = this.state;
|
||||||
@ -587,17 +577,12 @@ export class WorkspaceEnvironmentsEditModal extends PureComponent<Props, State>
|
|||||||
</div>
|
</div>
|
||||||
<div className="env-modal__editor">
|
<div className="env-modal__editor">
|
||||||
<EnvironmentEditor
|
<EnvironmentEditor
|
||||||
editorFontSize={editorFontSize}
|
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
editorKeyMap={editorKeyMap}
|
|
||||||
lineWrapping={lineWrapping}
|
|
||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
key={`${this.editorKey}::${selectedEnvironment ? selectedEnvironment._id : 'n/a'}`}
|
key={`${this.editorKey}::${selectedEnvironment ? selectedEnvironment._id : 'n/a'}`}
|
||||||
environmentInfo={environmentInfo}
|
environmentInfo={environmentInfo}
|
||||||
didChange={this._didChange}
|
didChange={this._didChange}
|
||||||
render={render}
|
render={render}
|
||||||
getRenderContext={getRenderContext}
|
getRenderContext={getRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,11 +66,6 @@ interface Props extends ReduxProps {
|
|||||||
clientCertificates: ClientCertificate[];
|
clientCertificates: ClientCertificate[];
|
||||||
workspace: Workspace;
|
workspace: Workspace;
|
||||||
apiSpec: ApiSpec;
|
apiSpec: ApiSpec;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
nunjucksPowerUserMode: boolean;
|
|
||||||
isVariableUncovered: boolean;
|
isVariableUncovered: boolean;
|
||||||
handleRender: HandleRender;
|
handleRender: HandleRender;
|
||||||
handleGetRenderContext: HandleGetRenderContext;
|
handleGetRenderContext: HandleGetRenderContext;
|
||||||
@ -297,13 +292,8 @@ export class UnconnectedWorkspaceSettingsModal extends PureComponent<Props, Stat
|
|||||||
clientCertificates,
|
clientCertificates,
|
||||||
workspace,
|
workspace,
|
||||||
activeWorkspaceName,
|
activeWorkspaceName,
|
||||||
editorLineWrapping,
|
|
||||||
editorFontSize,
|
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const publicCertificates = clientCertificates.filter(c => !c.isPrivate);
|
const publicCertificates = clientCertificates.filter(c => !c.isPrivate);
|
||||||
@ -347,14 +337,9 @@ export class UnconnectedWorkspaceSettingsModal extends PureComponent<Props, Stat
|
|||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
className="margin-top"
|
className="margin-top"
|
||||||
defaultPreviewMode={defaultPreviewMode}
|
defaultPreviewMode={defaultPreviewMode}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
placeholder="Write a description"
|
placeholder="Write a description"
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
defaultValue={workspace.description}
|
defaultValue={workspace.description}
|
||||||
onChange={this._handleDescriptionChange}
|
onChange={this._handleDescriptionChange}
|
||||||
|
@ -52,7 +52,6 @@ export const GrpcRequestPane: FunctionComponent<Props> = ({
|
|||||||
environmentId,
|
environmentId,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
forceRefreshKey,
|
forceRefreshKey,
|
||||||
settings,
|
|
||||||
handleRender,
|
handleRender,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
@ -83,7 +82,6 @@ export const GrpcRequestPane: FunctionComponent<Props> = ({
|
|||||||
placeholder="grpcb.in:9000"
|
placeholder="grpcb.in:9000"
|
||||||
onChange={handleChange.url}
|
onChange={handleChange.url}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
getAutocompleteConstants={getExistingGrpcUrls}
|
getAutocompleteConstants={getExistingGrpcUrls}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
@ -121,7 +119,6 @@ export const GrpcRequestPane: FunctionComponent<Props> = ({
|
|||||||
<TabPanel className="react-tabs__tab-panel">
|
<TabPanel className="react-tabs__tab-panel">
|
||||||
<GrpcTabbedMessages
|
<GrpcTabbedMessages
|
||||||
uniquenessKey={uniquenessKey}
|
uniquenessKey={uniquenessKey}
|
||||||
settings={settings}
|
|
||||||
tabNamePrefix="Stream"
|
tabNamePrefix="Stream"
|
||||||
messages={requestMessages}
|
messages={requestMessages}
|
||||||
bodyText={activeRequest.body.text}
|
bodyText={activeRequest.body.text}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
|
|
||||||
import type { GrpcRequest } from '../../../models/grpc-request';
|
import type { GrpcRequest } from '../../../models/grpc-request';
|
||||||
import type { Settings } from '../../../models/settings';
|
|
||||||
import { useGrpcRequestState } from '../../context/grpc';
|
import { useGrpcRequestState } from '../../context/grpc';
|
||||||
import { GrpcSpinner } from '../grpc-spinner';
|
import { GrpcSpinner } from '../grpc-spinner';
|
||||||
import { GrpcStatusTag } from '../tags/grpc-status-tag';
|
import { GrpcStatusTag } from '../tags/grpc-status-tag';
|
||||||
@ -11,10 +10,9 @@ import { Pane, PaneBody, PaneHeader } from './pane';
|
|||||||
interface Props {
|
interface Props {
|
||||||
forceRefreshKey: number;
|
forceRefreshKey: number;
|
||||||
activeRequest: GrpcRequest;
|
activeRequest: GrpcRequest;
|
||||||
settings: Settings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GrpcResponsePane: FunctionComponent<Props> = ({ settings, activeRequest, forceRefreshKey }) => {
|
export const GrpcResponsePane: FunctionComponent<Props> = ({ activeRequest, forceRefreshKey }) => {
|
||||||
// Used to refresh input fields to their default value when switching between requests.
|
// Used to refresh input fields to their default value when switching between requests.
|
||||||
// This is a common pattern in this codebase.
|
// This is a common pattern in this codebase.
|
||||||
const uniquenessKey = `${forceRefreshKey}::${activeRequest._id}`;
|
const uniquenessKey = `${forceRefreshKey}::${activeRequest._id}`;
|
||||||
@ -32,7 +30,6 @@ export const GrpcResponsePane: FunctionComponent<Props> = ({ settings, activeReq
|
|||||||
{!!responseMessages.length && (
|
{!!responseMessages.length && (
|
||||||
<GrpcTabbedMessages
|
<GrpcTabbedMessages
|
||||||
uniquenessKey={uniquenessKey}
|
uniquenessKey={uniquenessKey}
|
||||||
settings={settings}
|
|
||||||
tabNamePrefix="Response"
|
tabNamePrefix="Response"
|
||||||
messages={responseMessages}
|
messages={responseMessages}
|
||||||
/>
|
/>
|
||||||
|
@ -9,6 +9,7 @@ interface Props {
|
|||||||
hotKeyRegistry: HotKeyRegistry;
|
hotKeyRegistry: HotKeyRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: get hotKeyRegistry from redux
|
||||||
export const PlaceholderResponsePane: FunctionComponent<Props> = ({ hotKeyRegistry, children }) => (
|
export const PlaceholderResponsePane: FunctionComponent<Props> = ({ hotKeyRegistry, children }) => (
|
||||||
<Pane type="response">
|
<Pane type="response">
|
||||||
<PaneHeader />
|
<PaneHeader />
|
||||||
|
@ -272,7 +272,6 @@ export class RequestPane extends PureComponent<Props> {
|
|||||||
handleUpdateSettingsShowPasswords={updateSettingsShowPasswords}
|
handleUpdateSettingsShowPasswords={updateSettingsShowPasswords}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
onChange={updateRequestAuthentication}
|
onChange={updateRequestAuthentication}
|
||||||
/>
|
/>
|
||||||
@ -300,11 +299,7 @@ export class RequestPane extends PureComponent<Props> {
|
|||||||
key={headerEditorKey}
|
key={headerEditorKey}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
onChange={updateRequestParameters}
|
onChange={updateRequestParameters}
|
||||||
request={request}
|
request={request}
|
||||||
bulk={settings.useBulkParametersEditor}
|
bulk={settings.useBulkParametersEditor}
|
||||||
@ -333,11 +328,7 @@ export class RequestPane extends PureComponent<Props> {
|
|||||||
key={headerEditorKey}
|
key={headerEditorKey}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
onChange={updateRequestHeaders}
|
onChange={updateRequestHeaders}
|
||||||
request={request}
|
request={request}
|
||||||
bulk={settings.useBulkHeaderEditor}
|
bulk={settings.useBulkHeaderEditor}
|
||||||
|
@ -48,9 +48,6 @@ interface Props {
|
|||||||
filterHistory: string[];
|
filterHistory: string[];
|
||||||
disableHtmlPreviewJs: boolean;
|
disableHtmlPreviewJs: boolean;
|
||||||
editorFontSize: number;
|
editorFontSize: number;
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
loadStartTime: number;
|
loadStartTime: number;
|
||||||
responses: Response[];
|
responses: Response[];
|
||||||
hotKeyRegistry: HotKeyRegistry;
|
hotKeyRegistry: HotKeyRegistry;
|
||||||
@ -229,9 +226,6 @@ export class ResponsePane extends PureComponent<Props> {
|
|||||||
const {
|
const {
|
||||||
disableHtmlPreviewJs,
|
disableHtmlPreviewJs,
|
||||||
editorFontSize,
|
editorFontSize,
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
editorLineWrapping,
|
|
||||||
environment,
|
environment,
|
||||||
filter,
|
filter,
|
||||||
disableResponsePreviewLinks,
|
disableResponsePreviewLinks,
|
||||||
@ -336,9 +330,6 @@ export class ResponsePane extends PureComponent<Props> {
|
|||||||
disablePreviewLinks={disableResponsePreviewLinks}
|
disablePreviewLinks={disableResponsePreviewLinks}
|
||||||
download={this._handleDownloadResponseBody}
|
download={this._handleDownloadResponseBody}
|
||||||
editorFontSize={editorFontSize}
|
editorFontSize={editorFontSize}
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
editorKeyMap={editorKeyMap}
|
|
||||||
editorLineWrapping={editorLineWrapping}
|
|
||||||
error={response.error}
|
error={response.error}
|
||||||
filter={filter}
|
filter={filter}
|
||||||
filterHistory={filterHistory}
|
filterHistory={filterHistory}
|
||||||
@ -373,9 +364,6 @@ export class ResponsePane extends PureComponent<Props> {
|
|||||||
<ErrorBoundary key={response._id} errorClassName="font-error pad text-center">
|
<ErrorBoundary key={response._id} errorClassName="font-error pad text-center">
|
||||||
<ResponseTimelineViewer
|
<ResponseTimelineViewer
|
||||||
response={response}
|
response={response}
|
||||||
editorLineWrapping={editorLineWrapping}
|
|
||||||
editorFontSize={editorFontSize}
|
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
/>
|
/>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
@ -353,7 +353,6 @@ export class RequestUrlBar extends PureComponent<Props, State> {
|
|||||||
const {
|
const {
|
||||||
request,
|
request,
|
||||||
handleRender,
|
handleRender,
|
||||||
nunjucksPowerUserMode,
|
|
||||||
isVariableUncovered,
|
isVariableUncovered,
|
||||||
handleGetRenderContext,
|
handleGetRenderContext,
|
||||||
handleAutocompleteUrls,
|
handleAutocompleteUrls,
|
||||||
@ -378,7 +377,6 @@ export class RequestUrlBar extends PureComponent<Props, State> {
|
|||||||
forceEditor
|
forceEditor
|
||||||
type="text"
|
type="text"
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
nunjucksPowerUserMode={nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
getAutocompleteConstants={handleAutocompleteUrls}
|
getAutocompleteConstants={handleAutocompleteUrls}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
|
@ -3,7 +3,6 @@ import React, { FunctionComponent } from 'react';
|
|||||||
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
|
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
|
||||||
|
|
||||||
import { HandleGetRenderContext, HandleRender } from '../../../common/render';
|
import { HandleGetRenderContext, HandleRender } from '../../../common/render';
|
||||||
import { Settings } from '../../../models/settings';
|
|
||||||
import { Button } from '../base/button';
|
import { Button } from '../base/button';
|
||||||
import { GRPCEditor } from '../editors/grpc-editor';
|
import { GRPCEditor } from '../editors/grpc-editor';
|
||||||
|
|
||||||
@ -14,7 +13,6 @@ interface Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
settings: Settings;
|
|
||||||
messages?: Message[];
|
messages?: Message[];
|
||||||
tabNamePrefix: 'Stream' | 'Response';
|
tabNamePrefix: 'Stream' | 'Response';
|
||||||
bodyText?: string;
|
bodyText?: string;
|
||||||
@ -29,7 +27,6 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GrpcTabbedMessages: FunctionComponent<Props> = ({
|
export const GrpcTabbedMessages: FunctionComponent<Props> = ({
|
||||||
settings,
|
|
||||||
showActions,
|
showActions,
|
||||||
bodyText,
|
bodyText,
|
||||||
messages,
|
messages,
|
||||||
@ -88,7 +85,6 @@ export const GrpcTabbedMessages: FunctionComponent<Props> = ({
|
|||||||
<TabPanel className="react-tabs__tab-panel editor-wrapper">
|
<TabPanel className="react-tabs__tab-panel editor-wrapper">
|
||||||
<GRPCEditor
|
<GRPCEditor
|
||||||
content={bodyText}
|
content={bodyText}
|
||||||
settings={settings}
|
|
||||||
handleChange={handleBodyChange}
|
handleChange={handleBodyChange}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
@ -98,7 +94,7 @@ export const GrpcTabbedMessages: FunctionComponent<Props> = ({
|
|||||||
)}
|
)}
|
||||||
{orderedMessages.map(m => (
|
{orderedMessages.map(m => (
|
||||||
<TabPanel key={m.id} className="react-tabs__tab-panel editor-wrapper">
|
<TabPanel key={m.id} className="react-tabs__tab-panel editor-wrapper">
|
||||||
<GRPCEditor content={m.text} settings={settings} readOnly />
|
<GRPCEditor content={m.text} readOnly />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import React, { FC, memo } from 'react';
|
import React, { FC, memo } from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { selectSettings } from '../../redux/selectors';
|
||||||
import { Link } from '../base/link';
|
import { Link } from '../base/link';
|
||||||
import { showModal } from '../modals/index';
|
import { showModal } from '../modals/index';
|
||||||
import { SettingsModal } from '../modals/settings-modal';
|
import { SettingsModal } from '../modals/settings-modal';
|
||||||
@ -7,10 +9,10 @@ import { SettingsModal } from '../modals/settings-modal';
|
|||||||
interface Props {
|
interface Props {
|
||||||
error: string;
|
error: string;
|
||||||
url: string;
|
url: string;
|
||||||
fontSize: number;
|
|
||||||
}
|
}
|
||||||
export const ResponseErrorViewer: FC<Props> = memo(({ error, fontSize }) => {
|
export const ResponseErrorViewer: FC<Props> = memo(({ error }) => {
|
||||||
let msg: React.ReactNode = null;
|
let msg: React.ReactNode = null;
|
||||||
|
const { editorFontSize } = useSelector(selectSettings);
|
||||||
|
|
||||||
if (error?.toLowerCase().indexOf('certificate') !== -1) {
|
if (error?.toLowerCase().indexOf('certificate') !== -1) {
|
||||||
msg = (
|
msg = (
|
||||||
@ -37,7 +39,7 @@ export const ResponseErrorViewer: FC<Props> = memo(({ error, fontSize }) => {
|
|||||||
<pre
|
<pre
|
||||||
className="selectable pad force-pre-wrap"
|
className="selectable pad force-pre-wrap"
|
||||||
style={{
|
style={{
|
||||||
fontSize: `${fontSize}px`,
|
fontSize: `${editorFontSize}px`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{error}
|
{error}
|
||||||
|
@ -40,9 +40,6 @@ interface Props {
|
|||||||
filter: string;
|
filter: string;
|
||||||
filterHistory: string[];
|
filterHistory: string[];
|
||||||
editorFontSize: number;
|
editorFontSize: number;
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,9 +219,6 @@ export class ResponseMultipartViewer extends PureComponent<Props, State> {
|
|||||||
disableHtmlPreviewJs,
|
disableHtmlPreviewJs,
|
||||||
disablePreviewLinks,
|
disablePreviewLinks,
|
||||||
editorFontSize,
|
editorFontSize,
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
editorLineWrapping,
|
|
||||||
filter,
|
filter,
|
||||||
filterHistory,
|
filterHistory,
|
||||||
responseId,
|
responseId,
|
||||||
@ -303,9 +297,6 @@ export class ResponseMultipartViewer extends PureComponent<Props, State> {
|
|||||||
disablePreviewLinks={disablePreviewLinks}
|
disablePreviewLinks={disablePreviewLinks}
|
||||||
download={download}
|
download={download}
|
||||||
editorFontSize={editorFontSize}
|
editorFontSize={editorFontSize}
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
editorKeyMap={editorKeyMap}
|
|
||||||
editorLineWrapping={editorLineWrapping}
|
|
||||||
error={null}
|
error={null}
|
||||||
filter={filter}
|
filter={filter}
|
||||||
filterHistory={filterHistory}
|
filterHistory={filterHistory}
|
||||||
|
@ -6,7 +6,6 @@ import { CodeEditor, UnconnectedCodeEditor } from '../codemirror/code-editor';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value: string;
|
value: string;
|
||||||
fontSize?: number;
|
|
||||||
responseId?: string;
|
responseId?: string;
|
||||||
}
|
}
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
@autoBindMethodsForReact(AUTOBIND_CFG)
|
||||||
@ -30,14 +29,12 @@ export class ResponseRawViewer extends PureComponent<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fontSize, responseId, value } = this.props;
|
const { responseId, value } = this.props;
|
||||||
return (
|
return (
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
ref={this._setCodeEditorRef}
|
ref={this._setCodeEditorRef}
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
fontSize={fontSize}
|
|
||||||
hideLineNumbers
|
hideLineNumbers
|
||||||
lineWrapping
|
|
||||||
mode="text/plain"
|
mode="text/plain"
|
||||||
noMatchBrackets
|
noMatchBrackets
|
||||||
placeholder="..."
|
placeholder="..."
|
||||||
|
@ -7,9 +7,6 @@ import { CodeEditor } from '../codemirror/code-editor';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
response: Response;
|
response: Response;
|
||||||
editorFontSize: number;
|
|
||||||
editorIndentSize: number;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
@ -96,7 +93,6 @@ export class ResponseTimelineViewer extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { editorFontSize, editorIndentSize, editorLineWrapping } = this.props;
|
|
||||||
const { timeline, timelineKey } = this.state;
|
const { timeline, timelineKey } = this.state;
|
||||||
const rows = timeline
|
const rows = timeline
|
||||||
.map(this.renderRow)
|
.map(this.renderRow)
|
||||||
@ -110,9 +106,6 @@ export class ResponseTimelineViewer extends PureComponent<Props, State> {
|
|||||||
readOnly
|
readOnly
|
||||||
onClickLink={clickLink}
|
onClickLink={clickLink}
|
||||||
defaultValue={rows}
|
defaultValue={rows}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
className="pad-left"
|
className="pad-left"
|
||||||
mode="curl"
|
mode="curl"
|
||||||
/>
|
/>
|
||||||
|
@ -31,9 +31,6 @@ export interface ResponseViewerProps {
|
|||||||
disablePreviewLinks: boolean;
|
disablePreviewLinks: boolean;
|
||||||
download: (...args: any[]) => any;
|
download: (...args: any[]) => any;
|
||||||
editorFontSize: number;
|
editorFontSize: number;
|
||||||
editorIndentSize: number;
|
|
||||||
editorKeyMap: string;
|
|
||||||
editorLineWrapping: boolean;
|
|
||||||
filter: string;
|
filter: string;
|
||||||
filterHistory: string[];
|
filterHistory: string[];
|
||||||
getBody: (...args: any[]) => any;
|
getBody: (...args: any[]) => any;
|
||||||
@ -284,9 +281,6 @@ export class ResponseViewer extends Component<ResponseViewerProps, State> {
|
|||||||
disablePreviewLinks,
|
disablePreviewLinks,
|
||||||
download,
|
download,
|
||||||
editorFontSize,
|
editorFontSize,
|
||||||
editorIndentSize,
|
|
||||||
editorKeyMap,
|
|
||||||
editorLineWrapping,
|
|
||||||
error: responseError,
|
error: responseError,
|
||||||
filter,
|
filter,
|
||||||
filterHistory,
|
filterHistory,
|
||||||
@ -301,7 +295,7 @@ export class ResponseViewer extends Component<ResponseViewerProps, State> {
|
|||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<div className="scrollable tall">
|
<div className="scrollable tall">
|
||||||
<ResponseErrorViewer url={url} error={error} fontSize={editorFontSize} />
|
<ResponseErrorViewer url={url} error={error} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -415,9 +409,6 @@ export class ResponseViewer extends Component<ResponseViewerProps, State> {
|
|||||||
disablePreviewLinks={disablePreviewLinks}
|
disablePreviewLinks={disablePreviewLinks}
|
||||||
download={download}
|
download={download}
|
||||||
editorFontSize={editorFontSize}
|
editorFontSize={editorFontSize}
|
||||||
editorIndentSize={editorIndentSize}
|
|
||||||
editorKeyMap={editorKeyMap}
|
|
||||||
editorLineWrapping={editorLineWrapping}
|
|
||||||
filter={filter}
|
filter={filter}
|
||||||
filterHistory={filterHistory}
|
filterHistory={filterHistory}
|
||||||
key={responseId}
|
key={responseId}
|
||||||
@ -446,7 +437,6 @@ export class ResponseViewer extends Component<ResponseViewerProps, State> {
|
|||||||
responseId={responseId}
|
responseId={responseId}
|
||||||
ref={this._setSelectableViewRef}
|
ref={this._setSelectableViewRef}
|
||||||
value={this._getBody()}
|
value={this._getBody()}
|
||||||
fontSize={editorFontSize}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -460,10 +450,6 @@ export class ResponseViewer extends Component<ResponseViewerProps, State> {
|
|||||||
defaultValue={this._getBody()}
|
defaultValue={this._getBody()}
|
||||||
filter={filter}
|
filter={filter}
|
||||||
filterHistory={filterHistory}
|
filterHistory={filterHistory}
|
||||||
fontSize={editorFontSize}
|
|
||||||
indentSize={editorIndentSize}
|
|
||||||
keyMap={editorKeyMap}
|
|
||||||
lineWrapping={editorLineWrapping}
|
|
||||||
mode={this._getMode()}
|
mode={this._getMode()}
|
||||||
noMatchBrackets
|
noMatchBrackets
|
||||||
onClickLink={disablePreviewLinks ? undefined : this._handleClickLink}
|
onClickLink={disablePreviewLinks ? undefined : this._handleClickLink}
|
||||||
|
@ -297,7 +297,6 @@ export class WrapperDebug extends PureComponent<Props> {
|
|||||||
<GrpcResponsePane
|
<GrpcResponsePane
|
||||||
activeRequest={activeRequest}
|
activeRequest={activeRequest}
|
||||||
forceRefreshKey={forceRefreshKey}
|
forceRefreshKey={forceRefreshKey}
|
||||||
settings={settings}
|
|
||||||
/>
|
/>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
@ -309,9 +308,6 @@ export class WrapperDebug extends PureComponent<Props> {
|
|||||||
disableHtmlPreviewJs={settings.disableHtmlPreviewJs}
|
disableHtmlPreviewJs={settings.disableHtmlPreviewJs}
|
||||||
disableResponsePreviewLinks={settings.disableResponsePreviewLinks}
|
disableResponsePreviewLinks={settings.disableResponsePreviewLinks}
|
||||||
editorFontSize={settings.editorFontSize}
|
editorFontSize={settings.editorFontSize}
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
environment={activeEnvironment}
|
environment={activeEnvironment}
|
||||||
filter={responseFilter}
|
filter={responseFilter}
|
||||||
filterHistory={responseFilterHistory}
|
filterHistory={responseFilterHistory}
|
||||||
|
@ -146,7 +146,7 @@ export class WrapperDesign extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_renderEditor() {
|
_renderEditor() {
|
||||||
const { activeApiSpec, settings } = this.props.wrapperProps;
|
const { activeApiSpec } = this.props.wrapperProps;
|
||||||
const { lintMessages } = this.state;
|
const { lintMessages } = this.state;
|
||||||
|
|
||||||
if (!activeApiSpec) {
|
if (!activeApiSpec) {
|
||||||
@ -159,10 +159,6 @@ export class WrapperDesign extends PureComponent<Props, State> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
manualPrettify
|
manualPrettify
|
||||||
ref={this._setEditorRef}
|
ref={this._setEditorRef}
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
lineWrapping={settings.lineWrapping}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
lintOptions={WrapperDesign.lintOptions}
|
lintOptions={WrapperDesign.lintOptions}
|
||||||
mode="openapi"
|
mode="openapi"
|
||||||
defaultValue={activeApiSpec.contents}
|
defaultValue={activeApiSpec.contents}
|
||||||
|
@ -428,18 +428,12 @@ export class WrapperUnitTest extends PureComponent<Props, State> {
|
|||||||
<CodeEditor
|
<CodeEditor
|
||||||
dynamicHeight
|
dynamicHeight
|
||||||
manualPrettify
|
manualPrettify
|
||||||
fontSize={settings.editorFontSize}
|
|
||||||
indentSize={settings.editorIndentSize}
|
|
||||||
indentWithTabs={settings.editorIndentWithTabs}
|
|
||||||
keyMap={settings.editorKeyMap}
|
|
||||||
defaultValue={unitTest ? unitTest.code : ''}
|
defaultValue={unitTest ? unitTest.code : ''}
|
||||||
getAutocompleteSnippets={() => this.autocompleteSnippets(unitTest)}
|
getAutocompleteSnippets={() => this.autocompleteSnippets(unitTest)}
|
||||||
lintOptions={WrapperUnitTest.lintOptions}
|
lintOptions={WrapperUnitTest.lintOptions}
|
||||||
onChange={this._handleUnitTestCodeChange.bind(this, unitTest)}
|
onChange={this._handleUnitTestCodeChange.bind(this, unitTest)}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={settings.isVariableUncovered}
|
isVariableUncovered={settings.isVariableUncovered}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
placeholder=""
|
placeholder=""
|
||||||
/>
|
/>
|
||||||
</UnitTestItem>
|
</UnitTestItem>
|
||||||
|
@ -533,7 +533,7 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
<PaymentNotificationModal ref={registerModal} />
|
<PaymentNotificationModal ref={registerModal} />
|
||||||
<FilterHelpModal ref={registerModal} />
|
<FilterHelpModal ref={registerModal} />
|
||||||
<RequestRenderErrorModal ref={registerModal} />
|
<RequestRenderErrorModal ref={registerModal} />
|
||||||
<GenerateConfigModal ref={registerModal} settings={settings} />
|
<GenerateConfigModal ref={registerModal} />
|
||||||
<ProjectSettingsModal ref={registerModal} />
|
<ProjectSettingsModal ref={registerModal} />
|
||||||
<WorkspaceDuplicateModal ref={registerModal} vcs={vcs || undefined} />
|
<WorkspaceDuplicateModal ref={registerModal} vcs={vcs || undefined} />
|
||||||
|
|
||||||
@ -541,36 +541,21 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<RequestSettingsModal
|
<RequestSettingsModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
workspaces={workspaces}
|
workspaces={workspaces}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<RequestGroupSettingsModal
|
<RequestGroupSettingsModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
workspaces={workspaces}
|
workspaces={workspaces}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
@ -588,7 +573,6 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
<CookieModifyModal
|
<CookieModifyModal
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
cookieJar={activeCookieJar}
|
cookieJar={activeCookieJar}
|
||||||
workspace={activeWorkspace}
|
workspace={activeWorkspace}
|
||||||
@ -609,13 +593,8 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
clientCertificates={activeWorkspaceClientCertificates}
|
clientCertificates={activeWorkspaceClientCertificates}
|
||||||
workspace={activeWorkspace}
|
workspace={activeWorkspace}
|
||||||
apiSpec={activeApiSpec}
|
apiSpec={activeApiSpec}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
editorLineWrapping={settings.editorLineWrapping}
|
|
||||||
handleRender={handleRender}
|
handleRender={handleRender}
|
||||||
handleGetRenderContext={handleGetRenderContext}
|
handleGetRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
handleRemoveWorkspace={this._handleRemoveActiveWorkspace}
|
handleRemoveWorkspace={this._handleRemoveActiveWorkspace}
|
||||||
handleClearAllResponses={this._handleActiveWorkspaceClearAllResponses}
|
handleClearAllResponses={this._handleActiveWorkspaceClearAllResponses}
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
@ -625,9 +604,6 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
<GenerateCodeModal
|
<GenerateCodeModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
environmentId={activeEnvironment ? activeEnvironment._id : 'n/a'}
|
environmentId={activeEnvironment ? activeEnvironment._id : 'n/a'}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SettingsModal
|
<SettingsModal
|
||||||
@ -635,7 +611,7 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
settings={settings}
|
settings={settings}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ResponseDebugModal ref={registerModal} settings={settings} />
|
<ResponseDebugModal ref={registerModal} />
|
||||||
|
|
||||||
<RequestSwitcherModal
|
<RequestSwitcherModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
@ -644,14 +620,9 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
|
|
||||||
<EnvironmentEditModal
|
<EnvironmentEditModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
onChange={models.requestGroup.update}
|
onChange={models.requestGroup.update}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -702,14 +673,9 @@ export class Wrapper extends PureComponent<WrapperProps, State> {
|
|||||||
<WorkspaceEnvironmentsEditModal
|
<WorkspaceEnvironmentsEditModal
|
||||||
ref={registerModal}
|
ref={registerModal}
|
||||||
handleChangeEnvironment={this._handleChangeEnvironment}
|
handleChangeEnvironment={this._handleChangeEnvironment}
|
||||||
lineWrapping={settings.editorLineWrapping}
|
|
||||||
editorFontSize={settings.editorFontSize}
|
|
||||||
editorIndentSize={settings.editorIndentSize}
|
|
||||||
editorKeyMap={settings.editorKeyMap}
|
|
||||||
activeEnvironmentId={activeEnvironment ? activeEnvironment._id : null}
|
activeEnvironmentId={activeEnvironment ? activeEnvironment._id : null}
|
||||||
render={handleRender}
|
render={handleRender}
|
||||||
getRenderContext={handleGetRenderContext}
|
getRenderContext={handleGetRenderContext}
|
||||||
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
|
|
||||||
isVariableUncovered={isVariableUncovered}
|
isVariableUncovered={isVariableUncovered}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user