diff --git a/packages/insomnia/src/ui/components/settings/import-export.tsx b/packages/insomnia/src/ui/components/settings/import-export.tsx index d3f5b02d25..d2f0495eca 100644 --- a/packages/insomnia/src/ui/components/settings/import-export.tsx +++ b/packages/insomnia/src/ui/components/settings/import-export.tsx @@ -6,13 +6,17 @@ import { isLoggedIn } from '../../../account/session'; import { getProductName } from '../../../common/constants'; import { docsImportExport } from '../../../common/documentation'; import { exportAllToFile } from '../../../common/export'; +import { exportAllData } from '../../../common/export-all-data'; import { getWorkspaceLabel } from '../../../common/get-workspace-label'; import { strings } from '../../../common/strings'; +import { isScratchpadOrganizationId } from '../../../models/organization'; import { isScratchpad } from '../../../models/workspace'; import { ProjectLoaderData } from '../../routes/project'; import { WorkspaceLoaderData } from '../../routes/workspace'; import { Dropdown, DropdownButton, DropdownItem, DropdownSection, ItemContent } from '../base/dropdown'; import { Link } from '../base/link'; +import { Icon } from '../icon'; +import { showAlert } from '../modals'; import { ExportRequestsModal } from '../modals/export-requests-modal'; import { ImportModal } from '../modals/import-modal'; import { Button } from '../themed-button'; @@ -34,7 +38,7 @@ export const ImportExport: FC = ({ hideSettingsModal }) => { const workspacesFetcher = useFetcher(); useEffect(() => { const isIdleAndUninitialized = workspacesFetcher.state === 'idle' && !workspacesFetcher.data; - if (isIdleAndUninitialized) { + if (isIdleAndUninitialized && organizationId && !isScratchpadOrganizationId(organizationId)) { workspacesFetcher.load(`/organization/${organizationId}/project/${projectId}`); } }, [organizationId, projectId, workspacesFetcher]); @@ -47,6 +51,10 @@ export const ImportExport: FC = ({ hideSettingsModal }) => { exportAllToFile(projectName, workspacesForActiveProject); hideSettingsModal(); }; + + if (!organizationId) { + return null; + } // here we should list all the folders which contain insomnia.*.db files // and have some big red button to overwrite the current data with the backup // and once complete trigger an app restart? @@ -59,7 +67,7 @@ export const ImportExport: FC = ({ hideSettingsModal }) => {

Your format isn't supported? Add Your Own.

-
+
{workspaceData?.activeWorkspace ? isScratchpad(workspaceData.activeWorkspace) ? @@ -93,6 +101,48 @@ export const ImportExport: FC = ({ hideSettingsModal }) => { ) : () } +
+ + + + {({ close }) => ( +
+
+ Continue with cloud synchronization + +
+
+
+

+ By continuing with creating an account in Insomnia, or logging into your existing one, we will activate the automated cloud synchronization capability which will synchronize all of your data to the cloud in an end-to-end encrypted format (E2EE) for which you will be required to enter your secret passphrase, or create a new one. +

+
    +
  • Your data in the cloud is end-to-end encrypted (E2EE) and secure.
  • +
  • With Git Sync your data can be stored on a third party Git repository.
  • +
  • In Scratch Pad your data is always stored locally.
  • +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

+ While not needed, you can for portability. +

+
+ +
+
+
+ )} +
+
+
+
); }; diff --git a/packages/insomnia/src/ui/routes/onboarding.cloud-migration.tsx b/packages/insomnia/src/ui/routes/onboarding.cloud-migration.tsx index b0be416543..269e19fa20 100644 --- a/packages/insomnia/src/ui/routes/onboarding.cloud-migration.tsx +++ b/packages/insomnia/src/ui/routes/onboarding.cloud-migration.tsx @@ -222,7 +222,7 @@ export const OnboardingCloudMigration = () => {

{ : 'Log in to Insomnia to sync your data.'} + {isScratchpadOrganizationId(organizationId) ? ( + + ) : null}

=> { + const { organizationId, projectId } = params; + invariant(organizationId, 'Organization ID is required'); const sessionId = getCurrentSessionId(); + if (!sessionId) { await logout(); throw redirect('/auth/login'); } const search = new URL(request.url).searchParams; - const { organizationId } = params; - const { projectId } = params; - invariant(organizationId, 'Organization ID is required'); invariant(projectId, 'projectId parameter is required'); const sortOrder = search.get('sortOrder') || 'modified-desc'; const filter = search.get('filter') || '';