Skip to content

Commit 0c738b1

Browse files
committed
fix
1 parent 7bf5584 commit 0c738b1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/ControlPlane/ManagedResources.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useTranslation } from 'react-i18next';
2-
import { Fragment, useMemo, useState, useRef, useCallback } from 'react';
2+
import { Fragment, useMemo, useState, useRef, useCallback, useContext } from 'react';
33
import {
44
AnalyticalTable,
55
AnalyticalTableColumnDefinition,
@@ -40,6 +40,7 @@ import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx';
4040
import { APIError } from '../../lib/api/error.ts';
4141
import { useHandleResourcePatch as _useHandleResourcePatch } from '../../hooks/useHandleResourcePatch.ts';
4242
import { useAuthMcp as _useAuthMcp } from '../../spaces/mcp/auth/AuthContextMcp.tsx';
43+
import { ApiConfigContext } from '../Shared/k8s';
4344

4445
interface StatusFilterColumn {
4546
filterValue?: string;
@@ -87,6 +88,7 @@ export function ManagedResources({
8788
} = {}) {
8889
const { t } = useTranslation();
8990
const toast = useToast();
91+
const apiConfig = useContext(ApiConfigContext);
9092
const { openInAside } = useSplitter();
9193
const [pendingDeleteItem, setPendingDeleteItem] = useState<ManagedResourceItem | null>(null);
9294
const errorDialogRef = useRef<ErrorDialogHandle>(null);
@@ -128,6 +130,7 @@ export function ManagedResources({
128130
isEdit={true}
129131
resource={item as unknown as Resource}
130132
filename={`${item.kind}_${item.metadata.name}`}
133+
apiConfig={apiConfig}
131134
onApply={async (parsed) => await handlePatch(item, parsed)}
132135
/>
133136
</Fragment>,

src/components/ControlPlane/ProvidersConfig.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo';
1616

1717
import { YamlViewButton } from '../Yaml/YamlViewButton.tsx';
1818

19-
import { Fragment, useCallback, useMemo, useRef } from 'react';
19+
import { Fragment, useCallback, useContext, useMemo, useRef } from 'react';
2020
import { Resource } from '../../utils/removeManagedFieldsAndFilterData.ts';
2121
import { ProviderConfigItem } from '../../lib/shared/types.ts';
2222
import { ActionsMenu, type ActionItem } from './ActionsMenu';
@@ -25,6 +25,7 @@ import { YamlSidePanel } from '../Yaml/YamlSidePanel.tsx';
2525
import { useHandleResourcePatch } from '../../hooks/useHandleResourcePatch.ts';
2626
import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx';
2727
import { useAuthMcp } from '../../spaces/mcp/auth/AuthContextMcp.tsx';
28+
import { ApiConfigContext } from '../Shared/k8s';
2829

2930
type Rows = {
3031
parent: string;
@@ -39,7 +40,7 @@ export function ProvidersConfig() {
3940
const { openInAside } = useSplitter();
4041
const errorDialogRef = useRef<ErrorDialogHandle>(null);
4142
const handlePatch = useHandleResourcePatch(errorDialogRef);
42-
43+
const apiConfig = useContext(ApiConfigContext);
4344
const rows: Rows[] = [];
4445

4546
const { data: providerConfigsList, isLoading } = useProvidersConfigResource({
@@ -69,6 +70,7 @@ export function ProvidersConfig() {
6970
isEdit={true}
7071
resource={item as unknown as Resource}
7172
filename={`${item.kind}_${item.metadata.name}`}
73+
apiConfig={apiConfig}
7274
onApply={async (parsed) => await handlePatch(item, parsed)}
7375
/>
7476
</Fragment>,

0 commit comments

Comments
 (0)