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

cluster/tenant recognition fix + using base nav for cluster from env
This commit is contained in:
typescreep
2025-09-01 17:53:46 +03:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import { RootState } from 'store/store'
import { useNavSelectorClusters } from 'hooks/useNavSelectorClusters'
import { useMountEffect } from 'hooks/useMountEffect'
import { EntrySelect } from 'components/atoms'
import { BASE_NAVIGATE_FROM_CLUSTERLIST } from 'constants/customizationApiGroupAndVersion'
type TSelectorClusterProps = {
clusterName?: string
@@ -22,7 +23,8 @@ export const SelectorCluster: FC<TSelectorClusterProps> = ({ clusterName }) => {
const handleClusterChange = (value?: string) => {
if (value) {
setSelectedClusterName(value)
navigate(`${baseprefix}/clusters/${value}`)
// navigate(`${baseprefix}/clusters/${value}`)
navigate(BASE_NAVIGATE_FROM_CLUSTERLIST.replace('~recordValue~', value))
} else {
navigate(`${baseprefix}/clusters/`)
}

View File

@@ -85,6 +85,10 @@ export const BaseTemplate: FC<TBaseTemplateProps> = ({ children, withNoCluster,
dispatch(setCluster(clusterName))
}
if (clusterName === undefined) {
dispatch(setCluster(''))
}
if (!clusterName && !withNoCluster) {
navigate(`${baseprefix}/`)
}