Skip to content

Commit 03f32ad

Browse files
committed
fix: config drift window from app status modal
1 parent 0619646 commit 03f32ad

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

src/Shared/Components/AppStatusModal/AppStatusModal.component.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
ComponentSizeType,
2929
PROGRESSING_DEPLOYMENT_STATUS_POLLING_INTERVAL,
3030
} from '@Shared/constants'
31+
import { useMainContext } from '@Shared/Providers'
3132
import { AppType } from '@Shared/types'
3233

3334
import { APIResponseHandler } from '../APIResponseHandler'
@@ -57,7 +58,7 @@ const AppStatusModal = ({
5758
initialTab,
5859
debugWithAIButton,
5960
}: AppStatusModalProps) => {
60-
const [showConfigDriftModal, setShowConfigDriftModal] = useState(false)
61+
const { setTempAppWindowConfig } = useMainContext()
6162
const [selectedTab, setSelectedTab] = useState<AppStatusModalTabType>(initialTab || null)
6263

6364
const appDetailsAbortControllerRef = useRef<AbortController>(new AbortController())
@@ -241,30 +242,20 @@ const AppStatusModal = ({
241242

242243
const handleShowConfigDriftModal = isConfigDriftEnabled
243244
? () => {
244-
setShowConfigDriftModal(true)
245+
handleClose()
246+
setTempAppWindowConfig({
247+
open: true,
248+
title: `${appDetails.appName} / Live and desired manifest comparison`,
249+
component: <ConfigDriftModal appId={appDetails.appId} envId={appDetails.environmentId} />,
250+
})
245251
}
246252
: null
247253

248-
const handleCloseConfigDriftModal = () => {
249-
handleClose()
250-
setShowConfigDriftModal(false)
251-
}
252-
253254
const handleSelectTab = async (updatedTab: AppStatusModalTabType) => {
254255
handleClearDeploymentStatusTimeout()
255256
setSelectedTab(updatedTab)
256257
}
257258

258-
if (showConfigDriftModal) {
259-
return (
260-
<ConfigDriftModal
261-
appId={appDetails.appId}
262-
envId={+appDetails.environmentId}
263-
handleCloseModal={handleCloseConfigDriftModal}
264-
/>
265-
)
266-
}
267-
268259
const filteredTitleSegments = (titleSegments || []).filter((segment) => !!segment)
269260

270261
const getEmptyStateMessage = () => {

src/Shared/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ export interface AppDetails {
262262

263263
export interface ConfigDriftModalProps extends Required<Pick<AppDetails, 'appId'>> {
264264
envId: number
265-
handleCloseModal?: () => void
266265
}
267266

268267
export enum RegistryType {

0 commit comments

Comments
 (0)