Skip to content

Commit 68aba96

Browse files
committed
refactor: Update timelineStatus type to ReactNode in DeploymentStatusBreakdownItemType
1 parent fc3fbdd commit 68aba96

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/Shared/Components/CICDHistory/DeploymentStatusDetailRow.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { AppType, TIMELINE_STATUS } from '@Shared/types'
2424

2525
import { ReactComponent as DropDownIcon } from '../../../Assets/Icon/ic-chevron-down.svg'
2626
import { DATE_TIME_FORMATS, showError } from '../../../Common'
27-
import { ComponentSizeType, DEPLOYMENT_STATUS, statusIcon } from '../../constants'
27+
import { ComponentSizeType, DEPLOYMENT_STATUS } from '../../constants'
2828
import { AppStatusContent } from '../AppStatusModal'
2929
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
3030
import { APP_HEALTH_DROP_DOWN_LIST, MANIFEST_STATUS_HEADERS, TERMINAL_STATUS_MAP } from './constants'
@@ -47,10 +47,6 @@ export const DeploymentStatusDetailRow = ({
4747
const statusBreakDownType = deploymentDetailedData.deploymentStatusBreakdown[type]
4848
const [isCollapsed, setIsCollapsed] = useState<boolean>(statusBreakDownType.isCollapsed)
4949

50-
const isHelmManifestPushFailed =
51-
type === TIMELINE_STATUS.HELM_MANIFEST_PUSHED_TO_HELM_REPO &&
52-
deploymentDetailedData.deploymentStatus === statusIcon.failed
53-
5450
useEffect(() => {
5551
setIsCollapsed(statusBreakDownType.isCollapsed)
5652
}, [statusBreakDownType.isCollapsed])
@@ -132,22 +128,6 @@ export const DeploymentStatusDetailRow = ({
132128
)
133129
}
134130

135-
const renderErrorInfoBar = () => {
136-
if (deploymentDetailedData.lastFailedStatusType !== TIMELINE_STATUS.HELM_MANIFEST_PUSHED_TO_HELM_REPO) {
137-
return null
138-
}
139-
140-
return (
141-
<div className="bcr-1 fs-13 p-8">
142-
<span className="dc__word-break lh-20">{deploymentDetailedData.deploymentError}</span>
143-
<ol className="m-0 pl-20">
144-
<li>Ensure provided repository path is valid</li>
145-
<li>Check if credentials provided for OCI registry are valid and have PUSH permission</li>
146-
</ol>
147-
</div>
148-
)
149-
}
150-
151131
const isAccordion =
152132
statusBreakDownType.subSteps?.length ||
153133
(type === TIMELINE_STATUS.APP_HEALTH && APP_HEALTH_DROP_DOWN_LIST.includes(statusBreakDownType.icon)) ||
@@ -198,7 +178,7 @@ export const DeploymentStatusDetailRow = ({
198178
<>
199179
<div className="bw-1 en-2">
200180
<div
201-
className={`flexbox dc__align-items-center dc__content-space dc__gap-12 py-8 px-8 bg__primary ${isCollapsed ? (!isHelmManifestPushFailed ? 'br-4' : '') : 'border-collapse'}`}
181+
className={`flexbox dc__align-items-center dc__content-space dc__gap-12 py-8 px-8 bg__primary ${isCollapsed ? 'br-4' : 'border-collapse'}`}
202182
>
203183
<div className="flexbox dc__align-items-center dc__gap-12 flex-grow-1">
204184
{renderDeploymentTimelineIcon(statusBreakDownType.icon)}
@@ -247,7 +227,6 @@ export const DeploymentStatusDetailRow = ({
247227
/>
248228
)}
249229
</div>
250-
{isHelmManifestPushFailed && renderErrorInfoBar()}
251230
</div>
252231

253232
{renderAccordionDetails()}

src/Shared/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ export interface DeploymentStatusBreakdownItemType {
12651265
/**
12661266
* To be shown in accordion details below heading tile
12671267
*/
1268-
timelineStatus?: string
1268+
timelineStatus?: ReactNode
12691269
showHelmManifest?: boolean
12701270
}
12711271

0 commit comments

Comments
 (0)