insomnia/packages/insomnia-app/app/ui/components/wrapper.js

869 lines
31 KiB
JavaScript
Raw Normal View History

2017-07-19 04:48:28 +00:00
// @flow
2018-06-25 17:42:50 +00:00
import type { Settings } from '../../models/settings';
import type { Response } from '../../models/response';
import type { OAuth2Token } from '../../models/o-auth-2-token';
import type { Workspace } from '../../models/workspace';
import type {
Request,
RequestAuthentication,
RequestBody,
RequestHeader,
RequestParameter,
2018-06-25 17:42:50 +00:00
} from '../../models/request';
import type { SidebarChildObjects } from './sidebar/sidebar-children';
import SidebarChildren from './sidebar/sidebar-children';
2017-07-19 04:48:28 +00:00
import * as React from 'react';
import autobind from 'autobind-decorator';
import classnames from 'classnames';
2018-06-25 17:42:50 +00:00
import { registerModal, showModal } from './modals/index';
import AlertModal from './modals/alert-modal';
import WrapperModal from './modals/wrapper-modal';
2017-09-17 14:04:46 +00:00
import ErrorModal from './modals/error-modal';
import CookiesModal from './modals/cookies-modal';
2017-08-19 22:34:16 +00:00
import CookieModifyModal from '../components/modals/cookie-modify-modal';
import EnvironmentEditModal from './modals/environment-edit-modal';
import GenerateCodeModal from './modals/generate-code-modal';
import LoginModal from './modals/login-modal';
import ResponseDebugModal from './modals/response-debug-modal';
import PaymentNotificationModal from './modals/payment-notification-modal';
import NunjucksModal from './modals/nunjucks-modal';
import PromptModal from './modals/prompt-modal';
import AskModal from './modals/ask-modal';
2017-11-01 12:40:24 +00:00
import SelectModal from './modals/select-modal';
import RequestCreateModal from './modals/request-create-modal';
import RequestPane from './request-pane';
import RequestSwitcherModal from './modals/request-switcher-modal';
import SettingsModal from './modals/settings-modal';
import FilterHelpModal from './modals/filter-help-modal';
import ResponsePane from './response-pane';
import RequestSettingsModal from './modals/request-settings-modal';
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
import SetupSyncModal from './modals/setup-sync-modal';
import SyncStagingModal from './modals/sync-staging-modal';
import SyncMergeModal from './modals/sync-merge-modal';
import SyncHistoryModal from './modals/sync-history-modal';
import SyncShareModal from './modals/sync-share-modal';
import SyncBranchesModal from './modals/sync-branches-modal';
import RequestRenderErrorModal from './modals/request-render-error-modal';
import Sidebar from './sidebar/sidebar';
import WorkspaceEnvironmentsEditModal from './modals/workspace-environments-edit-modal';
import WorkspaceSettingsModal from './modals/workspace-settings-modal';
import WorkspaceShareSettingsModal from './modals/workspace-share-settings-modal';
import CodePromptModal from './modals/code-prompt-modal';
import * as db from '../../common/database';
import * as models from '../../models/index';
2016-11-26 00:37:59 +00:00
import * as importers from 'insomnia-importers';
2018-06-25 17:42:50 +00:00
import type { CookieJar } from '../../models/cookie-jar';
import type { Environment } from '../../models/environment';
import ErrorBoundary from './error-boundary';
2018-06-25 17:42:50 +00:00
import type { ClientCertificate } from '../../models/client-certificate';
import MoveRequestGroupModal from './modals/move-request-group-modal';
import AddKeyCombinationModal from './modals/add-key-combination-modal';
2019-02-27 15:01:51 +00:00
import ExportRequestsModal from './modals/export-requests-modal';
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
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
handleActivateRequest: Function,
handleSetSidebarFilter: Function,
handleToggleMenuBar: Function,
handleImportFileToWorkspace: Function,
handleImportClipBoardToWorkspace: Function,
handleImportUriToWorkspace: Function,
handleExportFile: Function,
handleShowExportRequestsModal: Function,
2019-02-27 15:01:51 +00:00
handleExportRequestsToFile: Function,
handleSetActiveWorkspace: Function,
handleSetActiveEnvironment: Function,
handleMoveDoc: Function,
handleCreateRequest: Function,
handleDuplicateRequest: Function,
handleDuplicateRequestGroup: Function,
handleMoveRequestGroup: Function,
handleDuplicateWorkspace: Function,
handleCreateRequestGroup: Function,
handleGenerateCodeForActiveRequest: Function,
handleGenerateCode: Function,
handleCopyAsCurl: Function,
handleCreateRequestForWorkspace: Function,
handleSetRequestPaneRef: Function,
handleSetResponsePaneRef: Function,
handleSetResponsePreviewMode: Function,
handleRender: Function,
handleGetRenderContext: Function,
handleSetResponseFilter: Function,
handleSetActiveResponse: Function,
handleSetSidebarRef: Function,
handleStartDragSidebar: Function,
handleResetDragSidebar: Function,
handleStartDragPaneHorizontal: Function,
handleStartDragPaneVertical: Function,
handleResetDragPaneHorizontal: Function,
handleResetDragPaneVertical: Function,
handleSetRequestGroupCollapsed: Function,
handleSetRequestPinned: Function,
handleSendRequestWithEnvironment: Function,
handleSendAndDownloadRequestWithEnvironment: Function,
handleUpdateRequestMimeType: Function,
handleUpdateDownloadPath: Function,
// Properties
loadStartTime: number,
isLoading: boolean,
paneWidth: number,
paneHeight: number,
responsePreviewMode: string,
responseFilter: string,
responseFilterHistory: Array<string>,
responseDownloadPath: string | null,
sidebarWidth: number,
sidebarHidden: boolean,
sidebarFilter: string,
sidebarChildren: SidebarChildObjects,
settings: Settings,
workspaces: Array<Workspace>,
requestMetas: Array<RequestMeta>,
requests: Array<Request>,
requestVersions: Array<RequestVersion>,
unseenWorkspaces: Array<Workspace>,
workspaceChildren: Array<Object>,
environments: Array<Object>,
activeRequestResponses: Array<Response>,
activeWorkspace: Workspace,
activeCookieJar: CookieJar,
activeEnvironment: Environment | null,
activeWorkspaceClientCertificates: Array<ClientCertificate>,
isVariableUncovered: boolean,
headerEditorKey: string,
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
vcs: VCS | null,
syncItems: Array<StatusCandidate>,
// Optional
oAuth2Token: OAuth2Token | null,
activeRequest: Request | null,
activeResponse: Response | null,
};
type State = {
forceRefreshKey: number,
};
2017-07-19 04:48:28 +00:00
const rUpdate = (request, ...args) => {
if (!request) {
throw new Error('Tried to update null request');
}
return models.request.update(request, ...args);
};
2016-11-26 00:37:59 +00:00
const sUpdate = models.settings.update;
2017-07-21 18:59:17 +00:00
@autobind
class Wrapper extends React.PureComponent<Props, State> {
2018-06-25 17:42:50 +00:00
constructor(props: any) {
super(props);
this.state = {
forceRefreshKey: Date.now(),
};
}
2016-11-26 00:37:59 +00:00
// Request updaters
async _handleForceUpdateRequest(r: Request, patch: Object): Promise<Request> {
const newRequest = await rUpdate(r, patch);
// Give it a second for the app to render first. If we don't wait, it will refresh
// on the old request and won't catch the newest one.
// TODO: Move this refresh key into redux store so we don't need timeout
window.setTimeout(this._forceRequestPaneRefresh, 100);
return newRequest;
}
_handleForceUpdateRequestHeaders(r: Request, headers: Array<RequestHeader>): Promise<Request> {
return this._handleForceUpdateRequest(r, { headers });
}
2016-11-28 07:12:17 +00:00
static _handleUpdateRequestBody(r: Request, body: RequestBody): Promise<Request> {
return rUpdate(r, { body });
}
static _handleUpdateRequestParameters(
r: Request,
parameters: Array<RequestParameter>,
): Promise<Request> {
return rUpdate(r, { parameters });
}
static _handleUpdateRequestAuthentication(
r: Request,
authentication: RequestAuthentication,
): Promise<Request> {
return rUpdate(r, { authentication });
}
static _handleUpdateRequestHeaders(r: Request, headers: Array<RequestHeader>): Promise<Request> {
return rUpdate(r, { headers });
}
static _handleUpdateRequestMethod(r: Request, method: string): Promise<Request> {
return rUpdate(r, { method });
}
static _handleUpdateRequestUrl(r: Request, url: string): Promise<Request> {
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
// Don't update if we don't need to
if (r.url === url) {
return Promise.resolve(r);
}
return rUpdate(r, { url });
}
2016-11-26 00:37:59 +00:00
// Special request updaters
2018-06-25 17:42:50 +00:00
_handleStartDragSidebar(e: Event): void {
e.preventDefault();
this.props.handleStartDragSidebar();
}
2018-06-25 17:42:50 +00:00
async _handleImport(text: string): Promise<Request | null> {
2016-11-26 00:37:59 +00:00
// Allow user to paste any import file into the url. If it results in
// only one item, it will overwrite the current request.
try {
2018-06-25 17:42:50 +00:00
const { data } = await importers.convert(text);
const { resources } = data;
2016-11-26 00:37:59 +00:00
const r = resources[0];
if (r && r._type === 'request' && this.props.activeRequest) {
2016-11-26 00:37:59 +00:00
// Only pull fields that we want to update
return this._handleForceUpdateRequest(this.props.activeRequest, {
2016-11-26 00:37:59 +00:00
url: r.url,
method: r.method,
headers: r.headers,
body: r.body,
authentication: r.authentication,
parameters: r.parameters,
2016-11-26 00:37:59 +00:00
});
}
} catch (e) {
// Import failed, that's alright
}
return null;
}
2016-11-26 00:37:59 +00:00
// Settings updaters
2018-10-17 16:42:33 +00:00
_handleUpdateSettingsShowPasswords(showPasswords: boolean): Promise<Settings> {
2018-06-25 17:42:50 +00:00
return sUpdate(this.props.settings, { showPasswords });
}
2018-10-17 16:42:33 +00:00
_handleUpdateSettingsUseBulkHeaderEditor(useBulkHeaderEditor: boolean): Promise<Settings> {
2018-06-25 17:42:50 +00:00
return sUpdate(this.props.settings, { useBulkHeaderEditor });
}
2016-11-26 00:37:59 +00:00
// Other Helpers
2018-06-25 17:42:50 +00:00
_handleImportFile(): void {
this.props.handleImportFileToWorkspace(this.props.activeWorkspace._id);
}
_handleImportClipBoard(): void {
this.props.handleImportClipBoardToWorkspace(this.props.activeWorkspace._id);
}
2018-06-25 17:42:50 +00:00
_handleImportUri(uri: string): void {
this.props.handleImportUriToWorkspace(this.props.activeWorkspace._id, uri);
}
2018-06-25 17:42:50 +00:00
_handleSetActiveResponse(responseId: string | null): void {
2017-07-19 04:48:28 +00:00
if (!this.props.activeRequest) {
console.warn('Tried to set active response when request not active');
return;
}
2018-10-17 16:42:33 +00:00
this.props.handleSetActiveResponse(this.props.activeRequest._id, responseId);
}
2016-12-07 17:57:01 +00:00
2018-06-25 17:42:50 +00:00
_handleShowEnvironmentsModal(): void {
showModal(WorkspaceEnvironmentsEditModal, this.props.activeWorkspace);
}
2016-11-26 00:37:59 +00:00
2018-06-25 17:42:50 +00:00
_handleShowCookiesModal(): void {
showModal(CookiesModal, this.props.activeWorkspace);
}
static _handleShowModifyCookieModal(cookie: Object): void {
2017-08-22 22:30:57 +00:00
showModal(CookieModifyModal, cookie);
2017-08-19 22:34:16 +00:00
}
2018-06-25 17:42:50 +00:00
_handleShowRequestSettingsModal(): void {
showModal(RequestSettingsModal, { request: this.props.activeRequest });
}
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
async _handleDeleteResponses(): Promise<void> {
2017-07-19 04:48:28 +00:00
if (!this.props.activeRequest) {
console.warn('Tried to delete responses when request not active');
return;
}
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
await models.response.removeForRequest(this.props.activeRequest._id);
this._handleSetActiveResponse(null);
}
2018-06-25 17:42:50 +00:00
async _handleDeleteResponse(response: Response): Promise<void> {
2017-06-12 21:48:17 +00:00
if (response) {
await models.response.remove(response);
}
// Also unset active response it's the one we're deleting
2018-10-17 16:42:33 +00:00
if (this.props.activeResponse && this.props.activeResponse._id === response._id) {
2017-06-12 21:48:17 +00:00
this._handleSetActiveResponse(null);
}
}
2018-06-25 17:42:50 +00:00
async _handleRemoveActiveWorkspace(): Promise<void> {
const { workspaces, activeWorkspace } = this.props;
if (workspaces.length <= 1) {
showModal(AlertModal, {
title: 'Deleting Last Workspace',
message: 'Since you deleted your only workspace, a new one has been created for you.',
});
2018-06-25 17:42:50 +00:00
models.workspace.create({ name: 'Insomnia' });
}
2017-07-19 04:48:28 +00:00
await models.workspace.remove(activeWorkspace);
}
async _handleActiveWorkspaceClearAllResponses(): Promise<void> {
const docs = await db.withDescendants(this.props.activeWorkspace, models.request.type);
const requests = docs.filter(doc => doc.type === models.request.type);
for (const req of requests) {
await models.response.removeForRequest(req._id);
}
}
2018-06-25 17:42:50 +00:00
_handleSendRequestWithActiveEnvironment(): void {
2018-10-17 16:42:33 +00:00
const { activeRequest, activeEnvironment, handleSendRequestWithEnvironment } = this.props;
2016-11-26 00:37:59 +00:00
const activeRequestId = activeRequest ? activeRequest._id : 'n/a';
2018-10-17 16:42:33 +00:00
const activeEnvironmentId = activeEnvironment ? activeEnvironment._id : 'n/a';
2016-11-26 00:37:59 +00:00
handleSendRequestWithEnvironment(activeRequestId, activeEnvironmentId);
}
2016-11-25 23:09:17 +00:00
async _handleSendAndDownloadRequestWithActiveEnvironment(filename?: string): Promise<void> {
2018-06-25 17:42:50 +00:00
const {
activeRequest,
activeEnvironment,
handleSendAndDownloadRequestWithEnvironment,
2018-06-25 17:42:50 +00:00
} = this.props;
const activeRequestId = activeRequest ? activeRequest._id : 'n/a';
2018-10-17 16:42:33 +00:00
const activeEnvironmentId = activeEnvironment ? activeEnvironment._id : 'n/a';
await handleSendAndDownloadRequestWithEnvironment(
activeRequestId,
activeEnvironmentId,
filename,
);
}
2018-06-25 17:42:50 +00:00
_handleSetPreviewMode(previewMode: string): void {
2016-11-25 23:09:17 +00:00
const activeRequest = this.props.activeRequest;
const activeRequestId = activeRequest ? activeRequest._id : 'n/a';
this.props.handleSetResponsePreviewMode(activeRequestId, previewMode);
}
2016-11-25 23:09:17 +00:00
2018-06-25 17:42:50 +00:00
_handleSetResponseFilter(filter: string): void {
2016-11-25 23:09:17 +00:00
const activeRequest = this.props.activeRequest;
const activeRequestId = activeRequest ? activeRequest._id : 'n/a';
this.props.handleSetResponseFilter(activeRequestId, filter);
}
2016-11-25 23:09:17 +00:00
_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);
}
2018-06-25 17:42:50 +00:00
_forceRequestPaneRefresh(): void {
this.setState({ forceRefreshKey: Date.now() });
}
2016-11-25 23:09:17 +00:00
renderSidebarBody(): React.Node {
2016-11-25 23:09:17 +00:00
const {
activeEnvironment,
activeRequest,
activeWorkspace,
2016-11-25 23:09:17 +00:00
environments,
handleActivateRequest,
handleCopyAsCurl,
2016-11-25 23:09:17 +00:00
handleCreateRequest,
handleCreateRequestGroup,
handleDuplicateRequest,
2016-11-28 07:12:17 +00:00
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,
activeEnvironment,
activeRequest,
activeRequestResponses,
activeResponse,
activeWorkspace,
activeWorkspaceClientCertificates,
handleActivateRequest,
handleCreateRequestForWorkspace,
handleDuplicateWorkspace,
2016-11-25 23:09:17 +00:00
handleExportFile,
handleExportRequestsToFile,
handleGenerateCodeForActiveRequest,
handleGetRenderContext,
handleRender,
handleResetDragPaneHorizontal,
handleResetDragPaneVertical,
handleResetDragSidebar,
handleSetActiveEnvironment,
handleSetActiveWorkspace,
2016-11-25 23:09:17 +00:00
handleSetRequestPaneRef,
handleSetResponsePaneRef,
handleSetSidebarRef,
handleShowExportRequestsModal,
handleStartDragPaneHorizontal,
handleStartDragPaneVertical,
handleToggleMenuBar,
handleUpdateDownloadPath,
handleUpdateRequestMimeType,
headerEditorKey,
isLoading,
isVariableUncovered,
loadStartTime,
oAuth2Token,
paneHeight,
paneWidth,
requestMetas,
requestVersions,
responseDownloadPath,
responseFilter,
responseFilterHistory,
responsePreviewMode,
settings,
2016-11-25 23:09:17 +00:00
sidebarChildren,
sidebarHidden,
sidebarWidth,
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
syncItems,
unseenWorkspaces,
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
vcs,
workspaceChildren,
workspaces,
2016-11-25 23:09:17 +00:00
} = this.props;
const realSidebarWidth = sidebarHidden ? 0 : sidebarWidth;
2018-06-25 17:42:50 +00:00
const columns = `${realSidebarWidth}rem 0 minmax(0, ${paneWidth}fr) 0 minmax(0, ${1 -
paneWidth}fr)`;
const rows = `minmax(0, ${paneHeight}fr) 0 minmax(0, ${1 - paneHeight}fr)`;
2016-11-25 23:09:17 +00:00
return [
<div key="modals" className="modals">
<ErrorBoundary showAlert>
<AlertModal ref={registerModal} />
<ErrorModal ref={registerModal} />
<PromptModal ref={registerModal} />
<WrapperModal ref={registerModal} />
<LoginModal ref={registerModal} />
<AskModal ref={registerModal} />
<SelectModal ref={registerModal} />
<RequestCreateModal ref={registerModal} />
<PaymentNotificationModal ref={registerModal} />
<FilterHelpModal ref={registerModal} />
<RequestRenderErrorModal ref={registerModal} />
<CodePromptModal
ref={registerModal}
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
editorLineWrapping={settings.editorLineWrapping}
isVariableUncovered={isVariableUncovered}
/>
<RequestSettingsModal
ref={registerModal}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
editorLineWrapping={settings.editorLineWrapping}
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
workspaces={workspaces}
isVariableUncovered={isVariableUncovered}
/>
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
{/* TODO: Figure out why cookieJar is sometimes null */}
{activeCookieJar ? (
<CookiesModal
handleShowModifyCookieModal={Wrapper._handleShowModifyCookieModal}
handleRender={handleRender}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
ref={registerModal}
workspace={activeWorkspace}
cookieJar={activeCookieJar}
isVariableUncovered={isVariableUncovered}
/>
) : null}
2017-08-23 03:33:07 +00:00
2017-08-19 22:34:16 +00:00
<CookieModifyModal
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
ref={registerModal}
2017-08-22 23:54:31 +00:00
cookieJar={activeCookieJar}
workspace={activeWorkspace}
isVariableUncovered={isVariableUncovered}
/>
2017-08-23 03:33:07 +00:00
<NunjucksModal
uniqueKey={`key::${this.state.forceRefreshKey}`}
ref={registerModal}
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
workspace={activeWorkspace}
/>
<MoveRequestGroupModal ref={registerModal} workspaces={workspaces} />
<WorkspaceSettingsModal
ref={registerModal}
clientCertificates={activeWorkspaceClientCertificates}
workspace={activeWorkspace}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
editorLineWrapping={settings.editorLineWrapping}
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
handleRemoveWorkspace={this._handleRemoveActiveWorkspace}
2017-06-07 00:07:09 +00:00
handleDuplicateWorkspace={handleDuplicateWorkspace}
handleClearAllResponses={this._handleActiveWorkspaceClearAllResponses}
isVariableUncovered={isVariableUncovered}
/>
<WorkspaceShareSettingsModal ref={registerModal} workspace={activeWorkspace} />
<GenerateCodeModal
ref={registerModal}
environmentId={activeEnvironment ? activeEnvironment._id : 'n/a'}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
/>
<SettingsModal
ref={registerModal}
handleShowExportRequestsModal={handleShowExportRequestsModal}
handleExportAllToFile={handleExportFile}
handleImportFile={this._handleImportFile}
handleImportClipBoard={this._handleImportClipBoard}
handleImportUri={this._handleImportUri}
handleToggleMenuBar={handleToggleMenuBar}
settings={settings}
/>
<ResponseDebugModal ref={registerModal} settings={settings} />
<RequestSwitcherModal
ref={registerModal}
workspace={activeWorkspace}
workspaces={workspaces}
workspaceChildren={workspaceChildren}
activeRequest={activeRequest}
activateRequest={handleActivateRequest}
requestMetas={requestMetas}
handleSetActiveWorkspace={handleSetActiveWorkspace}
/>
<EnvironmentEditModal
ref={registerModal}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
lineWrapping={settings.editorLineWrapping}
onChange={models.requestGroup.update}
render={handleRender}
getRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
isVariableUncovered={isVariableUncovered}
/>
<SetupSyncModal ref={registerModal} workspace={activeWorkspace} />
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
{vcs && (
<React.Fragment>
<SyncStagingModal
ref={registerModal}
workspace={activeWorkspace}
vcs={vcs}
syncItems={syncItems}
/>
<SyncMergeModal
ref={registerModal}
workspace={activeWorkspace}
syncItems={syncItems}
vcs={vcs}
/>
<SyncBranchesModal
ref={registerModal}
workspace={activeWorkspace}
vcs={vcs}
syncItems={syncItems}
/>
<SyncHistoryModal ref={registerModal} workspace={activeWorkspace} vcs={vcs} />
<SyncShareModal ref={registerModal} workspace={activeWorkspace} vcs={vcs} />
</React.Fragment>
)}
<WorkspaceEnvironmentsEditModal
ref={registerModal}
onChange={models.workspace.update}
lineWrapping={settings.editorLineWrapping}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
2018-10-17 16:42:33 +00:00
activeEnvironmentId={activeEnvironment ? activeEnvironment._id : null}
render={handleRender}
getRenderContext={handleGetRenderContext}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
isVariableUncovered={isVariableUncovered}
/>
<AddKeyCombinationModal ref={registerModal} />
<ExportRequestsModal
ref={registerModal}
childObjects={sidebarChildren.all}
handleExportRequestsToFile={handleExportRequestsToFile}
/>
</ErrorBoundary>
</div>,
2018-06-25 17:42:50 +00:00
<div
key="wrapper"
id="wrapper"
className={classnames('wrapper', {
'wrapper--vertical': settings.forceVerticalLayout,
2018-06-25 17:42:50 +00:00
})}
style={{
gridTemplateColumns: columns,
gridTemplateRows: rows,
boxSizing: 'border-box',
borderTop:
activeEnvironment &&
activeEnvironment.color &&
settings.environmentHighlightColorStyle === 'window-top'
? '5px solid ' + activeEnvironment.color
: null,
borderBottom:
activeEnvironment &&
activeEnvironment.color &&
settings.environmentHighlightColorStyle === 'window-bottom'
? '5px solid ' + activeEnvironment.color
: null,
borderLeft:
activeEnvironment &&
activeEnvironment.color &&
settings.environmentHighlightColorStyle === 'window-left'
? '5px solid ' + activeEnvironment.color
: null,
borderRight:
activeEnvironment &&
activeEnvironment.color &&
settings.environmentHighlightColorStyle === 'window-right'
? '5px solid ' + activeEnvironment.color
: null,
}}>
<ErrorBoundary showAlert>
<Sidebar
ref={handleSetSidebarRef}
activeEnvironment={activeEnvironment}
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
enableSyncBeta={settings.enableSyncBeta}
environmentHighlightColorStyle={settings.environmentHighlightColorStyle}
handleSetActiveEnvironment={handleSetActiveEnvironment}
handleSetActiveWorkspace={handleSetActiveWorkspace}
hidden={sidebarHidden || false}
hotKeyRegistry={settings.hotKeyRegistry}
isLoading={isLoading}
showEnvironmentsModal={this._handleShowEnvironmentsModal}
Version Control (beta) (#1439) * VCS proof of concept underway! * Stuff * Some things * Replace deprecated Electron makeSingleInstance * Rename `window` variables so not to be confused with window object * Don't unnecessarily update request when URL does not change * Regenerate package-lock * Fix tests + ESLint * Publish - insomnia-app@1.0.49 - insomnia-cookies@0.0.12 - insomnia-httpsnippet@1.16.18 - insomnia-importers@2.0.13 - insomnia-libcurl@0.0.23 - insomnia-prettify@0.1.7 - insomnia-url@0.1.6 - insomnia-xpath@1.0.9 - insomnia-plugin-base64@1.0.6 - insomnia-plugin-cookie-jar@1.0.8 - insomnia-plugin-core-themes@1.0.5 - insomnia-plugin-default-headers@1.1.9 - insomnia-plugin-file@1.0.7 - insomnia-plugin-hash@1.0.7 - insomnia-plugin-jsonpath@1.0.12 - insomnia-plugin-now@1.0.11 - insomnia-plugin-os@1.0.13 - insomnia-plugin-prompt@1.1.9 - insomnia-plugin-request@1.0.18 - insomnia-plugin-response@1.0.16 - insomnia-plugin-uuid@1.0.10 * Broken but w/e * Some tweaks * Big refactor. Create local snapshots and push done * POC merging and a lot of improvements * Lots of work done on initial UI/UX * Fix old tests * Atomic writes and size-based batches * Update StageEntry definition once again to be better * Factor out GraphQL query logic * Merge algorithm, history modal, other minor things * Fix test * Merge, checkout, revert w/ user changes now work * Force UI to refresh when switching branches changes active request * Rough draft pull() and some cleanup * E2EE stuff and some refactoring * Add ability to share project with team and fixed tests * VCS now created in root component and better remote project handling * Remove unused definition * Publish - insomnia-account@0.0.2 - insomnia-app@1.1.1 - insomnia-cookies@0.0.14 - insomnia-httpsnippet@1.16.20 - insomnia-importers@2.0.15 - insomnia-libcurl@0.0.25 - insomnia-prettify@0.1.9 - insomnia-sync@0.0.2 - insomnia-url@0.1.8 - insomnia-xpath@1.0.11 - insomnia-plugin-base64@1.0.8 - insomnia-plugin-cookie-jar@1.0.10 - insomnia-plugin-core-themes@1.0.7 - insomnia-plugin-file@1.0.9 - insomnia-plugin-hash@1.0.9 - insomnia-plugin-jsonpath@1.0.14 - insomnia-plugin-now@1.0.13 - insomnia-plugin-os@1.0.15 - insomnia-plugin-prompt@1.1.11 - insomnia-plugin-request@1.0.20 - insomnia-plugin-response@1.0.18 - insomnia-plugin-uuid@1.0.12 * Move some deps around * Fix Flow errors * Update package.json * Fix eslint errors * Fix tests * Update deps * bootstrap insomnia-sync * TRy fixing appveyor * Try something else * Bump lerna * try powershell * Try again * Fix imports * Fixed errors * sync types refactor * Show remote projects in workspace dropdown * Improved pulling of non-local workspaces * Loading indicators and some tweaks * Clean up sync staging modal * Some sync improvements: - No longer store stage - Upgrade Electron - Sync UI/UX improvements * Fix snyc tests * Upgraded deps and hot loader tweaks (it's broken for some reason) * Fix tests * Branches dialog, network refactoring, some tweaks * Fixed merging when other branch is empty * A bunch of small fixes from real testing * Fixed pull merge logic * Fix tests * Some bug fixes * A few small tweaks * Conflict resolution and other improvements * Fix tests * Add revert changes * Deal with duplicate projects per workspace * Some tweaks and accessibility improvements * Tooltip accessibility * Fix API endpoint * Fix tests * Remove jest dep from insomnia-importers
2019-04-18 00:50:03 +00:00
syncItems={syncItems}
unseenWorkspaces={unseenWorkspaces}
vcs={vcs}
width={sidebarWidth}
workspace={activeWorkspace}
workspaces={workspaces}>
{this.renderSidebarBody()}
</Sidebar>
</ErrorBoundary>
<div className="drag drag--sidebar">
<div onDoubleClick={handleResetDragSidebar} onMouseDown={this._handleStartDragSidebar} />
</div>
<ErrorBoundary showAlert>
<RequestPane
ref={handleSetRequestPaneRef}
handleImportFile={this._handleImportFile}
request={activeRequest}
workspace={activeWorkspace}
downloadPath={responseDownloadPath}
settings={settings}
environmentId={activeEnvironment ? activeEnvironment._id : ''}
oAuth2Token={oAuth2Token}
forceUpdateRequest={this._handleForceUpdateRequest}
handleCreateRequest={handleCreateRequestForWorkspace}
handleGenerateCode={handleGenerateCodeForActiveRequest}
handleImport={this._handleImport}
handleRender={handleRender}
handleGetRenderContext={handleGetRenderContext}
handleUpdateDownloadPath={handleUpdateDownloadPath}
updateRequestBody={Wrapper._handleUpdateRequestBody}
forceUpdateRequestHeaders={this._handleForceUpdateRequestHeaders}
updateRequestUrl={Wrapper._handleUpdateRequestUrl}
updateRequestMethod={Wrapper._handleUpdateRequestMethod}
updateRequestParameters={Wrapper._handleUpdateRequestParameters}
updateRequestAuthentication={Wrapper._handleUpdateRequestAuthentication}
updateRequestHeaders={Wrapper._handleUpdateRequestHeaders}
updateRequestMimeType={handleUpdateRequestMimeType}
2018-10-17 16:42:33 +00:00
updateSettingsShowPasswords={this._handleUpdateSettingsShowPasswords}
updateSettingsUseBulkHeaderEditor={this._handleUpdateSettingsUseBulkHeaderEditor}
forceRefreshCounter={this.state.forceRefreshKey}
handleSend={this._handleSendRequestWithActiveEnvironment}
2018-10-17 16:42:33 +00:00
handleSendAndDownload={this._handleSendAndDownloadRequestWithActiveEnvironment}
nunjucksPowerUserMode={settings.nunjucksPowerUserMode}
isVariableUncovered={isVariableUncovered}
headerEditorKey={headerEditorKey}
/>
</ErrorBoundary>
<div className="drag drag--pane-horizontal">
<div
onMouseDown={handleStartDragPaneHorizontal}
2018-06-25 17:42:50 +00:00
onDoubleClick={handleResetDragPaneHorizontal}
/>
</div>
<div className="drag drag--pane-vertical">
<div
onMouseDown={handleStartDragPaneVertical}
2018-06-25 17:42:50 +00:00
onDoubleClick={handleResetDragPaneVertical}
/>
</div>
<ErrorBoundary showAlert>
<ResponsePane
ref={handleSetResponsePaneRef}
request={activeRequest}
requestVersions={requestVersions}
responses={activeRequestResponses}
response={activeResponse}
editorFontSize={settings.editorFontSize}
editorIndentSize={settings.editorIndentSize}
editorKeyMap={settings.editorKeyMap}
editorLineWrapping={settings.editorLineWrapping}
hotKeyRegistry={settings.hotKeyRegistry}
previewMode={responsePreviewMode}
filter={responseFilter}
filterHistory={responseFilterHistory}
loadStartTime={loadStartTime}
showCookiesModal={this._handleShowCookiesModal}
handleShowRequestSettings={this._handleShowRequestSettingsModal}
handleSetActiveResponse={this._handleSetActiveResponse}
handleSetPreviewMode={this._handleSetPreviewMode}
handleDeleteResponses={this._handleDeleteResponses}
handleDeleteResponse={this._handleDeleteResponse}
handleSetFilter={this._handleSetResponseFilter}
/>
</ErrorBoundary>
</div>,
];
2016-11-25 23:09:17 +00:00
}
}
export default Wrapper;