15
15
*/
16
16
17
17
import React , { useEffect , useMemo } from 'react'
18
- import { NavLink , Redirect , Route , Switch , useParams , useRouteMatch } from 'react-router-dom'
18
+ import { Redirect , Route , Switch , useParams , useRouteMatch } from 'react-router-dom'
19
19
20
20
import { sanitizeTargetPlatforms } from '@Shared/Helpers'
21
21
@@ -31,6 +31,7 @@ import {
31
31
useInterval ,
32
32
} from '../../../Common'
33
33
import { DEPLOYMENT_STAGE_TO_NODE_MAP , EMPTY_STATE_STATUS } from '../../constants'
34
+ import { TabGroup } from '../TabGroup'
34
35
import Artifacts from './Artifacts'
35
36
import DeploymentDetailSteps from './DeploymentDetailSteps'
36
37
import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff'
@@ -409,66 +410,73 @@ const TriggerOutput = ({
409
410
workflowExecutionStages = { triggerDetails . workflowExecutionStages }
410
411
namespace = { triggerDetails . namespace }
411
412
/>
412
- < ul className = "pl-50 pr-20 pt-8 tab-list tab-list--nodes dc__border-bottom dc__position-sticky dc__top-0 bg__primary dc__zi-3" >
413
- { triggerDetails . stage === 'DEPLOY' && deploymentAppType !== DeploymentAppTypes . HELM && (
414
- < li className = "tab-list__tab" data-testid = "deployment-history-steps-link" >
415
- < NavLink
416
- replace
417
- className = "tab-list__tab-link fs-13-imp pb-8 pt-0-imp"
418
- activeClassName = "active"
419
- to = "deployment-steps"
420
- >
421
- Steps
422
- </ NavLink >
423
- </ li >
424
- ) }
425
- { ! ( triggerDetails . stage === 'DEPLOY' || triggerDetails . IsVirtualEnvironment ) && (
426
- < li className = "tab-list__tab" data-testid = "deployment-history-logs-link" >
427
- < NavLink
428
- replace
429
- className = "tab-list__tab-link fs-13-imp pb-8 pt-0-imp"
430
- activeClassName = "active"
431
- to = "logs"
432
- >
433
- Logs
434
- </ NavLink >
435
- </ li >
436
- ) }
437
- < li className = "tab-list__tab" data-testid = "deployment-history-source-code-link" >
438
- < NavLink
439
- replace
440
- className = "tab-list__tab-link fs-13-imp pb-8 pt-0-imp"
441
- activeClassName = "active"
442
- to = "source-code"
443
- >
444
- Source
445
- </ NavLink >
446
- </ li >
447
- { triggerDetails . stage === 'DEPLOY' && (
448
- < li className = "tab-list__tab" data-testid = "deployment-history-configuration-link" >
449
- < NavLink
450
- replace
451
- className = "tab-list__tab-link fs-13-imp pb-8 pt-0-imp"
452
- activeClassName = "active"
453
- to = "configuration"
454
- >
455
- Configuration
456
- </ NavLink >
457
- </ li >
458
- ) }
459
- { ( triggerDetails . stage !== 'DEPLOY' || triggerDetails . IsVirtualEnvironment ) && (
460
- < li className = "tab-list__tab" data-testid = "deployment-history-artifacts-link" >
461
- < NavLink
462
- replace
463
- className = "tab-list__tab-link fs-13-imp pb-8 pt-0-imp"
464
- activeClassName = "active"
465
- to = "artifacts"
466
- >
467
- Artifacts
468
- </ NavLink >
469
- </ li >
470
- ) }
471
- </ ul >
413
+ < div className = "pl-50 pr-20 pt-8 dc__border-bottom dc__position-sticky dc__top-0 bg__primary dc__zi-3" >
414
+ < TabGroup
415
+ tabs = { [
416
+ ...( triggerDetails . stage === 'DEPLOY' && deploymentAppType !== DeploymentAppTypes . HELM
417
+ ? [
418
+ {
419
+ id : 'deployment-history-steps-link' ,
420
+ label : 'Steps' ,
421
+ tabType : 'navLink' as const ,
422
+ props : {
423
+ to : 'deployment-steps' ,
424
+ 'data-testid' : 'deployment-history-steps-link' ,
425
+ } ,
426
+ } ,
427
+ ]
428
+ : [ ] ) ,
429
+ ...( ! ( triggerDetails . stage === 'DEPLOY' || triggerDetails . IsVirtualEnvironment )
430
+ ? [
431
+ {
432
+ id : 'deployment-history-logs-link' ,
433
+ label : 'Logs' ,
434
+ tabType : 'navLink' as const ,
435
+ props : {
436
+ to : 'logs' ,
437
+ 'data-testid' : 'deployment-history-logs-link' ,
438
+ } ,
439
+ } ,
440
+ ]
441
+ : [ ] ) ,
442
+ {
443
+ id : 'deployment-history-source-code-link' ,
444
+ label : 'Source' ,
445
+ tabType : 'navLink' ,
446
+ props : {
447
+ to : 'source-code' ,
448
+ 'data-testid' : 'deployment-history-source-code-link' ,
449
+ } ,
450
+ } ,
451
+ ...( triggerDetails . stage === 'DEPLOY'
452
+ ? [
453
+ {
454
+ id : 'deployment-history-configuration-link' ,
455
+ label : 'Configuration' ,
456
+ tabType : 'navLink' as const ,
457
+ props : {
458
+ to : 'configuration' ,
459
+ 'data-testid' : 'deployment-history-configuration-link' ,
460
+ } ,
461
+ } ,
462
+ ]
463
+ : [ ] ) ,
464
+ ...( triggerDetails . stage !== 'DEPLOY' || triggerDetails . IsVirtualEnvironment
465
+ ? [
466
+ {
467
+ id : 'deployment-history-artifacts-link' ,
468
+ label : 'Artifacts' ,
469
+ tabType : 'navLink' as const ,
470
+ props : {
471
+ to : 'artifacts' ,
472
+ 'data-testid' : 'deployment-history-artifacts-link' ,
473
+ } ,
474
+ } ,
475
+ ]
476
+ : [ ] ) ,
477
+ ] }
478
+ />
479
+ </ div >
472
480
</ >
473
481
) }
474
482
< HistoryLogs
0 commit comments