Skip to content

Commit cd187d7

Browse files
committed
feat: enhance AppStatusModal with InfoCardItemProps and update deployment status messaging
1 parent a8bce6c commit cd187d7

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed
Lines changed: 1 addition & 1 deletion
Loading

src/Shared/Components/AppStatusModal/AppStatusBody.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ComponentProps, ReactNode } from 'react'
1+
import { ComponentProps } from 'react'
22

33
import { getAIAnalyticsEvents } from '@Common/Helper'
44
import { Tooltip } from '@Common/Tooltip'
@@ -7,18 +7,19 @@ import { getAppDetailsURL } from '@Shared/Helpers'
77

88
import { Button, ButtonComponentType, ButtonVariantType } from '../Button'
99
import { DeploymentStatusDetailBreakdown } from '../CICDHistory'
10+
import { DEPLOYMENT_STATUS_TEXT_MAP } from '../DeploymentStatusBreakdown'
1011
import { ErrorBar } from '../Error'
1112
import { Icon } from '../Icon'
1213
import { ShowMoreText } from '../ShowMoreText'
1314
import { AppStatus, DeploymentStatus, StatusType } from '../StatusComponent'
1415
import AppStatusContent from './AppStatusContent'
1516
import { APP_STATUS_CUSTOM_MESSAGES } from './constants'
16-
import { AppStatusBodyProps, AppStatusModalTabType, StatusHeadingContainerProps } from './types'
17+
import { AppStatusBodyProps, AppStatusModalTabType, InfoCardItemProps, StatusHeadingContainerProps } from './types'
1718
import { getAppStatusMessageFromAppDetails } from './utils'
1819

19-
const InfoCardItem = ({ heading, value, isLast = false }: { heading: string; value: ReactNode; isLast?: boolean }) => (
20+
const InfoCardItem = ({ heading, value, isLast = false, alignCenter = false }: InfoCardItemProps) => (
2021
<div
21-
className={`py-12 px-16 dc__grid dc__column-gap-16 info-card-item ${!isLast ? 'border__secondary--bottom' : ''}`}
22+
className={`py-12 px-16 dc__grid dc__column-gap-16 info-card-item ${alignCenter ? 'dc__align-items-center' : ''} ${!isLast ? 'border__secondary--bottom' : ''} ${alignCenter ? 'dc__align-center' : ''}`}
2223
>
2324
<Tooltip content={heading}>
2425
<h3 className="cn-9 fs-13 fw-4 lh-1-5 dc__truncate m-0 dc__no-shrink">{heading}</h3>
@@ -149,6 +150,11 @@ export const AppStatusBody = ({
149150
{deploymentStatusDetailsBreakdownData?.deploymentStatus ? (
150151
<DeploymentStatus
151152
status={deploymentStatusDetailsBreakdownData.deploymentStatus}
153+
message={
154+
DEPLOYMENT_STATUS_TEXT_MAP[
155+
deploymentStatusDetailsBreakdownData.deploymentStatus
156+
]
157+
}
152158
showAnimatedIcon
153159
/>
154160
) : (
@@ -170,6 +176,7 @@ export const AppStatusBody = ({
170176
heading={item.heading}
171177
value={item.value}
172178
isLast={index === infoCardItems.length - 1}
179+
alignCenter={item.heading !== 'Message'}
173180
/>
174181
))}
175182
</div>

src/Shared/Components/AppStatusModal/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,10 @@ export interface StatusHeadingContainerProps extends PropsWithChildren<Pick<AppS
9898
envId?: number
9999
actionItem?: ReactNode
100100
}
101+
102+
export interface InfoCardItemProps {
103+
heading: string
104+
value: ReactNode
105+
isLast?: boolean
106+
alignCenter?: boolean
107+
}

src/Shared/Components/CICDHistory/DeploymentDetailSteps.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ const DeploymentDetailSteps = ({
5151
const [deploymentListLoader, setDeploymentListLoader] = useState<boolean>(
5252
deploymentStatus?.toUpperCase() !== TIMELINE_STATUS.ABORTED,
5353
)
54+
/**
55+
* Only present for helm apps history
56+
*/
5457
const appDetails = IndexStore.getAppDetails()
5558
const isVirtualEnv = useRef(isVirtualEnvironment)
5659
const isDeploymentWithoutApprovalRef = useRef(isDeploymentWithoutApproval)

0 commit comments

Comments
 (0)