fix: use core Link component for action links
Signed-off-by: pamelin <pamelin@expediagroup.com>
This commit is contained in:
@@ -56,6 +56,11 @@ describe('ActionsList', () => {
|
||||
const mockApi: jest.Mocked<StackstormApi> = {
|
||||
getPacks: jest.fn().mockResolvedValue(packs),
|
||||
getActions: jest.fn().mockResolvedValue(actions),
|
||||
getActionUrl: jest
|
||||
.fn()
|
||||
.mockResolvedValue(
|
||||
'http://stackstorm.example.com:8080/?#/actions/core.action',
|
||||
),
|
||||
} as any;
|
||||
|
||||
it('should render all packs', async () => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import React, { useState } from 'react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { Progress, ResponseErrorPanel } from '@backstage/core-components';
|
||||
import { Link, Progress, ResponseErrorPanel } from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
List,
|
||||
@@ -72,9 +72,12 @@ export const ActionItems = ({ pack }: ActionItemsProps) => {
|
||||
return (
|
||||
<ListItem
|
||||
key={a.ref}
|
||||
button
|
||||
component={Link}
|
||||
to={st2.getActionUrl(a.ref)}
|
||||
className={classes.nested}
|
||||
onClick={() => window.open(st2.getActionUrl(a.ref), '_blank')}
|
||||
underline="none"
|
||||
color="inherit"
|
||||
button
|
||||
>
|
||||
<ListItemText primary={a.name} secondary={a.description} />
|
||||
<ListItemSecondaryAction>{a.runner_type}</ListItemSecondaryAction>
|
||||
|
||||
Reference in New Issue
Block a user