Repository navigation
improvement(platform): consolidate integrations and credential management #9725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: improvement/platform-core-chat
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ import { | |
| Search, | ||
| } from '@sim/emcn' | ||
| import { Lock } from '@sim/emcn/icons' | ||
| import { useParams } from 'next/navigation' | ||
| import { redirect, useParams } from 'next/navigation' | ||
| import { useQueryStates } from 'nuqs' | ||
| import { | ||
| blockTypeToIconMap, | ||
|
|
@@ -22,6 +22,7 @@ import { | |
| resolveCredentialDisplay, | ||
| } from '@/lib/integrations' | ||
| import { isIntegrationPermitted } from '@/lib/integrations/access' | ||
| import { workspaceIntegrationsPath } from '@/lib/navigation/paths' | ||
| import { IntegrationTabsHeader } from '@/app/workspace/[workspaceId]/components/integration-tabs-header' | ||
| import { IntegrationSection } from '@/app/workspace/[workspaceId]/integrations/components/integration-section' | ||
| import { IntegrationTile } from '@/app/workspace/[workspaceId]/integrations/components/integrations-showcase' | ||
|
|
@@ -34,6 +35,7 @@ import { | |
| integrationsParsers, | ||
| integrationsUrlKeys, | ||
| } from '@/app/workspace/[workspaceId]/integrations/search-params' | ||
| import { useWorkspaceHostContext } from '@/app/workspace/[workspaceId]/providers/workspace-host-provider' | ||
| import { | ||
| SettingsEmptyState, | ||
| SettingsQueryErrorState, | ||
|
|
@@ -159,6 +161,10 @@ function ConnectedItem({ href, blockType, name, description, icon: Icon }: Conne | |
| } | ||
|
|
||
| export function Integrations() { | ||
| const host = useWorkspaceHostContext() | ||
| const workspaceId = host.workspace.id | ||
| const destination = workspaceIntegrationsPath(workspaceId, host) | ||
| if (destination !== `/workspace/${workspaceId}/integrations`) redirect(destination) | ||
|
Comment on lines
+164
to
+167
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This redirects eligible members away from the workspace credential directory to a different list of member accounts. For example, the workspace page lists GitLab personal tokens, but the organization center treats GitLab as managed and supplies no accounts. Members lose the normal way to find and manage those credentials, and opening the old directory URL redirects them again. Keep a workspace-credential entry reachable until the center supports these records and actions. Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| return ( | ||
| <PermissionAccessBoundary configKey='hideIntegrationsTab'> | ||
| <IntegrationsContent /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,11 +45,13 @@ import { useDeploymentShape } from '@/lib/core/config/deployment-shape' | |||||||||||
| import { MothershipHandoffStorage } from '@/lib/core/utils/browser-storage' | ||||||||||||
| import { getFolderPathNames } from '@/lib/folders/tree' | ||||||||||||
| import { sendMothershipMessage } from '@/lib/mothership/events' | ||||||||||||
| import { workspaceIntegrationsPath } from '@/lib/navigation/paths' | ||||||||||||
| import { captureEvent } from '@/lib/posthog/client' | ||||||||||||
| import { toSearchToken } from '@/lib/search/tokens' | ||||||||||||
| import { hasTriggerCapability } from '@/lib/workflows/triggers/utils' | ||||||||||||
| import { parseWorkspaceFileFolderDisplayPath } from '@/lib/workspace-files/folder-display-path' | ||||||||||||
| import { useInvokeGlobalCommand } from '@/app/workspace/[workspaceId]/providers/global-commands-provider' | ||||||||||||
| import { useWorkspaceHostContext } from '@/app/workspace/[workspaceId]/providers/workspace-host-provider' | ||||||||||||
| import { | ||||||||||||
| CommandFadedList, | ||||||||||||
| CommandSearch, | ||||||||||||
|
|
@@ -157,6 +159,8 @@ function SearchModalContent({ | |||||||||||
| const router = useRouter() | ||||||||||||
| const { chatEnabled } = useDeploymentShape() | ||||||||||||
| const workspaceId = params.workspaceId as string | ||||||||||||
| const host = useWorkspaceHostContext() | ||||||||||||
| const integrationsHref = workspaceIntegrationsPath(workspaceId, host) | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This URL also needs the host-membership guard: a viewer can have a hosted workspace and Prompt for AI agents
Suggested change
|
||||||||||||
| const currentWorkflowId = params.workflowId as string | undefined | ||||||||||||
| const inputRef = useRef<HTMLInputElement>(null) | ||||||||||||
| const listRef = useRef<HTMLDivElement>(null) | ||||||||||||
|
|
@@ -249,7 +253,7 @@ function SearchModalContent({ | |||||||||||
| id: 'integrations', | ||||||||||||
| name: 'Integrations', | ||||||||||||
| icon: Integration, | ||||||||||||
| href: `/workspace/${workspaceId}/integrations`, | ||||||||||||
| href: integrationsHref, | ||||||||||||
| hidden: | ||||||||||||
| permissionConfig.hideIntegrationsTab && | ||||||||||||
| !requestableFeatureKeys.has('hideIntegrationsTab'), | ||||||||||||
|
|
@@ -318,6 +322,7 @@ function SearchModalContent({ | |||||||||||
| permissionConfig.hideTablesTab, | ||||||||||||
| permissionConfig.hideFilesTab, | ||||||||||||
| permissionConfig.hideIntegrationsTab, | ||||||||||||
| integrationsHref, | ||||||||||||
| requestableFeatureKeys, | ||||||||||||
| ] | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This redirect drops the workspace page’s
categoryandsearchquery state, so filtered or bookmarked integration URLs open the organization list unfiltered. Translate the supported state (at leastsearchto the organization route’sq) before redirecting.Prompt for AI agents