Skip to content

Commit 239db7d

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-common-lib into feat/infra-overview
2 parents 7a8ed41 + 4fbef3b commit 239db7d

4 files changed

Lines changed: 11 additions & 19 deletions

File tree

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/Components/ContextSwitcher/ContextSwitcher.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const ContextSwitcher = ({
4545
optionListError,
4646
reloadOptionList,
4747
classNamePrefix,
48+
resource,
4849
}: ContextSwitcherTypes) => {
4950
const selectRef = useRef<SelectInstance<SelectPickerOptionType>>(null)
5051
const shouldShowToastRef = useRef<boolean>(true)
@@ -60,7 +61,7 @@ export const ContextSwitcher = ({
6061
if (shouldShowToastRef.current) {
6162
ToastManager.showToast({
6263
variant: ToastVariantType.shortcut,
63-
text: 'to switch Applications',
64+
text: `to switch ${resource}`,
6465
shortcuts: ['S'],
6566
})
6667
}

src/Shared/Components/ContextSwitcher/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface ContextSwitcherTypes
3636
> {
3737
options: GroupBase<SelectPickerOptionType<string | number>>[]
3838
isAppDataAvailable?: boolean
39+
resource: 'Cluster' | 'Release' | 'Tenant' | 'Application' | 'Job' | 'Application Group' | 'Chart Store'
3940
}
4041

4142
export interface RecentlyVisitedOptions extends SelectPickerOptionType<number> {

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)