diff --git a/package-lock.json b/package-lock.json index 730718a..a24379e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@ant-design/icons": "5.6.0", "@monaco-editor/react": "4.6.0", "@originjs/vite-plugin-federation": "1.3.6", - "@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.132", + "@prorobotech/openapi-k8s-toolkit": "^0.0.1-alpha.133", "@readme/openapi-parser": "4.0.0", "@reduxjs/toolkit": "2.2.5", "@tanstack/react-query": "5.62.2", @@ -2804,9 +2804,9 @@ } }, "node_modules/@prorobotech/openapi-k8s-toolkit": { - "version": "0.0.1-alpha.132", - "resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.132.tgz", - "integrity": "sha512-ZgRTaGzVhJL3ieWjjQGGUDfFrENkRLo4qPZQicl9oSkX0vEfXcEf6fGi858ycQ8KgtstK9OStzPQB4OJQ9knkg==", + "version": "0.0.1-alpha.133", + "resolved": "https://registry.npmjs.org/@prorobotech/openapi-k8s-toolkit/-/openapi-k8s-toolkit-0.0.1-alpha.133.tgz", + "integrity": "sha512-/fzTDAbm/YbSK9PEWVBpcmT9Vbk8EJhMGTku/5u/+T5MxPxj9krg0zfJ1DsEjoWAtT7hjlghxfGK/+GCHsONsg==", "license": "MIT", "dependencies": { "@monaco-editor/react": "4.6.0", diff --git a/package.json b/package.json index 05d069c..6734509 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@ant-design/icons": "5.6.0", "@monaco-editor/react": "4.6.0", "@originjs/vite-plugin-federation": "1.3.6", - "@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.132", + "@prorobotech/openapi-k8s-toolkit": "0.0.1-alpha.133", "@readme/openapi-parser": "4.0.0", "@reduxjs/toolkit": "2.2.5", "@tanstack/react-query": "5.62.2", diff --git a/src/components/molecules/TableApiBuiltin/TableApiBuiltin.tsx b/src/components/molecules/TableApiBuiltin/TableApiBuiltin.tsx index 0c20076..92d5075 100644 --- a/src/components/molecules/TableApiBuiltin/TableApiBuiltin.tsx +++ b/src/components/molecules/TableApiBuiltin/TableApiBuiltin.tsx @@ -73,6 +73,7 @@ export const TableApiBuiltin: FC = ({ const [selectedRowKeys, setSelectedRowKeys] = useState([]) const [selectedRowsData, setSelectedRowsData] = useState<{ name: string; endpoint: string }[]>([]) const [isNamespaced, setIsNamespaced] = useState() + const [isNamespacedLoading, setIsNamespacedLoading] = useState() const [height, setHeight] = useState(0) @@ -99,15 +100,20 @@ export const TableApiBuiltin: FC = ({ }, []) useEffect(() => { + setIsNamespacedLoading(true) if (resourceType === 'builtin') { checkIfBuiltInInstanceNamespaceScoped({ typeName, clusterName: cluster, - }).then(({ isNamespaceScoped }) => { - if (isNamespaceScoped) { - setIsNamespaced(isNamespaceScoped) - } }) + .then(({ isNamespaceScoped }) => { + if (isNamespaceScoped) { + setIsNamespaced(isNamespaceScoped) + } else { + setIsNamespaced(false) + } + }) + .finally(() => setIsNamespacedLoading(false)) } if (resourceType === 'api' && apiGroup && apiVersion) { checkIfApiInstanceNamespaceScoped({ @@ -115,11 +121,15 @@ export const TableApiBuiltin: FC = ({ apiVersion, typeName, clusterName: cluster, - }).then(({ isNamespaceScoped }) => { - if (isNamespaceScoped) { - setIsNamespaced(true) - } }) + .then(({ isNamespaceScoped }) => { + if (isNamespaceScoped) { + setIsNamespaced(true) + } else { + setIsNamespaced(false) + } + }) + .finally(() => setIsNamespacedLoading(false)) } }, [resourceType, cluster, typeName, apiGroup, apiVersion]) @@ -221,6 +231,7 @@ export const TableApiBuiltin: FC = ({ baseprefix={inside ? `${baseprefix}/inside` : baseprefix} dataItems={getDataItems({ resourceType, dataBuiltin, dataApi })} isNamespaced={isNamespaced} + isNamespacedLoading={isNamespacedLoading} dataForControls={{ cluster, syntheticProject: params.syntheticProject, diff --git a/src/pages/TableApiPage/TableApiPage.tsx b/src/pages/TableApiPage/TableApiPage.tsx index accb7e6..851dde5 100644 --- a/src/pages/TableApiPage/TableApiPage.tsx +++ b/src/pages/TableApiPage/TableApiPage.tsx @@ -85,6 +85,7 @@ export const TableApiPage: FC = ({ forcedTheme, inside }) => apiGroup={apiGroup} apiVersion={apiVersion} typeName={typeName} + key={`${apiGroup}-${apiVersion}-${namespace}-${typeName}`} limit={searchParams.get('limit')} inside={inside} customizationIdPrefix={tableCustomizationIdPrefix} diff --git a/src/pages/TableBuiltinPage/TableBuiltinPage.tsx b/src/pages/TableBuiltinPage/TableBuiltinPage.tsx index 71797c7..7d82f01 100644 --- a/src/pages/TableBuiltinPage/TableBuiltinPage.tsx +++ b/src/pages/TableBuiltinPage/TableBuiltinPage.tsx @@ -69,6 +69,7 @@ export const TableBuiltinPage: FC = ({ forcedTheme, insi