Skip to content

Commit 2184abe

Browse files
authored
Merge pull request #991 from devtron-labs/refactor/app-details
refactor: remove unused PodMetadatum interface and update aggregateNo…
2 parents 87bc9b8 + 88cdc5c commit 2184abe

7 files changed

Lines changed: 31 additions & 25 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.22.5",
3+
"version": "1.22.6",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
5959
<div className="shimmer w-64 lh-1-5 h-24" />
6060
) : (
6161
<span className={countClassName} data-testid={`segmented-bar-chart-${label}-value`}>
62-
{isProportional && !hideTotal ? `${value}/${total}` : value}
62+
{isProportional && !hideTotal
63+
? `${value.toLocaleString()}/${total.toLocaleString()}`
64+
: value.toLocaleString()}
6365
</span>
6466
)
6567

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ interface LoadingCardType {
2020

2121
const LoadingCard = ({ wider }: LoadingCardType) => (
2222
<div
23-
// TODO: Remove margin and use gap
24-
className={`flexbox-col ${wider ? 'w-250' : 'w-200'} bg__primary border__secondary-translucent br-8 mr-12 shadow__card--10`}
23+
className={`flexbox-col ${wider ? 'w-250' : 'w-200'} bg__primary border__secondary-translucent br-8 shadow__card--10`}
2524
>
2625
<div className="flexbox-col dc__gap-8 px-12 pt-12 pb-8">
2726
<span className="w-60 h-14 shimmer" />

src/Shared/Helpers.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import {
5454
ZERO_TIME_STRING,
5555
} from '../Common'
5656
import { getAggregator, GVKType } from '../Pages'
57-
import { AggregatedNodes, PodMetadatum } from './Components'
57+
import { AggregatedNodes } from './Components'
5858
import { CUBIC_BEZIER_CURVE, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants'
5959
import {
6060
AggregationKeys,
@@ -65,6 +65,7 @@ import {
6565
IntersectionOptions,
6666
Node,
6767
Nodes,
68+
PodMetaData,
6869
TargetPlatformItemDTO,
6970
TargetPlatformsDTO,
7071
WebhookEventNameType,
@@ -298,7 +299,7 @@ export const renderValidInputButtonTippy = (children: ReactElement) => (
298299
</Tippy>
299300
)
300301

301-
export function aggregateNodes(nodes: any[], podMetadata: PodMetadatum[]): AggregatedNodes {
302+
export function aggregateNodes(nodes: any[], podMetadata: PodMetaData[]): AggregatedNodes {
302303
const podMetadataMap = mapByKey(podMetadata, 'name')
303304
// group nodes
304305
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)