mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-23 15:19:04 -04:00
Small sidebar refactor and moved ESLint to top level
This commit is contained in:
1 parent
bb5eaaa871
commit
8fda24ae47
20 files changed
+4792
-3577
No files matched your search
@@ -0,0 +1,13 @@
|
||||
.idea/
|
||||
.github/
|
||||
docker/
|
||||
screenshots/
|
||||
**/*.min.js
|
||||
packages/insomnia-app/build/
|
||||
packages/insomnia-app/dist/
|
||||
**/coverage/
|
||||
**/node_modules/
|
||||
**/webpack/
|
||||
**/bin/
|
||||
**/__fixtures__/
|
||||
**/flow-typed/
|
||||
File renamed without changes.
Generated
+887
File diff suppressed because it is too large.
Load diff
+15
-1
@@ -8,10 +8,11 @@
|
||||
"url": "https://github.com/getinsomnia/insomnia"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint \"**/*.js\" \"**/*.html\" \"**/*.json\"",
|
||||
"bootstrap": "npm install && lerna bootstrap && lerna run --parallel --stream bootstrap",
|
||||
"publish": "lerna publish",
|
||||
"clean": "lerna clean --yes && rimraf node_modules",
|
||||
"test": "lerna run --stream --parallel test",
|
||||
"test": "npm run lint && lerna run --stream --parallel test",
|
||||
"app-start": "lerna run start --stream --parallel --bail",
|
||||
"app-build": "lerna run build --stream --parallel --bail",
|
||||
"app-package": "lerna run package --stream --parallel --bail",
|
||||
@@ -32,6 +33,19 @@
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-jest": "^24.7.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-semistandard": "^12.0.1",
|
||||
"eslint-config-standard": "^11.0.0",
|
||||
"eslint-plugin-filenames": "^1.2.0",
|
||||
"eslint-plugin-flowtype": "^2.46.2",
|
||||
"eslint-plugin-html": "^4.0.3",
|
||||
"eslint-plugin-import": "^2.11.0",
|
||||
"eslint-plugin-jest": "^21.15.1",
|
||||
"eslint-plugin-json": "^1.2.0",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint-plugin-promise": "^3.7.0",
|
||||
"eslint-plugin-react": "^7.7.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"flow-bin": "^0.104.0",
|
||||
"husky": "^1.0.0-rc.9",
|
||||
"jest": "^24.7.1",
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
**/*.min.js
|
||||
build/**/*
|
||||
dist/**/*
|
||||
coverage/**/*
|
||||
node_modules/**/*
|
||||
webpack/**/*
|
||||
bin/**/*
|
||||
**/__fixtures__/prettify/*
|
||||
flow-typed/
|
||||
@@ -1 +0,0 @@
|
||||
10
|
||||
@@ -22,7 +22,7 @@ type Props = {
|
||||
handleChangeEnvironment: Function,
|
||||
workspace: Workspace,
|
||||
environments: Array<Environment>,
|
||||
environmentHighlightColorStyle: String,
|
||||
environmentHighlightColorStyle: string,
|
||||
hotKeyRegistry: HotKeyRegistry,
|
||||
|
||||
// Optional
|
||||
|
||||
@@ -42,7 +42,7 @@ type Props = {
|
||||
activeEnvironment: Environment | null,
|
||||
|
||||
// Optional
|
||||
activeRequest?: Request,
|
||||
activeRequest: ?Request,
|
||||
};
|
||||
|
||||
class SidebarChildren extends React.PureComponent<Props> {
|
||||
|
||||
@@ -1,65 +1,55 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import autobind from 'autobind-decorator';
|
||||
import type { HotKeyRegistry } from '../../../common/hotkeys';
|
||||
import type { Workspace } from '../../../models/workspace';
|
||||
import type { Environment } from '../../../models/environment';
|
||||
import classnames from 'classnames';
|
||||
import EnvironmentsDropdown from '../dropdowns/environments-dropdown';
|
||||
import SidebarFilter from './sidebar-filter';
|
||||
import SidebarChildren from './sidebar-children';
|
||||
import SyncDropdown from '../dropdowns/sync-dropdown';
|
||||
import { COLLAPSE_SIDEBAR_REMS, SIDEBAR_SKINNY_REMS } from '../../../common/constants';
|
||||
import WorkspaceDropdown from '../dropdowns/workspace-dropdown';
|
||||
import { SIDEBAR_SKINNY_REMS, COLLAPSE_SIDEBAR_REMS } from '../../../common/constants';
|
||||
import VCS from '../../../sync/vcs';
|
||||
import SyncDropdown from '../dropdowns/sync-dropdown';
|
||||
import SyncLegacyDropdown from '../dropdowns/sync-legacy-dropdown';
|
||||
import type { StatusCandidate } from '../../../sync/types';
|
||||
import { isLoggedIn } from '../../../account/session';
|
||||
|
||||
type Props = {|
|
||||
activeEnvironment: Environment | null,
|
||||
children: React.Node,
|
||||
enableSyncBeta: boolean,
|
||||
environmentHighlightColorStyle: string,
|
||||
handleSetActiveEnvironment: Function,
|
||||
handleSetActiveWorkspace: Function,
|
||||
hidden: boolean,
|
||||
hotKeyRegistry: HotKeyRegistry,
|
||||
isLoading: boolean,
|
||||
showEnvironmentsModal: Function,
|
||||
syncItems: Array<StatusCandidate>,
|
||||
unseenWorkspaces: Array<Workspace>,
|
||||
vcs: VCS | null,
|
||||
width: number,
|
||||
workspace: Workspace,
|
||||
workspaces: Array<Workspace>,
|
||||
|};
|
||||
|
||||
@autobind
|
||||
class Sidebar extends PureComponent {
|
||||
_handleChangeEnvironment(id) {
|
||||
const { handleSetActiveEnvironment } = this.props;
|
||||
handleSetActiveEnvironment(id);
|
||||
}
|
||||
|
||||
_handleCreateRequestInWorkspace() {
|
||||
const { workspace, handleCreateRequest } = this.props;
|
||||
handleCreateRequest(workspace._id);
|
||||
}
|
||||
|
||||
_handleCreateRequestGroupInWorkspace() {
|
||||
const { workspace, handleCreateRequestGroup } = this.props;
|
||||
handleCreateRequestGroup(workspace._id);
|
||||
}
|
||||
|
||||
class Sidebar extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const {
|
||||
showCookiesModal,
|
||||
filter,
|
||||
childObjects,
|
||||
activeEnvironment,
|
||||
children,
|
||||
enableSyncBeta,
|
||||
environmentHighlightColorStyle,
|
||||
handleSetActiveWorkspace,
|
||||
hidden,
|
||||
hotKeyRegistry,
|
||||
isLoading,
|
||||
syncItems,
|
||||
unseenWorkspaces,
|
||||
vcs,
|
||||
width,
|
||||
workspace,
|
||||
workspaces,
|
||||
unseenWorkspaces,
|
||||
environments,
|
||||
activeEnvironment,
|
||||
handleSetActiveWorkspace,
|
||||
handleChangeFilter,
|
||||
isLoading,
|
||||
handleCreateRequest,
|
||||
handleDuplicateRequest,
|
||||
handleDuplicateRequestGroup,
|
||||
handleMoveRequestGroup,
|
||||
handleGenerateCode,
|
||||
handleCopyAsCurl,
|
||||
handleCreateRequestGroup,
|
||||
handleSetRequestGroupCollapsed,
|
||||
handleSetRequestPinned,
|
||||
moveDoc,
|
||||
handleActivateRequest,
|
||||
activeRequest,
|
||||
environmentHighlightColorStyle,
|
||||
hotKeyRegistry,
|
||||
enableSyncBeta,
|
||||
vcs,
|
||||
syncItems,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@@ -89,50 +79,7 @@ class Sidebar extends PureComponent {
|
||||
vcs={vcs}
|
||||
/>
|
||||
|
||||
<div className="sidebar__menu">
|
||||
<EnvironmentsDropdown
|
||||
handleChangeEnvironment={this._handleChangeEnvironment}
|
||||
activeEnvironment={activeEnvironment}
|
||||
environments={environments}
|
||||
workspace={workspace}
|
||||
environmentHighlightColorStyle={environmentHighlightColorStyle}
|
||||
hotKeyRegistry={hotKeyRegistry}
|
||||
/>
|
||||
<button className="btn btn--super-compact" onClick={showCookiesModal}>
|
||||
<div className="sidebar__menu__thing">
|
||||
<span>Cookies</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<SidebarFilter
|
||||
key={`${workspace._id}::filter`}
|
||||
onChange={handleChangeFilter}
|
||||
requestCreate={this._handleCreateRequestInWorkspace}
|
||||
requestGroupCreate={this._handleCreateRequestGroupInWorkspace}
|
||||
filter={filter || ''}
|
||||
hotKeyRegistry={hotKeyRegistry}
|
||||
/>
|
||||
|
||||
<SidebarChildren
|
||||
childObjects={childObjects}
|
||||
handleActivateRequest={handleActivateRequest}
|
||||
handleCreateRequest={handleCreateRequest}
|
||||
handleCreateRequestGroup={handleCreateRequestGroup}
|
||||
handleSetRequestGroupCollapsed={handleSetRequestGroupCollapsed}
|
||||
handleSetRequestPinned={handleSetRequestPinned}
|
||||
handleDuplicateRequest={handleDuplicateRequest}
|
||||
handleDuplicateRequestGroup={handleDuplicateRequestGroup}
|
||||
handleMoveRequestGroup={handleMoveRequestGroup}
|
||||
handleGenerateCode={handleGenerateCode}
|
||||
handleCopyAsCurl={handleCopyAsCurl}
|
||||
moveDoc={moveDoc}
|
||||
workspace={workspace}
|
||||
activeRequest={activeRequest}
|
||||
filter={filter || ''}
|
||||
hotKeyRegistry={hotKeyRegistry}
|
||||
activeEnvironment={activeEnvironment}
|
||||
/>
|
||||
{children}
|
||||
|
||||
{enableSyncBeta && vcs && isLoggedIn() && (
|
||||
<SyncDropdown
|
||||
@@ -155,44 +102,4 @@ class Sidebar extends PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
Sidebar.propTypes = {
|
||||
// Functions
|
||||
handleActivateRequest: PropTypes.func.isRequired,
|
||||
handleSetRequestGroupCollapsed: PropTypes.func.isRequired,
|
||||
handleSetRequestPinned: PropTypes.func.isRequired,
|
||||
handleChangeFilter: PropTypes.func.isRequired,
|
||||
handleSetActiveWorkspace: PropTypes.func.isRequired,
|
||||
handleSetActiveEnvironment: PropTypes.func.isRequired,
|
||||
moveDoc: PropTypes.func.isRequired,
|
||||
handleCreateRequest: PropTypes.func.isRequired,
|
||||
handleCreateRequestGroup: PropTypes.func.isRequired,
|
||||
handleDuplicateRequest: PropTypes.func.isRequired,
|
||||
handleDuplicateRequestGroup: PropTypes.func.isRequired,
|
||||
handleMoveRequestGroup: PropTypes.func.isRequired,
|
||||
handleGenerateCode: PropTypes.func.isRequired,
|
||||
handleCopyAsCurl: PropTypes.func.isRequired,
|
||||
showEnvironmentsModal: PropTypes.func.isRequired,
|
||||
showCookiesModal: PropTypes.func.isRequired,
|
||||
|
||||
// Other
|
||||
hidden: PropTypes.bool.isRequired,
|
||||
width: PropTypes.number.isRequired,
|
||||
isLoading: PropTypes.bool.isRequired,
|
||||
workspace: PropTypes.object.isRequired,
|
||||
childObjects: PropTypes.object.isRequired,
|
||||
workspaces: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
unseenWorkspaces: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
environments: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
environmentHighlightColorStyle: PropTypes.string.isRequired,
|
||||
hotKeyRegistry: PropTypes.object.isRequired,
|
||||
enableSyncBeta: PropTypes.bool.isRequired,
|
||||
syncItems: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
|
||||
// Optional
|
||||
filter: PropTypes.string,
|
||||
activeRequest: PropTypes.object,
|
||||
activeEnvironment: PropTypes.object,
|
||||
vcs: PropTypes.object,
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
RequestParameter,
|
||||
} from '../../models/request';
|
||||
import type { SidebarChildObjects } from './sidebar/sidebar-children';
|
||||
import SidebarChildren from './sidebar/sidebar-children';
|
||||
|
||||
import * as React from 'react';
|
||||
import autobind from 'autobind-decorator';
|
||||
@@ -63,6 +64,8 @@ import VCS from '../../sync/vcs';
|
||||
import type { StatusCandidate } from '../../sync/types';
|
||||
import type { RequestMeta } from '../../models/request-meta';
|
||||
import type { RequestVersion } from '../../models/request-version';
|
||||
import EnvironmentsDropdown from './dropdowns/environments-dropdown';
|
||||
import SidebarFilter from './sidebar/sidebar-filter';
|
||||
|
||||
type Props = {
|
||||
// Helper Functions
|
||||
@@ -140,9 +143,9 @@ type Props = {
|
||||
syncItems: Array<StatusCandidate>,
|
||||
|
||||
// Optional
|
||||
oAuth2Token: ?OAuth2Token,
|
||||
activeRequest: ?Request,
|
||||
activeResponse: ?Response,
|
||||
oAuth2Token: OAuth2Token | null,
|
||||
activeRequest: Request | null,
|
||||
activeResponse: Response | null,
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -372,10 +375,102 @@ class Wrapper extends React.PureComponent<Props, State> {
|
||||
this.props.handleSetResponseFilter(activeRequestId, filter);
|
||||
}
|
||||
|
||||
_handleCreateRequestInWorkspace() {
|
||||
const { activeWorkspace, handleCreateRequest } = this.props;
|
||||
handleCreateRequest(activeWorkspace._id);
|
||||
}
|
||||
|
||||
_handleCreateRequestGroupInWorkspace() {
|
||||
const { activeWorkspace, handleCreateRequestGroup } = this.props;
|
||||
handleCreateRequestGroup(activeWorkspace._id);
|
||||
}
|
||||
|
||||
_handleChangeEnvironment(id: string) {
|
||||
const { handleSetActiveEnvironment } = this.props;
|
||||
handleSetActiveEnvironment(id);
|
||||
}
|
||||
|
||||
_forceRequestPaneRefresh(): void {
|
||||
this.setState({ forceRefreshKey: Date.now() });
|
||||
}
|
||||
|
||||
renderSidebarBody(): React.Node {
|
||||
const {
|
||||
activeEnvironment,
|
||||
activeRequest,
|
||||
activeWorkspace,
|
||||
environments,
|
||||
handleActivateRequest,
|
||||
handleCopyAsCurl,
|
||||
handleCreateRequest,
|
||||
handleCreateRequestGroup,
|
||||
handleDuplicateRequest,
|
||||
handleDuplicateRequestGroup,
|
||||
handleGenerateCode,
|
||||
handleMoveDoc,
|
||||
handleMoveRequestGroup,
|
||||
handleSetRequestGroupCollapsed,
|
||||
handleSetRequestPinned,
|
||||
handleSetSidebarFilter,
|
||||
settings,
|
||||
sidebarChildren,
|
||||
sidebarFilter,
|
||||
sidebarWidth,
|
||||
sidebarHidden,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="sidebar__menu">
|
||||
<EnvironmentsDropdown
|
||||
handleChangeEnvironment={this._handleChangeEnvironment}
|
||||
activeEnvironment={activeEnvironment}
|
||||
environments={environments}
|
||||
workspace={activeWorkspace}
|
||||
environmentHighlightColorStyle={settings.environmentHighlightColorStyle}
|
||||
hotKeyRegistry={settings.hotKeyRegistry}
|
||||
/>
|
||||
<button className="btn btn--super-compact" onClick={this._handleShowCookiesModal}>
|
||||
<div className="sidebar__menu__thing">
|
||||
<span>Cookies</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<SidebarFilter
|
||||
key={`${activeWorkspace._id}::filter`}
|
||||
onChange={handleSetSidebarFilter}
|
||||
requestCreate={this._handleCreateRequestInWorkspace}
|
||||
requestGroupCreate={this._handleCreateRequestGroupInWorkspace}
|
||||
filter={sidebarFilter || ''}
|
||||
hotKeyRegistry={settings.hotKeyRegistry}
|
||||
/>
|
||||
|
||||
<SidebarChildren
|
||||
childObjects={sidebarChildren}
|
||||
handleActivateRequest={handleActivateRequest}
|
||||
handleCreateRequest={handleCreateRequest}
|
||||
handleCreateRequestGroup={handleCreateRequestGroup}
|
||||
handleSetRequestGroupCollapsed={handleSetRequestGroupCollapsed}
|
||||
handleSetRequestPinned={handleSetRequestPinned}
|
||||
handleDuplicateRequest={handleDuplicateRequest}
|
||||
handleDuplicateRequestGroup={handleDuplicateRequestGroup}
|
||||
handleMoveRequestGroup={handleMoveRequestGroup}
|
||||
handleGenerateCode={handleGenerateCode}
|
||||
handleCopyAsCurl={handleCopyAsCurl}
|
||||
moveDoc={handleMoveDoc}
|
||||
hidden={sidebarHidden}
|
||||
width={sidebarWidth}
|
||||
workspace={activeWorkspace}
|
||||
activeRequest={activeRequest}
|
||||
filter={sidebarFilter || ''}
|
||||
hotKeyRegistry={settings.hotKeyRegistry}
|
||||
activeEnvironment={activeEnvironment}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
activeCookieJar,
|
||||
@@ -385,40 +480,28 @@ class Wrapper extends React.PureComponent<Props, State> {
|
||||
activeResponse,
|
||||
activeWorkspace,
|
||||
activeWorkspaceClientCertificates,
|
||||
environments,
|
||||
handleActivateRequest,
|
||||
handleCopyAsCurl,
|
||||
handleCreateRequest,
|
||||
handleCreateRequestForWorkspace,
|
||||
handleCreateRequestGroup,
|
||||
handleDuplicateRequest,
|
||||
handleDuplicateRequestGroup,
|
||||
handleDuplicateWorkspace,
|
||||
handleExportFile,
|
||||
handleExportRequestsToFile,
|
||||
handleGenerateCode,
|
||||
handleGenerateCodeForActiveRequest,
|
||||
handleGetRenderContext,
|
||||
handleMoveDoc,
|
||||
handleMoveRequestGroup,
|
||||
handleRender,
|
||||
handleResetDragPaneHorizontal,
|
||||
handleResetDragPaneVertical,
|
||||
handleResetDragSidebar,
|
||||
handleSetActiveEnvironment,
|
||||
handleSetActiveWorkspace,
|
||||
handleSetRequestGroupCollapsed,
|
||||
handleSetRequestPaneRef,
|
||||
handleSetRequestPinned,
|
||||
handleSetResponsePaneRef,
|
||||
handleSetSidebarFilter,
|
||||
handleSetSidebarRef,
|
||||
handleShowExportRequestsModal,
|
||||
handleStartDragPaneHorizontal,
|
||||
handleStartDragPaneVertical,
|
||||
handleToggleMenuBar,
|
||||
handleUpdateRequestMimeType,
|
||||
handleUpdateDownloadPath,
|
||||
handleUpdateRequestMimeType,
|
||||
headerEditorKey,
|
||||
isLoading,
|
||||
isVariableUncovered,
|
||||
@@ -428,13 +511,12 @@ class Wrapper extends React.PureComponent<Props, State> {
|
||||
paneWidth,
|
||||
requestMetas,
|
||||
requestVersions,
|
||||
responseDownloadPath,
|
||||
responseFilter,
|
||||
responseFilterHistory,
|
||||
responsePreviewMode,
|
||||
responseDownloadPath,
|
||||
settings,
|
||||
sidebarChildren,
|
||||
sidebarFilter,
|
||||
sidebarHidden,
|
||||
sidebarWidth,
|
||||
syncItems,
|
||||
@@ -674,41 +756,23 @@ class Wrapper extends React.PureComponent<Props, State> {
|
||||
<ErrorBoundary showAlert>
|
||||
<Sidebar
|
||||
ref={handleSetSidebarRef}
|
||||
showEnvironmentsModal={this._handleShowEnvironmentsModal}
|
||||
showCookiesModal={this._handleShowCookiesModal}
|
||||
handleActivateRequest={handleActivateRequest}
|
||||
handleChangeFilter={handleSetSidebarFilter}
|
||||
handleImportFile={this._handleImportFile}
|
||||
handleExportFile={handleExportFile}
|
||||
handleSetActiveWorkspace={handleSetActiveWorkspace}
|
||||
handleDuplicateRequest={handleDuplicateRequest}
|
||||
handleGenerateCode={handleGenerateCode}
|
||||
handleCopyAsCurl={handleCopyAsCurl}
|
||||
handleDuplicateRequestGroup={handleDuplicateRequestGroup}
|
||||
handleMoveRequestGroup={handleMoveRequestGroup}
|
||||
handleSetActiveEnvironment={handleSetActiveEnvironment}
|
||||
moveDoc={handleMoveDoc}
|
||||
handleSetRequestGroupCollapsed={handleSetRequestGroupCollapsed}
|
||||
handleSetRequestPinned={handleSetRequestPinned}
|
||||
activeRequest={activeRequest}
|
||||
activeEnvironment={activeEnvironment}
|
||||
handleCreateRequest={handleCreateRequest}
|
||||
handleCreateRequestGroup={handleCreateRequestGroup}
|
||||
filter={sidebarFilter || ''}
|
||||
hidden={sidebarHidden || false}
|
||||
workspace={activeWorkspace}
|
||||
unseenWorkspaces={unseenWorkspaces}
|
||||
childObjects={sidebarChildren}
|
||||
width={sidebarWidth}
|
||||
isLoading={isLoading}
|
||||
workspaces={workspaces}
|
||||
environments={environments}
|
||||
environmentHighlightColorStyle={settings.environmentHighlightColorStyle}
|
||||
enableSyncBeta={settings.enableSyncBeta}
|
||||
environmentHighlightColorStyle={settings.environmentHighlightColorStyle}
|
||||
handleSetActiveEnvironment={handleSetActiveEnvironment}
|
||||
handleSetActiveWorkspace={handleSetActiveWorkspace}
|
||||
hidden={sidebarHidden || false}
|
||||
hotKeyRegistry={settings.hotKeyRegistry}
|
||||
vcs={vcs}
|
||||
isLoading={isLoading}
|
||||
showEnvironmentsModal={this._handleShowEnvironmentsModal}
|
||||
syncItems={syncItems}
|
||||
/>
|
||||
unseenWorkspaces={unseenWorkspaces}
|
||||
vcs={vcs}
|
||||
width={sidebarWidth}
|
||||
workspace={activeWorkspace}
|
||||
workspaces={workspaces}>
|
||||
{this.renderSidebarBody()}
|
||||
</Sidebar>
|
||||
</ErrorBoundary>
|
||||
|
||||
<div className="drag drag--sidebar">
|
||||
|
||||
Generated
+3717
-3354
File diff suppressed because it is too large.
Load diff
@@ -20,8 +20,7 @@
|
||||
"url": "https://github.com/getinsomnia/insomnia"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint \"**/*.js\" \"**/*.html\" \"**/*.json\"",
|
||||
"test": "flow check && npm run lint && npm run test:jest",
|
||||
"test": "flow check && npm run test:jest",
|
||||
"test:jest": "cross-env NODE_ENV=test jest --silent",
|
||||
"test-appveyor": "npm run test -- --maxWorkers 1",
|
||||
"start:electron": "cross-env NODE_ENV=development webpack --config ./webpack/webpack.config.electron.babel.js && electron .",
|
||||
@@ -177,19 +176,6 @@
|
||||
"electron-builder-lib": "^20.20.4",
|
||||
"electron-builder-squirrel-windows": "^20.20.4",
|
||||
"electron-rebuild": "^1.8.4",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-semistandard": "^12.0.1",
|
||||
"eslint-config-standard": "^11.0.0",
|
||||
"eslint-plugin-filenames": "^1.2.0",
|
||||
"eslint-plugin-flowtype": "^2.46.2",
|
||||
"eslint-plugin-html": "^4.0.3",
|
||||
"eslint-plugin-import": "^2.11.0",
|
||||
"eslint-plugin-jest": "^21.15.1",
|
||||
"eslint-plugin-json": "^1.2.0",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint-plugin-promise": "^3.7.0",
|
||||
"eslint-plugin-react": "^7.7.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"file-loader": "^3.0.1",
|
||||
"less": "^3.8.1",
|
||||
"less-loader": "^4.1.0",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { CookieJar } = require('tough-cookie');
|
||||
const { cookieToString, jarFromCookies, cookiesFromJar } = require('..');
|
||||
const { jarFromCookies, cookiesFromJar } = require('..');
|
||||
|
||||
describe('jarFromCookies()', () => {
|
||||
it('returns valid cookies', done => {
|
||||
|
||||
@@ -71,7 +71,7 @@ function importArgs(args) {
|
||||
// Start at 1 so we can skip the ^curl part
|
||||
for (let i = 1; i < args.length; i++) {
|
||||
const arg = args[i];
|
||||
if (arg.match(/^-{1,2}[\w\-]+/)) {
|
||||
if (arg.match(/^-{1,2}[\w-]+/)) {
|
||||
const isSingleDash = arg[0] === '-' && arg[1] !== '-';
|
||||
let name = arg.replace(/^-{1,2}/, '');
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const utils = require('../utils');
|
||||
|
||||
let requestCount = 1;
|
||||
|
||||
module.exports.id = 'har';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const utils = require('../utils');
|
||||
|
||||
module.exports.id = 'insomnia-2';
|
||||
module.exports.name = 'Insomnia v2';
|
||||
module.exports.description = 'Insomnia export format 2';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const utils = require('../utils');
|
||||
|
||||
module.exports.id = 'insomnia-3';
|
||||
module.exports.name = 'Insomnia v3';
|
||||
module.exports.description = 'Insomnia export format 3';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const utils = require('../utils');
|
||||
const YAML = require('yaml');
|
||||
|
||||
module.exports.id = 'insomnia-4';
|
||||
|
||||
@@ -108,7 +108,7 @@ function parseEndpoints(document) {
|
||||
.filter(method => method !== 'parameters')
|
||||
.map(method => Object.assign({}, schemasPerMethod[method], { path, method }));
|
||||
})
|
||||
.reduce((flat, arr) => flat.concat(arr), []); //flat single array
|
||||
.reduce((flat, arr) => flat.concat(arr), []); // flat single array
|
||||
|
||||
const tags = document.tags || [];
|
||||
const folders = tags.map(tag => {
|
||||
|
||||
@@ -6,7 +6,6 @@ module.exports.description = 'Importer for Postman collections';
|
||||
|
||||
let requestCount = 1;
|
||||
let requestGroupCount = 1;
|
||||
let currentSchema = '';
|
||||
|
||||
const POSTMAN_SCHEMA_V2_0 = 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json';
|
||||
const POSTMAN_SCHEMA_V2_1 = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json';
|
||||
@@ -45,10 +44,9 @@ function importCollection(collection, schema) {
|
||||
|
||||
function importVariable(items) {
|
||||
let variable = {};
|
||||
if (items.length == 0) {
|
||||
if (items.length === 0) {
|
||||
return null;
|
||||
} else {
|
||||
items;
|
||||
for (let idx = 0; idx < items.length; idx++) {
|
||||
variable[items[idx].key] = items[idx].value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user