@@ -49,9 +49,12 @@ import StatefulSet from '../../lib/k8s/statefulSet';
4949import { createRouteURL , getDefaultRoutes } from '../../lib/router' ;
5050import { getClusterPrefixedPath } from '../../lib/util' ;
5151import { useTypedSelector } from '../../redux/hooks' ;
52+ import { Activity } from '../activity/Activity' ;
5253import { ADVANCED_SEARCH_QUERY_KEY } from '../advancedSearch/AdvancedSearch' ;
5354import { ThemePreview } from '../App/Settings/ThemePreview' ;
5455import { setTheme , useAppThemes } from '../App/themeSlice' ;
56+ import { KubeObjectDetails } from '../resourceMap/details/KubeNodeDetails' ;
57+ import { KubeIcon } from '../resourceMap/kubeIcon/KubeIcon' ;
5558import { Delayed } from './Delayed' ;
5659import { useLocalStorageState } from './useLocalStorageState' ;
5760import { useRecent } from './useRecent' ;
@@ -158,6 +161,7 @@ export function GlobalSearchContent({
158161 const [ query , setQuery ] = useState ( defaultValue ?? '' ) ;
159162 const clusters = useClustersConf ( ) ?? { } ;
160163 const selectedClusters = useSelectedClusters ( ) ;
164+ const drawerEnabled = useTypedSelector ( state => state . drawerMode . isDetailDrawerEnabled ) ;
161165
162166 const [ recent , bump ] = useRecent ( 'search-recent-items' ) ;
163167
@@ -177,7 +181,18 @@ export function GlobalSearchContent({
177181 name : item . metadata . name ,
178182 namespace : item . metadata . namespace ,
179183 } ) ;
180- history . push ( url ) ;
184+
185+ if ( drawerEnabled ) {
186+ Activity . launch ( {
187+ id : item . metadata . uid ,
188+ content : < KubeObjectDetails resource = { item } /> ,
189+ location : 'split-right' ,
190+ title : item . kind + ': ' + item . metadata . name ,
191+ icon : < KubeIcon kind = { item . kind } width = "100%" height = "100%" /> ,
192+ } ) ;
193+ } else {
194+ history . push ( url ) ;
195+ }
181196 } ) ,
182197 [ resources , isMap , location . search ]
183198 ) ;
0 commit comments