Skip to content

Commit 697e748

Browse files
committed
fix: typing issues
1 parent 9385f3b commit 697e748

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

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

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
// @ts-nocheck - @TODO: Remove this by fixing the type issues
18-
import React, { useEffect, useMemo, useState } from 'react'
19-
import { useParams } from 'react-router-dom'
17+
import { useEffect, useMemo, useState } from 'react'
18+
import { Link, useParams } from 'react-router-dom'
2019
import Tippy from '@tippyjs/react'
2120
import moment from 'moment'
2221
import {
@@ -48,7 +47,6 @@ import { ReactComponent as RotateIcon } from '../../../../assets/icons/ic-arrows
4847
import { ReactComponent as LinkIcon } from '../../../../assets/icons/ic-link.svg'
4948
import { ReactComponent as Trash } from '../../../../assets/icons/ic-delete-dots.svg'
5049
import { ReactComponent as ScaleDown } from '../../../../assets/icons/ic-scale-down.svg'
51-
import { ConfigApplyStatusCard } from './ConfigApplyStatusCard'
5250
import HelmAppConfigApplyStatusCard from '@Components/v2/appDetails/sourceInfo/environmentStatus/HelmAppConfigApplyStatusCard'
5351

5452
const AppDetailsDownloadCard = importComponentFromFELibrary('AppDetailsDownloadCard')
@@ -192,7 +190,8 @@ export const SourceInfo = ({
192190
}`}
193191
>
194192
<div className={`flex ${!appDetails.isVirtualEnvironment ? 'ml-16' : ''}`}>
195-
<DeploymentTypeIcon deploymentAppType={appDetails?.deploymentAppType} />
193+
{/* TODO: verify what appType needs to be passed */}
194+
<DeploymentTypeIcon deploymentAppType={appDetails?.deploymentAppType} appType={null} />
196195
</div>
197196
</Tooltip>
198197
)}
@@ -210,7 +209,9 @@ export const SourceInfo = ({
210209
<div className="fw-4 lh-18 flexbox-col dc__ga-2">
211210
<h6 className="fs-12 fw-6 cn-0 m-0">Last snapshot received</h6>
212211
<p className="m-0 fs-12 cn-50">
213-
{moment(relativeSnapshotTime).format(DATE_TIME_FORMATS.TWELVE_HOURS_FORMAT)}
212+
{moment(appDetails.resourceTree.lastSnapshotTime).format(
213+
DATE_TIME_FORMATS.TWELVE_HOURS_FORMAT,
214+
)}
214215
</p>
215216
</div>
216217
}
@@ -220,9 +221,7 @@ export const SourceInfo = ({
220221
<div className="dc__divider h-20 mr-8 ml-8" />
221222
<div className="flex left dc__gap-6 px-8 py-4">
222223
<ICCamera className="scn-9 dc__no-shrink icon-dim-16" />
223-
<p className="m-0 fs-13 fw-4 lh-20 cn-9 dc__truncate">
224-
{deploymentStatusDetailsBreakdownData.statusLastFetchedAt}
225-
</p>
224+
<p className="m-0 fs-13 fw-4 lh-20 cn-9 dc__truncate">{relativeSnapshotTime}</p>
226225
</div>
227226
</div>
228227
</Tooltip>
@@ -264,7 +263,7 @@ export const SourceInfo = ({
264263
<button
265264
data-testid="app-details-rotate-pods-modal-button"
266265
className="cta cta-with-img small cancel fs-12 fw-6 mr-6"
267-
onClick={setRotateModal}
266+
onClick={() => setRotateModal(true)}
268267
disabled={isApprovalConfigured}
269268
>
270269
<RotateIcon className="icon-dim-16 mr-6 icon-color-n7 scn-4" />
@@ -319,13 +318,15 @@ export const SourceInfo = ({
319318
environment && (
320319
<div className="flex left w-100">
321320
{status && (
322-
<AppStatusCard
323-
appDetails={appDetails}
324-
status={status}
325-
cardLoading={cardLoading}
326-
setDetailed={setDetailed}
327-
message={message}
328-
/>
321+
<AppStatusCard
322+
// TODO: Fix and remove
323+
// @ts-ignore
324+
appDetails={appDetails}
325+
status={status}
326+
cardLoading={cardLoading}
327+
setDetailed={setDetailed}
328+
message={message}
329+
/>
329330
)}
330331
{!helmMigratedAppNotTriggered && (
331332
<>

src/components/app/details/appDetails/appDetails.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export interface SecurityVulnerabilityCardType {
232232
}
233233

234234
export interface DeployedCommitCardType {
235-
showCommitInfoDrawer: () => void
235+
showCommitInfoDrawer: (e) => void
236236
cardLoading?: boolean
237237
envId: number | string
238238
ciArtifactId: number

src/components/app/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
RuntimeParamsListItemType,
2626
RuntimeParamsTriggerPayloadType,
2727
ReleaseMode,
28+
HelmReleaseStatus,
2829
} from '@devtron-labs/devtron-fe-common-lib'
2930
import { RouteComponentProps } from 'react-router'
3031
import { AppEnvironment } from '../../services/service.types'
@@ -90,9 +91,14 @@ export interface CDModalProps {
9091
parentEnvironmentName: string
9192
ciPipelineId?: number
9293
isRedirectedFromAppDetails?: boolean
94+
deploymentUserActionState?: ACTION_STATE
9395
}
9496

9597
export interface AppDetails extends CDModalProps {
98+
appStoreChartId: number
99+
appStoreChartName: string
100+
appStoreAppVersion: string
101+
appStoreAppName: string
96102
appId: number
97103
deploymentAppType?: DeploymentAppTypes
98104
externalCi?: boolean
@@ -188,6 +194,7 @@ interface ResourceTree {
188194
podMetadata: PodMetadatum[]
189195
conditions?: any
190196
lastSnapshotTime?: string
197+
releaseStatus?: HelmReleaseStatus
191198
}
192199

193200
interface Node {

0 commit comments

Comments
 (0)