16
16
17
17
import { useEffect , useMemo , useState } from 'react'
18
18
import Tippy from '@tippyjs/react'
19
- import { useHistory } from 'react-router-dom'
20
- import { URLS } from '@Common/Constants'
21
19
import { ReactComponent as InfoIcon } from '../../../Assets/Icon/ic-info-filled.svg'
22
20
import { ReactComponent as Chat } from '../../../Assets/Icon/ic-chat-circle-dots.svg'
23
21
import { AppStatusDetailsChartType , AggregatedNodes , STATUS_SORTING_ORDER , NodeFilters } from './types'
@@ -30,10 +28,9 @@ import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
30
28
const AppStatusDetailsChart = ( {
31
29
filterRemoveHealth = false ,
32
30
showFooter,
33
- showConfigDriftInfo = false ,
31
+ setShowConfigDriftModal ,
34
32
onClose,
35
33
} : AppStatusDetailsChartType ) => {
36
- const history = useHistory ( )
37
34
const _appDetails = IndexStore . getAppDetails ( )
38
35
const [ currentFilter , setCurrentFilter ] = useState < string > ( ALL_RESOURCE_KIND_FILTER )
39
36
const [ flattenedNodes , setFlattenedNodes ] = useState ( [ ] )
@@ -42,7 +39,7 @@ const AppStatusDetailsChart = ({
42
39
43
40
const handleCompareDesiredManifest = ( ) => {
44
41
onClose ( )
45
- history . push ( ` ${ URLS . APP } / ${ appId } ${ URLS . DETAILS } / ${ envId } / ${ URLS . APP_DETAILS_K8 } / ${ URLS . CONFIG_DRIFT } ` )
42
+ setShowConfigDriftModal ( true )
46
43
}
47
44
48
45
const nodes : AggregatedNodes = useMemo (
@@ -151,7 +148,7 @@ const AppStatusDetailsChart = ({
151
148
{ nodeDetails . status ? nodeDetails . status : nodeDetails . health . status }
152
149
</ div >
153
150
< div className = "flexbox-col dc__gap-4" >
154
- { showConfigDriftInfo && nodeDetails . hasDrift && (
151
+ { setShowConfigDriftModal && nodeDetails . hasDrift && (
155
152
< div className = "flexbox dc__gap-8 dc__align-items-center" >
156
153
< span className = "fs-13 fw-4 lh-20 cy-7" > Config drift detected</ span >
157
154
{ onClose && appId && envId && (
0 commit comments