Merge pull request #141 from PRO-Robotech/feature/dev

fix ns col while same table type resource change | labels edit while …
This commit is contained in:
typescreep
2025-10-13 16:49:13 +03:00
committed by GitHub
5 changed files with 26 additions and 13 deletions

8
package-lock.json generated
View File

@@ -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",

View File

@@ -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",

View File

@@ -73,6 +73,7 @@ export const TableApiBuiltin: FC<TTableApiBuiltinProps> = ({
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([])
const [selectedRowsData, setSelectedRowsData] = useState<{ name: string; endpoint: string }[]>([])
const [isNamespaced, setIsNamespaced] = useState<boolean>()
const [isNamespacedLoading, setIsNamespacedLoading] = useState<boolean>()
const [height, setHeight] = useState(0)
@@ -99,15 +100,20 @@ export const TableApiBuiltin: FC<TTableApiBuiltinProps> = ({
}, [])
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<TTableApiBuiltinProps> = ({
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<TTableApiBuiltinProps> = ({
baseprefix={inside ? `${baseprefix}/inside` : baseprefix}
dataItems={getDataItems({ resourceType, dataBuiltin, dataApi })}
isNamespaced={isNamespaced}
isNamespacedLoading={isNamespacedLoading}
dataForControls={{
cluster,
syntheticProject: params.syntheticProject,

View File

@@ -85,6 +85,7 @@ export const TableApiPage: FC<TTableApiPageProps> = ({ forcedTheme, inside }) =>
apiGroup={apiGroup}
apiVersion={apiVersion}
typeName={typeName}
key={`${apiGroup}-${apiVersion}-${namespace}-${typeName}`}
limit={searchParams.get('limit')}
inside={inside}
customizationIdPrefix={tableCustomizationIdPrefix}

View File

@@ -69,6 +69,7 @@ export const TableBuiltinPage: FC<TTableBuiltinPageProps> = ({ forcedTheme, insi
<TableApiBuiltin
resourceType="builtin"
apiVersion="v1"
key={`${namespace}-${typeName}`}
namespace={namespace}
typeName={typeName}
limit={searchParams.get('limit')}