1
1
import * as React from 'react' ;
2
+ import { Link } from 'react-router-dom' ;
2
3
3
4
import { Tooltip } from '@material-ui/core' ;
4
5
@@ -16,7 +17,6 @@ import { JanusObjectLink } from '../../utils/janusLinks';
16
17
import { renderTrafficStatus } from '../Health/HealthDetails' ;
17
18
import { MissingSidecar } from '../MissingSidecar/MissingSidecar' ;
18
19
import { PFBadge , PFBadges } from '../Pf/PfBadges' ;
19
- import { Link } from "react-router-dom" ;
20
20
21
21
type Props = {
22
22
entity ?: boolean ;
@@ -77,7 +77,6 @@ export const DetailDescription: React.FC<Props> = (props: Props) => {
77
77
namespace : string ,
78
78
appName : string ,
79
79
) : React . ReactNode => {
80
-
81
80
let link : React . ReactNode ;
82
81
83
82
link = (
@@ -103,8 +102,7 @@ export const DetailDescription: React.FC<Props> = (props: Props) => {
103
102
if ( props . view === DRAWER ) {
104
103
href = `#application/${ namespace } _${ appName } ` ;
105
104
106
-
107
- link = < Link to = { href } > { appName } </ Link > ;
105
+ link = < Link to = { href } > { appName } </ Link > ;
108
106
}
109
107
110
108
return (
@@ -122,10 +120,9 @@ export const DetailDescription: React.FC<Props> = (props: Props) => {
122
120
namespace : string ,
123
121
serviceName : string ,
124
122
) : React . ReactNode => {
123
+ let link : React . ReactNode ;
125
124
126
- let link : React . ReactNode ;
127
-
128
- link = (
125
+ link = (
129
126
< JanusObjectLink
130
127
entity = { props . entity }
131
128
namespace = { namespace }
@@ -139,19 +136,17 @@ export const DetailDescription: React.FC<Props> = (props: Props) => {
139
136
</ JanusObjectLink >
140
137
) ;
141
138
142
-
143
139
if ( props . view === DRAWER ) {
144
- let href = `/namespaces/${ namespace } /services/${ serviceName } ` ;
140
+ let href = `/namespaces/${ namespace } /services/${ serviceName } ` ;
145
141
146
- if ( props . cluster && isMultiCluster ) {
147
- href = `${ href } ?clusterName=${ props . cluster } ` ;
148
- }
142
+ if ( props . cluster && isMultiCluster ) {
143
+ href = `${ href } ?clusterName=${ props . cluster } ` ;
144
+ }
149
145
150
- href = `#service/${ namespace } _${ serviceName } ` ;
151
- link = < Link to = { href } > { serviceName } </ Link > ;
146
+ href = `#service/${ namespace } _${ serviceName } ` ;
147
+ link = < Link to = { href } > { serviceName } </ Link > ;
152
148
}
153
149
154
-
155
150
return (
156
151
< li key = { `Service_${ serviceName } ` } className = { itemStyle } >
157
152
< div className = { iconStyle } >
@@ -219,9 +214,9 @@ export const DetailDescription: React.FC<Props> = (props: Props) => {
219
214
} ;
220
215
221
216
const renderWorkloadItem = ( workload : AppWorkload ) : React . ReactNode => {
222
- let link : React . ReactNode ;
217
+ let link : React . ReactNode ;
223
218
224
- link = (
219
+ link = (
225
220
< JanusObjectLink
226
221
entity = { props . entity }
227
222
namespace = { props . namespace }
@@ -235,17 +230,15 @@ let link: React.ReactNode;
235
230
</ JanusObjectLink >
236
231
) ;
237
232
238
- if ( props . view === DRAWER ) {
239
-
240
- let href = `/namespaces/${ props . namespace } /workloads/${ workload . workloadName } ` ;
241
-
242
- if ( props . cluster && isMultiCluster ) {
243
- href = `${ href } ?clusterName=${ props . cluster } ` ;
244
- }
233
+ if ( props . view === DRAWER ) {
234
+ let href = `/namespaces/${ props . namespace } /workloads/${ workload . workloadName } ` ;
245
235
236
+ if ( props . cluster && isMultiCluster ) {
237
+ href = `${ href } ?clusterName=${ props . cluster } ` ;
238
+ }
246
239
247
240
href = `#workload/${ props . namespace } _${ workload . workloadName } ` ;
248
- link = < Link to = { href } > { workload . workloadName } </ Link > ;
241
+ link = < Link to = { href } > { workload . workloadName } </ Link > ;
249
242
}
250
243
251
244
return (
@@ -288,9 +281,8 @@ let link: React.ReactNode;
288
281
}
289
282
290
283
if ( workload ) {
291
-
292
- let link : React . ReactNode ;
293
- link = (
284
+ let link : React . ReactNode ;
285
+ link = (
294
286
< JanusObjectLink
295
287
entity = { props . entity }
296
288
namespace = { props . namespace }
@@ -306,19 +298,17 @@ let link: React.ReactNode;
306
298
</ JanusObjectLink >
307
299
) ;
308
300
309
- if ( props . view === DRAWER ) {
310
- let href = `/namespaces/${ props . namespace } /workloads/${ workload . workloadName } ` ;
311
-
312
- if ( props . cluster && isMultiCluster ) {
313
- href = `${ href } ?clusterName=${ props . cluster } ` ;
314
- }
301
+ if ( props . view === DRAWER ) {
302
+ let href = `/namespaces/${ props . namespace } /workloads/${ workload . workloadName } ` ;
315
303
304
+ if ( props . cluster && isMultiCluster ) {
305
+ href = `${ href } ?clusterName=${ props . cluster } ` ;
306
+ }
316
307
317
308
href = `#workload/${ props . namespace } _${ workload . workloadName } ` ;
318
- link = < Link to = { href } > { workload . workloadName } </ Link > ;
309
+ link = < Link to = { href } > { workload . workloadName } </ Link > ;
319
310
}
320
311
321
-
322
312
return (
323
313
< span key = { `WorkloadItem_${ workload . workloadName } ` } >
324
314
< div className = { iconStyle } >
0 commit comments