Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function AppRouter() {
<Route path="projects" element={<ProjectListView />} />
<Route path="projects/:projectName" element={<ProjectPage />} />
<Route
path="projects/:projectName/workspaces/:workspaceName/mcps/:controlPlaneName/context/:contextName"
path="projects/:projectName/workspaces/:workspaceName/mcps/:controlPlaneName"
element={<McpPage />}
/>
</Route>
Expand Down
10 changes: 2 additions & 8 deletions src/components/ControlPlanes/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import yaml from 'js-yaml';
import { useRef, useState } from 'react';
import { DownloadKubeconfig } from './CopyKubeconfigButton.tsx';
import { useApiResource } from '../../lib/api/useApiResource.ts';
import { extractWorkspaceNameFromNamespace } from '../../utils/index.ts';
import { extractWorkspaceNameFromNamespace } from '../../utils';
import { useTranslation } from 'react-i18next';

interface Props {
Expand Down Expand Up @@ -45,10 +45,6 @@ export default function ConnectButton(props: Props) {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const contexts = kubeconfig.contexts as any[];
const currentContext = kubeconfig['current-context'];
if (!currentContext) {
return <></>;
}

if (contexts.length === 1) {
return (
Expand All @@ -57,9 +53,7 @@ export default function ConnectButton(props: Props) {
disabled={props.disabled}
onClick={() =>
navigate(
`/mcp/projects/${props.projectName}/workspaces/${extractWorkspaceNameFromNamespace(
props.workspaceName,
)}/mcps/${props.controlPlaneName}/context/${currentContext}`,
`/mcp/projects/${props.projectName}/workspaces/${extractWorkspaceNameFromNamespace(props.workspaceName)}/mcps/${props.controlPlaneName}`,
)
}
>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/api/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const useCrateClusterHeader = 'X-use-crate';
const projectNameHeader = 'X-project';
const workspaceNameHeader = 'X-workspace';
const mcpNameHeader = 'X-mcp';
const contextHeader = 'X-context';
const jqHeader = 'X-jq';
const contentTypeHeader = 'Content-Type';

Expand Down Expand Up @@ -37,7 +36,6 @@ export const fetchApiServer = async (
headers[projectNameHeader] = config.mcpConfig.projectName;
headers[workspaceNameHeader] = config.mcpConfig.workspaceName;
headers[mcpNameHeader] = config.mcpConfig.controlPlaneName;
headers[contextHeader] = config.mcpConfig.contextName;
} else {
headers[useCrateClusterHeader] = 'true';
}
Expand Down
1 change: 0 additions & 1 deletion src/lib/api/types/apiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ type McpConfig = {
projectName: string;
workspaceName: string;
controlPlaneName: string;
contextName: string;
};

//syntax basically combines all the atrributes from the types into one
Expand Down
2 changes: 0 additions & 2 deletions src/lib/shared/McpContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface Mcp {
project: string;
workspace: string;
name: string;
context: string;

secretNamespace?: string;
secretName?: string;
Expand Down Expand Up @@ -56,7 +55,6 @@ function RequireDownstreamLogin(props: { children?: ReactNode }) {
<ApiConfigProvider
apiConfig={{
mcpConfig: {
contextName: mcp.context,
projectName: mcp.project,
workspaceName: mcp.workspace,
controlPlaneName: mcp.name,
Expand Down
5 changes: 2 additions & 3 deletions src/spaces/mcp/pages/McpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { isNotFoundError } from '../../../lib/api/error.ts';
import { NotFoundBanner } from '../../../components/Ui/NotFoundBanner/NotFoundBanner.tsx';

export default function McpPage() {
const { projectName, workspaceName, controlPlaneName, contextName } = useParams();
const { projectName, workspaceName, controlPlaneName } = useParams();
const { t } = useTranslation();

const {
Expand All @@ -39,7 +39,7 @@ export default function McpPage() {
return <BusyIndicator active />;
}

if (!projectName || !workspaceName || !controlPlaneName || !contextName || isNotFoundError(error)) {
if (!projectName || !workspaceName || !controlPlaneName || isNotFoundError(error)) {
return <NotFoundBanner entityType={t('Entities.ManagedControlPlane')} />;
}

Expand All @@ -53,7 +53,6 @@ export default function McpPage() {
project: projectName,
workspace: workspaceName,
name: controlPlaneName,
context: contextName,
}}
>
<AuthProviderMcp>
Expand Down
Loading