Plugins: Remove duplication of links from plugin details header (#108899)

remove duplication of links from plugin details header
This commit is contained in:
Yulia Shanyrova
2025-08-06 15:56:12 +02:00
committed by GitHub
parent 7e603d855d
commit f82ea23061
2 changed files with 4 additions and 28 deletions
@@ -62,16 +62,10 @@ describe('PluginSubtitle', () => {
expect(screen.getByText('Test description')).toBeInTheDocument();
});
it('renders links', () => {
render(<PluginSubtitle plugin={basePlugin} />);
expect(screen.getByText('Website')).toHaveAttribute('href', 'http://test.com');
});
it('shows error alert when installation error exists', () => {
jest.spyOn(runtime, 'useInstallStatus').mockReturnValueOnce({
error: { message: 'Install failed', error: 'Details' },
isInstalling: false,
});
jest
.spyOn(runtime, 'useInstallStatus')
.mockReturnValueOnce({ error: { message: 'Install failed', error: 'Details' }, isInstalling: false });
render(<PluginSubtitle plugin={basePlugin} />);
expect(screen.getByText('Install failed')).toBeInTheDocument();
});
@@ -45,18 +45,6 @@ export const PluginSubtitle = ({ plugin }: Props) => {
<Stack direction="row" justifyContent="space-between">
<div>
{plugin?.description && <div>{plugin?.description}</div>}
{!!plugin?.details?.links?.length && (
<span>
{plugin.details.links.map((link, index) => (
<Fragment key={index}>
{index > 0 && ' | '}
<a href={link.url} className="external-link">
{link.name}
</a>
</Fragment>
))}
</span>
)}
{hasInstallControlWarning(plugin, isRemotePluginsAvailable, latestCompatibleVersion) && (
<InstallControlsWarning
plugin={plugin}
@@ -74,11 +62,5 @@ export const PluginSubtitle = ({ plugin }: Props) => {
};
export const getStyles = (theme: GrafanaTheme2) => {
return {
subtitle: css({
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(1),
}),
};
return { subtitle: css({ display: 'flex', flexDirection: 'column', gap: theme.spacing(1) }) };
};