Skip to content

Commit d63f2c8

Browse files
committed
feat: use tab group in trigger output
1 parent b2589ee commit d63f2c8

File tree

2 files changed

+69
-62
lines changed

2 files changed

+69
-62
lines changed

src/Common/Constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export const URLS = {
6464
CREATE_JOB: 'create-job',
6565
GETTING_STARTED: 'getting-started',
6666
STACK_MANAGER_ABOUT: '/stack-manager/about',
67-
APP_LIST_HELM: 'h',
6867
APP_CI_DETAILS: 'ci-details',
6968
LOGS: 'Logs',
7069
CREATE: '/create',

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
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'
1919

2020
import { sanitizeTargetPlatforms } from '@Shared/Helpers'
2121

@@ -31,6 +31,7 @@ import {
3131
useInterval,
3232
} from '../../../Common'
3333
import { DEPLOYMENT_STAGE_TO_NODE_MAP, EMPTY_STATE_STATUS } from '../../constants'
34+
import { TabGroup } from '../TabGroup'
3435
import Artifacts from './Artifacts'
3536
import DeploymentDetailSteps from './DeploymentDetailSteps'
3637
import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff'
@@ -409,66 +410,73 @@ const TriggerOutput = ({
409410
workflowExecutionStages={triggerDetails.workflowExecutionStages}
410411
namespace={triggerDetails.namespace}
411412
/>
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>
472480
</>
473481
)}
474482
<HistoryLogs

0 commit comments

Comments
 (0)