Skip to content

Commit 7925515

Browse files
Merge pull request #2669 from devtron-labs/feat/app-status-modal
feat: update app status modal
2 parents e28dca8 + dbc5f9a commit 7925515

26 files changed

+152
-308
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.13.0-pre-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.13.0-pre-2",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Shared/index.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Shared/utils.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/components/ClusterNodes/ClusterEvents.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
*/
1616

1717
import { useState, useEffect } from 'react'
18-
import { showError } from '@devtron-labs/devtron-fe-common-lib'
18+
import { showError, getAIAnalyticsEvents } from '@devtron-labs/devtron-fe-common-lib'
1919
import { MESSAGING_UI } from '../../config'
2020
import { EventsTable } from '../v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/EventsTable'
2121
import { PodEventsType } from '../v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/node.type'
2222
import MessageUI from '../v2/common/message.ui'
2323
import { getClusterEvents } from './clusterNodes.service'
2424
import { ClusterEventsType } from './types'
25-
import { getAIAnalyticsEvents } from 'src/Shared'
2625

2726
export default function ClusterEvents({ terminalAccessId, reconnectStart, clusterId }: ClusterEventsType) {
2827
const [events, setEvents] = useState([])

src/components/ResourceBrowser/ResourceList/BaseResourceList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import { useEffect, useMemo, useRef, useState } from 'react'
1818
import { useHistory, useLocation, useRouteMatch } from 'react-router-dom'
1919
import DOMPurify from 'dompurify'
20-
import { getAIAnalyticsEvents } from 'src/Shared'
2120

2221
import {
2322
ALL_NAMESPACE_OPTION,
@@ -29,6 +28,7 @@ import {
2928
ClipboardButton,
3029
ConditionalWrap,
3130
GenericFilterEmptyState,
31+
getAIAnalyticsEvents,
3232
GVKType,
3333
highlightSearchText,
3434
K8sResourceDetailDataType,

src/components/ResourceBrowser/ResourceList/EventList.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616

1717
/* eslint-disable react/no-danger */
1818
import DOMPurify from 'dompurify'
19-
import { getAIAnalyticsEvents } from 'src/Shared'
2019

21-
import { highlightSearchText, Tooltip } from '@devtron-labs/devtron-fe-common-lib'
20+
import { getAIAnalyticsEvents, highlightSearchText, Tooltip } from '@devtron-labs/devtron-fe-common-lib'
2221

2322
import { importComponentFromFELibrary } from '@Components/common'
2423

src/components/ResourceBrowser/ResourceList/K8SResourceList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
import { useMemo, useRef, useState } from 'react'
1818
import { useLocation, useParams } from 'react-router-dom'
19-
import { getAIAnalyticsEvents } from 'src/Shared'
2019

2120
import {
2221
abortPreviousRequests,
2322
ALL_NAMESPACE_OPTION,
23+
getAIAnalyticsEvents,
2424
getIsRequestAborted,
2525
Nodes,
2626
useAsync,

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { generatePath, Route, useHistory, useLocation, useParams, useRouteMatch
2020
import {
2121
ACTION_STATE,
2222
aggregateNodes,
23+
AppStatusModal,
2324
ArtifactInfoModal,
2425
Button,
2526
ButtonComponentType,
@@ -71,7 +72,6 @@ import { AppType, EnvType } from '../../../v2/appDetails/appDetails.type'
7172
import IndexStore from '../../../v2/appDetails/index.store'
7273
import { EmptyK8sResourceComponent } from '../../../v2/appDetails/k8Resource/K8Resource.component'
7374
import NodeTreeDetailTab from '../../../v2/appDetails/NodeTreeDetailTab'
74-
import AppStatusDetailModal from '../../../v2/appDetails/sourceInfo/environmentStatus/AppStatusDetailModal'
7575
import RotatePodsModal from '../../../v2/appDetails/sourceInfo/rotatePods/RotatePodsModal.component'
7676
import SyncErrorComponent from '../../../v2/appDetails/SyncError.component'
7777
import { TriggerUrlModal } from '../../list/TriggerUrl'
@@ -99,7 +99,6 @@ import { SourceInfo } from './SourceInfo'
9999
const VirtualAppDetailsEmptyState = importComponentFromFELibrary('VirtualAppDetailsEmptyState')
100100
const DeploymentWindowStatusModal = importComponentFromFELibrary('DeploymentWindowStatusModal')
101101
const DeploymentWindowConfirmationDialog = importComponentFromFELibrary('DeploymentWindowConfirmationDialog')
102-
const ConfigDriftModalRoute = importComponentFromFELibrary('ConfigDriftModalRoute', null, 'function')
103102
const processVirtualEnvironmentDeploymentData = importComponentFromFELibrary(
104103
'processVirtualEnvironmentDeploymentData',
105104
null,
@@ -113,6 +112,9 @@ const getDeploymentWindowProfileMetaData = importComponentFromFELibrary(
113112
'function',
114113
)
115114

115+
const ConfigDriftModal = importComponentFromFELibrary('ConfigDriftModal', null, 'function')
116+
const ExplainWithAIButton = importComponentFromFELibrary('ExplainWithAIButton', null, 'function')
117+
116118
export const AppNotConfigured = ({
117119
image,
118120
title,
@@ -243,8 +245,10 @@ const Details: React.FC<DetailsType> = ({
243245
applications,
244246
}) => {
245247
const params = useParams<{ appId: string; envId: string }>()
246-
const { path } = useRouteMatch()
247248
const location = useLocation()
249+
250+
const appDetailsFromIndexStore = IndexStore.getAppDetails()
251+
248252
// fixme: the state is not being set anywhere and just being drilled down
249253
const [detailedStatus, toggleDetailedStatus] = useState<boolean>(false)
250254
const [resourceTreeFetchTimeOut, setResourceTreeFetchTimeOut] = useState<boolean>(false)
@@ -286,7 +290,7 @@ const Details: React.FC<DetailsType> = ({
286290
deploymentStatus: DEFAULT_STATUS,
287291
deploymentStatusText: DEFAULT_STATUS_TEXT,
288292
})
289-
const isConfigDriftEnabled: boolean = window._env_.FEATURE_CONFIG_DRIFT_ENABLE && !!ConfigDriftModalRoute
293+
const isConfigDriftEnabled: boolean = window._env_.FEATURE_CONFIG_DRIFT_ENABLE && !!ConfigDriftModal
290294
const isExternalToolAvailable: boolean =
291295
externalLinksAndTools.externalLinks.length > 0 && externalLinksAndTools.monitoringTools.length > 0
292296
const interval = Number(window._env_.DEVTRON_APP_DETAILS_POLLING_INTERVAL) || 30000
@@ -776,10 +780,14 @@ const Details: React.FC<DetailsType> = ({
776780
renderAppDetails()
777781
)}
778782
{detailedStatus && (
779-
<AppStatusDetailModal
780-
close={hideAppDetailsStatus}
781-
showAppStatusMessage={false}
782-
showConfigDriftInfo={isConfigDriftEnabled}
783+
<AppStatusModal
784+
titleSegments={[appDetailsFromIndexStore.appName, appDetailsFromIndexStore.environmentName]}
785+
handleClose={hideAppDetailsStatus}
786+
type="devtron-app"
787+
appDetails={appDetailsFromIndexStore}
788+
isConfigDriftEnabled={isConfigDriftEnabled}
789+
configDriftModal={ConfigDriftModal}
790+
debugWithAIButton={ExplainWithAIButton}
783791
/>
784792
)}
785793
{location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
@@ -815,7 +823,6 @@ const Details: React.FC<DetailsType> = ({
815823
)}
816824
{appDetails && !!hibernateConfirmationModal && renderHibernateModal()}
817825
{rotateModal && renderRestartWorkload()}
818-
{isConfigDriftEnabled && !isVirtualEnvRef.current && <ConfigDriftModalRoute path={path} />}
819826
</>
820827
)
821828
}

src/components/app/details/appDetails/AppStatusCard.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
import React, { useMemo } from 'react'
1818
import Tippy from '@tippyjs/react'
1919
import ReactGA from 'react-ga4'
20-
import { AppStatus, AppType, StatusType } from '@devtron-labs/devtron-fe-common-lib'
20+
import { AppStatus, AppType, StatusType, getAIAnalyticsEvents } from '@devtron-labs/devtron-fe-common-lib'
2121
import { ReactComponent as ICHelpOutline } from '../../../../assets/icons/ic-help-outline.svg'
2222
import { AppStatusCardType } from './appDetails.type'
2323
import LoadingCard from './LoadingCard'
2424
import './appDetails.scss'
2525
import { importComponentFromFELibrary } from '@Components/common'
26-
import { getAIAnalyticsEvents } from 'src/Shared'
2726

2827
const ExplainWithAIButton = importComponentFromFELibrary('ExplainWithAIButton', null, 'function')
2928

@@ -101,7 +100,7 @@ const AppStatusCard = ({ appDetails, status, cardLoading, setDetailed, message }
101100
</Tippy>
102101
</div>
103102
<div className="flex fs-12 fw-4">
104-
<div className={`fs-13 fw-6 lh-20 f-${status.toLowerCase()}`}>
103+
<div className={`fs-13 fw-6 lh-20 app-summary__status-name f-${status.toLowerCase()}`}>
105104
{isHibernated ? 'Hibernating' : status}
106105
</div>
107106
</div>

src/components/app/details/appDetails/IssuesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const IssuesCard = ({ cardLoading, setErrorsList, toggleIssuesModal, setDetailed
224224
</Tippy>
225225
</div>
226226
<div className="flex fs-12 fw-4">
227-
<div className="fs-13 fw-6 lh-20 f-degraded">{getErrorCountText()}</div>
227+
<div className="fs-13 fw-6 lh-20 app-summary__status-name f-degraded dc__first-letter-capitalize--imp">{getErrorCountText()}</div>
228228
</div>
229229
</div>
230230
<ErrorIcon className="form__icon--error icon-dim-24" />

0 commit comments

Comments
 (0)