@@ -45,7 +45,6 @@ const ResourceViewActionsContainer: React.FC<{
45
45
orgLabel : string ;
46
46
projectLabel : string ;
47
47
} > = ( { resource, orgLabel, projectLabel, latestResource, isLatest } ) => {
48
- const encodedResourceId = encodeURIComponent ( resource [ '@id' ] ) ;
49
48
const nexus = useNexusContext ( ) ;
50
49
const history = useHistory ( ) ;
51
50
const location = useLocation ( ) ;
@@ -131,6 +130,7 @@ const ResourceViewActionsContainer: React.FC<{
131
130
const [ view , setView ] = React . useState < Resource | null > ( null ) ;
132
131
const subapp = useOrganisationsSubappContext ( ) ;
133
132
React . useEffect ( ( ) => {
133
+ const encodedResourceId = encodeURIComponent ( resource [ '@id' ] ) ;
134
134
nexus . Resource . tags ( orgLabel , projectLabel , encodedResourceId ) . then (
135
135
data => {
136
136
setTags ( data ) ;
@@ -194,7 +194,7 @@ const ResourceViewActionsContainer: React.FC<{
194
194
< Menu . Item
195
195
key = { rev }
196
196
onClick = { ( ) => {
197
- goToResource ( orgLabel , projectLabel , encodedResourceId , rev ) ;
197
+ goToResource ( orgLabel , projectLabel , resource [ '@id' ] , rev ) ;
198
198
} }
199
199
>
200
200
Revision { rev }
@@ -305,7 +305,7 @@ const ResourceViewActionsContainer: React.FC<{
305
305
{
306
306
orgLabel,
307
307
projectLabel,
308
- resourceId : encodedResourceId ,
308
+ resourceId : resource [ '@id' ] ,
309
309
}
310
310
) } `;
311
311
@@ -324,13 +324,14 @@ const ResourceViewActionsContainer: React.FC<{
324
324
overlay = {
325
325
< Menu >
326
326
< Menu . Item
327
+ key = "fusion-url"
327
328
onClick = { ( ) => {
328
329
const pathToResource = `${ basePath } ${ generatePath (
329
330
'/:orgLabel/:projectLabel/resources/:resourceId' ,
330
331
{
331
332
orgLabel,
332
333
projectLabel,
333
- resourceId : encodedResourceId ,
334
+ resourceId : resource [ '@id' ] ,
334
335
}
335
336
) } `;
336
337
@@ -342,13 +343,14 @@ const ResourceViewActionsContainer: React.FC<{
342
343
Fusion URL
343
344
</ Menu . Item >
344
345
< Menu . Item
346
+ key = "fusion-url-(with-revision)"
345
347
onClick = { ( ) => {
346
348
const pathToResource = `${ basePath } ${ generatePath (
347
349
'/:orgLabel/:projectLabel/resources/:resourceId' ,
348
350
{
349
351
orgLabel,
350
352
projectLabel,
351
- resourceId : encodedResourceId ,
353
+ resourceId : resource [ '@id' ] ,
352
354
}
353
355
) } `;
354
356
@@ -361,20 +363,28 @@ const ResourceViewActionsContainer: React.FC<{
361
363
>
362
364
Fusion URL (with revision)
363
365
</ Menu . Item >
364
- < Menu . Item onClick = { ( ) => triggerCopy ( resource [ '@id' ] ) } >
366
+ < Menu . Item
367
+ onClick = { ( ) => triggerCopy ( resource [ '@id' ] ) }
368
+ key = "resource-id"
369
+ >
365
370
Resource ID
366
371
</ Menu . Item >
367
372
< Menu . Item
373
+ key = "resource-id-with-revision"
368
374
onClick = { ( ) =>
369
375
triggerCopy ( `${ resource [ '@id' ] } ?rev=${ resource . _rev } ` )
370
376
}
371
377
>
372
378
Resource ID (with revision)
373
379
</ Menu . Item >
374
- < Menu . Item onClick = { ( ) => triggerCopy ( self ? self : '' ) } >
380
+ < Menu . Item
381
+ onClick = { ( ) => triggerCopy ( self ? self : '' ) }
382
+ key = "nexus-api-endpoint"
383
+ >
375
384
Nexus API endpoint
376
385
</ Menu . Item >
377
386
< Menu . Item
387
+ key = "nexus-api-endpoitn-with-revision"
378
388
onClick = { ( ) =>
379
389
triggerCopy (
380
390
self
0 commit comments