Skip to content

Commit e7113fd

Browse files
fix: toast err
1 parent 2ee8ca0 commit e7113fd

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/components/app/details/cicdHistory/Constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ export const HISTORY_LABEL = {
2222
}
2323

2424
export const WORKER_POD_BASE_URL = '/resource-browser/1/devtron-ci/pod/k8sEmptyGroup'
25+
26+
export const TIMEOUT_VALUE = '12' // in hours
27+

src/components/app/details/cicdHistory/TriggerDetails.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
import { Link, NavLink } from 'react-router-dom'
2727
import { cancelCiTrigger, cancelPrePostCdTrigger, extractImage } from '../../service'
2828
import { DEFAULT_ENV } from '../triggerView/Constants'
29-
import { WORKER_POD_BASE_URL } from './Constants'
29+
import { TIMEOUT_VALUE, WORKER_POD_BASE_URL } from './Constants'
3030

3131
const TriggerDetailsStatusIcon = React.memo(({ status }: TriggerDetailsStatusIconType): JSX.Element => {
3232
return (
@@ -130,11 +130,10 @@ const Finished = React.memo(({ status, finishedOn, artifact, type }: FinishedTyp
130130
const WorkerStatus = React.memo(
131131
({ message, podStatus, stage, name, finishedOn }: WorkerStatusType): JSX.Element | null => {
132132
if (!message && !podStatus) return null
133-
const timeoutValue = '12' // in hours
134133
// check if finishedOn time is timed out or not
135-
const isTimedOut = moment(finishedOn).isBefore(moment().subtract(timeoutValue, 'hours'))
134+
const isTimedOut = moment(finishedOn).isBefore(moment().subtract(TIMEOUT_VALUE, 'hours'))
136135
// finishedOn is 0001-01-01T00:00:00Z when the worker is still running
137-
const showLink = true || finishedOn === ZERO_TIME_STRING || !isTimedOut
136+
const showLink = true || finishedOn === ZERO_TIME_STRING || !isTimedOut
138137

139138
return (
140139
<>

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetail.component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ function NodeDetailComponent({
102102

103103
const getContainersFromManifest = async () => {
104104
try {
105+
const nullCaseName = (isResourceBrowserView && params.nodeType==='pod') ? params.node: ""
105106
const { result } = await getManifestResource(
106107
appDetails,
107-
params.podName,
108+
params.node,
108109
params.nodeType,
109110
isResourceBrowserView,
110-
selectedResource,
111+
{...selectedResource, name: selectedResource.name ? selectedResource.name : nullCaseName },
111112
)
112113
const _resourceContainers = []
113114
if (result?.manifest?.spec) {

0 commit comments

Comments
 (0)