Skip to content

Commit 03f1380

Browse files
committed
refactor: remove unused PodMetadatum interface and update aggregateNodes function to use PodMetaData
1 parent 12f9a58 commit 03f1380

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,13 +642,6 @@ export interface AggregatedNodes {
642642
}
643643
}
644644

645-
export interface PodMetadatum {
646-
name: string
647-
uid: string
648-
containers: string[]
649-
isNew: boolean
650-
}
651-
652645
export const STATUS_SORTING_ORDER = {
653646
[NodeStatus.Missing]: 1,
654647
[NodeStatus.Degraded]: 2,

src/Shared/Helpers.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
ZERO_TIME_STRING,
5353
} from '../Common'
5454
import { getAggregator, GVKType } from '../Pages'
55-
import { AggregatedNodes, PodMetadatum } from './Components'
55+
import { AggregatedNodes } from './Components'
5656
import { CUBIC_BEZIER_CURVE, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants'
5757
import {
5858
AggregationKeys,
@@ -63,6 +63,7 @@ import {
6363
IntersectionOptions,
6464
Node,
6565
Nodes,
66+
PodMetaData,
6667
TargetPlatformItemDTO,
6768
TargetPlatformsDTO,
6869
WebhookEventNameType,
@@ -296,7 +297,7 @@ export const renderValidInputButtonTippy = (children: ReactElement) => (
296297
</Tippy>
297298
)
298299

299-
export function aggregateNodes(nodes: any[], podMetadata: PodMetadatum[]): AggregatedNodes {
300+
export function aggregateNodes(nodes: any[], podMetadata: PodMetaData[]): AggregatedNodes {
300301
const podMetadataMap = mapByKey(podMetadata, 'name')
301302
// group nodes
302303
const nodesGroup = nodes.reduce((agg, curr) => {

src/Shared/types.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,24 @@ export interface iNode extends Node {
175175
status: string
176176
pNode?: iNode
177177
}
178+
179+
export interface HelmReleaseStatus {
180+
status: string
181+
message: string
182+
description: string
183+
}
184+
178185
export interface ResourceTree {
179-
conditions: any
186+
nodes: Node[]
180187
newGenerationReplicaSet: string
181-
nodes: Array<Node>
182-
podMetadata: Array<PodMetaData>
183188
status: string
189+
podMetadata: PodMetaData[]
190+
conditions?: any
191+
releaseStatus?: HelmReleaseStatus
184192
resourcesSyncResult?: Record<string, string>
193+
hasDrift?: boolean
194+
// lastSnapshotTime and wfrId are only available for isolated
195+
lastSnapshotTime?: string
185196
wfrId?: number
186197
}
187198

@@ -193,12 +204,6 @@ export enum AppType {
193204
EXTERNAL_FLUX_APP = 'external_flux_app',
194205
}
195206

196-
export interface HelmReleaseStatus {
197-
status: string
198-
message: string
199-
description: string
200-
}
201-
202207
interface MaterialInfo {
203208
author: string
204209
branch: string
@@ -222,7 +227,7 @@ export interface AppDetails {
222227
appStoreChartName?: string
223228
appStoreInstalledAppVersionId?: number
224229
ciArtifactId?: number
225-
deprecated?: false
230+
deprecated?: boolean
226231
environmentId?: number
227232
environmentName: string
228233
installedAppId?: number
@@ -258,6 +263,12 @@ export interface AppDetails {
258263
FluxAppStatusDetail?: FluxAppStatusDetail
259264
isPipelineTriggered?: boolean
260265
releaseMode?: ReleaseMode
266+
cdPipelineId?: number
267+
triggerType?: string
268+
parentEnvironmentName?: string
269+
ciPipelineId?: number
270+
trafficSwitched?: boolean
271+
pcoId?: number
261272
}
262273

263274
export interface ConfigDriftModalProps extends Required<Pick<AppDetails, 'appId'>> {

0 commit comments

Comments
 (0)