From 02b3dbcf5c8f71bcd4429e3743f4d6a14df9de41 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Tue, 24 Feb 2026 23:21:48 +0530 Subject: [PATCH] feat(desktop): cloud for orgs platform contract (#5903) Co-authored-by: James George <25279263+jamesgeorge007@users.noreply.github.com> --- packages/hoppscotch-common/locales/en.json | 4 +- .../hoppscotch-common/src/components.d.ts | 4 +- .../src/components/app/Header.vue | 57 ++----- .../src/components/instance/Switcher.vue | 22 ++- .../src/components/organization/Switcher.vue | 26 ++++ .../utils/__tests__/organization.spec.ts | 147 ++++++++++++++++++ .../hoppscotch-common/src/platform/index.ts | 1 - .../src/platform/instance.ts | 7 - .../src/platform/organization.ts | 7 +- .../src-tauri/capabilities/README.md | 44 ++++++ .../src-tauri/capabilities/default.json | 15 +- .../src-tauri/src/server.rs | 62 ++++++++ .../src/composables/useAppInitialization.ts | 7 + 13 files changed, 339 insertions(+), 64 deletions(-) create mode 100644 packages/hoppscotch-common/src/components/organization/Switcher.vue create mode 100644 packages/hoppscotch-common/src/helpers/utils/__tests__/organization.spec.ts create mode 100644 packages/hoppscotch-desktop/src-tauri/capabilities/README.md diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index b86e4a59..68d8d9a5 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -952,7 +952,8 @@ "instance_changed": "Switched to instance", "current_instance_error": "Failed to track current instance", "not_available": "Instance switching is not available", - "cleanup_completed": "Instance switcher cleanup completed" + "cleanup_completed": "Instance switcher cleanup completed", + "self_hosted": "Self-hosted instances" }, "inspections": { "description": "Inspect possible errors", @@ -2246,6 +2247,7 @@ }, "organization_sidebar": { "hoppscotch_cloud": "Hoppscotch Cloud", + "cloud_locked": "Default instance cannot be removed", "admin": "Admin", "error_loading": "Failed to load organizations", "inactive_orgs": "Inactive Organizations", diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index bc172409..6a8215ea 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -73,7 +73,6 @@ declare module 'vue' { CollectionsDocumentationSectionsRequestBody: typeof import('./components/collections/documentation/sections/RequestBody.vue')['default'] CollectionsDocumentationSectionsResponse: typeof import('./components/collections/documentation/sections/Response.vue')['default'] CollectionsDocumentationSectionsVariables: typeof import('./components/collections/documentation/sections/Variables.vue')['default'] - CollectionsDocumentationSnapshotPreview: typeof import('./components/collections/documentation/SnapshotPreview.vue')['default'] CollectionsEdit: typeof import('./components/collections/Edit.vue')['default'] CollectionsEditFolder: typeof import('./components/collections/EditFolder.vue')['default'] CollectionsEditRequest: typeof import('./components/collections/EditRequest.vue')['default'] @@ -170,7 +169,6 @@ declare module 'vue' { HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing'] HoppSmartRadio: typeof import('@hoppscotch/ui')['HoppSmartRadio'] HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup'] - HoppSmartSelectItem: typeof import('@hoppscotch/ui')['HoppSmartSelectItem'] HoppSmartSelectWrapper: typeof import('@hoppscotch/ui')['HoppSmartSelectWrapper'] HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver'] HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] @@ -240,7 +238,6 @@ declare module 'vue' { IconLucideAlertTriangle: typeof import('~icons/lucide/alert-triangle')['default'] IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] IconLucideArrowUpRight: typeof import('~icons/lucide/arrow-up-right')['default'] - IconLucideBookOpen: typeof import('~icons/lucide/book-open')['default'] IconLucideBrush: typeof import('~icons/lucide/brush')['default'] IconLucideCheck: typeof import('~icons/lucide/check')['default'] IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default'] @@ -298,6 +295,7 @@ declare module 'vue' { MockServerMockServerDashboard: typeof import('./components/mockServer/MockServerDashboard.vue')['default'] MockServerMockServerLogs: typeof import('./components/mockServer/MockServerLogs.vue')['default'] MonacoScriptEditor: typeof import('./components/MonacoScriptEditor.vue')['default'] + OrganizationSwitcher: typeof import('./components/organization/Switcher.vue')['default'] Profile: typeof import('./components/profile/index.vue')['default'] ProfileUserDelete: typeof import('./components/profile/UserDelete.vue')['default'] RealtimeCommunication: typeof import('./components/realtime/Communication.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/app/Header.vue b/packages/hoppscotch-common/src/components/app/Header.vue index 0e43d708..863a367e 100644 --- a/packages/hoppscotch-common/src/components/app/Header.vue +++ b/packages/hoppscotch-common/src/components/app/Header.vue @@ -14,47 +14,17 @@ }" >
- + -
- - {{ - platform.instance.getCurrentInstance?.()?.displayName || - "Hoppscotch" - }} - - -
- -
- - -