@@ -17,14 +17,19 @@ import { ElementModel, GraphElement } from '@patternfly/react-topology';
17
17
import PipelineIcon from '../../../../assets/pipelineIcon.svg' ;
18
18
import { PipelineRunLabel } from '../../../../consts/pipelinerun' ;
19
19
import { useTaskRuns } from '../../../../hooks/useTaskRuns' ;
20
+ import {
21
+ COMPONENT_DETAILS_PATH ,
22
+ INTEGRATION_TEST_DETAILS_PATH ,
23
+ PIPELINE_RUNS_LOG_PATH ,
24
+ } from '../../../../routes/paths' ;
20
25
import { ErrorDetailsWithStaticLog } from '../../../../shared/components/pipeline-run-logs/logs/log-snippet-types' ;
21
26
import { getPLRLogSnippet } from '../../../../shared/components/pipeline-run-logs/logs/pipelineRunLogSnippet' ;
22
27
import { Timestamp } from '../../../../shared/components/timestamp/Timestamp' ;
28
+ import { useNamespace } from '../../../../shared/providers/Namespace' ;
23
29
import { PipelineRunKind } from '../../../../types' ;
24
30
import { calculateDuration } from '../../../../utils/pipeline-utils' ;
25
31
import ScanDescriptionListGroup from '../../../PipelineRun/PipelineRunDetailsView/tabs/ScanDescriptionListGroup' ;
26
32
import { StatusIconWithTextLabel } from '../../../topology/StatusIcon' ;
27
- import { useWorkspaceInfo } from '../../../Workspace/useWorkspaceInfo' ;
28
33
import { CommitWorkflowNodeModelData } from '../visualization/commit-visualization-types' ;
29
34
30
35
export interface IntegrationTestSidePanelBodyProps {
@@ -35,7 +40,7 @@ export interface IntegrationTestSidePanelBodyProps {
35
40
const IntegrationTestSidePanel : React . FC <
36
41
React . PropsWithChildren < IntegrationTestSidePanelBodyProps >
37
42
> = ( { workflowNode, onClose } ) => {
38
- const { workspace , namespace } = useWorkspaceInfo ( ) ;
43
+ const namespace = useNamespace ( ) ;
39
44
const workflowData = workflowNode . getData ( ) ;
40
45
const integrationTestPipeline = workflowData . resource as PipelineRunKind ;
41
46
const [ taskRuns ] = useTaskRuns ( namespace , integrationTestPipeline ?. metadata . name ) ;
@@ -61,9 +66,11 @@ const IntegrationTestSidePanel: React.FC<
61
66
< span className = "commit-side-panel__head-title" >
62
67
{ integrationTestPipeline ? (
63
68
< Link
64
- to = { `/workspaces/${ workspace } /applications/${
65
- workflowData . application
66
- } /integrationtests/${ workflowNode . getLabel ( ) } `}
69
+ to = { INTEGRATION_TEST_DETAILS_PATH . createPath ( {
70
+ applicationName : workflowData . application ,
71
+ workspaceName : namespace ,
72
+ integrationTestName : workflowNode . getLabel ( ) ,
73
+ } ) }
67
74
>
68
75
{ workflowNode . getLabel ( ) }
69
76
</ Link >
@@ -122,11 +129,13 @@ const IntegrationTestSidePanel: React.FC<
122
129
{ integrationTestPipeline ?. metadata ?. labels ?. [ PipelineRunLabel . COMPONENT ] ? (
123
130
integrationTestPipeline ?. metadata ?. labels ?. [ PipelineRunLabel . APPLICATION ] ? (
124
131
< Link
125
- to = { `/workspaces/${ workspace } /applications/${
126
- integrationTestPipeline . metadata . labels [ PipelineRunLabel . APPLICATION ]
127
- } /components/${
128
- integrationTestPipeline . metadata . labels [ PipelineRunLabel . COMPONENT ]
129
- } `}
132
+ to = { COMPONENT_DETAILS_PATH . createPath ( {
133
+ applicationName :
134
+ integrationTestPipeline . metadata . labels [ PipelineRunLabel . APPLICATION ] ,
135
+ componentName :
136
+ integrationTestPipeline . metadata . labels [ PipelineRunLabel . COMPONENT ] ,
137
+ workspaceName : namespace ,
138
+ } ) }
130
139
>
131
140
{ integrationTestPipeline . metadata . labels [ PipelineRunLabel . COMPONENT ] }
132
141
</ Link >
@@ -171,7 +180,11 @@ const IntegrationTestSidePanel: React.FC<
171
180
component = { ( props ) => (
172
181
< Link
173
182
{ ...props }
174
- to = { `/workspaces/${ workspace } /applications/${ workflowData . application } /pipelineruns/${ integrationTestPipeline . metadata ?. name } /logs` }
183
+ to = { PIPELINE_RUNS_LOG_PATH . createPath ( {
184
+ applicationName : workflowData . application ,
185
+ pipelineRunName : integrationTestPipeline . metadata ?. name ,
186
+ workspaceName : namespace ,
187
+ } ) }
175
188
/>
176
189
) }
177
190
>
0 commit comments