From 52b453aadbd7832f8f66d07d9adb296d99967b2d Mon Sep 17 00:00:00 2001 From: pamelin Date: Thu, 16 Feb 2023 16:59:00 +0000 Subject: [PATCH] fix: use core Link component for action links Signed-off-by: pamelin --- .../src/components/ActionsList/ActionsList.test.tsx | 5 +++++ .../src/components/ActionsList/ActionsList.tsx | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/stackstorm/src/components/ActionsList/ActionsList.test.tsx b/plugins/stackstorm/src/components/ActionsList/ActionsList.test.tsx index 5876860c54..2a65db427a 100644 --- a/plugins/stackstorm/src/components/ActionsList/ActionsList.test.tsx +++ b/plugins/stackstorm/src/components/ActionsList/ActionsList.test.tsx @@ -56,6 +56,11 @@ describe('ActionsList', () => { const mockApi: jest.Mocked = { 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 () => { diff --git a/plugins/stackstorm/src/components/ActionsList/ActionsList.tsx b/plugins/stackstorm/src/components/ActionsList/ActionsList.tsx index 35006baef0..1080f67373 100644 --- a/plugins/stackstorm/src/components/ActionsList/ActionsList.tsx +++ b/plugins/stackstorm/src/components/ActionsList/ActionsList.tsx @@ -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 ( window.open(st2.getActionUrl(a.ref), '_blank')} + underline="none" + color="inherit" + button > {a.runner_type}