@@ -22,6 +22,7 @@ import LogsRenderer from '../cicdHistory/LogsRenderer'
2222import { EMPTY_STATE_STATUS } from '../../../../config/constantMessaging'
2323import { ReactComponent as NoVulnerability } from '../../../../assets/img/ic-vulnerability-not-found.svg'
2424import { ScannedByToolModal } from '../../../common/security/ScannedByToolModal'
25+ import { CIPipelineBuildType } from '../../../ciPipeline/types'
2526
2627const terminalStatus = new Set ( [ 'succeeded' , 'failed' , 'error' , 'cancelled' , 'nottriggered' , 'notbuilt' ] )
2728let statusSet = new Set ( [ 'starting' , 'running' , 'pending' ] )
@@ -156,7 +157,7 @@ export default function CIDetails({ isJobView }: { isJobView?: boolean }) {
156157 replace ( generatePath ( path , { appId, pipelineId : pipelines [ 0 ] . id } ) )
157158 }
158159 const pipelineOptions : CICDSidebarFilterOptionType [ ] = ( pipelines || [ ] ) . map ( ( item ) => {
159- return { value : `${ item . id } ` , label : item . name , pipelineId : item . id }
160+ return { value : `${ item . id } ` , label : item . name , pipelineId : item . id , pipelineType : item . pipelineType }
160161 } )
161162 const pipelinesMap = mapByKey ( pipelines , 'id' )
162163 const pipeline = pipelinesMap . get ( + pipelineId )
@@ -221,6 +222,7 @@ export default function CIDetails({ isJobView }: { isJobView?: boolean }) {
221222 appReleaseTags = { appReleaseTags }
222223 hideImageTaggingHardDelete = { hideImageTaggingHardDelete }
223224 fetchIdData = { fetchBuildIdData }
225+ isJobCI = { pipeline . pipelineType === CIPipelineBuildType . CI_JOB }
224226 />
225227 </ Route >
226228 ) : pipeline . parentCiPipeline || pipeline . pipelineType === 'LINKED' ? (
@@ -259,12 +261,14 @@ export const Details = ({
259261 isSecurityModuleInstalled,
260262 isBlobStorageConfigured,
261263 isJobView,
264+ isJobCI,
262265 appIdFromParent,
263266 tagsEditable,
264267 appReleaseTags,
265268 hideImageTaggingHardDelete,
266269 fetchIdData,
267270} : BuildDetails ) => {
271+ const isJobCard : boolean = isJobView || isJobCI
268272 const { pipelineId, appId, buildId } = useParams < { appId : string ; buildId : string ; pipelineId : string } > ( )
269273 const triggerDetails = triggerHistory . get ( + buildId )
270274 const [ triggerDetailsLoading , triggerDetailsResult , triggerDetailsError , reloadTriggerDetails ] = useAsync (
@@ -403,7 +407,7 @@ export const Details = ({
403407 Artifacts
404408 </ NavLink >
405409 </ li >
406- { ! isJobView && isSecurityModuleInstalled && (
410+ { ! isJobCard && isSecurityModuleInstalled && (
407411 < li className = "tab-list__tab" >
408412 < NavLink
409413 replace
@@ -425,6 +429,7 @@ export const Details = ({
425429 triggerDetails = { triggerDetails }
426430 isBlobStorageConfigured = { isBlobStorageConfigured }
427431 isJobView = { isJobView }
432+ isJobCI = { isJobCI }
428433 appIdFromParent = { appIdFromParent }
429434 appReleaseTags = { appReleaseTags }
430435 tagsEditable = { tagsEditable }
@@ -438,12 +443,14 @@ const HistoryLogs = ({
438443 triggerDetails,
439444 isBlobStorageConfigured,
440445 isJobView,
446+ isJobCI,
441447 appIdFromParent,
442448 appReleaseTags,
443449 tagsEditable,
444450 hideImageTaggingHardDelete,
445451} : HistoryLogsType ) => {
446452 let { path } = useRouteMatch ( )
453+ const isJobCard : boolean = isJobCI || isJobView
447454 const { pipelineId, buildId } = useParams < { buildId : string ; pipelineId : string } > ( )
448455 const [ ref , scrollToTop , scrollToBottom ] = useScrollable ( {
449456 autoBottomScroll : triggerDetails . status . toLowerCase ( ) !== 'succeeded' ,
@@ -479,6 +486,7 @@ const HistoryLogs = ({
479486 getArtifactPromise = { _getArtifactPromise }
480487 isArtifactUploaded = { triggerDetails . isArtifactUploaded }
481488 isJobView = { isJobView }
489+ isJobCI = { isJobCI }
482490 imageComment = { triggerDetails . imageComment }
483491 imageReleaseTags = { triggerDetails . imageReleaseTags }
484492 ciPipelineId = { triggerDetails . ciPipelineId }
@@ -489,7 +497,7 @@ const HistoryLogs = ({
489497 type = { HistoryComponentType . CI }
490498 />
491499 </ Route >
492- { ! isJobView && (
500+ { ! isJobCard && (
493501 < Route path = { `${ path } /security` } >
494502 < SecurityTab
495503 ciPipelineId = { triggerDetails . ciPipelineId }
0 commit comments