File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Shared/Components/CICDHistory Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { NavLink } from 'react-router-dom'
4
4
import moment from 'moment'
5
5
import { ReactComponent as ICLines } from '@Icons/ic-lines.svg'
6
6
import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg'
7
- import { ZERO_TIME_STRING } from '@Common/Constants '
7
+ import { isTimeStringAvailable } from '@Shared/Helpers '
8
8
import { ShowMoreText } from '../ShowMoreText'
9
9
import { FAILED_WORKFLOW_STAGE_STATUS_MAP , TIMEOUT_VALUE , WORKFLOW_STAGE_STATUS_TO_TEXT_MAP } from './constants'
10
10
import { getWorkerPodBaseUrl } from './utils'
@@ -27,10 +27,12 @@ const WorkerStatus = memo(
27
27
if ( ! message && ! podStatus ) {
28
28
return null
29
29
}
30
- // check if finishedOn time is timed out or not
31
- const isTimedOut = moment ( finishedOn ) . isBefore ( moment ( ) . subtract ( TIMEOUT_VALUE , 'hours' ) )
32
- // finishedOn is 0001-01-01T00:00:00Z when the worker is still running
33
- const showLink = workerPodName && ( finishedOn === ZERO_TIME_STRING || ! isTimedOut )
30
+
31
+ // Logic is workerPodName should be available and, if finishedOn is available, it should be less than timeout value
32
+ const showLink =
33
+ workerPodName &&
34
+ ( ! isTimeStringAvailable ( finishedOn ) ||
35
+ ! moment ( finishedOn ) . isBefore ( moment ( ) . subtract ( TIMEOUT_VALUE , 'hours' ) ) )
34
36
35
37
const getViewWorker = ( ) =>
36
38
showLink ? (
You can’t perform that action at this time.
0 commit comments