Skip to content

Commit ec58773

Browse files
committed
revert: Config drift modal to state
1 parent dd86761 commit ec58773

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.7.0-beta-2",
3+
"version": "1.7.0-beta-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const URLS = {
8080
NETWORK_STATUS_INTERFACE: '/network-status-interface',
8181
RESOURCE_BROWSER: '/resource-browser',
8282
COMPARE_CLUSTERS: '/compare-clusters',
83+
CONFIG_DRIFT: 'config-drift',
8384
}
8485

8586
export const ROUTES = {

src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import { useEffect, useMemo, useState } from 'react'
1818
import Tippy from '@tippyjs/react'
19+
import { useHistory } from 'react-router-dom'
20+
import { URLS } from '@Common/Constants'
1921
import { ReactComponent as InfoIcon } from '../../../Assets/Icon/ic-info-filled.svg'
2022
import { ReactComponent as Chat } from '../../../Assets/Icon/ic-chat-circle-dots.svg'
2123
import { AppStatusDetailsChartType, AggregatedNodes, STATUS_SORTING_ORDER, NodeFilters } from './types'
@@ -28,9 +30,10 @@ import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
2830
const AppStatusDetailsChart = ({
2931
filterRemoveHealth = false,
3032
showFooter,
31-
handleOpenConfigDriftModal,
33+
showConfigDriftInfo = false,
3234
onClose,
3335
}: AppStatusDetailsChartType) => {
36+
const history = useHistory()
3437
const _appDetails = IndexStore.getAppDetails()
3538
const [currentFilter, setCurrentFilter] = useState<string>(ALL_RESOURCE_KIND_FILTER)
3639
const [flattenedNodes, setFlattenedNodes] = useState([])
@@ -39,7 +42,7 @@ const AppStatusDetailsChart = ({
3942

4043
const handleCompareDesiredManifest = () => {
4144
onClose()
42-
handleOpenConfigDriftModal()
45+
history.push(`${URLS.APP}/${appId}${URLS.DETAILS}/${envId}/${URLS.APP_DETAILS_K8}/${URLS.CONFIG_DRIFT}`)
4346
}
4447

4548
const nodes: AggregatedNodes = useMemo(
@@ -148,7 +151,7 @@ const AppStatusDetailsChart = ({
148151
{nodeDetails.status ? nodeDetails.status : nodeDetails.health.status}
149152
</div>
150153
<div className="flexbox-col dc__gap-4">
151-
{handleOpenConfigDriftModal && nodeDetails.hasDrift && (
154+
{showConfigDriftInfo && nodeDetails.hasDrift && (
152155
<div className="flexbox dc__gap-8 dc__align-items-center">
153156
<span className="fs-13 fw-4 lh-20 cy-7">Config drift detected</span>
154157
{onClose && appId && envId && (

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ export interface DeploymentHistorySidebarType {
631631
export interface AppStatusDetailsChartType {
632632
filterRemoveHealth?: boolean
633633
showFooter: boolean
634-
handleOpenConfigDriftModal?: () => void
634+
showConfigDriftInfo?: boolean
635635
onClose?: () => void
636636
}
637637

0 commit comments

Comments
 (0)