Skip to content

Commit e30cfe7

Browse files
committed
fix
1 parent 42a5778 commit e30cfe7

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/components/Yaml/YamlViewButton.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,56 @@ export interface YamlViewButtonResourceProps {
1515
variant: 'resource';
1616
resource: Resource;
1717
toolbarContent?: JSX.Element;
18+
withoutApiConfig?: boolean;
1819
}
1920
export interface YamlViewButtonLoaderProps {
2021
variant: 'loader';
2122
workspaceName?: string;
2223
resourceType: 'projects' | 'workspaces' | 'managedcontrolplanes';
2324
resourceName: string;
25+
withoutApiConfig?: boolean;
2426
}
2527
export type YamlViewButtonProps = YamlViewButtonResourceProps | YamlViewButtonLoaderProps;
2628

2729
export function YamlViewButton({ variant, ...props }: YamlViewButtonProps) {
2830
const { t } = useTranslation();
29-
const { openInAsideWithApiConfig } = useSplitter();
31+
const { openInAsideWithApiConfig, openInAside } = useSplitter();
3032
const apiConfig = useContext(ApiConfigContext);
3133
const openSplitterSidePanel = () => {
3234
switch (variant) {
3335
case 'resource': {
34-
const { resource, toolbarContent } = props as YamlViewButtonResourceProps;
35-
openInAsideWithApiConfig(
36+
const { resource, toolbarContent, withoutApiConfig } = props as YamlViewButtonResourceProps;
37+
const content = (
3638
<YamlSidePanel
3739
isEdit={false}
3840
resource={resource}
3941
filename={`${resource?.kind ?? ''}${resource?.metadata?.name ? '_' : ''}${resource?.metadata?.name ?? ''}`}
4042
toolbarContent={toolbarContent}
41-
/>,
42-
apiConfig,
43+
/>
4344
);
45+
if (withoutApiConfig) {
46+
openInAside(content);
47+
} else {
48+
openInAsideWithApiConfig(content, apiConfig);
49+
}
4450
break;
4551
}
4652

4753
case 'loader': {
48-
const { workspaceName, resourceType, resourceName } = props as YamlViewButtonLoaderProps;
49-
openInAsideWithApiConfig(
54+
const { workspaceName, resourceType, resourceName, withoutApiConfig } = props as YamlViewButtonLoaderProps;
55+
const content = (
5056
<YamlSidePanelWithLoader
5157
isEdit={false}
5258
workspaceName={workspaceName}
5359
resourceType={resourceType}
5460
resourceName={resourceName}
55-
/>,
56-
apiConfig,
61+
/>
5762
);
63+
if (withoutApiConfig) {
64+
openInAside(content);
65+
} else {
66+
openInAsideWithApiConfig(content, apiConfig);
67+
}
5868
break;
5969
}
6070
}

src/spaces/mcp/pages/McpPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export default function McpPage() {
116116
workspaceName={mcp?.status?.access?.namespace}
117117
resourceType={'managedcontrolplanes'}
118118
resourceName={controlPlaneName}
119+
withoutApiConfig
119120
/>
120121
<CopyKubeconfigButton />
121122
<ControlPlanePageMenu

0 commit comments

Comments
 (0)