mirror of
https://github.com/outbackdingo/openapi-ui.git
synced 2026-01-28 02:19:48 +00:00
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:
@@ -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/`)
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@ export const BaseTemplate: FC<TBaseTemplateProps> = ({ children, withNoCluster,
|
||||
dispatch(setCluster(clusterName))
|
||||
}
|
||||
|
||||
if (clusterName === undefined) {
|
||||
dispatch(setCluster(''))
|
||||
}
|
||||
|
||||
if (!clusterName && !withNoCluster) {
|
||||
navigate(`${baseprefix}/`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user