Skip to content

Commit e07afab

Browse files
authored
Merge pull request #554 from devtron-labs/feat/config-drift-state
feat: move config drift modal from route to state
2 parents 51234ed + 3f50c0f commit e07afab

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
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.6.8",
3+
"version": "1.6.9",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export const URLS = {
7878
GLOBAL_CONFIG_SCOPED_VARIABLES: '/global-config/scoped-variables',
7979
GLOBAL_CONFIG_DEPLOYMENT_CHARTS_LIST: '/global-config/deployment-charts',
8080
NETWORK_STATUS_INTERFACE: '/network-status-interface',
81-
CONFIG_DRIFT: 'config-drift',
8281
RESOURCE_BROWSER: '/resource-browser',
8382
COMPARE_CLUSTERS: '/compare-clusters',
8483
}

src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
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'
2119
import { ReactComponent as InfoIcon } from '../../../Assets/Icon/ic-info-filled.svg'
2220
import { ReactComponent as Chat } from '../../../Assets/Icon/ic-chat-circle-dots.svg'
2321
import { AppStatusDetailsChartType, AggregatedNodes, STATUS_SORTING_ORDER, NodeFilters } from './types'
@@ -30,10 +28,9 @@ import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
3028
const AppStatusDetailsChart = ({
3129
filterRemoveHealth = false,
3230
showFooter,
33-
showConfigDriftInfo = false,
31+
handleOpenConfigDriftModal,
3432
onClose,
3533
}: AppStatusDetailsChartType) => {
36-
const history = useHistory()
3734
const _appDetails = IndexStore.getAppDetails()
3835
const [currentFilter, setCurrentFilter] = useState<string>(ALL_RESOURCE_KIND_FILTER)
3936
const [flattenedNodes, setFlattenedNodes] = useState([])
@@ -42,7 +39,7 @@ const AppStatusDetailsChart = ({
4239

4340
const handleCompareDesiredManifest = () => {
4441
onClose()
45-
history.push(`${URLS.APP}/${appId}${URLS.DETAILS}/${envId}/${URLS.APP_DETAILS_K8}/${URLS.CONFIG_DRIFT}`)
42+
handleOpenConfigDriftModal()
4643
}
4744

4845
const nodes: AggregatedNodes = useMemo(
@@ -151,7 +148,7 @@ const AppStatusDetailsChart = ({
151148
{nodeDetails.status ? nodeDetails.status : nodeDetails.health.status}
152149
</div>
153150
<div className="flexbox-col dc__gap-4">
154-
{showConfigDriftInfo && nodeDetails.hasDrift && (
151+
{handleOpenConfigDriftModal && nodeDetails.hasDrift && (
155152
<div className="flexbox dc__gap-8 dc__align-items-center">
156153
<span className="fs-13 fw-4 lh-20 cy-7">Config drift detected</span>
157154
{onClose && appId && envId && (

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export interface DeploymentHistorySidebarType {
560560
export interface AppStatusDetailsChartType {
561561
filterRemoveHealth?: boolean
562562
showFooter: boolean
563-
showConfigDriftInfo?: boolean
563+
handleOpenConfigDriftModal?: () => void
564564
onClose?: () => void
565565
}
566566

src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const ConfirmationModalBody = ({
113113
/>
114114
)}
115115
</div>
116-
<div className="p-16 dc__gap-12 flexbox dc__content-end">
116+
<div className="px-20 py-16 dc__gap-12 flexbox dc__content-end">
117117
{secondaryButtonConfig && (
118118
<Button
119119
dataTestId="confirmation-modal-secondary-button"

0 commit comments

Comments
 (0)